[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <0954cb7ec766d6d1e0b66a93876762b516ae9bae.1743250122.git.houwenlong.hwl@antgroup.com>
Date: Sat, 29 Mar 2025 21:05:24 +0800
From: "Hou Wenlong" <houwenlong.hwl@...group.com>
To: linux-kernel@...r.kernel.org
Cc: "Hou Wenlong" <houwenlong.hwl@...group.com>,
"Dave Hansen" <dave.hansen@...ux.intel.com>,
"Andy Lutomirski" <luto@...nel.org>,
"Peter Zijlstra" <peterz@...radead.org>,
"Thomas Gleixner" <tglx@...utronix.de>,
"Ingo Molnar" <mingo@...hat.com>,
"Borislav Petkov" <bp@...en8.de>,
<x86@...nel.org>,
"H. Peter Anvin" <hpa@...or.com>,
"Rik van Riel" <riel@...riel.com>
Subject: [PATCH 1/3] x86/mm: Correct the actual count of available global ASIDs
The available ASID range for global ASID allocation is
[TLB_NR_DYN_ASIDS, MAX_ASID_AVAILABLE-1], which is a close interval. So
the actual count of available ASIDs for global ASID allocation should be
'(MAX_ASID_AVIALBE-1) - TLB_NR_DYN_ASIDS + 1'.
Fixes: d504d1247e36 ("x86/mm: Add global ASID allocation helper functions")
Signed-off-by: Hou Wenlong <houwenlong.hwl@...group.com>
---
arch/x86/mm/tlb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c
index e459d97ef397..cad4a8eae2d8 100644
--- a/arch/x86/mm/tlb.c
+++ b/arch/x86/mm/tlb.c
@@ -279,7 +279,7 @@ static DEFINE_RAW_SPINLOCK(global_asid_lock);
static u16 last_global_asid = MAX_ASID_AVAILABLE;
static DECLARE_BITMAP(global_asid_used, MAX_ASID_AVAILABLE);
static DECLARE_BITMAP(global_asid_freed, MAX_ASID_AVAILABLE);
-static int global_asid_available = MAX_ASID_AVAILABLE - TLB_NR_DYN_ASIDS - 1;
+static int global_asid_available = MAX_ASID_AVAILABLE - TLB_NR_DYN_ASIDS;
/*
* When the search for a free ASID in the global ASID space reaches
--
2.31.1
Powered by blists - more mailing lists