qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Igor Mammedov <imammedo@redhat.com>, Laurent Vivier <lvivier@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Eduardo Habkost <ehabkost@redhat.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Julia Suvorova <jusual@redhat.com>,
	Richard Henderson <richard.henderson@linaro.org>,
	qemu-devel@nongnu.org, Paolo Bonzini <pbonzini@redhat.com>,
	David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [PULL v3 05/19] hw/acpi/ich9: Set ACPI PCI hot-plug as default on Q35
Date: Wed, 21 Jul 2021 18:01:16 +0200	[thread overview]
Message-ID: <75446ede-1918-1ef6-02ef-4f7f12302323@redhat.com> (raw)
In-Reply-To: <20210721165934.2f81f3f3@redhat.com>

On 7/21/21 4:59 PM, Igor Mammedov wrote:
> On Tue, 20 Jul 2021 14:56:06 +0200
> Laurent Vivier <lvivier@redhat.com> wrote:
>> On 20/07/2021 13:38, Laurent Vivier wrote:
>>> On 16/07/2021 17:15, Michael S. Tsirkin wrote:  
>>>> From: Julia Suvorova <jusual@redhat.com>
>>>>
>>>> Q35 has three different types of PCI devices hot-plug: PCIe Native,
>>>> SHPC Native and ACPI hot-plug. This patch changes the default choice
>>>> for cold-plugged bridges from PCIe Native to ACPI Hot-plug with
>>>> ability to use SHPC and PCIe Native for hot-plugged bridges.
>>>>
>>>> This is a list of the PCIe Native hot-plug issues that led to this
>>>> change:
>>>>     * no racy behavior during boot (see 110c477c2ed)
>>>>     * no delay during deleting - after the actual power off software
>>>>       must wait at least 1 second before indicating about it. This case
>>>>       is quite important for users, it even has its own bug:
>>>>           https://bugzilla.redhat.com/show_bug.cgi?id=1594168
>>>>     * no timer-based behavior - in addition to the previous example,
>>>>       the attention button has a 5-second waiting period, during which
>>>>       the operation can be canceled with a second press. While this
>>>>       looks fine for manual button control, automation will result in
>>>>       the need to queue or drop events, and the software receiving
>>>>       events in all sort of unspecified combinations of attention/power
>>>>       indicator states, which is racy and uppredictable.
>>>>     * fixes:
>>>>         * https://bugzilla.redhat.com/show_bug.cgi?id=1752465
>>>>         * https://bugzilla.redhat.com/show_bug.cgi?id=1690256
>>>>
>>>> To return to PCIe Native hot-plug:
>>>>     -global ICH9-LPC.acpi-pci-hotplug-with-bridge-support=off
>>>>
>>>> Known issue: older linux guests need the following flag
>>>> to allow hotplugged pci express devices to use io:
>>>>         -device pcie-root-port,io-reserve=4096.
>>>> io is unusual for pci express so this seems minor.
>>>> We'll fix this by a follow up patch.
>>>>
>>>> Signed-off-by: Julia Suvorova <jusual@redhat.com>
>>>> Reviewed-by: Igor Mammedov <imammedo@redhat.com>
>>>> Message-Id: <20210713004205.775386-6-jusual@redhat.com>
>>>> Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
>>>> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
>>>> Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
>>>> ---

