From: Greg Kroah-Hartman Date: Fri, 5 Dec 2014 22:41:34 +0000 (-0800) Subject: 3.14-stable patches X-Git-Tag: v3.10.62~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5eedf4475cc5a8259af68684c966744f14819657;p=thirdparty%2Fkernel%2Fstable-queue.git 3.14-stable patches added patches: batman-fix-a-bogus-warning-from-batadv_is_on_batman_iface.patch nfs-don-t-busy-wait-on-sigkill-in-__nfs_iocounter_wait.patch x86-kvm-use-alternatives-for-vmcall-vs.-vmmcall-if-kernel-text-is-read-only.patch --- diff --git a/queue-3.14/batman-fix-a-bogus-warning-from-batadv_is_on_batman_iface.patch b/queue-3.14/batman-fix-a-bogus-warning-from-batadv_is_on_batman_iface.patch new file mode 100644 index 00000000000..e97338ec496 --- /dev/null +++ b/queue-3.14/batman-fix-a-bogus-warning-from-batadv_is_on_batman_iface.patch @@ -0,0 +1,39 @@ +From b6ed5498601df40489606dbc14a9c7011c16630b Mon Sep 17 00:00:00 2001 +From: Cong Wang +Date: Thu, 22 May 2014 11:57:17 -0700 +Subject: batman: fix a bogus warning from batadv_is_on_batman_iface() + +From: Cong Wang + +commit b6ed5498601df40489606dbc14a9c7011c16630b upstream. + +batman tries to search dev->iflink to check if it's a batman interface, +but ->iflink could be 0, which is not a valid ifindex. It should just +avoid iflink == 0 case. + +Reported-by: Jet Chen +Tested-by: Jet Chen +Cc: David S. Miller +Cc: Steffen Klassert +Cc: Antonio Quartulli +Cc: Marek Lindner +Signed-off-by: Cong Wang +Signed-off-by: Cong Wang +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman + +--- + net/batman-adv/hard-interface.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/net/batman-adv/hard-interface.c ++++ b/net/batman-adv/hard-interface.c +@@ -83,7 +83,7 @@ static bool batadv_is_on_batman_iface(co + return true; + + /* no more parents..stop recursion */ +- if (net_dev->iflink == net_dev->ifindex) ++ if (net_dev->iflink == 0 || net_dev->iflink == net_dev->ifindex) + return false; + + /* recurse over the parent device */ diff --git a/queue-3.14/nfs-don-t-busy-wait-on-sigkill-in-__nfs_iocounter_wait.patch b/queue-3.14/nfs-don-t-busy-wait-on-sigkill-in-__nfs_iocounter_wait.patch new file mode 100644 index 00000000000..1a693d5402f --- /dev/null +++ b/queue-3.14/nfs-don-t-busy-wait-on-sigkill-in-__nfs_iocounter_wait.patch @@ -0,0 +1,39 @@ +From 92a56555bd576c61b27a5cab9f38a33a1e9a1df5 Mon Sep 17 00:00:00 2001 +From: David Jeffery +Date: Tue, 5 Aug 2014 11:19:42 -0400 +Subject: nfs: Don't busy-wait on SIGKILL in __nfs_iocounter_wait + +From: David Jeffery + +commit 92a56555bd576c61b27a5cab9f38a33a1e9a1df5 upstream. + +If a SIGKILL is sent to a task waiting in __nfs_iocounter_wait, +it will busy-wait or soft lockup in its while loop. +nfs_wait_bit_killable won't sleep, and the loop won't exit on +the error return. + +Stop the busy-wait by breaking out of the loop when +nfs_wait_bit_killable returns an error. + +Signed-off-by: David Jeffery +Signed-off-by: Trond Myklebust +[ kamal: backport to 3.13-stable: context ] +Cc: Moritz Mühlenhoff +Signed-off-by: Kamal Mostafa +Signed-off-by: Greg Kroah-Hartman + +--- + fs/nfs/pagelist.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/fs/nfs/pagelist.c ++++ b/fs/nfs/pagelist.c +@@ -113,7 +113,7 @@ __nfs_iocounter_wait(struct nfs_io_count + if (atomic_read(&c->io_count) == 0) + break; + ret = nfs_wait_bit_killable(&c->flags); +- } while (atomic_read(&c->io_count) != 0); ++ } while (atomic_read(&c->io_count) != 0 && !ret); + finish_wait(wq, &q.wait); + return ret; + } diff --git a/queue-3.14/series b/queue-3.14/series index 1528fa47fb9..ad2fb7144cc 100644 --- a/queue-3.14/series +++ b/queue-3.14/series @@ -68,3 +68,6 @@ gpu-radeon-set-flag-to-indicate-broken-64-bit-msi.patch bitops-fix-shift-overflow-in-genmask-macros.patch locks-eliminate-bug-call-when-there-s-an-unexpected-lock-on-file-close.patch powerpc-powernv-honor-the-generic-no_64bit_msi-flag.patch +batman-fix-a-bogus-warning-from-batadv_is_on_batman_iface.patch +x86-kvm-use-alternatives-for-vmcall-vs.-vmmcall-if-kernel-text-is-read-only.patch +nfs-don-t-busy-wait-on-sigkill-in-__nfs_iocounter_wait.patch diff --git a/queue-3.14/x86-kvm-use-alternatives-for-vmcall-vs.-vmmcall-if-kernel-text-is-read-only.patch b/queue-3.14/x86-kvm-use-alternatives-for-vmcall-vs.-vmmcall-if-kernel-text-is-read-only.patch new file mode 100644 index 00000000000..4b763422630 --- /dev/null +++ b/queue-3.14/x86-kvm-use-alternatives-for-vmcall-vs.-vmmcall-if-kernel-text-is-read-only.patch @@ -0,0 +1,89 @@ +From c1118b3602c2329671ad5ec8bdf8e374323d6343 Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Mon, 22 Sep 2014 13:17:48 +0200 +Subject: x86: kvm: use alternatives for VMCALL vs. VMMCALL if kernel text is read-only + +From: Paolo Bonzini + +commit c1118b3602c2329671ad5ec8bdf8e374323d6343 upstream. + +On x86_64, kernel text mappings are mapped read-only with CONFIG_DEBUG_RODATA. +In that case, KVM will fail to patch VMCALL instructions to VMMCALL +as required on AMD processors. + +The failure mode is currently a divide-by-zero exception, which obviously +is a KVM bug that has to be fixed. However, picking the right instruction +between VMCALL and VMMCALL will be faster and will help if you cannot upgrade +the hypervisor. + +Reported-by: Chris Webb +Tested-by: Chris Webb +Cc: Thomas Gleixner +Cc: Ingo Molnar +Cc: "H. Peter Anvin" +Cc: x86@kernel.org +Acked-by: Borislav Petkov +Signed-off-by: Paolo Bonzini +Signed-off-by: Chris J Arges +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/include/asm/cpufeature.h | 1 + + arch/x86/include/asm/kvm_para.h | 10 ++++++++-- + arch/x86/kernel/cpu/amd.c | 7 +++++++ + 3 files changed, 16 insertions(+), 2 deletions(-) + +--- a/arch/x86/include/asm/cpufeature.h ++++ b/arch/x86/include/asm/cpufeature.h +@@ -203,6 +203,7 @@ + #define X86_FEATURE_DECODEASSISTS (8*32+12) /* AMD Decode Assists support */ + #define X86_FEATURE_PAUSEFILTER (8*32+13) /* AMD filtered pause intercept */ + #define X86_FEATURE_PFTHRESHOLD (8*32+14) /* AMD pause filter threshold */ ++#define X86_FEATURE_VMMCALL (8*32+15) /* Prefer vmmcall to vmcall */ + + + /* Intel-defined CPU features, CPUID level 0x00000007:0 (ebx), word 9 */ +--- a/arch/x86/include/asm/kvm_para.h ++++ b/arch/x86/include/asm/kvm_para.h +@@ -2,6 +2,7 @@ + #define _ASM_X86_KVM_PARA_H + + #include ++#include + #include + + extern void kvmclock_init(void); +@@ -16,10 +17,15 @@ static inline bool kvm_check_and_clear_g + } + #endif /* CONFIG_KVM_GUEST */ + +-/* This instruction is vmcall. On non-VT architectures, it will generate a +- * trap that we will then rewrite to the appropriate instruction. ++#ifdef CONFIG_DEBUG_RODATA ++#define KVM_HYPERCALL \ ++ ALTERNATIVE(".byte 0x0f,0x01,0xc1", ".byte 0x0f,0x01,0xd9", X86_FEATURE_VMMCALL) ++#else ++/* On AMD processors, vmcall will generate a trap that we will ++ * then rewrite to the appropriate instruction. + */ + #define KVM_HYPERCALL ".byte 0x0f,0x01,0xc1" ++#endif + + /* For KVM hypercalls, a three-byte sequence of either the vmcall or the vmmcall + * instruction. The hypervisor may replace it with something else but only the +--- a/arch/x86/kernel/cpu/amd.c ++++ b/arch/x86/kernel/cpu/amd.c +@@ -508,6 +508,13 @@ static void early_init_amd(struct cpuinf + } + #endif + ++ /* ++ * This is only needed to tell the kernel whether to use VMCALL ++ * and VMMCALL. VMMCALL is never executed except under virt, so ++ * we can set it unconditionally. ++ */ ++ set_cpu_cap(c, X86_FEATURE_VMMCALL); ++ + /* F16h erratum 793, CVE-2013-6885 */ + if (c->x86 == 0x16 && c->x86_model <= 0xf) { + u64 val;