Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Suchanek <msuchanek@suse.de>2019-10-02 13:20:53 +0200
committerMichal Suchanek <msuchanek@suse.de>2019-10-02 21:06:45 +0200
commit60ee413cdaaff930f4a8871d61aef66800bdb7b4 (patch)
treed096f1787df57b5b86a3488fec484ddb9cd0d2e3
parent3f5a2a56eb760ec7bc3b5fd760fb62f99c3974ce (diff)
powerpc/mm/radix: Drop unneeded NULL check (bsc#1152161
ltc#181664).
-rw-r--r--patches.suse/powerpc-mm-radix-Drop-unneeded-NULL-check.patch105
-rw-r--r--series.conf1
2 files changed, 106 insertions, 0 deletions
diff --git a/patches.suse/powerpc-mm-radix-Drop-unneeded-NULL-check.patch b/patches.suse/powerpc-mm-radix-Drop-unneeded-NULL-check.patch
new file mode 100644
index 0000000000..359782ad16
--- /dev/null
+++ b/patches.suse/powerpc-mm-radix-Drop-unneeded-NULL-check.patch
@@ -0,0 +1,105 @@
+From 6773027205ea4ccf17055d7f0a0cd813f22fe127 Mon Sep 17 00:00:00 2001
+From: Michael Ellerman <mpe@ellerman.id.au>
+Date: Mon, 16 Oct 2017 12:41:00 +0530
+Subject: [PATCH] powerpc/mm/radix: Drop unneeded NULL check
+
+References: bsc#1152161 ltc#181664
+Patch-mainline: v4.15-rc1
+Git-commit: 6773027205ea4ccf17055d7f0a0cd813f22fe127
+
+We call these functions with non-NULL mm or vma. Hence we can skip the
+NULL check in these functions. We also remove now unused function
+__local_flush_hugetlb_page().
+
+Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
+[mpe: Drop the checks with is_vm_hugetlb_page() as noticed by Nick]
+Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
+Acked-by: Michal Suchanek <msuchanek@suse.de>
+---
+ arch/powerpc/include/asm/hugetlb.h | 6 ------
+ arch/powerpc/mm/tlb-radix.c | 22 ++++++++++------------
+ 2 files changed, 10 insertions(+), 18 deletions(-)
+
+--- a/arch/powerpc/include/asm/hugetlb.h
++++ b/arch/powerpc/include/asm/hugetlb.h
+@@ -40,12 +40,6 @@ static inline void flush_hugetlb_page(st
+ return radix__flush_hugetlb_page(vma, vmaddr);
+ }
+
+-static inline void __local_flush_hugetlb_page(struct vm_area_struct *vma,
+- unsigned long vmaddr)
+-{
+- if (radix_enabled())
+- return radix__local_flush_hugetlb_page(vma, vmaddr);
+-}
+ #else
+
+ static inline pte_t *hugepd_page(hugepd_t hpd)
+--- a/arch/powerpc/mm/tlb-radix.c
++++ b/arch/powerpc/mm/tlb-radix.c
+@@ -164,7 +164,7 @@ void radix__local_flush_tlb_page_psize(s
+ unsigned long ap = mmu_get_ap(psize);
+
+ preempt_disable();
+- pid = mm ? mm->context.id : 0;
++ pid = mm->context.id;
+ if (pid != MMU_NO_CONTEXT)
+ _tlbiel_va(vmaddr, pid, ap, RIC_FLUSH_TLB);
+ preempt_enable();
+@@ -174,11 +174,10 @@ void radix__local_flush_tlb_page(struct
+ {
+ #ifdef CONFIG_HUGETLB_PAGE
+ /* need the return fix for nohash.c */
+- if (vma && is_vm_hugetlb_page(vma))
+- return __local_flush_hugetlb_page(vma, vmaddr);
++ if (is_vm_hugetlb_page(vma))
++ return radix__local_flush_hugetlb_page(vma, vmaddr);
+ #endif
+- radix__local_flush_tlb_page_psize(vma ? vma->vm_mm : NULL, vmaddr,
+- mmu_virtual_psize);
++ radix__local_flush_tlb_page_psize(vma->vm_mm, vmaddr, mmu_virtual_psize);
+ }
+ EXPORT_SYMBOL(radix__local_flush_tlb_page);
+
+@@ -232,7 +231,7 @@ void radix__flush_tlb_page_psize(struct
+ unsigned long ap = mmu_get_ap(psize);
+
+ preempt_disable();
+- pid = mm ? mm->context.id : 0;
++ pid = mm->context.id;
+ if (unlikely(pid == MMU_NO_CONTEXT))
+ goto bail;
+ if (!mm_is_thread_local(mm))
+@@ -246,11 +245,10 @@ bail:
+ void radix__flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr)
+ {
+ #ifdef CONFIG_HUGETLB_PAGE
+- if (vma && is_vm_hugetlb_page(vma))
+- return flush_hugetlb_page(vma, vmaddr);
++ if (is_vm_hugetlb_page(vma))
++ return radix__flush_hugetlb_page(vma, vmaddr);
+ #endif
+- radix__flush_tlb_page_psize(vma ? vma->vm_mm : NULL, vmaddr,
+- mmu_virtual_psize);
++ radix__flush_tlb_page_psize(vma->vm_mm, vmaddr, mmu_virtual_psize);
+ }
+ EXPORT_SYMBOL(radix__flush_tlb_page);
+
+@@ -330,7 +328,7 @@ void radix__flush_tlb_range_psize(struct
+
+
+ preempt_disable();
+- pid = mm ? mm->context.id : 0;
++ pid = mm->context.id;
+ if (unlikely(pid == MMU_NO_CONTEXT))
+ goto err_out;
+
+@@ -361,7 +359,7 @@ void radix__flush_tlb_collapsed_pmd(stru
+ unsigned long pid, end;
+
+
+- pid = mm ? mm->context.id : 0;
++ pid = mm->context.id;
+ preempt_disable();
+ if (unlikely(pid == MMU_NO_CONTEXT))
+ goto no_context;
diff --git a/series.conf b/series.conf
index 475cf8a8da..98a18069b2 100644
--- a/series.conf
+++ b/series.conf
@@ -10171,6 +10171,7 @@
patches.suse/powerpc-powernv-Enable-TM-without-suspend-if-possibl.patch
patches.suse/powerpc-tm-P9-disable-transactionally-suspended-sigc.patch
patches.suse/powerpc-xmon-Check-before-calling-xive-functions.patch
+ patches.suse/powerpc-mm-radix-Drop-unneeded-NULL-check.patch
patches.suse/powerpc-perf-hv-24x7-Fix-incorrect-comparison-in-mem.patch
patches.suse/KVM-PPC-Book3S-HV-Handle-host-system-reset-in-guest-.patch
patches.suse/powerpc-64s-radix-Fix-process-table-entry-cache-inva.patch