qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] e2a629: hw/pcie-root-port: Fix hotplug for PC


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] e2a629: hw/pcie-root-port: Fix hotplug for PCI devices req...
Date: Wed, 04 Aug 2021 08:52:55 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: e2a6290aab578b2170c1f5909fa556385dc0d820
      
https://github.com/qemu/qemu/commit/e2a6290aab578b2170c1f5909fa556385dc0d820
  Author: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
  Date:   2021-08-03 (Tue, 03 Aug 2021)

  Changed paths:
    M hw/pci-bridge/gen_pcie_root_port.c

  Log Message:
  -----------
  hw/pcie-root-port: Fix hotplug for PCI devices requiring IO

Q35 has now ACPI hotplug enabled by default for PCI(e) devices.
As opposed to native PCIe hotplug, guests like Fedora 34
will not assign IO range to pcie-root-ports not supporting
native hotplug, resulting into a regression.

Reproduce by:
    qemu-bin -M q35 -device pcie-root-port,id=p1 -monitor stdio
    device_add e1000,bus=p1
In the Guest OS the respective pcie-root-port will have the IO range
disabled.

Fix it by setting the "reserve-io" hint capability of the
pcie-root-ports so the firmware will allocate the IO range instead.

Acked-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
Message-Id: <20210802090057.1709775-1-marcel@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: d7346e614f4ec353f9b24bb69bfeaf1ade287e07
      
https://github.com/qemu/qemu/commit/d7346e614f4ec353f9b24bb69bfeaf1ade287e07
  Author: Igor Mammedov <imammedo@redhat.com>
  Date:   2021-08-03 (Tue, 03 Aug 2021)

  Changed paths:
    M hw/i386/acpi-build.c

  Log Message:
  -----------
  acpi: x86: pcihp: add support hotplug on multifunction bridges

Commit [1] switched PCI hotplug from native to ACPI one by default.

That however breaks hotplug on following CLI that used to work:
   -nodefaults -machine q35 \
   -device 
pcie-root-port,id=pcie-root-port-0,multifunction=on,bus=pcie.0,addr=0x1,chassis=1
 \
   -device 
pcie-root-port,id=pcie-root-port-1,port=0x1,addr=0x1.0x1,bus=pcie.0,chassis=2

where PCI device is hotplugged to pcie-root-port-1 with error on guest side:

  ACPI BIOS Error (bug): Could not resolve symbol [^S0B.PCNT], AE_NOT_FOUND 
(20201113/psargs-330)
  ACPI Error: Aborting method \_SB.PCI0.PCNT due to previous error 
(AE_NOT_FOUND) (20201113/psparse-531)
  ACPI Error: Aborting method \_GPE._E01 due to previous error (AE_NOT_FOUND) 
(20201113/psparse-531)
  ACPI Error: AE_NOT_FOUND, while evaluating GPE method [_E01] 
(20201113/evgpe-515)

cause is that QEMU's ACPI hotplug never supported functions other then 0
and due to bug it was generating notification entries for not described
functions.

Technically there is no reason not to describe cold-plugged bridges
(root ports) on functions other then 0, as they similarly to bridge
on function 0 are unpluggable.

So since we need to describe multifunction devices iterate over
fuctions as well. But describe only cold-plugged bridges[root ports]
on functions other than 0 as well.

1)
Fixes: 17858a169508609ca9063c544833e5a1adeb7b52 (hw/acpi/ich9: Set ACPI PCI 
hot-plug as default on Q35)
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reported-by: Laurent Vivier <lvivier@redhat.com>
Message-Id: <20210723090424.2092226-1-imammedo@redhat.com>
Fixes: 17858a169508609ca9063c544833e5a1adeb7b52 (hw/acpi/ich9: Set ACPI PCI 
hot-plug as default on Q35)<br>
Signed-off-by: Igor Mammedov &lt;<a href="mailto:imammedo@redhat.com"; 
target="_blank">imammedo@redhat.com</a>&gt;<br>
Reported-by: Laurent Vivier &lt;<a href="mailto:lvivier@redhat.com"; 
target="_blank">lvivier@redhat.com</a>&gt;<br>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 5cd4a8d4e567a6d52553c2133bf1c9b008d80481
      
https://github.com/qemu/qemu/commit/5cd4a8d4e567a6d52553c2133bf1c9b008d80481
  Author: Michael S. Tsirkin <mst@redhat.com>
  Date:   2021-08-03 (Tue, 03 Aug 2021)

  Changed paths:
    M tests/qtest/bios-tables-test-allowed-diff.h

  Log Message:
  -----------
  arm/acpi: allow DSDT changes

