* [Qemu-devel] [PULL 0/2] vfio-pci fixes for v2.4
@ 2015-07-23 19:06 Alex Williamson
2015-07-23 19:06 ` [Qemu-devel] [PULL 1/2] vfio/pci: Fix RTL8168 NIC quirks Alex Williamson
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Alex Williamson @ 2015-07-23 19:06 UTC (permalink / raw)
To: qemu-devel; +Cc: alex.williamson
The following changes since commit b69b30532e0a80e25449244c01b0cbed000c99a3:
Update version for v2.4.0-rc2 release (2015-07-22 18:17:19 +0100)
are available in the git repository at:
git://github.com/awilliam/qemu-vfio.git tags/vfio-fixes-20150723.0
for you to fetch changes up to 759b484c5d7f92bd01f98797c07e8543ee187888:
vfio/pci: Fix bootindex (2015-07-22 14:56:01 -0600)
----------------------------------------------------------------
VFIO fixes for v2.4.0-rc3
- Fix Realtek NIC quirk (Alex Williamson)
- Restore bootindex functionality (Alex Williamson)
----------------------------------------------------------------
Alex Williamson (2):
vfio/pci: Fix RTL8168 NIC quirks
vfio/pci: Fix bootindex
hw/vfio/pci.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Qemu-devel] [PULL 1/2] vfio/pci: Fix RTL8168 NIC quirks
2015-07-23 19:06 [Qemu-devel] [PULL 0/2] vfio-pci fixes for v2.4 Alex Williamson
@ 2015-07-23 19:06 ` Alex Williamson
2015-07-23 19:06 ` [Qemu-devel] [PULL 2/2] vfio/pci: Fix bootindex Alex Williamson
2015-07-24 10:11 ` [Qemu-devel] [PULL 0/2] vfio-pci fixes for v2.4 Peter Maydell
2 siblings, 0 replies; 4+ messages in thread
From: Alex Williamson @ 2015-07-23 19:06 UTC (permalink / raw)
To: qemu-devel; +Cc: alex.williamson
The RTL8168 quirk correctly describes using bit 31 as a signal to
mark a latch/completion, but the code mistakenly uses bit 28. This
causes the Realtek driver to spin on this register for quite a while,
20k cycles on Windows 7 v7.092 driver. Then it gets frustrated and
tries to set the bit itself and spins for another 20k cycles. For
some this still results in a working driver, for others not. About
the only thing the code really does in its current form is protect
the guest from sneaking in writes to the real hardware MSI-X table.
The fix is obviously to use bit 31 as we document that we should.
The other problem doesn't seem to affect current drivers as nobody
seems to use these window registers for writes to the MSI-X table, but
we need to use the stored data when a write is triggered, not the
value of the current write, which only provides the offset.
Note that only the Windows drivers from Realtek seem to use these
registers, the Microsoft drivers provided with Windows 8.1 do not
access them, nor do Linux in-kernel drivers.
Link: https://bugs.launchpad.net/qemu/+bug/1384892
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Cc: qemu-stable@nongnu.org # v2.1+
---
hw/vfio/pci.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index 2ed877f..0af762a 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -1517,7 +1517,7 @@ static uint64_t vfio_rtl8168_window_quirk_read(void *opaque,
memory_region_name(&quirk->mem),
vdev->vbasedev.name);
- return quirk->data.address_match ^ 0x10000000U;
+ return quirk->data.address_match ^ 0x80000000U;
}
break;
case 0: /* data */
@@ -1558,7 +1558,7 @@ static void vfio_rtl8168_window_quirk_write(void *opaque, hwaddr addr,
switch (addr) {
case 4: /* address */
if ((data & 0x7fff0000) == 0x10000) {
- if (data & 0x10000000U &&
+ if (data & 0x80000000U &&
vdev->pdev.cap_present & QEMU_PCI_CAP_MSIX) {
trace_vfio_rtl8168_window_quirk_write_table(
@@ -1566,11 +1566,9 @@ static void vfio_rtl8168_window_quirk_write(void *opaque, hwaddr addr,
vdev->vbasedev.name);
memory_region_dispatch_write(&vdev->pdev.msix_table_mmio,
- (hwaddr)(quirk->data.address_match
- & 0xfff),
- data,
- size,
- MEMTXATTRS_UNSPECIFIED);
+ (hwaddr)(data & 0xfff),
+ (uint64_t)quirk->data.address_mask,
+ size, MEMTXATTRS_UNSPECIFIED);
}
quirk->data.flags = 1;
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Qemu-devel] [PULL 2/2] vfio/pci: Fix bootindex
2015-07-23 19:06 [Qemu-devel] [PULL 0/2] vfio-pci fixes for v2.4 Alex Williamson
2015-07-23 19:06 ` [Qemu-devel] [PULL 1/2] vfio/pci: Fix RTL8168 NIC quirks Alex Williamson
@ 2015-07-23 19:06 ` Alex Williamson
2015-07-24 10:11 ` [Qemu-devel] [PULL 0/2] vfio-pci fixes for v2.4 Peter Maydell
2 siblings, 0 replies; 4+ messages in thread
From: Alex Williamson @ 2015-07-23 19:06 UTC (permalink / raw)
To: qemu-devel; +Cc: alex.williamson
bootindex was incorrectly changed to a device Property during the
platform code split, resulting in it no longer working. Remove it.
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Cc: qemu-stable@nongnu.org # v2.3+
---
hw/vfio/pci.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index 0af762a..4023d8e 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -3749,7 +3749,6 @@ static Property vfio_pci_dev_properties[] = {
VFIO_FEATURE_ENABLE_VGA_BIT, false),
DEFINE_PROP_BIT("x-req", VFIOPCIDevice, features,
VFIO_FEATURE_ENABLE_REQ_BIT, true),
- DEFINE_PROP_INT32("bootindex", VFIOPCIDevice, bootindex, -1),
DEFINE_PROP_BOOL("x-mmap", VFIOPCIDevice, vbasedev.allow_mmap, true),
/*
* TODO - support passed fds... is this necessary?
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PULL 0/2] vfio-pci fixes for v2.4
2015-07-23 19:06 [Qemu-devel] [PULL 0/2] vfio-pci fixes for v2.4 Alex Williamson
2015-07-23 19:06 ` [Qemu-devel] [PULL 1/2] vfio/pci: Fix RTL8168 NIC quirks Alex Williamson
2015-07-23 19:06 ` [Qemu-devel] [PULL 2/2] vfio/pci: Fix bootindex Alex Williamson
@ 2015-07-24 10:11 ` Peter Maydell
2 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2015-07-24 10:11 UTC (permalink / raw)
To: Alex Williamson; +Cc: QEMU Developers
On 23 July 2015 at 20:06, Alex Williamson <alex.williamson@redhat.com> wrote:
> The following changes since commit b69b30532e0a80e25449244c01b0cbed000c99a3:
>
> Update version for v2.4.0-rc2 release (2015-07-22 18:17:19 +0100)
>
> are available in the git repository at:
>
> git://github.com/awilliam/qemu-vfio.git tags/vfio-fixes-20150723.0
>
> for you to fetch changes up to 759b484c5d7f92bd01f98797c07e8543ee187888:
>
> vfio/pci: Fix bootindex (2015-07-22 14:56:01 -0600)
>
> ----------------------------------------------------------------
> VFIO fixes for v2.4.0-rc3
> - Fix Realtek NIC quirk (Alex Williamson)
> - Restore bootindex functionality (Alex Williamson)
>
Applied, thanks.
-- PMM
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-07-24 10:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-23 19:06 [Qemu-devel] [PULL 0/2] vfio-pci fixes for v2.4 Alex Williamson
2015-07-23 19:06 ` [Qemu-devel] [PULL 1/2] vfio/pci: Fix RTL8168 NIC quirks Alex Williamson
2015-07-23 19:06 ` [Qemu-devel] [PULL 2/2] vfio/pci: Fix bootindex Alex Williamson
2015-07-24 10:11 ` [Qemu-devel] [PULL 0/2] vfio-pci fixes for v2.4 Peter Maydell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).