qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] d45100: vfio/pci: Cleanup RTL8168 quirk and t


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] d45100: vfio/pci: Cleanup RTL8168 quirk and tracing
Date: Wed, 23 Sep 2015 17:30:05 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: d451008e0fdf7fb817c791397e7999d5f3687e58
      
https://github.com/qemu/qemu/commit/d451008e0fdf7fb817c791397e7999d5f3687e58
  Author: Alex Williamson <address@hidden>
  Date:   2015-09-23 (Wed, 23 Sep 2015)

  Changed paths:
    M hw/vfio/pci.c
    M trace-events

  Log Message:
  -----------
  vfio/pci: Cleanup RTL8168 quirk and tracing

There's quite a bit of cleanup that can be done to the RTL8168 quirk,
as well as the tracing to prevent a spew of uninteresting accesses
for anything else the driver might choose to use the window registers
for besides the MSI-X table.  There should be no functional change,
but it's now possible to get compact and useful traces by enabling
vfio_rtl8168_quirk*, ex:

vfio_rtl8168_quirk_write 0000:04:00.0 [address]: 0x1f000
vfio_rtl8168_quirk_read 0000:04:00.0 [address]: 0x8001f000
vfio_rtl8168_quirk_read 0000:04:00.0 [data]: 0xfee0100c
vfio_rtl8168_quirk_write 0000:04:00.0 [address]: 0x1f004
vfio_rtl8168_quirk_read 0000:04:00.0 [address]: 0x8001f004
vfio_rtl8168_quirk_read 0000:04:00.0 [data]: 0x0
vfio_rtl8168_quirk_write 0000:04:00.0 [address]: 0x1f008
vfio_rtl8168_quirk_read 0000:04:00.0 [address]: 0x8001f008
vfio_rtl8168_quirk_read 0000:04:00.0 [data]: 0x49b1
vfio_rtl8168_quirk_write 0000:04:00.0 [address]: 0x1f00c
vfio_rtl8168_quirk_read 0000:04:00.0 [address]: 0x8001f00c
vfio_rtl8168_quirk_read 0000:04:00.0 [data]: 0x0

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


  Commit: b5bd049fa907bccc4600ad1855e1c9c0e62f0be3
      
https://github.com/qemu/qemu/commit/b5bd049fa907bccc4600ad1855e1c9c0e62f0be3
  Author: Alex Williamson <address@hidden>
  Date:   2015-09-23 (Wed, 23 Sep 2015)

  Changed paths:
    M hw/vfio/pci.c

  Log Message:
  -----------
  vfio/pci: Cleanup vfio_early_setup_msix() error path

With the addition of the Chelsio quirk we have an error path out of
vfio_early_setup_msix() that doesn't free the allocated VFIOMSIXInfo
struct.  This doesn't introduce a leak as it still gets freed in the
vfio_put_device() path, but it's complicated and sloppy to rely on
that.  Restructure to free the allocated data on error and only link
it into the vdev on success.

Signed-off-by: Alex Williamson <address@hidden>
Reported-by: Laszlo Ersek <address@hidden>
Reviewed-by: Laszlo Ersek <address@hidden>


  Commit: 870cb6f104e5d3364288d894746dd88fe9ac59cb
      
https://github.com/qemu/qemu/commit/870cb6f104e5d3364288d894746dd88fe9ac59cb
  Author: Alex Williamson <address@hidden>
  Date:   2015-09-23 (Wed, 23 Sep 2015)

  Changed paths:
    M hw/vfio/pci.c
    M trace-events

  Log Message:
  -----------
  vfio/pci: Rename INTx functions for easier tracing

Rename functions and tracing callbacks so that we can trace vfio_intx*
to see all the INTx related activities.

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


  Commit: 0de70dc7bab1cd58d02e86ed27e291843983b13b
      
https://github.com/qemu/qemu/commit/0de70dc7bab1cd58d02e86ed27e291843983b13b
  Author: Alex Williamson <address@hidden>
  Date:   2015-09-23 (Wed, 23 Sep 2015)

  Changed paths:
    M hw/vfio/pci.c
    M trace-events

  Log Message:
  -----------
  vfio/pci: Rename MSI/X functions for easier tracing

This allows vfio_msi* tracing.  The MSI/X interrupt tracing is also
pulled out of #ifdef DEBUG_VFIO to avoid a recompile for tracing this
path.  A few cycles to read the message is hardly anything if we're
already in QEMU.

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


  Commit: 46746dbaa8c2c421b9bda78193caad57d7fb1136
      
