Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 48a8b97c authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Linus Torvalds
Browse files

x86/mm: Only use tlb_remove_table() for paravirt



If we don't use paravirt; don't play unnecessary and complicated games
to free page-tables.

Suggested-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: default avatarRik van Riel <riel@surriel.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent fd1102f0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -180,7 +180,7 @@ config X86
	select HAVE_HARDLOCKUP_DETECTOR_PERF	if PERF_EVENTS && HAVE_PERF_EVENTS_NMI
	select HAVE_PERF_REGS
	select HAVE_PERF_USER_STACK_DUMP
	select HAVE_RCU_TABLE_FREE
	select HAVE_RCU_TABLE_FREE		if PARAVIRT
	select HAVE_RCU_TABLE_INVALIDATE	if HAVE_RCU_TABLE_FREE
	select HAVE_REGS_AND_STACK_ACCESS_API
	select HAVE_RELIABLE_STACKTRACE		if X86_64 && (UNWINDER_FRAME_POINTER || UNWINDER_ORC) && STACK_VALIDATION
+2 −0
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@
#include <asm/mshyperv.h>
#include <asm/msr.h>
#include <asm/tlbflush.h>
#include <asm/tlb.h>

#define CREATE_TRACE_POINTS
#include <asm/trace/hyperv.h>
@@ -231,4 +232,5 @@ void hyperv_setup_mmu_ops(void)

	pr_info("Using hypercall for remote TLB flush\n");
	pv_mmu_ops.flush_tlb_others = hyperv_flush_tlb_others;
	pv_mmu_ops.tlb_remove_table = tlb_remove_table;
}
+5 −0
Original line number Diff line number Diff line
@@ -309,6 +309,11 @@ static inline void flush_tlb_others(const struct cpumask *cpumask,
	PVOP_VCALL2(pv_mmu_ops.flush_tlb_others, cpumask, info);
}

static inline void paravirt_tlb_remove_table(struct mmu_gather *tlb, void *table)
{
	PVOP_VCALL2(pv_mmu_ops.tlb_remove_table, tlb, table);
}

static inline int paravirt_pgd_alloc(struct mm_struct *mm)
{
	return PVOP_CALL1(int, pv_mmu_ops.pgd_alloc, mm);
+3 −0
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ struct desc_struct;
struct task_struct;
struct cpumask;
struct flush_tlb_info;
struct mmu_gather;

/*
 * Wrapper type for pointers to code which uses the non-standard
@@ -222,6 +223,8 @@ struct pv_mmu_ops {
	void (*flush_tlb_others)(const struct cpumask *cpus,
				 const struct flush_tlb_info *info);

	void (*tlb_remove_table)(struct mmu_gather *tlb, void *table);

	/* Hooks for allocating and freeing a pagetable top-level */
	int  (*pgd_alloc)(struct mm_struct *mm);
	void (*pgd_free)(struct mm_struct *mm, pgd_t *pgd);
+3 −0
Original line number Diff line number Diff line
@@ -552,6 +552,9 @@ extern void arch_tlbbatch_flush(struct arch_tlbflush_unmap_batch *batch);
#ifndef CONFIG_PARAVIRT
#define flush_tlb_others(mask, info)	\
	native_flush_tlb_others(mask, info)

#define paravirt_tlb_remove_table(tlb, page) \
	tlb_remove_page(tlb, (void *)(page))
#endif

#endif /* _ASM_X86_TLBFLUSH_H */
Loading