selftests/mm: add platform independent in code comments

The in code comments for the selftest were made on the basis of 128TB
switch, an architecture feature specific to PowerPc and x86 platforms. 
Keeping in mind the support added for arm64 platforms which implements a
256TB switch, a more generic explanation has been provided.

Link: https://lkml.kernel.org/r/20230323105243.2807166-4-chaitanyas.prakash@arm.com
Signed-off-by: Chaitanya S Prakash <chaitanyas.prakash@arm.com>
Cc: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
Chaitanya S Prakash 2023-03-23 16:22:41 +05:30 committed by Andrew Morton
parent bbe168729d
commit c2af2a4190

View File

@ -30,8 +30,8 @@
#endif #endif
/* /*
* >= 128TB is the hint addr value we used to select * The hint addr value is used to allocate addresses
* large address space. * beyond the high address switch boundary.
*/ */
#define ADDR_MARK_128TB (1UL << 47) #define ADDR_MARK_128TB (1UL << 47)
@ -73,9 +73,10 @@ static struct testcase testcases[] = {
}, },
{ {
/* /*
* We should never allocate at the requested address or above it * Unless MAP_FIXED is specified, allocation based on hint
* The len cross the 128TB boundary. Without MAP_FIXED * addr is never at requested address or above it, which is
* we will always search in the lower address space. * beyond high address switch boundary in this case. Instead,
* a suitable allocation is found in lower address space.
*/ */
.addr = ((void *)(ADDR_SWITCH_HINT - PAGE_SIZE)), .addr = ((void *)(ADDR_SWITCH_HINT - PAGE_SIZE)),
.size = 2 * PAGE_SIZE, .size = 2 * PAGE_SIZE,
@ -85,8 +86,8 @@ static struct testcase testcases[] = {
}, },
{ {
/* /*
* Exact mapping at 128TB, the area is free we should get that * Exact mapping at high address switch boundary, should
* even without MAP_FIXED. * be obtained even without MAP_FIXED as area is free.
*/ */
.addr = ((void *)(ADDR_SWITCH_HINT)), .addr = ((void *)(ADDR_SWITCH_HINT)),
.size = PAGE_SIZE, .size = PAGE_SIZE,