We are going to commit ccee1a8140 ("acpi: Update _DSM method in expected 
files").
Allow changes to DSDT on ARM. Only configs with pci are
affected thus all virt variants but for microvm only the pcie variant.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 40c3472a29c9a1fd65255fc196aa6feb99aaec9e
      
https://github.com/qemu/qemu/commit/40c3472a29c9a1fd65255fc196aa6feb99aaec9e
  Author: Michael S. Tsirkin <mst@redhat.com>
  Date:   2021-08-03 (Tue, 03 Aug 2021)

  Changed paths:
    M hw/pci-host/gpex-acpi.c

  Log Message:
  -----------
  Revert "acpi/gpex: Inform os to keep firmware resource map"

This reverts commit 0cf8882fd06ba0aeb1e90fa6f23fce85504d7e14.

Which this commit, with aarch64 when using efi PCI devices with IO ports
do not work.  The reason is that EFI creates I/O port mappings below
0x1000 (in fact, at 0). However Linux, for legacy reasons, does not
support I/O ports <= 0x1000 on PCI, so the I/O assignment created by EFI
is rejected.

EFI creates the mappings primarily for itself, and up until DSM #5
started to be enforced, all PCI resource allocations that existed at
boot were ignored by Linux and recreated from scratch.

Also, the commit in question looks dubious - it seems unlikely that
Linux would fail to create a resource tree. What does
happen is that BARs get moved around, which may cause trouble in some
cases: for instance, Linux had to add special code to the EFI framebuffer
driver to copy with framebuffer BARs being relocated.

DSM #5 has a long history of debate and misinterpretation.

Link: https://lore.kernel.org/r/20210724185234.GA2265457@roeck-us.net/
Fixes: 0cf8882fd06 ("acpi/gpex: Inform os to keep firmware resource map")
Reported-by: Guenter Roeck <linux@roeck-us.net>
Suggested-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: 62a4db5522cbbd8b5309a2949c22f00e5b0138e3
      
https://github.com/qemu/qemu/commit/62a4db5522cbbd8b5309a2949c22f00e5b0138e3
  Author: Michael S. Tsirkin <mst@redhat.com>
  Date:   2021-08-03 (Tue, 03 Aug 2021)

  Changed paths:
    M tests/data/acpi/microvm/DSDT.pcie
    M tests/data/acpi/virt/DSDT
    M tests/data/acpi/virt/DSDT.memhp
    M tests/data/acpi/virt/DSDT.numamem
    M tests/data/acpi/virt/DSDT.pxb
    M tests/qtest/bios-tables-test-allowed-diff.h

  Log Message:
  -----------
  Drop _DSM 5 from expected DSDTs on ARM

diff -rup /tmp/old/tests/data/acpi/microvm/DSDT.pcie.dsl 
/tmp/new/tests/data/acpi/microvm/DSDT.pcie.dsl
--- /tmp/old/tests/data/acpi/microvm/DSDT.pcie.dsl      2021-08-03 
16:22:52.289295442 -0400
+++ /tmp/new/tests/data/acpi/microvm/DSDT.pcie.dsl      2021-08-03 
16:22:40.102286317 -0400
@@ -1302,14 +1302,9 @@ DefinitionBlock ("", "DSDT", 2, "BOCHS "
                     {
                         Return (Buffer (One)
                         {
-                             0x21                                             
// !
+                             0x01                                             
// .
                         })
                     }
-
-                    If ((Arg2 == 0x05))
-                    {
-                        Return (Zero)
-                    }
                 }

                 Return (Buffer (One)

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>


  Commit: f17d05569a5443691edd823f65c2d833a3598ae6
      
https://github.com/qemu/qemu/commit/f17d05569a5443691edd823f65c2d833a3598ae6
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2021-08-04 (Wed, 04 Aug 2021)

  Changed paths:
    M hw/i386/acpi-build.c
    M hw/pci-bridge/gen_pcie_root_port.c
    M hw/pci-host/gpex-acpi.c
    M tests/data/acpi/microvm/DSDT.pcie
    M tests/data/acpi/virt/DSDT
    M tests/data/acpi/virt/DSDT.memhp
    M tests/data/acpi/virt/DSDT.numamem
    M tests/data/acpi/virt/DSDT.pxb

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging

pc,pci: bugfixes

Small bugfixes all over the place.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

# gpg: Signature made Tue 03 Aug 2021 21:32:43 BST
# gpg:                using RSA key 5D09FD0871C8F85B94CA8A0D281F0DB8D28D5469
# gpg:                issuer "mst@redhat.com"
# gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" [full]
# gpg:                 aka "Michael S. Tsirkin <mst@redhat.com>" [full]
# Primary key fingerprint: 0270 606B 6F3C DF3D 0B17  0970 C350 3912 AFBE 8E67
#      Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA  8A0D 281F 0DB8 D28D 5469

* remotes/mst/tags/for_upstream:
  Drop _DSM 5 from expected DSDTs on ARM
  Revert "acpi/gpex: Inform os to keep firmware resource map"
  arm/acpi: allow DSDT changes
  acpi: x86: pcihp: add support hotplug on multifunction bridges
  hw/pcie-root-port: Fix hotplug for PCI devices requiring IO

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/700d82c9bc6c...f17d05569a54



reply via email to

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