https://github.com/qemu/qemu/commit/46746dbaa8c2c421b9bda78193caad57d7fb1136
  Author: Alex Williamson <address@hidden>
  Date:   2015-09-23 (Wed, 23 Sep 2015)

  Changed paths:
    M hw/vfio/pci.c
    M include/hw/vfio/vfio-common.h

  Log Message:
  -----------
  vfio/pci: Make interrupt bypass runtime configurable

Tracing is more effective when we can completely disable all KVM
bypass paths.  Make these runtime rather than build-time configurable.

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


  Commit: 5e15d79b8681c7f4e2079833288785708e7520d3
      
https://github.com/qemu/qemu/commit/5e15d79b8681c7f4e2079833288785708e7520d3
  Author: Alex Williamson <address@hidden>
  Date:   2015-09-23 (Wed, 23 Sep 2015)

  Changed paths:
    M hw/vfio/common.c
    M hw/vfio/pci.c
    M hw/vfio/platform.c
    M include/hw/vfio/vfio-common.h

  Log Message:
  -----------
  vfio: Change polarity of our no-mmap option

The default should be to allow mmap and new drivers shouldn't need to
expose an option or set it to other than the allocation default in
their initfn.  Take advantage of the experimental flag to change this
option to the correct polarity.

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


  Commit: 78f33d2bfd26ec552d9e824bcc1dbb8e2736ce34
      
https://github.com/qemu/qemu/commit/78f33d2bfd26ec552d9e824bcc1dbb8e2736ce34
  Author: Alex Williamson <address@hidden>
  Date:   2015-09-23 (Wed, 23 Sep 2015)

  Changed paths:
    M hw/vfio/pci.c
    A hw/vfio/pci.h

  Log Message:
  -----------
  vfio/pci: Extract PCI structures to a separate header

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


  Commit: c00d61d8fa22b096b15e19ee2fde846ffc1c0b5d
      
https://github.com/qemu/qemu/commit/c00d61d8fa22b096b15e19ee2fde846ffc1c0b5d
  Author: Alex Williamson <address@hidden>
  Date:   2015-09-23 (Wed, 23 Sep 2015)

  Changed paths:
    M hw/vfio/Makefile.objs
    A hw/vfio/pci-quirks.c
    M hw/vfio/pci.c
    M hw/vfio/pci.h

  Log Message:
  -----------
  vfio/pci: Split quirks to a separate file

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


  Commit: 056dfcb695cde3c62b7dc1d5ed6d2e38b3a73e29
      
https://github.com/qemu/qemu/commit/056dfcb695cde3c62b7dc1d5ed6d2e38b3a73e29
  Author: Alex Williamson <address@hidden>
  Date:   2015-09-23 (Wed, 23 Sep 2015)

  Changed paths:
    M hw/vfio/pci-quirks.c
    M hw/vfio/pci.h
    M trace-events

  Log Message:
  -----------
  vfio/pci: Cleanup ROM blacklist quirk

Create a vendor:device ID helper that we'll also use as we rework the
rest of the quirks.  Re-reading the config entries, even if we get
more blacklist entries, is trivial overhead and only incurred during
device setup.  There's no need to typedef the blacklist structure,
it's a static private data type used once.  The elements get bumped
up to uint32_t to avoid future maintenance issues if PCI_ANY_ID gets
used for a blacklist entry (avoiding an actual hardware match).  Our
test loop is also crying out to be simplified as a for loop.

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


  Commit: 8c4f234853d9d438dc1733ca98674b1139a87c99
      
https://github.com/qemu/qemu/commit/8c4f234853d9d438dc1733ca98674b1139a87c99
  Author: Alex Williamson <address@hidden>
  Date:   2015-09-23 (Wed, 23 Sep 2015)

  Changed paths:
    M hw/vfio/pci-quirks.c
    M hw/vfio/pci.h

  Log Message:
  -----------
  vfio/pci: Foundation for new quirk structure

VFIOQuirk hosts a single memory region and a fixed set of data fields
that try to handle all the quirk cases, but end up making those that
don't exactly match really confusing.  This patch introduces a struct
intended to provide more flexibility and simpler code.  VFIOQuirk is
stripped to its basics, an opaque data pointer for quirk specific
data and a pointer to an array of MemoryRegions with a counter.  This
still allows us to have common teardown routines, but adds much
greater flexibility to support multiple memory regions and quirk
specific data structures that are easier to maintain.  The existing
VFIOQuirk is transformed into VFIOLegacyQuirk, which further patches
will eliminate entirely.

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


  Commit: b946d286114e09a81c303c7ec8ec3f7b33dff9e8
      
