From 4386935191c576fa62a52d52734e264fe8329a67 Mon Sep 17 00:00:00 2001 From: Andrew Turner Date: Thu, 21 Sep 2023 11:50:29 +0100 Subject: [PATCH] vtgpu: Fix the physical memory size Use the correct endian switching function when switching to a little endian 64-bit address. Even on a little-endian machine this will truncate the address to a 32-bit value. Sponsored by: Arm Ltd --- sys/dev/virtio/gpu/virtio_gpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/virtio/gpu/virtio_gpu.c b/sys/dev/virtio/gpu/virtio_gpu.c index 0009d7bb3ec..f18eef985cc 100644 --- a/sys/dev/virtio/gpu/virtio_gpu.c +++ b/sys/dev/virtio/gpu/virtio_gpu.c @@ -565,7 +565,7 @@ vtgpu_attach_backing(struct vtgpu_softc *sc) s.req.backing.resource_id = htole32(VTGPU_RESOURCE_ID); s.req.backing.nr_entries = htole32(1); - s.req.mem[0].addr = htole32(sc->vtgpu_fb_info.fb_pbase); + s.req.mem[0].addr = htole64(sc->vtgpu_fb_info.fb_pbase); s.req.mem[0].length = htole32(sc->vtgpu_fb_info.fb_size); error = vtgpu_req_resp(sc, &s.req, sizeof(s.req), &s.resp,