]> Git Repo - linux.git/commit
x86/pci: Treat EfiMemoryMappedIO as reservation of ECAM space
authorBjorn Helgaas <[email protected]>
Tue, 10 Jan 2023 18:02:43 +0000 (12:02 -0600)
committerBjorn Helgaas <[email protected]>
Fri, 13 Jan 2023 17:53:54 +0000 (11:53 -0600)
commitfd3a8cff4d4a4acb0af49dd947c822717c053cf7
tree966d2c1db37887aff2fb013d3601598fd0846a78
parenta48fe6376919c182597b737984bb905a909727c2
x86/pci: Treat EfiMemoryMappedIO as reservation of ECAM space

Normally we reject ECAM space unless it is reported as reserved in the E820
table or via a PNP0C02 _CRS method (PCI Firmware, r3.3, sec 4.1.2).

07eab0901ede ("efi/x86: Remove EfiMemoryMappedIO from E820 map"), removes
E820 entries that correspond to EfiMemoryMappedIO regions because some
other firmware uses EfiMemoryMappedIO for PCI host bridge windows, and the
E820 entries prevent Linux from allocating BAR space for hot-added devices.

Some firmware doesn't report ECAM space via PNP0C02 _CRS methods, but does
mention it as an EfiMemoryMappedIO region via EFI GetMemoryMap(), which is
normally converted to an E820 entry by a bootloader or EFI stub.  After
07eab0901ede, that E820 entry is removed, so we reject this ECAM space,
which makes PCI extended config space (offsets 0x100-0xfff) inaccessible.

The lack of extended config space breaks anything that relies on it,
including perf, VSEC telemetry, EDAC, QAT, SR-IOV, etc.

Allow use of ECAM for extended config space when the region is covered by
an EfiMemoryMappedIO region, even if it's not included in E820 or PNP0C02
_CRS.

Link: https://lore.kernel.org/r/[email protected]
Link: https://bugzilla.kernel.org/show_bug.cgi?id=216891
Fixes: 07eab0901ede ("efi/x86: Remove EfiMemoryMappedIO from E820 map")
Link: https://lore.kernel.org/r/[email protected]
Reported-by: Kan Liang <[email protected]>
Reported-by: Tony Luck <[email protected]>
Reported-by: Giovanni Cabiddu <[email protected]>
Reported-by: Yunying Sun <[email protected]>
Reported-by: Baowen Zheng <[email protected]>
Reported-by: Zhenzhong Duan <[email protected]>
Reported-by: Yang Lixiao <[email protected]>
Tested-by: Tony Luck <[email protected]>
Tested-by: Giovanni Cabiddu <[email protected]>
Tested-by: Kan Liang <[email protected]>
Tested-by: Yunying Sun <[email protected]>
Signed-off-by: Bjorn Helgaas <[email protected]>
Reviewed-by: Dan Williams <[email protected]>
Reviewed-by: Rafael J. Wysocki <[email protected]>
arch/x86/pci/mmconfig-shared.c
This page took 0.052468 seconds and 4 git commands to generate.