https://github.com/qemu/qemu/commit/b946d286114e09a81c303c7ec8ec3f7b33dff9e8
  Author: Alex Williamson <address@hidden>
  Date:   2015-09-23 (Wed, 23 Sep 2015)

  Changed paths:
    M hw/vfio/pci-quirks.c
    M trace-events

  Log Message:
  -----------
  vfio/pci: Cleanup ATI 0x3c3 quirk

This is an easy quirk that really doesn't need a data structure if
its own.  We can pass vdev as the opaque data and access to the
MemoryRegion isn't required.

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


  Commit: 6029a424be37e0d7949546af7593b9b604611480
      
https://github.com/qemu/qemu/commit/6029a424be37e0d7949546af7593b9b604611480
  Author: Alex Williamson <address@hidden>
  Date:   2015-09-23 (Wed, 23 Sep 2015)

  Changed paths:
    M hw/vfio/pci-quirks.c
    M trace-events

  Log Message:
  -----------
  vfio/pci: Cleanup Nvidia 0x3d0 quirk

The Nvidia 0x3d0 quirk makes use of a two separate registers and gives
us our first chance to make use of separate memory regions for each to
simplify the code a bit.

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


  Commit: 954258a5f11b51abd1ceed7c96d1204d4cef1353
      
https://github.com/qemu/qemu/commit/954258a5f11b51abd1ceed7c96d1204d4cef1353
  Author: Alex Williamson <address@hidden>
  Date:   2015-09-23 (Wed, 23 Sep 2015)

  Changed paths:
    M hw/vfio/pci-quirks.c
    M trace-events

  Log Message:
  -----------
  vfio/pci: Rework RTL8168 quirk

Another rework of this quirk, this time to update to the new quirk
structure.  We can handle the address and data registers with
separate MemoryRegions and a quirk specific data structure, making the
code much more understandable.

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


  Commit: 0e54f24a5b4bb756715928058b60a7d5f70ccd7f
      
https://github.com/qemu/qemu/commit/0e54f24a5b4bb756715928058b60a7d5f70ccd7f
  Author: Alex Williamson <address@hidden>
  Date:   2015-09-23 (Wed, 23 Sep 2015)

  Changed paths:
    M hw/vfio/pci-quirks.c
    M trace-events

  Log Message:
  -----------
  vfio/pci: Config window quirks

Config windows make use of an address register and a data register.
In VGA cards, these are often used to provide real mode code in the
BIOS an easy way to access MMIO registers since the window often
resides in an I/O port register.  When the MMIO register has a mirror
of PCI config space, we need to trap those accesses and redirect them
to emulated config space.

The previous version of this functionality made use of a single
MemoryRegion and single match address.  This version uses separate
MemoryRegions for each of the address and data registers and allows
for multiple match addresses.  This is useful for Nvidia cards which
have two ranges which index into PCI config space.

The previous implementation is left for the follow-on patch for a more
reviewable diff.

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


  Commit: 0d38fb1c5f921acc050d5f80a2ff4e627b565494
      
https://github.com/qemu/qemu/commit/0d38fb1c5f921acc050d5f80a2ff4e627b565494
  Author: Alex Williamson <address@hidden>
  Date:   2015-09-23 (Wed, 23 Sep 2015)

  Changed paths:
    M hw/vfio/pci-quirks.c
    M trace-events

  Log Message:
  -----------
  vfio/pci: Config mirror quirk

Re-implement our mirror quirk using the new infrastructure.

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


  Commit: 958d553405462e95b9d15e8ca6cfb602f7815277
      
https://github.com/qemu/qemu/commit/958d553405462e95b9d15e8ca6cfb602f7815277
  Author: Alex Williamson <address@hidden>
  Date:   2015-09-23 (Wed, 23 Sep 2015)

  Changed paths:
    M hw/vfio/pci-quirks.c
    M hw/vfio/pci.h
    M trace-events

  Log Message:
  -----------
  vfio/pci: Remove old config window and mirror quirks

These are now unused.

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


  Commit: c9c5000991148383d628aac59f1593937be572e4
      
https://github.com/qemu/qemu/commit/c9c5000991148383d628aac59f1593937be572e4
  Author: Alex Williamson <address@hidden>
  Date:   2015-09-23 (Wed, 23 Sep 2015)

  Changed paths:
    M hw/vfio/pci-quirks.c
    M hw/vfio/pci.c
    M hw/vfio/pci.h
    M trace-events

  Log Message:
  -----------
  vfio/pci: Move AMD device specific reset to quirks

This is just another quirk, for reset rather than affecting memory
regions.  Move it to our new quirks file.

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


  Commit: ff635e3775447b7e797f1bad8cf33403199faba1
      
