aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-yocto-4.9.21/0033-kaiser-kaiser_flush_tlb_on_return_to_user-check-PCID.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/linux-yocto-4.9.21/0033-kaiser-kaiser_flush_tlb_on_return_to_user-check-PCID.patch')
-rw-r--r--common/recipes-kernel/linux/linux-yocto-4.9.21/0033-kaiser-kaiser_flush_tlb_on_return_to_user-check-PCID.patch93
1 files changed, 0 insertions, 93 deletions
diff --git a/common/recipes-kernel/linux/linux-yocto-4.9.21/0033-kaiser-kaiser_flush_tlb_on_return_to_user-check-PCID.patch b/common/recipes-kernel/linux/linux-yocto-4.9.21/0033-kaiser-kaiser_flush_tlb_on_return_to_user-check-PCID.patch
deleted file mode 100644
index b7c611b2..00000000
--- a/common/recipes-kernel/linux/linux-yocto-4.9.21/0033-kaiser-kaiser_flush_tlb_on_return_to_user-check-PCID.patch
+++ /dev/null
@@ -1,93 +0,0 @@
-From bb144d27d0915eb3370d1d640d598ac047ce960e Mon Sep 17 00:00:00 2001
-From: Hugh Dickins <hughd@google.com>
-Date: Sat, 4 Nov 2017 18:43:06 -0700
-Subject: [PATCH 033/103] kaiser: kaiser_flush_tlb_on_return_to_user() check
- PCID
-
-Let kaiser_flush_tlb_on_return_to_user() do the X86_FEATURE_PCID
-check, instead of each caller doing it inline first: nobody needs
-to optimize for the noPCID case, it's clearer this way, and better
-suits later changes. Replace those no-op X86_CR3_PCID_KERN_FLUSH lines
-by a BUILD_BUG_ON() in load_new_mm_cr3(), in case something changes.
-
-Signed-off-by: Hugh Dickins <hughd@google.com>
-Acked-by: Jiri Kosina <jkosina@suse.cz>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- arch/x86/include/asm/tlbflush.h | 4 ++--
- arch/x86/mm/kaiser.c | 6 +++---
- arch/x86/mm/tlb.c | 8 ++++----
- 3 files changed, 9 insertions(+), 9 deletions(-)
-
-diff --git a/arch/x86/include/asm/tlbflush.h b/arch/x86/include/asm/tlbflush.h
-index bc6f979..8db339a 100644
---- a/arch/x86/include/asm/tlbflush.h
-+++ b/arch/x86/include/asm/tlbflush.h
-@@ -159,7 +159,7 @@ static inline void __native_flush_tlb(void)
- * back:
- */
- preempt_disable();
-- if (kaiser_enabled && this_cpu_has(X86_FEATURE_PCID))
-+ if (kaiser_enabled)
- kaiser_flush_tlb_on_return_to_user();
- native_write_cr3(native_read_cr3());
- preempt_enable();
-@@ -218,7 +218,7 @@ static inline void __native_flush_tlb_single(unsigned long addr)
- */
-
- if (!this_cpu_has(X86_FEATURE_INVPCID_SINGLE)) {
-- if (kaiser_enabled && this_cpu_has(X86_FEATURE_PCID))
-+ if (kaiser_enabled)
- kaiser_flush_tlb_on_return_to_user();
- asm volatile("invlpg (%0)" ::"r" (addr) : "memory");
- return;
-diff --git a/arch/x86/mm/kaiser.c b/arch/x86/mm/kaiser.c
-index 65ac3fd..8600663 100644
---- a/arch/x86/mm/kaiser.c
-+++ b/arch/x86/mm/kaiser.c
-@@ -435,12 +435,12 @@ void kaiser_setup_pcid(void)
-
- /*
- * Make a note that this cpu will need to flush USER tlb on return to user.
-- * Caller checks whether this_cpu_has(X86_FEATURE_PCID) before calling:
-- * if cpu does not, then the NOFLUSH bit will never have been set.
-+ * If cpu does not have PCID, then the NOFLUSH bit will never have been set.
- */
- void kaiser_flush_tlb_on_return_to_user(void)
- {
-- this_cpu_write(x86_cr3_pcid_user,
-+ if (this_cpu_has(X86_FEATURE_PCID))
-+ this_cpu_write(x86_cr3_pcid_user,
- X86_CR3_PCID_USER_FLUSH | KAISER_SHADOW_PGD_OFFSET);
- }
- EXPORT_SYMBOL(kaiser_flush_tlb_on_return_to_user);
-diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c
-index fde44bb..e81f8bb 100644
---- a/arch/x86/mm/tlb.c
-+++ b/arch/x86/mm/tlb.c
-@@ -41,7 +41,7 @@ static void load_new_mm_cr3(pgd_t *pgdir)
- {
- unsigned long new_mm_cr3 = __pa(pgdir);
-
-- if (kaiser_enabled && this_cpu_has(X86_FEATURE_PCID)) {
-+ if (kaiser_enabled) {
- /*
- * We reuse the same PCID for different tasks, so we must
- * flush all the entries for the PCID out when we change tasks.
-@@ -52,10 +52,10 @@ static void load_new_mm_cr3(pgd_t *pgdir)
- * do it here, but can only be used if X86_FEATURE_INVPCID is
- * available - and many machines support pcid without invpcid.
- *
-- * The line below is a no-op: X86_CR3_PCID_KERN_FLUSH is now 0;
-- * but keep that line in there in case something changes.
-+ * If X86_CR3_PCID_KERN_FLUSH actually added something, then it
-+ * would be needed in the write_cr3() below - if PCIDs enabled.
- */
-- new_mm_cr3 |= X86_CR3_PCID_KERN_FLUSH;
-+ BUILD_BUG_ON(X86_CR3_PCID_KERN_FLUSH);
- kaiser_flush_tlb_on_return_to_user();
- }
-
---
-2.7.4
-