[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <cover.1743250122.git.houwenlong.hwl@antgroup.com>
Date: Sat, 29 Mar 2025 21:05:23 +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 0/3] Fix some ASID range size calculation issues in global ASID allocation
During the code review of the global ASID allocation, I found some ASID
range size calculation issues and I'm not sure if I missread.
Firstly, as described in the comments, the range for global ASIDs is
[TLB_NR_DYN_SIZE,MAX_ASID_AVAILABLE-1], which is a close interval. So
the size of range is '(MAX_ASID_AVAILABLE-1)- TLB_NR_DYN_SIZE + 1'.
However, 'global_asid_available' is set as 'MAX_ASID_AVAILABLE -
TLB_NR_DYN_ASIDS - 1', which means one ASID is missed.
The macro 'MAX_ASID_AVAILABLE', as I understand it, is used to represent
the maximum valid ASID. Thus the available ASID range described in the
comments is [0,MAX_ASID_AVAILABLE], which is a close interval too. So
the acutal size of the range is 'MAX_ASID_AVAILABLE + 1'. But it is
incorrectly used as the size of the bitmap in global ASID allocation,
leading to the maximum ASID number being excluded from global ASID
allocation.
Hou Wenlong (3):
x86/mm: Correct the actual count of available global ASIDs
mm/tlb: Fix wrong judgement in allocate_global_asid()
x86/mm: Fix wrong usage of 'MAX_ASID_AVAILABLE' in global ASID
allocation
arch/x86/mm/tlb.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
--
2.31.1
Powered by blists - more mailing lists