qemu-devel
[Top][All Lists]
Advanced

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

Re: [RFC PATCH v2 0/4] vfio/pci: Atomic Ops completer support


From: Philippe Mathieu-Daudé
Subject: Re: [RFC PATCH v2 0/4] vfio/pci: Atomic Ops completer support
Date: Thu, 1 Jun 2023 00:31:38 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.11.0

On 27/5/23 01:15, Alex Williamson wrote:
This RFC proposes to allow a vfio-pci device to manipulate the PCI
Express capability of an associated root port to enable Atomic Op
completer support as equivalent to host capabilities.  This would
[...]

While it's not exactly standard practice to modify root port device
capabilities runtime, it also does not seem to be precluded by the PCIe
Spec (6.0.1).  The Atomic Op completion bits of the DEVCAP2 register
are defined as Read-only:

7.4 Configuration Register Types
  Read-only - Register bits are read-only and cannot be altered by software.
              Where explicitly defined, these bits are used to reflect changing
              hardware state, and as a result bit values can be observed to
              change at run time. Register bit default values and bits that
              cannot change value at run time, are permitted to be hard-coded,
              initialized by system/device firmware, or initialized by hardware
              mechanisms such as pin strapping or nonvolatile storage.
              Initialization by system firmware is permitted only for system-
              integrated devices. If the optional feature that would Set the
              bits is not implemented, the bits must be hardwired to Zero.

Here "altered by software" is relative to guest writes to the config
space register, whereas in this implementation we're acting as hardware
and the bits are changing to reflect a change in runtime capabilities.
The spec does include a HwInit register type which would restrict the
value from changing at runtime outside of resets.  Therefore while it
would not be advised to update these bits arbitrarily, it does seem safe
and compatible with guest software to update the value on device attach
and detach.

From my previous (short) PCIe experience, this is also my understanding.



reply via email to

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