2024-02-22 19:11:06

by Yosry Ahmed

[permalink] [raw]
Subject: [PATCH mm-stable 2/2] x86/mm: always pass NULL as the first argument of switch_mm_irqs_off()

The first argument of switch_mm_irqs_off() is unused by the x86
implementation. Make sure that x86 code never passes a non-NULL value to
make this clear. Update the only non violating caller, switch_mm().

Suggested-by: Dave Hansen <[email protected]>
Signed-off-by: Yosry Ahmed <[email protected]>
---
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 b67545baf6973..51f9f56941058 100644
--- a/arch/x86/mm/tlb.c
+++ b/arch/x86/mm/tlb.c
@@ -327,7 +327,7 @@ void switch_mm(struct mm_struct *prev, struct mm_struct *next,
unsigned long flags;

local_irq_save(flags);
- switch_mm_irqs_off(prev, next, tsk);
+ switch_mm_irqs_off(NULL, next, tsk);
local_irq_restore(flags);
}

--
2.44.0.rc1.240.g4c46232300-goog



2024-02-22 19:25:03

by Dave Hansen

[permalink] [raw]
Subject: Re: [PATCH mm-stable 2/2] x86/mm: always pass NULL as the first argument of switch_mm_irqs_off()

On 2/22/24 11:09, Yosry Ahmed wrote:
> The first argument of switch_mm_irqs_off() is unused by the x86
> implementation. Make sure that x86 code never passes a non-NULL value to
> make this clear. Update the only non violating caller, switch_mm().

Acked-by: Dave Hansen <[email protected]>