--- /dev/null
+From 38c5ce936a0862a6ce2c8d1c72689a3aba301425 Mon Sep 17 00:00:00 2001
+From: Christian Borntraeger <borntraeger@de.ibm.com>
+Date: Tue, 6 Jan 2015 22:54:46 +0100
+Subject: mm/gup: Replace ACCESS_ONCE with READ_ONCE
+
+From: Christian Borntraeger <borntraeger@de.ibm.com>
+
+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 <borntraeger@de.ibm.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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))
--- /dev/null
+From 378af02b1aecabb3756e19c0cbb8cdd9c3b9637f Mon Sep 17 00:00:00 2001
+From: Guenter Roeck <linux@roeck-us.net>
+Date: Wed, 7 Jan 2015 12:32:28 -0800
+Subject: next: sh: Fix compile error
+
+From: Guenter Roeck <linux@roeck-us.net>
+
+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 <paulmck@linux.vnet.ibm.com>
+Cc: Christian Borntraeger <borntraeger@de.ibm.com>
+Signed-off-by: Guenter Roeck <linux@roeck-us.net>
+Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
+Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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
--- /dev/null
+From da1a288d8562739aa8ba0273d4fb6b73b856c0d3 Mon Sep 17 00:00:00 2001
+From: Christian Borntraeger <borntraeger@de.ibm.com>
+Date: Tue, 6 Jan 2015 22:47:41 +0100
+Subject: ppc/hugetlbfs: Replace ACCESS_ONCE with READ_ONCE
+
+From: Christian Borntraeger <borntraeger@de.ibm.com>
+
+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 <borntraeger@de.ibm.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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.
--- /dev/null
+From 5ee07612e9e20817bb99256ab6cf1400fd5aa270 Mon Sep 17 00:00:00 2001
+From: Christian Borntraeger <borntraeger@de.ibm.com>
+Date: Tue, 6 Jan 2015 22:41:46 +0100
+Subject: ppc/kvm: Replace ACCESS_ONCE with READ_ONCE
+
+From: Christian Borntraeger <borntraeger@de.ibm.com>
+
+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 <borntraeger@de.ibm.com>
+Acked-by: Alexander Graf <agraf@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ 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;