>> It also happens with non-VFIO device like e1000e:
>>
>> ...
>> -device e1000e,bus=pcie-root-port-1,addr=0x0,id=hostdev0 \
>                      ^^^^^^^^^^^^^
> ACPI hotplug operates on slot level, so functions greater than 0 are not considered,
> hence unexpected ACPI error. For above CLI, setting 'addr' on root-ports to dedicated slots
> should fix issue.
> 
> The same will happen on PC machine if you assign bridge to any function other than 0.
> 
> Following should fix ACPI error:
> 
> diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
> index 17836149fe..e2345bd7d0 100644
> --- a/hw/i386/acpi-build.c
> +++ b/hw/i386/acpi-build.c
> @@ -527,7 +527,7 @@ static void build_append_pci_bus_devices(Aml *parent_scope, PCIBus *bus,
>              QLIST_FOREACH(sec, &bus->child, sibling) {
>                  int32_t devfn = sec->parent_dev->devfn;
>  
> -                if (pci_bus_is_root(sec)) {
> +                if (pci_bus_is_root(sec) || PCI_FUNC(devfn)) {
>                      continue;
>                  }
> 
> but unplug request will stay ignored if root port/bridge is not on function 0.

Shouldn't we emit a warning/error if a such config is used?



  parent reply	other threads:[~2021-07-21 16:09 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-16 15:15 [PULL v3 00/19] pc,pci,virtio: lots of new features Michael S. Tsirkin
2021-07-16 15:15 ` [PULL v3 01/19] hw/i386/acpi-build: Add ACPI PCI hot-plug methods to Q35 Michael S. Tsirkin
2021-07-16 15:15 ` [PULL v3 02/19] hw/acpi/ich9: Enable ACPI PCI hot-plug Michael S. Tsirkin
2021-07-16 15:15 ` [PULL v3 03/19] hw/pci/pcie: Do not set HPC flag if acpihp is used Michael S. Tsirkin
2021-07-16 15:15 ` [PULL v3 04/19] bios-tables-test: Allow changes in DSDT ACPI tables Michael S. Tsirkin
2021-07-16 15:15 ` [PULL v3 05/19] hw/acpi/ich9: Set ACPI PCI hot-plug as default on Q35 Michael S. Tsirkin
2021-07-20 11:38   ` Laurent Vivier
2021-07-20 12:56     ` Laurent Vivier
2021-07-21 14:59       ` Igor Mammedov
2021-07-21 15:49         ` Laurent Vivier
2021-07-21 16:09           ` Michael S. Tsirkin
2021-07-21 16:27             ` Igor Mammedov
2021-07-21 16:37               ` Michael S. Tsirkin
2021-07-22  9:56                 ` Laurent Vivier
2021-07-22 10:57                 ` Igor Mammedov
2021-07-21 16:01         ` Philippe Mathieu-Daudé [this message]
2021-07-16 15:15 ` [PULL v3 06/19] bios-tables-test: Update golden binaries Michael S. Tsirkin
2021-07-16 15:15 ` [PULL v3 07/19] hw/virtio: add boilerplate for vhost-user-i2c device Michael S. Tsirkin
2021-07-16 15:15 ` [PULL v3 08/19] hw/virtio: add vhost-user-i2c-pci boilerplate Michael S. Tsirkin
2021-07-16 15:15 ` [PULL v3 09/19] docs: Add '-device intel-iommu' entry Michael S. Tsirkin
2021-07-16 15:15 ` [PULL v3 10/19] hw/pci/pci_host: Allow PCI host to bypass iommu Michael S. Tsirkin
2021-07-16 15:15 ` [PULL v3 11/19] hw/pxb: Add a bypass iommu property Michael S. Tsirkin
2021-07-16 15:15 ` [PULL v3 12/19] hw/arm/virt: Add default_bus_bypass_iommu machine option Michael S. Tsirkin
2021-07-16 15:15 ` [PULL v3 13/19] hw/i386: Add a default_bus_bypass_iommu pc " Michael S. Tsirkin
2021-07-16 15:15 ` [PULL v3 14/19] hw/pci: Add pci_bus_range() to get PCI bus number range Michael S. Tsirkin
2021-07-16 15:15 ` [PULL v3 15/19] hw/arm/virt-acpi-build: Add IORT support to bypass SMMUv3 Michael S. Tsirkin
2021-07-16 15:15 ` [PULL v3 16/19] hw/i386/acpi-build: Add DMAR support to bypass iommu Michael S. Tsirkin
2021-07-16 15:15 ` [PULL v3 17/19] hw/i386/acpi-build: Add IVRS " Michael S. Tsirkin
2021-07-16 15:15 ` [PULL v3 18/19] docs: Add documentation for iommu bypass Michael S. Tsirkin
2021-07-16 15:15 ` [PULL v3 19/19] vhost-vsock: SOCK_SEQPACKET feature bit support Michael S. Tsirkin
2021-07-16 17:49 ` [PULL v3 00/19] pc,pci,virtio: lots of new features Peter Maydell

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=75446ede-1918-1ef6-02ef-4f7f12302323@redhat.com \
    --to=philmd@redhat.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=ehabkost@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=jusual@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.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).