--- /dev/null
+From ce8a5dbdf9e709bdaf4618d7ef8cceb91e8adc69 Mon Sep 17 00:00:00 2001
+From: David Jeffery <djeffery@redhat.com>
+Date: Mon, 6 May 2013 13:49:30 +0800
+Subject: autofs - remove autofs dentry mount check
+
+From: David Jeffery <djeffery@redhat.com>
+
+commit ce8a5dbdf9e709bdaf4618d7ef8cceb91e8adc69 upstream.
+
+When checking if an autofs mount point is busy it isn't sufficient to
+only check if it's a mount point.
+
+For example, if the mount of an offset mountpoint in a tree is denied
+for this host by its export and the dentry becomes a process working
+directory the check incorrectly returns the mount as not in use at
+expire.
+
+This can happen since the default when mounting within a tree is
+nostrict, which means ingnore mount fails on mounts within the tree and
+continue. The nostrict option is meant to allow mounting in this case.
+
+Signed-off-by: David Jeffery <djeffery@redhat.com>
+Signed-off-by: Ian Kent <raven@themaw.net>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/autofs4/expire.c | 9 ---------
+ 1 file changed, 9 deletions(-)
+
+--- a/fs/autofs4/expire.c
++++ b/fs/autofs4/expire.c
+@@ -61,15 +61,6 @@ static int autofs4_mount_busy(struct vfs
+ /* This is an autofs submount, we can't expire it */
+ if (autofs_type_indirect(sbi->type))
+ goto done;
+-
+- /*
+- * Otherwise it's an offset mount and we need to check
+- * if we can umount its mount, if there is one.
+- */
+- if (!d_mountpoint(path.dentry)) {
+- status = 0;
+- goto done;
+- }
+ }
+
+ /* Update the expiry counter if fs is busy */
--- /dev/null
+From 73d2fb758e678c93bc76d40876c2359f0729b0ef Mon Sep 17 00:00:00 2001
+From: Anton Blanchard <anton@samba.org>
+Date: Wed, 1 May 2013 20:06:33 +0000
+Subject: powerpc: Emulate non privileged DSCR read and write
+
+From: Anton Blanchard <anton@samba.org>
+
+commit 73d2fb758e678c93bc76d40876c2359f0729b0ef upstream.
+
+POWER8 allows read and write of the DSCR in userspace. We added
+kernel emulation so applications could always use the instructions
+regardless of the CPU type.
+
+Unfortunately there are two SPRs for the DSCR and we only added
+emulation for the privileged one. Add code to match the non
+privileged one.
+
+A simple test was created to verify the fix:
+
+http://ozlabs.org/~anton/junkcode/user_dscr_test.c
+
+Without the patch we get a SIGILL and it passes with the patch.
+
+Signed-off-by: Anton Blanchard <anton@samba.org>
+Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/powerpc/include/asm/ppc-opcode.h | 4 ++++
+ arch/powerpc/kernel/traps.c | 10 ++++++++--
+ 2 files changed, 12 insertions(+), 2 deletions(-)
+
+--- a/arch/powerpc/include/asm/ppc-opcode.h
++++ b/arch/powerpc/include/asm/ppc-opcode.h
+@@ -45,6 +45,10 @@
+ #define PPC_INST_MFSPR_DSCR_MASK 0xfc1fffff
+ #define PPC_INST_MTSPR_DSCR 0x7c1103a6
+ #define PPC_INST_MTSPR_DSCR_MASK 0xfc1fffff
++#define PPC_INST_MFSPR_DSCR_USER 0x7c0302a6
++#define PPC_INST_MFSPR_DSCR_USER_MASK 0xfc1fffff
++#define PPC_INST_MTSPR_DSCR_USER 0x7c0303a6
++#define PPC_INST_MTSPR_DSCR_USER_MASK 0xfc1fffff
+ #define PPC_INST_SLBFEE 0x7c0007a7
+
+ #define PPC_INST_STRING 0x7c00042a
+--- a/arch/powerpc/kernel/traps.c
++++ b/arch/powerpc/kernel/traps.c
+@@ -960,7 +960,10 @@ static int emulate_instruction(struct pt
+
+ #ifdef CONFIG_PPC64
+ /* Emulate the mfspr rD, DSCR. */
+- if (((instword & PPC_INST_MFSPR_DSCR_MASK) == PPC_INST_MFSPR_DSCR) &&
++ if ((((instword & PPC_INST_MFSPR_DSCR_USER_MASK) ==
++ PPC_INST_MFSPR_DSCR_USER) ||
++ ((instword & PPC_INST_MFSPR_DSCR_MASK) ==
++ PPC_INST_MFSPR_DSCR)) &&
+ cpu_has_feature(CPU_FTR_DSCR)) {
+ PPC_WARN_EMULATED(mfdscr, regs);
+ rd = (instword >> 21) & 0x1f;
+@@ -968,7 +971,10 @@ static int emulate_instruction(struct pt
+ return 0;
+ }
+ /* Emulate the mtspr DSCR, rD. */
+- if (((instword & PPC_INST_MTSPR_DSCR_MASK) == PPC_INST_MTSPR_DSCR) &&
++ if ((((instword & PPC_INST_MTSPR_DSCR_USER_MASK) ==
++ PPC_INST_MTSPR_DSCR_USER) ||
++ ((instword & PPC_INST_MTSPR_DSCR_MASK) ==
++ PPC_INST_MTSPR_DSCR)) &&
+ cpu_has_feature(CPU_FTR_DSCR)) {
+ PPC_WARN_EMULATED(mtdscr, regs);
+ rd = (instword >> 21) & 0x1f;
--- /dev/null
+From 7122beeee7bc1757682049780179d7c216dd1c83 Mon Sep 17 00:00:00 2001
+From: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
+Date: Fri, 22 Mar 2013 05:49:35 +0000
+Subject: powerpc: fix numa distance for form0 device tree
+
+From: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
+
+commit 7122beeee7bc1757682049780179d7c216dd1c83 upstream.
+
+The following commit breaks numa distance setup for old powerpc
+systems that use form0 encoding in device tree.
+
+commit 41eab6f88f24124df89e38067b3766b7bef06ddb
+powerpc/numa: Use form 1 affinity to setup node distance
+
+Device tree node /rtas/ibm,associativity-reference-points would
+index into /cpus/PowerPCxxxx/ibm,associativity based on form0 or
+form1 encoding detected by ibm,architecture-vec-5 property.
+
+All modern systems use form1 and current kernel code is correct.
+However, on older systems with form0 encoding, the numa distance
+will get hard coded as LOCAL_DISTANCE for all nodes. This causes
+task scheduling anomaly since scheduler will skip building numa
+level domain (topmost domain with all cpus) if all numa distances
+are same. (value of 'level' in sched_init_numa() will remain 0)
+
+Prior to the above commit:
+((from) == (to) ? LOCAL_DISTANCE : REMOTE_DISTANCE)
+
+Restoring compatible behavior with this patch for old powerpc systems
+with device tree where numa distance are encoded as form0.
+
+Signed-off-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
+Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/powerpc/mm/numa.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/powerpc/mm/numa.c
++++ b/arch/powerpc/mm/numa.c
+@@ -201,7 +201,7 @@ int __node_distance(int a, int b)
+ int distance = LOCAL_DISTANCE;
+
+ if (!form1_affinity)
+- return distance;
++ return ((a == b) ? LOCAL_DISTANCE : REMOTE_DISTANCE);
+
+ for (i = 0; i < distance_ref_points_depth; i++) {
+ if (distance_lookup_table[a][i] == distance_lookup_table[b][i])
--- /dev/null
+powerpc-emulate-non-privileged-dscr-read-and-write.patch
+powerpc-fix-numa-distance-for-form0-device-tree.patch
+autofs-remove-autofs-dentry-mount-check.patch