From: Bjorn Helgaas <helgaas@kernel.org>
To: Hans de Goede <hdegoede@redhat.com>,
"Rafael J . Wysocki" <rjw@rjwysocki.net>,
Borislav Petkov <bp@alien8.de>, "H . Peter Anvin" <hpa@zytor.com>,
Ingo Molnar <mingo@redhat.com>
Cc: "Mika Westerberg" <mika.westerberg@linux.intel.com>,
"Krzysztof Wilczyński" <kw@linux.com>,
"Myron Stowe" <myron.stowe@redhat.com>,
"Juha-Pekka Heikkila" <juhapekka.heikkila@gmail.com>,
"Benoit Grégoire" <benoitg@coeus.ca>,
"Hui Wang" <hui.wang@canonical.com>,
"Kai-Heng Feng" <kai.heng.feng@canonical.com>,
linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org,
x86@kernel.org, linux-kernel@vger.kernel.org,
"Bjorn Helgaas" <bhelgaas@google.com>
Subject: [PATCH v2 2/3] x86: Log resource clipping for E820 regions
Date: Thu, 14 Apr 2022 13:22:51 -0500 [thread overview]
Message-ID: <20220414182252.758742-3-helgaas@kernel.org> (raw)
In-Reply-To: <20220414182252.758742-1-helgaas@kernel.org>
From: Bjorn Helgaas <bhelgaas@google.com>
When remove_e820_regions() clips a resource because an E820 region overlaps
it, log a note in dmesg to add in debugging.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
arch/x86/kernel/resource.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/x86/kernel/resource.c b/arch/x86/kernel/resource.c
index 8ffe68437744..30d524adb012 100644
--- a/arch/x86/kernel/resource.c
+++ b/arch/x86/kernel/resource.c
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
#include <linux/ioport.h>
+#include <linux/printk.h>
#include <asm/e820/api.h>
static void resource_clip(struct resource *res, resource_size_t start,
@@ -28,6 +29,7 @@ static void remove_e820_regions(struct resource *avail)
int i;
struct e820_entry *entry;
u64 e820_start, e820_end;
+ struct resource orig = *avail;
for (i = 0; i < e820_table->nr_entries; i++) {
entry = &e820_table->entries[i];
@@ -35,6 +37,11 @@ static void remove_e820_regions(struct resource *avail)
e820_end = entry->addr + entry->size - 1;
resource_clip(avail, e820_start, e820_end);
+ if (orig.start != avail->start || orig.end != avail->end) {
+ pr_info("clipped %pR to %pR for e820 entry [mem %#010Lx-%#010Lx]\n",
+ &orig, avail, e820_start, e820_end);
+ orig = *avail;
+ }
}
}
--
2.25.1
next prev parent reply other threads:[~2022-04-14 18:23 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-14 18:22 [PATCH v2 0/3] x86/PCI: Log E820 clipping Bjorn Helgaas
2022-04-14 18:22 ` [PATCH v2 1/3] x86/PCI: Eliminate remove_e820_regions() common subexpressions Bjorn Helgaas
2022-04-14 18:22 ` Bjorn Helgaas [this message]
2022-04-15 14:12 ` [PATCH v2 2/3] x86: Log resource clipping for E820 regions Rafael J. Wysocki
2022-04-14 18:22 ` [PATCH v2 3/3] x86/PCI: Clip only host bridge windows " Bjorn Helgaas
2022-04-19 9:59 ` [PATCH v2 0/3] x86/PCI: Log E820 clipping Hans de Goede
2022-04-19 15:03 ` Bjorn Helgaas
2022-04-19 15:16 ` Hans de Goede
2022-04-19 16:45 ` Bjorn Helgaas
2022-05-02 12:24 ` Hans de Goede
2022-05-02 20:32 ` Bjorn Helgaas
2022-05-05 15:03 ` Hans de Goede
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=20220414182252.758742-3-helgaas@kernel.org \
--to=helgaas@kernel.org \
--cc=benoitg@coeus.ca \
--cc=bhelgaas@google.com \
--cc=bp@alien8.de \
--cc=hdegoede@redhat.com \
--cc=hpa@zytor.com \
--cc=hui.wang@canonical.com \
--cc=juhapekka.heikkila@gmail.com \
--cc=kai.heng.feng@canonical.com \
--cc=kw@linux.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=mingo@redhat.com \
--cc=myron.stowe@redhat.com \
--cc=rjw@rjwysocki.net \
--cc=x86@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).