linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] PCI: Continue E820 vs host bridge window saga
@ 2022-12-02 21:18 Bjorn Helgaas
  2022-12-02 21:18 ` [PATCH 1/4] efi/x86: Remove EfiMemoryMappedIO from E820 map Bjorn Helgaas
                   ` (4 more replies)
  0 siblings, 5 replies; 17+ messages in thread
From: Bjorn Helgaas @ 2022-12-02 21:18 UTC (permalink / raw)
  To: linux-pci
  Cc: Hans de Goede, Florent DELAHAYE, Konrad J Hambrick, Matt Hansen,
	Benoit Grégoire, Nicholas Johnson, Mika Westerberg,
	Werner Sembach, mumblingdrunkard, linux-kernel, Bjorn Helgaas

From: Bjorn Helgaas <bhelgaas@google.com>

When allocating space for PCI BARs, Linux avoids allocating space mentioned
in the E820 map.  This was originally done by 4dc2287c1805 ("x86: avoid
E820 regions when allocating address space") to work around BIOS defects
that included unusable space in host bridge _CRS.

Some recent machines use EfiMemoryMappedIO for PCI MMCONFIG and host bridge
apertures, and bootloaders and EFI stubs convert those to E820 regions,
which means we can't allocate space for hot-added PCI devices (often a
dock) or for devices the BIOS didn't configure (often a touchpad)

The current strategy is to add DMI quirks that disable the E820 filtering
on these machines and to disable it entirely starting with 2023 BIOSes:

  d341838d776a ("x86/PCI: Disable E820 reserved region clipping via quirks")
  0ae084d5a674 ("x86/PCI: Disable E820 reserved region clipping starting in 2023")

But the quirks are problematic because it's really hard to list all the
machines that need them.

This series is an attempt at a more generic approach.  I'm told by firmware
folks that EfiMemoryMappedIO means "the OS should map this area so EFI
runtime services can use it in virtual mode," but does not prevent the OS
from using it.

The first patch removes any EfiMemoryMappedIO areas from the E820 map.
This doesn't affect any virtual mapping of those areas (that would have to
be done directly from the EFI memory map) but it means Linux can allocate
space for PCI MMIO.

The rest are basically cosmetic log message changes.

Bjorn Helgaas (4):
  efi/x86: Remove EfiMemoryMappedIO from E820 map
  PCI: Skip allocate_resource() if too little space available
  x86/PCI: Tidy E820 removal messages
  x86/PCI: Fix log message typo

 arch/x86/kernel/resource.c  |  7 +++++--
 arch/x86/pci/acpi.c         |  2 +-
 arch/x86/platform/efi/efi.c | 36 ++++++++++++++++++++++++++++++++++++
 drivers/pci/bus.c           |  4 ++++
 4 files changed, 46 insertions(+), 3 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2022-12-08 20:20 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-02 21:18 [PATCH 0/4] PCI: Continue E820 vs host bridge window saga Bjorn Helgaas
2022-12-02 21:18 ` [PATCH 1/4] efi/x86: Remove EfiMemoryMappedIO from E820 map Bjorn Helgaas
2022-12-02 21:18 ` [PATCH 2/4] PCI: Skip allocate_resource() if too little space available Bjorn Helgaas
2022-12-02 21:18 ` [PATCH 3/4] x86/PCI: Tidy E820 removal messages Bjorn Helgaas
2022-12-02 21:18 ` [PATCH 4/4] x86/PCI: Fix log message typo Bjorn Helgaas
2022-12-03 12:44 ` [PATCH 0/4] PCI: Continue E820 vs host bridge window saga Hans de Goede
2022-12-03 17:57   ` Bjorn Helgaas
2022-12-04  9:13     ` Hans de Goede
2022-12-07 15:31       ` Hans de Goede
2022-12-08 18:57         ` Bjorn Helgaas
2022-12-08 19:16           ` Hans de Goede
2022-12-08 20:06             ` Bjorn Helgaas
2022-12-08 20:19               ` Hans de Goede
2022-12-04  9:29     ` Hans de Goede
2022-12-05 13:27       ` Werner Sembach
2022-12-05 14:26         ` Hans de Goede
     [not found]           ` <CANBHt+MoHWz6nB39N3vCM8OkWcjqn_5Va-_bbEcknYDQ3Ve8=Q@mail.gmail.com>
2022-12-05 19:21             ` Hans de Goede

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).