x86/mm: delete unused cpu argument to leave_mm()
authorYosry Ahmed <yosryahmed@google.com>
Fri, 26 Jan 2024 08:06:43 +0000 (08:06 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 22 Feb 2024 18:24:41 +0000 (10:24 -0800)
The argument is unused since commit 3d28ebceaffa ("x86/mm: Rework lazy
TLB to track the actual loaded mm"), delete it.

Link: https://lkml.kernel.org/r/20240126080644.1714297-1-yosryahmed@google.com
Signed-off-by: Yosry Ahmed <yosryahmed@google.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov (AMD) <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/x86/include/asm/mmu.h
arch/x86/kernel/alternative.c
arch/x86/mm/tlb.c
arch/x86/xen/mmu_pv.c
drivers/cpuidle/cpuidle.c
include/linux/mmu_context.h

index 0da5c227f490c07bcff20c877ba4ea6b77129c91..ce4677b8b7356c276c2b5e3b4b08474924fb90db 100644 (file)
@@ -75,7 +75,7 @@ typedef struct {
                .lock = __MUTEX_INITIALIZER(mm.context.lock),           \
        }
 
-void leave_mm(int cpu);
+void leave_mm(void);
 #define leave_mm leave_mm
 
 #endif /* _ASM_X86_MMU_H */
index 1d85cb7071cb21c84899477ec4a150d2fcc4da43..21108d8e6f6b2e02e8de1f0882ad001cac21125f 100644 (file)
@@ -1805,7 +1805,7 @@ static inline temp_mm_state_t use_temporary_mm(struct mm_struct *mm)
         * restoring the previous mm.
         */
        if (this_cpu_read(cpu_tlbstate_shared.is_lazy))
-               leave_mm(smp_processor_id());
+               leave_mm();
 
        temp_state.mm = this_cpu_read(cpu_tlbstate.loaded_mm);
        switch_mm_irqs_off(NULL, mm, current);
index 5768d386efab6ece2029b9d6f797c54dc7491220..80b0caa82a91b47a98ca8f4c98da97d6ae2ef4b1 100644 (file)
@@ -299,7 +299,7 @@ static void load_new_mm_cr3(pgd_t *pgdir, u16 new_asid, unsigned long lam,
        write_cr3(new_mm_cr3);
 }
 
-void leave_mm(int cpu)
+void leave_mm(void)
 {
        struct mm_struct *loaded_mm = this_cpu_read(cpu_tlbstate.loaded_mm);
 
index 72af496a160c8bea33252edd349018dedf6fe19f..218773cfb009f721793ccfaac1a52cf35b52b32b 100644 (file)
@@ -913,7 +913,7 @@ static void drop_mm_ref_this_cpu(void *info)
        struct mm_struct *mm = info;
 
        if (this_cpu_read(cpu_tlbstate.loaded_mm) == mm)
-               leave_mm(smp_processor_id());
+               leave_mm();
 
        /*
         * If this cpu still has a stale cr3 reference, then make sure
index 737a026ef58a3835d07de4d89062e75e37d9cb86..02e40fd7d948c94e8ff014836ec8b8abefd824e1 100644 (file)
@@ -237,7 +237,7 @@ noinstr int cpuidle_enter_state(struct cpuidle_device *dev,
        }
 
        if (target_state->flags & CPUIDLE_FLAG_TLB_FLUSHED)
-               leave_mm(dev->cpu);
+               leave_mm();
 
        /* Take note of the planned idle state. */
        sched_idle_set_state(target_state);
index f2b7a3f040999e8a1506306d0c30800a2a7d3ec2..bbaec80c78c5055b348edb3d641f8480a5f9b15e 100644 (file)
@@ -11,7 +11,7 @@
 #endif
 
 #ifndef leave_mm
-static inline void leave_mm(int cpu) { }
+static inline void leave_mm(void) { }
 #endif
 
 /*