Skip to contentSkip to conversation

arm64: mm: use bitmap_zero() API

PATCH In review [email protected] 2 participants 2 messages May 6, 2023 – May 16, 2023 arm64

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: mm: use bitmap_zero() API

From: Ye Xingchen <[email protected]>

bitmap_zero() is faster than bitmap_clear(), so use bitmap_zero() instead of bitmap_clear().

---
 arch/arm64/mm/context.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/mm/context.c +1 -1
index e1e0dca01839..ed0bf7f8e8ce 100644
@@ -95,7 +95,7 @@ static void set_reserved_asid_bits(void)
 	else if (arm64_kernel_unmapped_at_el0())
 		set_kpti_asid_bits(asid_map);
 	else
-		bitmap_clear(asid_map, 0, NUM_USER_ASIDS);
+		bitmap_zero(asid_map, NUM_USER_ASIDS);
 }
 
 #define asid_gen_match(asid) \
Signature · 1 line
2.25.1
maintainer
#1 lore raw
Quoted 4 lines · On Sat, May 06, 2023 at 04:36:31PM +0800, [email protected] wrote:

From: Ye Xingchen <[email protected]>

bitmap_zero() is faster than bitmap_clear(), so use bitmap_zero() instead of bitmap_clear().

Is it? Don't these both boil down to:

	memset(asid_map, 0, NUM_USER_ASIDS / 8)

?

Will

Quoted 19 lines
---
 arch/arm64/mm/context.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/mm/context.c +1 -1
index e1e0dca01839..ed0bf7f8e8ce 100644
@@ -95,7 +95,7 @@ static void set_reserved_asid_bits(void)
 	else if (arm64_kernel_unmapped_at_el0())
 		set_kpti_asid_bits(asid_map);
 	else
-		bitmap_clear(asid_map, 0, NUM_USER_ASIDS);
+		bitmap_zero(asid_map, NUM_USER_ASIDS);
 }
 
 #define asid_gen_match(asid) \
Signature · 1 line
2.25.1