qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] b0223e: vfio-pci: Make host MSI-X enable trac


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] b0223e: vfio-pci: Make host MSI-X enable track guest
Date: Thu, 10 Jan 2013 12:30:08 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: b0223e29afdc88cc262a764026296414396cd129
      
https://github.com/qemu/qemu/commit/b0223e29afdc88cc262a764026296414396cd129
  Author: Alex Williamson <address@hidden>
  Date:   2013-01-08 (Tue, 08 Jan 2013)

  Changed paths:
    M hw/vfio_pci.c

  Log Message:
  -----------
  vfio-pci: Make host MSI-X enable track guest

Guests typically enable MSI-X with all of the vectors in the MSI-X
vector table masked.  Only when the vector is enabled does the vector
get unmasked, resulting in a vector_use callback.  These two points,
enable and unmask, correspond to pci_enable_msix() and request_irq()
for Linux guests.  Some drivers rely on VF/PF or PF/fw communication
channels that expect the physical state of the device to match the
guest visible state of the device.  They don't appreciate lazily
enabling MSI-X on the physical device.

To solve this, enable MSI-X with a single vector when the MSI-X
capability is enabled and immediate disable the vector.  This leaves
the physical device in exactly the same state between host and guest.
Furthermore, the brief gap where we enable vector 0, it fires into
userspace, not KVM, so the guest doesn't get spurious interrupts.
Ideally we could call VFIO_DEVICE_SET_IRQS with the right parameters
to enable MSI-X with zero vectors, but this will currently return an
error as the Linux MSI-X interfaces do not allow it.

Signed-off-by: Alex Williamson <address@hidden>
Cc: address@hidden


  Commit: 8fc94e5a8046e349e07976f9bcaffbcd5833f3a2
      
https://github.com/qemu/qemu/commit/8fc94e5a8046e349e07976f9bcaffbcd5833f3a2
  Author: Alex Williamson <address@hidden>
  Date:   2013-01-08 (Tue, 08 Jan 2013)

  Changed paths:
    M hw/vfio_pci.c

  Log Message:
  -----------
  vfio-pci: Loosen sanity checks to allow future features

VFIO_PCI_NUM_REGIONS and VFIO_PCI_NUM_IRQS should never have been
used in this manner as it locks a specific kernel implementation.
Future features may introduce new regions or interrupt entries
(VGA may add legacy ranges, AER might add an IRQ for error
signalling).  Fix this before it gets us into trouble.

Signed-off-by: Alex Williamson <address@hidden>
Cc: address@hidden


  Commit: 5e3bc735d93dd23f074b5116fd11e1ad8cd4962f
      
https://github.com/qemu/qemu/commit/5e3bc735d93dd23f074b5116fd11e1ad8cd4962f
  Author: Fabien Chouteau <address@hidden>
  Date:   2013-01-09 (Wed, 09 Jan 2013)

  Changed paths:
    M main-loop.c

  Log Message:
  -----------
  Check return values from g_poll and select

The current implementation of os_host_main_loop_wait() on Windows,
returns 1 only when a g_poll() event occurs because the return value of
select() is overridden. This is wrong as we may skip a socket event, as
shown in this example:

1. select() returns 0
2. g_poll() returns 1  (socket event occurs)
3. os_host_main_loop_wait() returns 1
4. qemu_iohandler_poll() sees no socket event because select() has
   return before the event occurs
5. select() returns 1
6. g_poll() returns 0 (g_poll overrides select's return value)
7. os_host_main_loop_wait() returns 0
8. qemu_iohandler_poll() doesn't check for socket events because the
   return value of os_host_main_loop_wait() is zero.
9. goto 5

This patch use one variable for each of these return values, so we don't
miss a select() event anymore.

Also move the call to select() after g_poll(), this will improve latency
as we don't have to go through two os_host_main_loop_wait() calls to
detect a socket event.

Reviewed-by: Paolo Bonzini <address@hidden>
Signed-off-by: Fabien Chouteau <address@hidden>
Signed-off-by: Anthony Liguori <address@hidden>


  Commit: 4e45deedf57c6cc7113b588282d0c16f89298aff
      
https://github.com/qemu/qemu/commit/4e45deedf57c6cc7113b588282d0c16f89298aff
  Author: Gerd Hoffmann <address@hidden>
  Date:   2013-01-10 (Thu, 10 Jan 2013)

  Changed paths:
    M tests/rtc-test.c

  Log Message:
  -----------
  rtc-test: skip year-2038 overflow check in case time_t is 32bit only

Signed-off-by: Gerd Hoffmann <address@hidden>


  Commit: 067f0691277325dcce8401534d2ffc6164305021
      
https://github.com/qemu/qemu/commit/067f0691277325dcce8401534d2ffc6164305021
  Author: Gerd Hoffmann <address@hidden>
  Date:   2013-01-10 (Thu, 10 Jan 2013)

  Changed paths:
    M tests/m48t59-test.c

  Log Message:
  -----------
  m48t59-test: don't touch watchdog

Signed-off-by: Gerd Hoffmann <address@hidden>


  Commit: 8757c09f15dcd455f81b4faed73da0d35d7e6b53
      
https://github.com/qemu/qemu/commit/8757c09f15dcd455f81b4faed73da0d35d7e6b53
  Author: Anthony Liguori <address@hidden>
  Date:   2013-01-10 (Thu, 10 Jan 2013)

  Changed paths:
    M hw/vfio_pci.c

  Log Message:
  -----------
  Merge remote-tracking branch 'awilliam/tags/qemu-1.4-vfio-20130109.0' into 
staging

vfio-pci: Fixes for qemu 1.4 & stable

* awilliam/tags/qemu-1.4-vfio-20130109.0:
  vfio-pci: Loosen sanity checks to allow future features
  vfio-pci: Make host MSI-X enable track guest

Signed-off-by: Anthony Liguori <address@hidden>


  Commit: a6308bc2224db238e72c570482717b68246a7ce0
      
https://github.com/qemu/qemu/commit/a6308bc2224db238e72c570482717b68246a7ce0
  Author: Anthony Liguori <address@hidden>
  Date:   2013-01-10 (Thu, 10 Jan 2013)

  Changed paths:
    M tests/m48t59-test.c
    M tests/rtc-test.c

  Log Message:
  -----------
  Merge remote-tracking branch 'kraxel/build.1' into staging

* kraxel/build.1:
  m48t59-test: don't touch watchdog
  rtc-test: skip year-2038 overflow check in case time_t is 32bit only

Signed-off-by: Anthony Liguori <address@hidden>


Compare: https://github.com/qemu/qemu/compare/7cd5da7eef15...a6308bc2224d

reply via email to

[Prev in Thread] Current Thread [Next in Thread]