From: Bjorn Helgaas <helgaas@kernel.org>
To: linux-pci@vger.kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org, "H . Peter Anvin" <hpa@zytor.com>,
"Rafael J . Wysocki" <rjw@rjwysocki.net>,
Dan Williams <dan.j.williams@intel.com>,
Kan Liang <kan.liang@linux.intel.com>,
Tony Luck <tony.luck@intel.com>,
Giovanni Cabiddu <giovanni.cabiddu@intel.com>,
Yunying Sun <yunying.sun@intel.com>,
Tomasz Pala <gotar@polanet.pl>,
Sebastian Manciulea <manciuleas@protonmail.com>,
linux-kernel@vger.kernel.org, Bjorn Helgaas <bhelgaas@google.com>
Subject: [PATCH 2/9] x86/pci: Reword ECAM EfiMemoryMappedIO logging to avoid 'reserved'
Date: Tue, 21 Nov 2023 12:36:36 -0600 [thread overview]
Message-ID: <20231121183643.249006-3-helgaas@kernel.org> (raw)
In-Reply-To: <20231121183643.249006-1-helgaas@kernel.org>
From: Bjorn Helgaas <bhelgaas@google.com>
fd3a8cff4d4a ("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
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
arch/x86/pci/mmconfig-shared.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/arch/x86/pci/mmconfig-shared.c b/arch/x86/pci/mmconfig-shared.c
index e9497ee0f854..64c39a23d37a 100644
--- a/arch/x86/pci/mmconfig-shared.c
+++ b/arch/x86/pci/mmconfig-shared.c
@@ -443,9 +443,11 @@ static bool is_acpi_reserved(u64 start, u64 end, enum e820_type not_used)
return mcfg_res.flags;
}
-static bool is_efi_mmio(u64 start, u64 end, enum e820_type not_used)
+static bool is_efi_mmio(struct resource *res)
{
#ifdef CONFIG_EFI
+ u64 start = res->start;
+ u64 end = res->start + resource_size(res);
efi_memory_desc_t *md;
u64 size, mmio_start, mmio_end;
@@ -455,11 +457,6 @@ static bool is_efi_mmio(u64 start, u64 end, enum e820_type not_used)
mmio_start = md->phys_addr;
mmio_end = mmio_start + size;
- /*
- * N.B. Caller supplies (start, start + size),
- * so to match, mmio_end is the first address
- * *past* the EFI_MEMORY_MAPPED_IO area.
- */
if (mmio_start <= start && end <= mmio_end)
return true;
}
@@ -543,8 +540,9 @@ pci_mmcfg_check_reserved(struct device *dev, struct pci_mmcfg_region *cfg, int e
"ACPI motherboard resources\n",
&cfg->res);
- if (is_mmconf_reserved(is_efi_mmio, cfg, dev,
- "EfiMemoryMappedIO")) {
+ if (is_efi_mmio(&cfg->res)) {
+ pr_info("ECAM %pR is EfiMemoryMappedIO; assuming valid\n",
+ &cfg->res);
conflict = insert_resource_conflict(&iomem_resource,
&cfg->res);
if (conflict)
--
2.34.1
next prev parent reply other threads:[~2023-11-21 18:36 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-21 18:36 [PATCH 0/9] x86/pci: Work around lack of ECAM space reservation Bjorn Helgaas
2023-11-21 18:36 ` [PATCH 1/9] x86/pci: Reserve ECAM if BIOS didn't include it in PNP0C02 _CRS Bjorn Helgaas
2023-11-21 18:36 ` Bjorn Helgaas [this message]
2023-11-21 18:36 ` [PATCH 3/9] x86/pci: Add MCFG debug logging Bjorn Helgaas
2023-11-21 18:36 ` [PATCH 4/9] x86/pci: Rename 'MMCONFIG' to 'ECAM', use pr_fmt Bjorn Helgaas
2023-11-21 18:36 ` [PATCH 5/9] x86/pci: Rename acpi_mcfg_check_entry() to acpi_mcfg_valid_entry() Bjorn Helgaas
2023-11-21 18:36 ` [PATCH 6/9] x86/pci: Rename pci_mmcfg_check_reserved() to pci_mmcfg_reserved() Bjorn Helgaas
2023-11-21 18:36 ` [PATCH 7/9] x86/pci: Comment pci_mmconfig_insert() obscure MCFG dependency Bjorn Helgaas
2023-11-21 18:36 ` [PATCH 8/9] x86/pci: Return pci_mmconfig_add() failure early Bjorn Helgaas
2023-11-21 18:36 ` [PATCH 9/9] x86/pci: Reorder pci_mmcfg_arch_map() definition before calls Bjorn Helgaas
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=20231121183643.249006-3-helgaas@kernel.org \
--to=helgaas@kernel.org \
--cc=bhelgaas@google.com \
--cc=bp@alien8.de \
--cc=dan.j.williams@intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=giovanni.cabiddu@intel.com \
--cc=gotar@polanet.pl \
--cc=hpa@zytor.com \
--cc=kan.liang@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=manciuleas@protonmail.com \
--cc=mingo@redhat.com \
--cc=rjw@rjwysocki.net \
--cc=tglx@linutronix.de \
--cc=tony.luck@intel.com \
--cc=x86@kernel.org \
--cc=yunying.sun@intel.com \
/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