https://github.com/qemu/qemu/commit/ff635e3775447b7e797f1bad8cf33403199faba1
  Author: Alex Williamson <address@hidden>
  Date:   2015-09-23 (Wed, 23 Sep 2015)

  Changed paths:
    M hw/vfio/pci-quirks.c
    M hw/vfio/pci.c
    M hw/vfio/pci.h

  Log Message:
  -----------
  vfio/pci: Cache vendor and device ID

Simplify access to commonly referenced PCI vendor and device ID by
caching it on the VFIOPCIDevice struct.

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


  Commit: 89dcccc5931cc8afc2ccc7cd378695165768148b
      
https://github.com/qemu/qemu/commit/89dcccc5931cc8afc2ccc7cd378695165768148b
  Author: Alex Williamson <address@hidden>
  Date:   2015-09-23 (Wed, 23 Sep 2015)

  Changed paths:
    M hw/vfio/pci-quirks.c
    M hw/vfio/pci.c
    M hw/vfio/pci.h
    M trace-events

  Log Message:
  -----------
  vfio/pci: Add emulated PCI IDs

Specifying an emulated PCI vendor/device ID can be useful for testing
various quirk paths, even though the behavior and functionality of
the device with bogus IDs is fully unsupportable.  We need to use a
uint32_t for the vendor/device IDs, even though the registers
themselves are only 16-bit in order to be able to determine whether
the value is valid and user set.

The same support is added for subsystem vendor/device ID, though these
have the possibility of being useful and supported for more than a
testing tool.  An emulated platform might want to impose their own
subsystem IDs or at least hide the physical subsystem ID.  Windows
guests will often reinstall drivers due to a change in subsystem IDs,
something that VM users may want to avoid.  Of course careful
attention would be required to ensure that guest drivers do not rely
on the subsystem ID as a basis for device driver quirks.

All of these options are added using the standard experimental option
prefix and should not be considered stable.

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


  Commit: fefa4b128de06cec6d513f00ee61e8208aed4a87
      
https://github.com/qemu/qemu/commit/fefa4b128de06cec6d513f00ee61e8208aed4a87
  Author: Peter Maydell <address@hidden>
  Date:   2015-09-23 (Wed, 23 Sep 2015)

  Changed paths:
    M hw/vfio/Makefile.objs
    M hw/vfio/common.c
    A hw/vfio/pci-quirks.c
    M hw/vfio/pci.c
    A hw/vfio/pci.h
    M hw/vfio/platform.c
    M include/hw/vfio/vfio-common.h
    M trace-events

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/awilliam/tags/vfio-update-20150923.0' 
into staging

VFIO updates 2015-09-23

 - Tracing improvements to use common prefixes for functional areas
 - Quirks overhaul:
   - Split PCI quirks to separate file
   - Make them understandable and more extensible
   - Improve use of MemoryRegions and eliminate use of target pagesize
 - Eliminate build-time debugging, everything migrated to runtime opts

# gpg: Signature made Wed 23 Sep 2015 21:09:05 BST using RSA key ID 3BB08B22
# gpg: Good signature from "Alex Williamson <address@hidden>"
# gpg:                 aka "Alex Williamson <address@hidden>"
# gpg:                 aka "Alex Williamson <address@hidden>"
# gpg:                 aka "Alex Williamson <address@hidden>"

* remotes/awilliam/tags/vfio-update-20150923.0:
  vfio/pci: Add emulated PCI IDs
  vfio/pci: Cache vendor and device ID
  vfio/pci: Move AMD device specific reset to quirks
  vfio/pci: Remove old config window and mirror quirks
  vfio/pci: Config mirror quirk
  vfio/pci: Config window quirks
  vfio/pci: Rework RTL8168 quirk
  vfio/pci: Cleanup Nvidia 0x3d0 quirk
  vfio/pci: Cleanup ATI 0x3c3 quirk
  vfio/pci: Foundation for new quirk structure
  vfio/pci: Cleanup ROM blacklist quirk
  vfio/pci: Split quirks to a separate file
  vfio/pci: Extract PCI structures to a separate header
  vfio: Change polarity of our no-mmap option
  vfio/pci: Make interrupt bypass runtime configurable
  vfio/pci: Rename MSI/X functions for easier tracing
  vfio/pci: Rename INTx functions for easier tracing
  vfio/pci: Cleanup vfio_early_setup_msix() error path
  vfio/pci: Cleanup RTL8168 quirk and tracing

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/684bb5770ec5...fefa4b128de0

reply via email to

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