From: Greg Kroah-Hartman Date: Wed, 4 Mar 2015 20:42:49 +0000 (-0800) Subject: 3.19-stable patches X-Git-Tag: v3.10.71~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d2185354227611f9a3c03285d14061d79f84f9a6;p=thirdparty%2Fkernel%2Fstable-queue.git 3.19-stable patches added patches: mm-gup-replace-access_once-with-read_once.patch next-sh-fix-compile-error.patch ppc-hugetlbfs-replace-access_once-with-read_once.patch ppc-kvm-replace-access_once-with-read_once.patch --- diff --git a/queue-3.19/mm-gup-replace-access_once-with-read_once.patch b/queue-3.19/mm-gup-replace-access_once-with-read_once.patch new file mode 100644 index 00000000000..69bac7c2502 --- /dev/null +++ b/queue-3.19/mm-gup-replace-access_once-with-read_once.patch @@ -0,0 +1,34 @@ +From 38c5ce936a0862a6ce2c8d1c72689a3aba301425 Mon Sep 17 00:00:00 2001 +From: Christian Borntraeger +Date: Tue, 6 Jan 2015 22:54:46 +0100 +Subject: mm/gup: Replace ACCESS_ONCE with READ_ONCE + +From: Christian Borntraeger + +commit 38c5ce936a0862a6ce2c8d1c72689a3aba301425 upstream. + +ACCESS_ONCE does not work reliably on non-scalar types. For +example gcc 4.6 and 4.7 might remove the volatile tag for such +accesses during the SRA (scalar replacement of aggregates) step +(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58145) + +Fixup gup_pmd_range. + +Signed-off-by: Christian Borntraeger +Signed-off-by: Greg Kroah-Hartman + +--- + mm/gup.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/mm/gup.c ++++ b/mm/gup.c +@@ -926,7 +926,7 @@ static int gup_pmd_range(pud_t pud, unsi + + pmdp = pmd_offset(&pud, addr); + do { +- pmd_t pmd = ACCESS_ONCE(*pmdp); ++ pmd_t pmd = READ_ONCE(*pmdp); + + next = pmd_addr_end(addr, end); + if (pmd_none(pmd) || pmd_trans_splitting(pmd)) diff --git a/queue-3.19/next-sh-fix-compile-error.patch b/queue-3.19/next-sh-fix-compile-error.patch new file mode 100644 index 00000000000..d97338f8fc6 --- /dev/null +++ b/queue-3.19/next-sh-fix-compile-error.patch @@ -0,0 +1,41 @@ +From 378af02b1aecabb3756e19c0cbb8cdd9c3b9637f Mon Sep 17 00:00:00 2001 +From: Guenter Roeck +Date: Wed, 7 Jan 2015 12:32:28 -0800 +Subject: next: sh: Fix compile error + +From: Guenter Roeck + +commit 378af02b1aecabb3756e19c0cbb8cdd9c3b9637f upstream. + +Commit 927609d622a3 ("kernel: tighten rules for ACCESS ONCE") results in a +compile failure for sh builds with CONFIG_X2TLB enabled. + +arch/sh/mm/gup.c: In function 'gup_get_pte': +arch/sh/mm/gup.c:20:2: error: invalid initializer +make[1]: *** [arch/sh/mm/gup.o] Error 1 + +Replace ACCESS_ONCE with READ_ONCE to fix the problem. + +Fixes: 927609d622a3 ("kernel: tighten rules for ACCESS ONCE") +Cc: Paul E. McKenney +Cc: Christian Borntraeger +Signed-off-by: Guenter Roeck +Reviewed-by: Paul E. McKenney +Signed-off-by: Christian Borntraeger +Signed-off-by: Greg Kroah-Hartman + +--- + arch/sh/mm/gup.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/sh/mm/gup.c ++++ b/arch/sh/mm/gup.c +@@ -17,7 +17,7 @@ + static inline pte_t gup_get_pte(pte_t *ptep) + { + #ifndef CONFIG_X2TLB +- return ACCESS_ONCE(*ptep); ++ return READ_ONCE(*ptep); + #else + /* + * With get_user_pages_fast, we walk down the pagetables without diff --git a/queue-3.19/ppc-hugetlbfs-replace-access_once-with-read_once.patch b/queue-3.19/ppc-hugetlbfs-replace-access_once-with-read_once.patch new file mode 100644 index 00000000000..db21b93eba0 --- /dev/null +++ b/queue-3.19/ppc-hugetlbfs-replace-access_once-with-read_once.patch @@ -0,0 +1,43 @@ +From da1a288d8562739aa8ba0273d4fb6b73b856c0d3 Mon Sep 17 00:00:00 2001 +From: Christian Borntraeger +Date: Tue, 6 Jan 2015 22:47:41 +0100 +Subject: ppc/hugetlbfs: Replace ACCESS_ONCE with READ_ONCE + +From: Christian Borntraeger + +commit da1a288d8562739aa8ba0273d4fb6b73b856c0d3 upstream. + +ACCESS_ONCE does not work reliably on non-scalar types. For +example gcc 4.6 and 4.7 might remove the volatile tag for such +accesses during the SRA (scalar replacement of aggregates) step +(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58145) + +Change the ppc/hugetlbfs code to replace ACCESS_ONCE with READ_ONCE. + +Signed-off-by: Christian Borntraeger +Signed-off-by: Greg Kroah-Hartman + +--- + arch/powerpc/mm/hugetlbpage.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/arch/powerpc/mm/hugetlbpage.c ++++ b/arch/powerpc/mm/hugetlbpage.c +@@ -978,7 +978,7 @@ pte_t *find_linux_pte_or_hugepte(pgd_t * + */ + pdshift = PUD_SHIFT; + pudp = pud_offset(&pgd, ea); +- pud = ACCESS_ONCE(*pudp); ++ pud = READ_ONCE(*pudp); + + if (pud_none(pud)) + return NULL; +@@ -990,7 +990,7 @@ pte_t *find_linux_pte_or_hugepte(pgd_t * + else { + pdshift = PMD_SHIFT; + pmdp = pmd_offset(&pud, ea); +- pmd = ACCESS_ONCE(*pmdp); ++ pmd = READ_ONCE(*pmdp); + /* + * A hugepage collapse is captured by pmd_none, because + * it mark the pmd none and do a hpte invalidate. diff --git a/queue-3.19/ppc-kvm-replace-access_once-with-read_once.patch b/queue-3.19/ppc-kvm-replace-access_once-with-read_once.patch new file mode 100644 index 00000000000..30ee196bdf4 --- /dev/null +++ b/queue-3.19/ppc-kvm-replace-access_once-with-read_once.patch @@ -0,0 +1,137 @@ +From 5ee07612e9e20817bb99256ab6cf1400fd5aa270 Mon Sep 17 00:00:00 2001 +From: Christian Borntraeger +Date: Tue, 6 Jan 2015 22:41:46 +0100 +Subject: ppc/kvm: Replace ACCESS_ONCE with READ_ONCE + +From: Christian Borntraeger + +commit 5ee07612e9e20817bb99256ab6cf1400fd5aa270 upstream. + +ACCESS_ONCE does not work reliably on non-scalar types. For +example gcc 4.6 and 4.7 might remove the volatile tag for such +accesses during the SRA (scalar replacement of aggregates) step +(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58145) + +Change the ppc/kvm code to replace ACCESS_ONCE with READ_ONCE. + +Signed-off-by: Christian Borntraeger +Acked-by: Alexander Graf +Signed-off-by: Greg Kroah-Hartman + +--- + arch/powerpc/kvm/book3s_hv_rm_xics.c | 8 ++++---- + arch/powerpc/kvm/book3s_xics.c | 16 ++++++++-------- + 2 files changed, 12 insertions(+), 12 deletions(-) + +--- a/arch/powerpc/kvm/book3s_hv_rm_xics.c ++++ b/arch/powerpc/kvm/book3s_hv_rm_xics.c +@@ -152,7 +152,7 @@ static void icp_rm_down_cppr(struct kvmp + * in virtual mode. + */ + do { +- old_state = new_state = ACCESS_ONCE(icp->state); ++ old_state = new_state = READ_ONCE(icp->state); + + /* Down_CPPR */ + new_state.cppr = new_cppr; +@@ -211,7 +211,7 @@ unsigned long kvmppc_rm_h_xirr(struct kv + * pending priority + */ + do { +- old_state = new_state = ACCESS_ONCE(icp->state); ++ old_state = new_state = READ_ONCE(icp->state); + + xirr = old_state.xisr | (((u32)old_state.cppr) << 24); + if (!old_state.xisr) +@@ -277,7 +277,7 @@ int kvmppc_rm_h_ipi(struct kvm_vcpu *vcp + * whenever the MFRR is made less favored. + */ + do { +- old_state = new_state = ACCESS_ONCE(icp->state); ++ old_state = new_state = READ_ONCE(icp->state); + + /* Set_MFRR */ + new_state.mfrr = mfrr; +@@ -352,7 +352,7 @@ int kvmppc_rm_h_cppr(struct kvm_vcpu *vc + icp_rm_clr_vcpu_irq(icp->vcpu); + + do { +- old_state = new_state = ACCESS_ONCE(icp->state); ++ old_state = new_state = READ_ONCE(icp->state); + + reject = 0; + new_state.cppr = cppr; +--- a/arch/powerpc/kvm/book3s_xics.c ++++ b/arch/powerpc/kvm/book3s_xics.c +@@ -327,7 +327,7 @@ static bool icp_try_to_deliver(struct kv + icp->server_num); + + do { +- old_state = new_state = ACCESS_ONCE(icp->state); ++ old_state = new_state = READ_ONCE(icp->state); + + *reject = 0; + +@@ -512,7 +512,7 @@ static void icp_down_cppr(struct kvmppc_ + * in virtual mode. + */ + do { +- old_state = new_state = ACCESS_ONCE(icp->state); ++ old_state = new_state = READ_ONCE(icp->state); + + /* Down_CPPR */ + new_state.cppr = new_cppr; +@@ -567,7 +567,7 @@ static noinline unsigned long kvmppc_h_x + * pending priority + */ + do { +- old_state = new_state = ACCESS_ONCE(icp->state); ++ old_state = new_state = READ_ONCE(icp->state); + + xirr = old_state.xisr | (((u32)old_state.cppr) << 24); + if (!old_state.xisr) +@@ -634,7 +634,7 @@ static noinline int kvmppc_h_ipi(struct + * whenever the MFRR is made less favored. + */ + do { +- old_state = new_state = ACCESS_ONCE(icp->state); ++ old_state = new_state = READ_ONCE(icp->state); + + /* Set_MFRR */ + new_state.mfrr = mfrr; +@@ -679,7 +679,7 @@ static int kvmppc_h_ipoll(struct kvm_vcp + if (!icp) + return H_PARAMETER; + } +- state = ACCESS_ONCE(icp->state); ++ state = READ_ONCE(icp->state); + kvmppc_set_gpr(vcpu, 4, ((u32)state.cppr << 24) | state.xisr); + kvmppc_set_gpr(vcpu, 5, state.mfrr); + return H_SUCCESS; +@@ -721,7 +721,7 @@ static noinline void kvmppc_h_cppr(struc + BOOK3S_INTERRUPT_EXTERNAL_LEVEL); + + do { +- old_state = new_state = ACCESS_ONCE(icp->state); ++ old_state = new_state = READ_ONCE(icp->state); + + reject = 0; + new_state.cppr = cppr; +@@ -885,7 +885,7 @@ static int xics_debug_show(struct seq_fi + if (!icp) + continue; + +- state.raw = ACCESS_ONCE(icp->state.raw); ++ state.raw = READ_ONCE(icp->state.raw); + seq_printf(m, "cpu server %#lx XIRR:%#x PPRI:%#x CPPR:%#x MFRR:%#x OUT:%d NR:%d\n", + icp->server_num, state.xisr, + state.pending_pri, state.cppr, state.mfrr, +@@ -1082,7 +1082,7 @@ int kvmppc_xics_set_icp(struct kvm_vcpu + * the ICS states before the ICP states. + */ + do { +- old_state = ACCESS_ONCE(icp->state); ++ old_state = READ_ONCE(icp->state); + + if (new_state.mfrr <= old_state.mfrr) { + resend = false; diff --git a/queue-3.19/series b/queue-3.19/series index d6b5119647d..64ecf3fccc7 100644 --- a/queue-3.19/series +++ b/queue-3.19/series @@ -174,3 +174,7 @@ kernel-make-read_once-valid-on-const-arguments.patch x86-spinlocks-paravirt-fix-memory-corruption-on-unlock.patch x86-xen-p2m-replace-access_once-with-read_once.patch quota-store-maximum-space-limit-in-bytes.patch +next-sh-fix-compile-error.patch +mm-gup-replace-access_once-with-read_once.patch +ppc-hugetlbfs-replace-access_once-with-read_once.patch +ppc-kvm-replace-access_once-with-read_once.patch