diff options
author | Stefan Hajnoczi <stefanha@redhat.com> | 2017-05-05 16:14:08 +0100 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2017-05-05 16:14:15 +0100 |
commit | 4f3652b3aa5f77582c94ac434e960db242430eac (patch) | |
tree | c644654d3bbc8ae0dfdcd2c8e5c5f0e13909a9b3 /hw | |
parent | 4f225f343adb23c6903cb02948d1e27a04f7916e (diff) | |
parent | 6e4e6f0d403b1fb25f9dfdbe17754c643997753d (diff) |
Merge remote-tracking branch 'awilliam/tags/vfio-updates-20170503.0' into staging
VFIO fixes 2017-05-03
- Enable 8-byte memory region accesses (Jose Ricardo Ziviani)
- Fix vfio-pci error message (Dong Jia Shi)
# gpg: Signature made Wed 03 May 2017 10:28:55 PM BST
# gpg: using RSA key 0x239B9B6E3BB08B22
# gpg: Good signature from "Alex Williamson <alex.williamson@redhat.com>"
# gpg: aka "Alex Williamson <alex@shazbot.org>"
# gpg: aka "Alex Williamson <alwillia@redhat.com>"
# gpg: aka "Alex Williamson <alex.l.williamson@gmail.com>"
# Primary key fingerprint: 42F6 C04E 540B D1A9 9E7B 8A90 239B 9B6E 3BB0 8B22
* awilliam/tags/vfio-updates-20170503.0:
vfio/pci: Fix incorrect error message
vfio: enable 8-byte reads/writes to vfio
vfio: Set MemoryRegionOps:max_access_size and min_access_size
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/vfio/common.c | 14 | ||||
-rw-r--r-- | hw/vfio/pci.c | 4 |
2 files changed, 16 insertions, 2 deletions
diff --git a/hw/vfio/common.c b/hw/vfio/common.c index 6b33b9f55d..a8f12eeb35 100644 --- a/hw/vfio/common.c +++ b/hw/vfio/common.c @@ -119,6 +119,9 @@ void vfio_region_write(void *opaque, hwaddr addr, case 4: buf.dword = cpu_to_le32(data); break; + case 8: + buf.qword = cpu_to_le64(data); + break; default: hw_error("vfio: unsupported write size, %d bytes", size); break; @@ -173,6 +176,9 @@ uint64_t vfio_region_read(void *opaque, case 4: data = le32_to_cpu(buf.dword); break; + case 8: + data = le64_to_cpu(buf.qword); + break; default: hw_error("vfio: unsupported read size, %d bytes", size); break; @@ -190,6 +196,14 @@ const MemoryRegionOps vfio_region_ops = { .read = vfio_region_read, .write = vfio_region_write, .endianness = DEVICE_LITTLE_ENDIAN, + .valid = { + .min_access_size = 1, + .max_access_size = 8, + }, + .impl = { + .min_access_size = 1, + .max_access_size = 8, + }, }; /* diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 03a3d01549..32aca77701 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -2625,8 +2625,8 @@ static void vfio_realize(PCIDevice *pdev, Error **errp) if (!(~vdev->host.domain || ~vdev->host.bus || ~vdev->host.slot || ~vdev->host.function)) { error_setg(errp, "No provided host device"); - error_append_hint(errp, "Use -vfio-pci,host=DDDD:BB:DD.F " - "or -vfio-pci,sysfsdev=PATH_TO_DEVICE\n"); + error_append_hint(errp, "Use -device vfio-pci,host=DDDD:BB:DD.F " + "or -device vfio-pci,sysfsdev=PATH_TO_DEVICE\n"); return; } vdev->vbasedev.sysfsdev = |