[PATCH v5 00/18] pci hotplug tracking

Vladimir Sementsov-Ogievskiy posted 18 patches 1 year, 2 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20230216180356.156832-1-vsementsov@yandex-team.ru
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Paolo Bonzini <pbonzini@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Eduardo Habkost <eduardo@habkost.net>, Eric Blake <eblake@redhat.com>, Markus Armbruster <armbru@redhat.com>
There is a newer version of this series
qapi/qdev.json                  | 224 ++++++++++++++++++++++++++++++--
include/hw/hotplug.h            |  12 ++
include/hw/pci/pci.h            |   1 +
include/hw/pci/pci_bridge.h     |   2 +
include/hw/pci/pcie.h           |  10 +-
include/hw/pci/pcie_regs.h      |  14 --
include/hw/pci/shpc.h           |   2 +
include/monitor/qdev.h          |   7 +
hw/core/hotplug.c               |  13 ++
hw/pci-bridge/pci_bridge_dev.c  |  14 ++
hw/pci-bridge/pcie_pci_bridge.c |   1 +
hw/pci/pci.c                    |  33 +++++
hw/pci/pcie.c                   | 122 +++++++++++++++--
hw/pci/pcie_port.c              |   1 +
hw/pci/shpc.c                   | 214 ++++++++++++++++++++++--------
softmmu/qdev-monitor.c          |  67 ++++++++++
16 files changed, 639 insertions(+), 98 deletions(-)
[PATCH v5 00/18] pci hotplug tracking
Posted by Vladimir Sementsov-Ogievskiy 1 year, 2 months ago
Hi all!

v5: - don't deprecate IDs and return to ID & QOM scheme
    - split complicated HOTPLUG_STATE patch into several ones

----

The main patches are the last four ones:

- introduce HOTPLUG_STATE event, that inform when hotplug controller
change it's state, especially indicator leds

- query-hotplug command, that provides same information as event on
demand

- DEVICE_ON event - a kind of counterpart for DEVICE_DELETED, signals
when device is finally accepted by guest, power indicator is on and so
on.

That's all for smarter handling of SHPC and PCIe-native hotplug.

If you want to test new events, don't forget
  -global ICH9-LPC.acpi-pci-hotplug-with-bridge-support=off
flag, to disable ACPI hotplug default.

Vladimir Sementsov-Ogievskiy (18):
  pci/shpc: set attention led to OFF on reset
  pci/shpc: change shpc_get_status() return type to uint8_t
  pci/shpc: shpc_slot_command(): handle PWRONLY -> ENABLED transition
  pci/shpc: more generic handle hot-unplug in shpc_slot_command()
  pci/shpc: pass PCIDevice pointer to shpc_slot_command()
  pci/shpc: refactor shpc_device_plug_common()
  pcie: pcie_cap_slot_write_config(): use correct macro
  pcie_regs: drop duplicated indicator value macros
  pcie: drop unused PCIExpressIndicator
  pcie: pcie_cap_slot_enable_power() use correct helper
  pcie: introduce pcie_sltctl_powered_off() helper
  pcie: set power indicator to off on reset by default
  pci: introduce pci_find_the_only_child()
  qapi/qdev.json: unite DEVICE_* event data into single structure
  qapi: add HOTPLUG_STATE infrastructure
  shpc: implement HOTPLUG_STATE event and query-hotplug
  pcie: implement HOTPLUG_STATE event and query-hotplug
  qapi: introduce DEVICE_ON event

 qapi/qdev.json                  | 224 ++++++++++++++++++++++++++++++--
 include/hw/hotplug.h            |  12 ++
 include/hw/pci/pci.h            |   1 +
 include/hw/pci/pci_bridge.h     |   2 +
 include/hw/pci/pcie.h           |  10 +-
 include/hw/pci/pcie_regs.h      |  14 --
 include/hw/pci/shpc.h           |   2 +
 include/monitor/qdev.h          |   7 +
 hw/core/hotplug.c               |  13 ++
 hw/pci-bridge/pci_bridge_dev.c  |  14 ++
 hw/pci-bridge/pcie_pci_bridge.c |   1 +
 hw/pci/pci.c                    |  33 +++++
 hw/pci/pcie.c                   | 122 +++++++++++++++--
 hw/pci/pcie_port.c              |   1 +
 hw/pci/shpc.c                   | 214 ++++++++++++++++++++++--------
 softmmu/qdev-monitor.c          |  67 ++++++++++
 16 files changed, 639 insertions(+), 98 deletions(-)

