public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/mm: Remove duplicate check from build_cr3()
@ 2024-08-14 12:46 Yuntao Wang
  2024-08-14 17:46 ` [tip: x86/mm] " tip-bot2 for Yuntao Wang
  0 siblings, 1 reply; 2+ messages in thread
From: Yuntao Wang @ 2024-08-14 12:46 UTC (permalink / raw)
  To: linux-kernel, x86
  Cc: Dave Hansen, Andy Lutomirski, Peter Zijlstra, Thomas Gleixner,
	Ingo Molnar, Borislav Petkov, H. Peter Anvin, Yuntao Wang

There is already a check for 'asid > MAX_ASID_AVAILABLE' in kern_pcid(),
so it is unnecessary to perform this check again in build_cr3(). Remove it.

Signed-off-by: Yuntao Wang <yuntao.wang@linux.dev>
---
 arch/x86/mm/tlb.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c
index 44ac64f3a047..5bc87519e13e 100644
--- a/arch/x86/mm/tlb.c
+++ b/arch/x86/mm/tlb.c
@@ -160,7 +160,6 @@ static inline unsigned long build_cr3(pgd_t *pgd, u16 asid, unsigned long lam)
 	unsigned long cr3 = __sme_pa(pgd) | lam;
 
 	if (static_cpu_has(X86_FEATURE_PCID)) {
-		VM_WARN_ON_ONCE(asid > MAX_ASID_AVAILABLE);
 		cr3 |= kern_pcid(asid);
 	} else {
 		VM_WARN_ON_ONCE(asid != 0);
-- 
2.46.0


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

end of thread, other threads:[~2024-08-14 17:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-14 12:46 [PATCH] x86/mm: Remove duplicate check from build_cr3() Yuntao Wang
2024-08-14 17:46 ` [tip: x86/mm] " tip-bot2 for Yuntao Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox