From: "Daniel P. Berrangé" <berrange@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Marcel Apfelbaum <mapfelba@redhat.com>,
Julia Suvorova <jusual@redhat.com>,
qemu-devel@nongnu.org, Gerd Hoffmann <kraxel@redhat.com>,
Ani Sinha <ani@anisinha.ca>, Igor Mammedov <imammedo@redhat.com>
Subject: Re: [PATCH 1/5] hw/pci/pcie_port: Rename 'native-hotplug' to 'native-hpc-bit'
Date: Wed, 10 Nov 2021 09:08:34 +0000 [thread overview]
Message-ID: <YYuMEtYOSCNO5whZ@redhat.com> (raw)
In-Reply-To: <20211110010239-mutt-send-email-mst@kernel.org>
On Wed, Nov 10, 2021 at 01:04:54AM -0500, Michael S. Tsirkin wrote:
> On Wed, Nov 10, 2021 at 06:30:10AM +0100, Julia Suvorova wrote:
> > Rename the option to better represent its function - toggle Hot-Plug
> > Capable bit in the PCIe Slot Capability.
> >
> > Signed-off-by: Julia Suvorova <jusual@redhat.com>
> > ---
> > include/hw/pci/pcie_port.h | 2 +-
> > hw/i386/pc_q35.c | 2 +-
> > hw/pci-bridge/gen_pcie_root_port.c | 6 +++++-
> > hw/pci/pcie.c | 2 +-
> > hw/pci/pcie_port.c | 2 +-
> > 5 files changed, 9 insertions(+), 5 deletions(-)
> >
> > diff --git a/include/hw/pci/pcie_port.h b/include/hw/pci/pcie_port.h
> > index e25b289ce8..0da6d66c95 100644
> > --- a/include/hw/pci/pcie_port.h
> > +++ b/include/hw/pci/pcie_port.h
> > @@ -60,7 +60,7 @@ struct PCIESlot {
> > /* Indicates whether any type of hot-plug is allowed on the slot */
> > bool hotplug;
> >
> > - bool native_hotplug;
> > + bool native_hpc_bit;
> >
> > QLIST_ENTRY(PCIESlot) next;
> > };
> > diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
>
>
> This is ok.
>
>
> > index 797e09500b..ded61f8ef7 100644
> > --- a/hw/i386/pc_q35.c
> > +++ b/hw/i386/pc_q35.c
> > @@ -243,7 +243,7 @@ static void pc_q35_init(MachineState *machine)
> > NULL);
> >
> > if (acpi_pcihp) {
> > - object_register_sugar_prop(TYPE_PCIE_SLOT, "native-hotplug",
> > + object_register_sugar_prop(TYPE_PCIE_SLOT, "native-hpc-bit",
> > "false", true);
> > }
> >
>
>
> This part is problematic since we made the feature user-settable in 6.1.
> We can have two features if we really want to ...
> I don't think we have a way to mark properties deprecated, do we?
IMHO just leave the feature with its current name. It won't be the
first thing without a "perfect" name and the name doesn't have a
negative impact on mgmt apps. Changing the name will cause more
pain than it solves.
>
> > diff --git a/hw/pci-bridge/gen_pcie_root_port.c b/hw/pci-bridge/gen_pcie_root_port.c
> > index 20099a8ae3..ed079d72b3 100644
> > --- a/hw/pci-bridge/gen_pcie_root_port.c
> > +++ b/hw/pci-bridge/gen_pcie_root_port.c
> > @@ -87,7 +87,11 @@ static void gen_rp_realize(DeviceState *dev, Error **errp)
> > return;
> > }
> >
> > - if (grp->res_reserve.io == -1 && s->hotplug && !s->native_hotplug) {
> > + /*
> > + * Make sure that IO is assigned in case the slot is hot-pluggable
> > + * but it is not visible through the PCIe Slot Capabilities
> > + */
> > + if (grp->res_reserve.io == -1 && s->hotplug && !s->native_hpc_bit) {
> > grp->res_reserve.io = GEN_PCIE_ROOT_DEFAULT_IO_RANGE;
> > }
> > int rc = pci_bridge_qemu_reserve_cap_init(d, 0,
> > diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c
> > index 914a9bf3d1..ebe002831e 100644
> > --- a/hw/pci/pcie.c
> > +++ b/hw/pci/pcie.c
> > @@ -535,7 +535,7 @@ void pcie_cap_slot_init(PCIDevice *dev, PCIESlot *s)
> > * hot-plug is disabled on the slot.
> > */
> > if (s->hotplug &&
> > - (s->native_hotplug || DEVICE(dev)->hotplugged)) {
> > + (s->native_hpc_bit || DEVICE(dev)->hotplugged)) {
> > pci_long_test_and_set_mask(dev->config + pos + PCI_EXP_SLTCAP,
> > PCI_EXP_SLTCAP_HPS |
> > PCI_EXP_SLTCAP_HPC);
> > diff --git a/hw/pci/pcie_port.c b/hw/pci/pcie_port.c
> > index da850e8dde..eae06d10e2 100644
> > --- a/hw/pci/pcie_port.c
> > +++ b/hw/pci/pcie_port.c
> > @@ -148,7 +148,7 @@ static Property pcie_slot_props[] = {
> > DEFINE_PROP_UINT8("chassis", PCIESlot, chassis, 0),
> > DEFINE_PROP_UINT16("slot", PCIESlot, slot, 0),
> > DEFINE_PROP_BOOL("hotplug", PCIESlot, hotplug, true),
> > - DEFINE_PROP_BOOL("native-hotplug", PCIESlot, native_hotplug, true),
> > + DEFINE_PROP_BOOL("native-hpc-bit", PCIESlot, native_hpc_bit, true),
> > DEFINE_PROP_END_OF_LIST()
> > };
> >
> > --
> > 2.31.1
>
>
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2021-11-10 9:11 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-10 5:30 [PATCH 0/5] Fix Q35 ACPI PCI Hot-plug I/O issues Julia Suvorova
2021-11-10 5:30 ` [PATCH 1/5] hw/pci/pcie_port: Rename 'native-hotplug' to 'native-hpc-bit' Julia Suvorova
2021-11-10 6:04 ` Michael S. Tsirkin
2021-11-10 9:08 ` Daniel P. Berrangé [this message]
2021-11-10 13:30 ` Igor Mammedov
2021-11-10 15:52 ` Michael S. Tsirkin
2021-11-10 5:30 ` [PATCH 2/5] hw/acpi/ich9: Add compatibility option for 'native-hpc-bit' Julia Suvorova
2021-11-10 13:33 ` Igor Mammedov
2021-11-10 13:45 ` Igor Mammedov
2021-11-10 5:30 ` [PATCH 3/5] bios-tables-test: Allow changes in DSDT ACPI tables Julia Suvorova
2021-11-10 5:30 ` [PATCH 4/5] hw/i386/acpi-build: Deny control on PCIe Native Hot-plug in _OSC Julia Suvorova
2021-11-10 7:21 ` Michael S. Tsirkin
2021-11-10 13:57 ` Igor Mammedov
2021-11-10 15:25 ` Julia Suvorova
2021-11-10 15:37 ` Michael S. Tsirkin
2021-11-10 5:30 ` [PATCH 5/5] bios-tables-test: Update golden binaries Julia Suvorova
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YYuMEtYOSCNO5whZ@redhat.com \
--to=berrange@redhat.com \
--cc=ani@anisinha.ca \
--cc=imammedo@redhat.com \
--cc=jusual@redhat.com \
--cc=kraxel@redhat.com \
--cc=mapfelba@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).