-- 
2.34.1
Re: [PATCH v5 00/18] pci hotplug tracking
Posted by Michael S. Tsirkin 1 year, 2 months ago
On Thu, Feb 16, 2023 at 09:03:38PM +0300, Vladimir Sementsov-Ogievskiy wrote:
> Hi all!
> 
> v5: - don't deprecate IDs and return to ID & QOM scheme
>     - split complicated HOTPLUG_STATE patch into several ones


picked up 1-12

new events and commands need more review, in particular by qapi
maintainers.

> ----
> 
> The main patches are the last four ones:
> 
> - introduce HOTPLUG_STATE event, that inform when hotplug controller
> change it's state, especially indicator leds
> 
> - query-hotplug command, that provides same information as event on
> demand
> 
> - DEVICE_ON event - a kind of counterpart for DEVICE_DELETED, signals
> when device is finally accepted by guest, power indicator is on and so
> on.
> 
> That's all for smarter handling of SHPC and PCIe-native hotplug.
> 
> If you want to test new events, don't forget
>   -global ICH9-LPC.acpi-pci-hotplug-with-bridge-support=off
> flag, to disable ACPI hotplug default.
> 
> Vladimir Sementsov-Ogievskiy (18):
>   pci/shpc: set attention led to OFF on reset
>   pci/shpc: change shpc_get_status() return type to uint8_t
>   pci/shpc: shpc_slot_command(): handle PWRONLY -> ENABLED transition
>   pci/shpc: more generic handle hot-unplug in shpc_slot_command()
>   pci/shpc: pass PCIDevice pointer to shpc_slot_command()
>   pci/shpc: refactor shpc_device_plug_common()
>   pcie: pcie_cap_slot_write_config(): use correct macro
>   pcie_regs: drop duplicated indicator value macros
>   pcie: drop unused PCIExpressIndicator
>   pcie: pcie_cap_slot_enable_power() use correct helper
>   pcie: introduce pcie_sltctl_powered_off() helper
>   pcie: set power indicator to off on reset by default
>   pci: introduce pci_find_the_only_child()
>   qapi/qdev.json: unite DEVICE_* event data into single structure
>   qapi: add HOTPLUG_STATE infrastructure
>   shpc: implement HOTPLUG_STATE event and query-hotplug
>   pcie: implement HOTPLUG_STATE event and query-hotplug
>   qapi: introduce DEVICE_ON event
> 
>  qapi/qdev.json                  | 224 ++++++++++++++++++++++++++++++--
>  include/hw/hotplug.h            |  12 ++
>  include/hw/pci/pci.h            |   1 +
>  include/hw/pci/pci_bridge.h     |   2 +
>  include/hw/pci/pcie.h           |  10 +-
>  include/hw/pci/pcie_regs.h      |  14 --
>  include/hw/pci/shpc.h           |   2 +
>  include/monitor/qdev.h          |   7 +
>  hw/core/hotplug.c               |  13 ++
>  hw/pci-bridge/pci_bridge_dev.c  |  14 ++
>  hw/pci-bridge/pcie_pci_bridge.c |   1 +
>  hw/pci/pci.c                    |  33 +++++
>  hw/pci/pcie.c                   | 122 +++++++++++++++--
>  hw/pci/pcie_port.c              |   1 +
>  hw/pci/shpc.c                   | 214 ++++++++++++++++++++++--------
>  softmmu/qdev-monitor.c          |  67 ++++++++++
>  16 files changed, 639 insertions(+), 98 deletions(-)
> 
> -- 
> 2.34.1
Re: [PATCH v5 00/18] pci hotplug tracking
Posted by Vladimir Sementsov-Ogievskiy 1 year, 2 months ago
On 02.03.23 00:17, Michael S. Tsirkin wrote:
> On Thu, Feb 16, 2023 at 09:03:38PM +0300, Vladimir Sementsov-Ogievskiy wrote:
>> Hi all!
>>
>> v5: - don't deprecate IDs and return to ID & QOM scheme
>>      - split complicated HOTPLUG_STATE patch into several ones
> 
> picked up 1-12

