mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 03:04:51 +01:00
x86/xen: use lazy_mmu_state when context-switching
We currently set a TIF flag when scheduling out a task that is in lazy MMU mode, in order to restore it when the task is scheduled again. The generic lazy_mmu layer now tracks whether a task is in lazy MMU mode in task_struct::lazy_mmu_state. We can therefore check that state when switching to the new task, instead of using a separate TIF flag. Link: https://lkml.kernel.org/r/20251215150323.2218608-14-kevin.brodsky@arm.com Signed-off-by: Kevin Brodsky <kevin.brodsky@arm.com> Acked-by: David Hildenbrand (Red Hat) <david@kernel.org> Reviewed-by: Juergen Gross <jgross@suse.com> Reviewed-by: Yeoreum Yun <yeoreum.yun@arm.com> Cc: Alexander Gordeev <agordeev@linux.ibm.com> Cc: Andreas Larsson <andreas@gaisler.com> Cc: Anshuman Khandual <anshuman.khandual@arm.com> Cc: Borislav Betkov <bp@alien8.de> Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Christophe Leroy <christophe.leroy@csgroup.eu> Cc: David Hildenbrand <david@redhat.com> Cc: David S. Miller <davem@davemloft.net> Cc: David Woodhouse <dwmw2@infradead.org> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Jann Horn <jannh@google.com> Cc: Liam Howlett <liam.howlett@oracle.com> Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Cc: Madhavan Srinivasan <maddy@linux.ibm.com> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Michal Hocko <mhocko@suse.com> Cc: Mike Rapoport <rppt@kernel.org> Cc: Nicholas Piggin <npiggin@gmail.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Ritesh Harjani (IBM) <ritesh.list@gmail.com> Cc: Ryan Roberts <ryan.roberts@arm.com> Cc: Suren Baghdasaryan <surenb@google.com> Cc: Thomas Gleinxer <tglx@linutronix.de> Cc: Venkat Rao Bagalkote <venkat88@linux.ibm.com> Cc: Vlastimil Babka <vbabka@suse.cz> Cc: Will Deacon <will@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
dacd24ec49
commit
291b3abed6
2 changed files with 2 additions and 5 deletions
|
|
@ -100,8 +100,7 @@ struct thread_info {
|
|||
#define TIF_FORCED_TF 24 /* true if TF in eflags artificially */
|
||||
#define TIF_SINGLESTEP 25 /* reenable singlestep on user return*/
|
||||
#define TIF_BLOCKSTEP 26 /* set when we want DEBUGCTLMSR_BTF */
|
||||
#define TIF_LAZY_MMU_UPDATES 27 /* task is updating the mmu lazily */
|
||||
#define TIF_ADDR32 28 /* 32-bit address space on 64 bits */
|
||||
#define TIF_ADDR32 27 /* 32-bit address space on 64 bits */
|
||||
|
||||
#define _TIF_SSBD BIT(TIF_SSBD)
|
||||
#define _TIF_SPEC_IB BIT(TIF_SPEC_IB)
|
||||
|
|
@ -114,7 +113,6 @@ struct thread_info {
|
|||
#define _TIF_FORCED_TF BIT(TIF_FORCED_TF)
|
||||
#define _TIF_BLOCKSTEP BIT(TIF_BLOCKSTEP)
|
||||
#define _TIF_SINGLESTEP BIT(TIF_SINGLESTEP)
|
||||
#define _TIF_LAZY_MMU_UPDATES BIT(TIF_LAZY_MMU_UPDATES)
|
||||
#define _TIF_ADDR32 BIT(TIF_ADDR32)
|
||||
|
||||
/* flags to check in __switch_to() */
|
||||
|
|
|
|||
|
|
@ -426,7 +426,6 @@ static void xen_start_context_switch(struct task_struct *prev)
|
|||
|
||||
if (this_cpu_read(xen_lazy_mode) == XEN_LAZY_MMU) {
|
||||
arch_leave_lazy_mmu_mode();
|
||||
set_ti_thread_flag(task_thread_info(prev), TIF_LAZY_MMU_UPDATES);
|
||||
}
|
||||
enter_lazy(XEN_LAZY_CPU);
|
||||
}
|
||||
|
|
@ -437,7 +436,7 @@ static void xen_end_context_switch(struct task_struct *next)
|
|||
|
||||
xen_mc_flush();
|
||||
leave_lazy(XEN_LAZY_CPU);
|
||||
if (test_and_clear_ti_thread_flag(task_thread_info(next), TIF_LAZY_MMU_UPDATES))
|
||||
if (__task_lazy_mmu_mode_active(next))
|
||||
arch_enter_lazy_mmu_mode();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue