[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 27/29] vhost-user: fix mmap offset calculation
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 27/29] vhost-user: fix mmap offset calculation |
Date: |
Mon, 3 Nov 2014 14:46:11 +0200 |
qemu_get_ram_block_host_ptr should get ram_addr_t,
vhost-user passes in GPA.
That's very wrong.
Reported-by: Linhaifeng <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
hw/virtio/vhost-user.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c
index 4e88d9c..aefe0bb 100644
--- a/hw/virtio/vhost-user.c
+++ b/hw/virtio/vhost-user.c
@@ -226,7 +226,7 @@ static int vhost_user_call(struct vhost_dev *dev, unsigned
long int request,
msg.memory.regions[fd_num].memory_size = reg->memory_size;
msg.memory.regions[fd_num].guest_phys_addr =
reg->guest_phys_addr;
msg.memory.regions[fd_num].mmap_offset = reg->userspace_addr -
- (uintptr_t)
qemu_get_ram_block_host_ptr(reg->guest_phys_addr);
+ (uintptr_t) qemu_get_ram_block_host_ptr(ram_addr);
assert(fd_num < VHOST_MEMORY_MAX_NREGIONS);
fds[fd_num++] = fd;
}
--
MST
- [Qemu-devel] [PULL 19/29] -machine vmport=off: Allow disabling of VMWare ioport emulation, (continued)
- [Qemu-devel] [PULL 19/29] -machine vmport=off: Allow disabling of VMWare ioport emulation, Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 20/29] hw/pci: fixed error flow in pci_qdev_init, Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 21/29] hw/pci: fixed hotplug crash when using rombar=0 with devices having romfile, Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 22/29] hw/virtio/vring/event_idx: fix the vring_avail_event error, Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 23/29] pc: Add pc_compat_2_1() function, Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 24/29] smbios: Encode UUID according to SMBIOS specification, Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 26/29] qemu-char: fix tcp_get_fds, Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 25/29] hw/i386/acpi-build.c: Fix memory leak in acpi_build_tables_cleanup(), Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 28/29] vga: add default display to machine class, Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 29/29] vga: flip qemu 2.2 pc machine types from cirrus to stdvga, Michael S. Tsirkin, 2014/11/03
- [Qemu-devel] [PULL 27/29] vhost-user: fix mmap offset calculation,
Michael S. Tsirkin <=