Thanks!

-- 
Best regards,
Vladimir
Re: [PATCH v5 00/18] pci hotplug tracking
Posted by Michael S. Tsirkin 1 year, 2 months ago
On Thu, Feb 16, 2023 at 09:03:38PM +0300, Vladimir Sementsov-Ogievskiy wrote:
> Hi all!
> 
> v5: - don't deprecate IDs and return to ID & QOM scheme
>     - split complicated HOTPLUG_STATE patch into several ones


One small point: when you change patchset subject, that is ok,
but pls reply to old patchset with an email explaining that.

> ----
> 
> The main patches are the last four ones:
> 
> - introduce HOTPLUG_STATE event, that inform when hotplug controller
> change it's state, especially indicator leds
> 
> - query-hotplug command, that provides same information as event on
> demand
> 
> - DEVICE_ON event - a kind of counterpart for DEVICE_DELETED, signals
> when device is finally accepted by guest, power indicator is on and so
> on.
> 
> That's all for smarter handling of SHPC and PCIe-native hotplug.
> 
> If you want to test new events, don't forget
>   -global ICH9-LPC.acpi-pci-hotplug-with-bridge-support=off
> flag, to disable ACPI hotplug default.
> 
> Vladimir Sementsov-Ogievskiy (18):
>   pci/shpc: set attention led to OFF on reset
>   pci/shpc: change shpc_get_status() return type to uint8_t
>   pci/shpc: shpc_slot_command(): handle PWRONLY -> ENABLED transition
>   pci/shpc: more generic handle hot-unplug in shpc_slot_command()
>   pci/shpc: pass PCIDevice pointer to shpc_slot_command()
>   pci/shpc: refactor shpc_device_plug_common()
>   pcie: pcie_cap_slot_write_config(): use correct macro
>   pcie_regs: drop duplicated indicator value macros
>   pcie: drop unused PCIExpressIndicator
>   pcie: pcie_cap_slot_enable_power() use correct helper
>   pcie: introduce pcie_sltctl_powered_off() helper
>   pcie: set power indicator to off on reset by default
>   pci: introduce pci_find_the_only_child()
>   qapi/qdev.json: unite DEVICE_* event data into single structure
>   qapi: add HOTPLUG_STATE infrastructure
>   shpc: implement HOTPLUG_STATE event and query-hotplug
>   pcie: implement HOTPLUG_STATE event and query-hotplug
>   qapi: introduce DEVICE_ON event
> 
>  qapi/qdev.json                  | 224 ++++++++++++++++++++++++++++++--
>  include/hw/hotplug.h            |  12 ++
>  include/hw/pci/pci.h            |   1 +
>  include/hw/pci/pci_bridge.h     |   2 +
>  include/hw/pci/pcie.h           |  10 +-
>  include/hw/pci/pcie_regs.h      |  14 --
>  include/hw/pci/shpc.h           |   2 +
>  include/monitor/qdev.h          |   7 +
>  hw/core/hotplug.c               |  13 ++
>  hw/pci-bridge/pci_bridge_dev.c  |  14 ++
>  hw/pci-bridge/pcie_pci_bridge.c |   1 +
>  hw/pci/pci.c                    |  33 +++++
>  hw/pci/pcie.c                   | 122 +++++++++++++++--
>  hw/pci/pcie_port.c              |   1 +
>  hw/pci/shpc.c                   | 214 ++++++++++++++++++++++--------
>  softmmu/qdev-monitor.c          |  67 ++++++++++
>  16 files changed, 639 insertions(+), 98 deletions(-)
> 
> -- 
> 2.34.1
Re: [PATCH v5 00/18] pci hotplug tracking
Posted by Vladimir Sementsov-Ogievskiy 1 year, 2 months ago
On 02.03.23 00:16, Michael S. Tsirkin wrote:
> On Thu, Feb 16, 2023 at 09:03:38PM +0300, Vladimir Sementsov-Ogievskiy wrote:
>> Hi all!
>>
>> v5: - don't deprecate IDs and return to ID & QOM scheme
>>      - split complicated HOTPLUG_STATE patch into several ones
> 
> One small point: when you change patchset subject, that is ok,
> but pls reply to old patchset with an email explaining that.
> 

Good point, will do next time. Sorry for inconvenience.

-- 
Best regards,
Vladimir