Skip to content

Commit e1fad9d

Browse files
committed
x86/pci: Reword ECAM EfiMemoryMappedIO logging to avoid 'reserved'
fd3a8cf ("x86/pci: Treat EfiMemoryMappedIO as reservation of ECAM space") added the concept of using the EFI memory map to help decide whether ECAM space mentioned in the MCFG table is valid. Unfortunately it described that EfiMemoryMappedIO space as "reserved", but it is actually not *reserved* by the EFI memory map. EfiMemoryMappedIO only means the firmware requested that the OS map this space for use by firmware runtime services. Change the dmesg logging to describe it as simply "EfiMemoryMappedIO", not as "reserved as EfiMemoryMappedIO". A previous commit actually *does* reserve the space if ACPI PNP0C01/02 devices haven't done so: - PCI: ECAM at [mem 0xe0000000-0xefffffff] reserved as EfiMemoryMappedIO + PCI: ECAM at [mem 0xe0000000-0xefffffff] is EfiMemoryMappedIO; assuming valid PCI: ECAM [mem 0xe0000000-0xefffffff] reserved to work around lack of ACPI motherboard _CRS Link: https://lore.kernel.org/r/[email protected] Tested-by: Tomasz Pala <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
1 parent 070909e commit e1fad9d

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

arch/x86/pci/mmconfig-shared.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -443,9 +443,11 @@ static bool is_acpi_reserved(u64 start, u64 end, enum e820_type not_used)
443443
return mcfg_res.flags;
444444
}
445445

446-
static bool is_efi_mmio(u64 start, u64 end, enum e820_type not_used)
446+
static bool is_efi_mmio(struct resource *res)
447447
{
448448
#ifdef CONFIG_EFI
449+
u64 start = res->start;
450+
u64 end = res->start + resource_size(res);
449451
efi_memory_desc_t *md;
450452
u64 size, mmio_start, mmio_end;
451453

@@ -455,11 +457,6 @@ static bool is_efi_mmio(u64 start, u64 end, enum e820_type not_used)
455457
mmio_start = md->phys_addr;
456458
mmio_end = mmio_start + size;
457459

458-
/*
459-
* N.B. Caller supplies (start, start + size),
460-
* so to match, mmio_end is the first address
461-
* *past* the EFI_MEMORY_MAPPED_IO area.
462-
*/
463460
if (mmio_start <= start && end <= mmio_end)
464461
return true;
465462
}
@@ -543,8 +540,9 @@ pci_mmcfg_check_reserved(struct device *dev, struct pci_mmcfg_region *cfg, int e
543540
"ACPI motherboard resources\n",
544541
&cfg->res);
545542

546-
if (is_mmconf_reserved(is_efi_mmio, cfg, dev,
547-
"EfiMemoryMappedIO")) {
543+
if (is_efi_mmio(&cfg->res)) {
544+
pr_info("ECAM %pR is EfiMemoryMappedIO; assuming valid\n",
545+
&cfg->res);
548546
conflict = insert_resource_conflict(&iomem_resource,
549547
&cfg->res);
550548
if (conflict)

0 commit comments

Comments
 (0)