From: Khalid Ali <khaliidcaliy@gmail.com>
To: dave.hansen@linux.intel.com, luto@kernel.org,
peterz@infradead.org, tglx@linutronix.de, mingo@redhat.com,
bp@alien8.de
Cc: x86@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org,
Khalid Ali <khaliidcaliy@gmail.com>
Subject: [PATCH] x86/mm: Fix log overwrite in CPA check_conflict()
Date: Thu, 19 Jun 2025 17:42:41 +0000 [thread overview]
Message-ID: <20250619174305.897-1-khaliidcaliy@gmail.com> (raw)
From: Khalid Ali <khaliidcaliy@gmail.com>
On certain configurations (e.g. custom builds), check_conflict()
may produce a large number of warnings, flooding the kernel log
and overwriting earlier messages.
Observed warning:
CPA protect Rodata RO: 0xffff888022a75000 - 0xffff888022a75fff
PFN 22a75 req 8000000000000023 prevent 0000000000000002
Rate-limit these messages by replacing pr_warn() with
pr_warn_ratelimited().
Signed-off-by: Khalid Ali <khaliidcaliy@gmail.com>
---
arch/x86/mm/pat/set_memory.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/mm/pat/set_memory.c b/arch/x86/mm/pat/set_memory.c
index 8834c76f91c9..bc5b62988b40 100644
--- a/arch/x86/mm/pat/set_memory.c
+++ b/arch/x86/mm/pat/set_memory.c
@@ -608,7 +608,7 @@ static inline void check_conflict(int warnlvl, pgprot_t prot, pgprotval_t val,
if (warnlvl > cpa_warn_level || !conflicts(prot, val))
return;
- pr_warn("CPA %8s %10s: 0x%016lx - 0x%016lx PFN %lx req %016llx prevent %016llx\n",
+ pr_warn_ratelimited("CPA %8s %10s: 0x%016lx - 0x%016lx PFN %lx req %016llx prevent %016llx\n",
lvltxt[warnlvl], txt, start, end, pfn, (unsigned long long)pgprot_val(prot),
(unsigned long long)val);
}
--
2.49.0
next reply other threads:[~2025-06-19 17:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-19 17:42 Khalid Ali [this message]
2025-06-20 9:01 ` Peter Zijlstra
2025-06-20 18:20 ` Khalid Ali
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=20250619174305.897-1-khaliidcaliy@gmail.com \
--to=khaliidcaliy@gmail.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--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
all inboxes | Powered by JetHome®