From: Greg Kroah-Hartman Date: Wed, 8 May 2013 20:42:54 +0000 (-0700) Subject: 3.4-stable patches X-Git-Tag: v3.9.2~66 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=861f266d73acc9ab4775a3eb6cab8ea5e327c6a7;p=thirdparty%2Fkernel%2Fstable-queue.git 3.4-stable patches added patches: autofs-remove-autofs-dentry-mount-check.patch powerpc-emulate-non-privileged-dscr-read-and-write.patch powerpc-fix-numa-distance-for-form0-device-tree.patch --- diff --git a/queue-3.4/autofs-remove-autofs-dentry-mount-check.patch b/queue-3.4/autofs-remove-autofs-dentry-mount-check.patch new file mode 100644 index 00000000000..4d3e63c4384 --- /dev/null +++ b/queue-3.4/autofs-remove-autofs-dentry-mount-check.patch @@ -0,0 +1,48 @@ +From ce8a5dbdf9e709bdaf4618d7ef8cceb91e8adc69 Mon Sep 17 00:00:00 2001 +From: David Jeffery +Date: Mon, 6 May 2013 13:49:30 +0800 +Subject: autofs - remove autofs dentry mount check + +From: David Jeffery + +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 +Signed-off-by: Ian Kent +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + 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 */ diff --git a/queue-3.4/powerpc-emulate-non-privileged-dscr-read-and-write.patch b/queue-3.4/powerpc-emulate-non-privileged-dscr-read-and-write.patch new file mode 100644 index 00000000000..22f90e4d1c5 --- /dev/null +++ b/queue-3.4/powerpc-emulate-non-privileged-dscr-read-and-write.patch @@ -0,0 +1,71 @@ +From 73d2fb758e678c93bc76d40876c2359f0729b0ef Mon Sep 17 00:00:00 2001 +From: Anton Blanchard +Date: Wed, 1 May 2013 20:06:33 +0000 +Subject: powerpc: Emulate non privileged DSCR read and write + +From: Anton Blanchard + +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 +Signed-off-by: Benjamin Herrenschmidt +Signed-off-by: Greg Kroah-Hartman + +--- + 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; diff --git a/queue-3.4/powerpc-fix-numa-distance-for-form0-device-tree.patch b/queue-3.4/powerpc-fix-numa-distance-for-form0-device-tree.patch new file mode 100644 index 00000000000..ce39320a2ef --- /dev/null +++ b/queue-3.4/powerpc-fix-numa-distance-for-form0-device-tree.patch @@ -0,0 +1,51 @@ +From 7122beeee7bc1757682049780179d7c216dd1c83 Mon Sep 17 00:00:00 2001 +From: Vaidyanathan Srinivasan +Date: Fri, 22 Mar 2013 05:49:35 +0000 +Subject: powerpc: fix numa distance for form0 device tree + +From: Vaidyanathan Srinivasan + +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 +Signed-off-by: Michael Ellerman +Signed-off-by: Greg Kroah-Hartman + +--- + 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]) diff --git a/queue-3.4/series b/queue-3.4/series new file mode 100644 index 00000000000..c3eb822b119 --- /dev/null +++ b/queue-3.4/series @@ -0,0 +1,3 @@ +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