]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Oct 2015 22:16:42 +0000 (15:16 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Oct 2015 22:16:42 +0000 (15:16 -0700)
added patches:
use-warn_on_once-for-missing-x86_feature_nrips.patch
x86-mm-set-nx-on-gap-between-__ex_table-and-rodata.patch
x86-xen-support-kexec-kdump-in-hvm-guests-by-doing-a-soft-reset.patch

queue-3.10/series
queue-3.10/use-warn_on_once-for-missing-x86_feature_nrips.patch [new file with mode: 0644]
queue-3.10/x86-mm-set-nx-on-gap-between-__ex_table-and-rodata.patch [new file with mode: 0644]
queue-3.10/x86-xen-support-kexec-kdump-in-hvm-guests-by-doing-a-soft-reset.patch [new file with mode: 0644]

index 27e35f4a09500e7d828713b7bce83553683be03b..216183c06fffff947c71add65e9fbb9d376e1e2f 100644 (file)
@@ -4,3 +4,6 @@ arm-8429-1-disable-gcc-sra-optimization.patch
 windfarm-decrement-client-count-when-unregistering.patch
 x86-apic-serialize-lvtt-and-tsc_deadline-writes.patch
 x86-platform-fix-geode-lx-timekeeping-in-the-generic-x86-build.patch
+use-warn_on_once-for-missing-x86_feature_nrips.patch
+x86-mm-set-nx-on-gap-between-__ex_table-and-rodata.patch
+x86-xen-support-kexec-kdump-in-hvm-guests-by-doing-a-soft-reset.patch
diff --git a/queue-3.10/use-warn_on_once-for-missing-x86_feature_nrips.patch b/queue-3.10/use-warn_on_once-for-missing-x86_feature_nrips.patch
new file mode 100644 (file)
index 0000000..279a60f
--- /dev/null
@@ -0,0 +1,37 @@
+From d2922422c48df93f3edff7d872ee4f3191fefb08 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Dirk=20M=C3=BCller?= <dmueller@suse.com>
+Date: Thu, 1 Oct 2015 13:43:42 +0200
+Subject: Use WARN_ON_ONCE for missing X86_FEATURE_NRIPS
+
+From: =?UTF-8?q?Dirk=20M=C3=BCller?= <dmueller@suse.com>
+
+commit d2922422c48df93f3edff7d872ee4f3191fefb08 upstream.
+
+The cpu feature flags are not ever going to change, so warning
+everytime can cause a lot of kernel log spam
+(in our case more than 10GB/hour).
+
+The warning seems to only occur when nested virtualization is
+enabled, so it's probably triggered by a KVM bug.  This is a
+sensible and safe change anyway, and the KVM bug fix might not
+be suitable for stable releases anyway.
+
+Signed-off-by: Dirk Mueller <dmueller@suse.com>
+Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/x86/kvm/svm.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/x86/kvm/svm.c
++++ b/arch/x86/kvm/svm.c
+@@ -496,7 +496,7 @@ static void skip_emulated_instruction(st
+       struct vcpu_svm *svm = to_svm(vcpu);
+       if (svm->vmcb->control.next_rip != 0) {
+-              WARN_ON(!static_cpu_has(X86_FEATURE_NRIPS));
++              WARN_ON_ONCE(!static_cpu_has(X86_FEATURE_NRIPS));
+               svm->next_rip = svm->vmcb->control.next_rip;
+       }
diff --git a/queue-3.10/x86-mm-set-nx-on-gap-between-__ex_table-and-rodata.patch b/queue-3.10/x86-mm-set-nx-on-gap-between-__ex_table-and-rodata.patch
new file mode 100644 (file)
index 0000000..5503ee8
--- /dev/null
@@ -0,0 +1,64 @@
+From ab76f7b4ab2397ffdd2f1eb07c55697d19991d10 Mon Sep 17 00:00:00 2001
+From: Stephen Smalley <sds@tycho.nsa.gov>
+Date: Thu, 1 Oct 2015 09:04:22 -0400
+Subject: x86/mm: Set NX on gap between __ex_table and rodata
+
+From: Stephen Smalley <sds@tycho.nsa.gov>
+
+commit ab76f7b4ab2397ffdd2f1eb07c55697d19991d10 upstream.
+
+Unused space between the end of __ex_table and the start of
+rodata can be left W+x in the kernel page tables.  Extend the
+setting of the NX bit to cover this gap by starting from
+text_end rather than rodata_start.
+
+  Before:
+  ---[ High Kernel Mapping ]---
+  0xffffffff80000000-0xffffffff81000000          16M                               pmd
+  0xffffffff81000000-0xffffffff81600000           6M     ro         PSE     GLB x  pmd
+  0xffffffff81600000-0xffffffff81754000        1360K     ro                 GLB x  pte
+  0xffffffff81754000-0xffffffff81800000         688K     RW                 GLB x  pte
+  0xffffffff81800000-0xffffffff81a00000           2M     ro         PSE     GLB NX pmd
+  0xffffffff81a00000-0xffffffff81b3b000        1260K     ro                 GLB NX pte
+  0xffffffff81b3b000-0xffffffff82000000        4884K     RW                 GLB NX pte
+  0xffffffff82000000-0xffffffff82200000           2M     RW         PSE     GLB NX pmd
+  0xffffffff82200000-0xffffffffa0000000         478M                               pmd
+
+  After:
+  ---[ High Kernel Mapping ]---
+  0xffffffff80000000-0xffffffff81000000          16M                               pmd
+  0xffffffff81000000-0xffffffff81600000           6M     ro         PSE     GLB x  pmd
+  0xffffffff81600000-0xffffffff81754000        1360K     ro                 GLB x  pte
+  0xffffffff81754000-0xffffffff81800000         688K     RW                 GLB NX pte
+  0xffffffff81800000-0xffffffff81a00000           2M     ro         PSE     GLB NX pmd
+  0xffffffff81a00000-0xffffffff81b3b000        1260K     ro                 GLB NX pte
+  0xffffffff81b3b000-0xffffffff82000000        4884K     RW                 GLB NX pte
+  0xffffffff82000000-0xffffffff82200000           2M     RW         PSE     GLB NX pmd
+  0xffffffff82200000-0xffffffffa0000000         478M                               pmd
+
+Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
+Acked-by: Kees Cook <keescook@chromium.org>
+Cc: Linus Torvalds <torvalds@linux-foundation.org>
+Cc: Mike Galbraith <efault@gmx.de>
+Cc: Peter Zijlstra <peterz@infradead.org>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Cc: linux-kernel@vger.kernel.org
+Link: http://lkml.kernel.org/r/1443704662-3138-1-git-send-email-sds@tycho.nsa.gov
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/x86/mm/init_64.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/x86/mm/init_64.c
++++ b/arch/x86/mm/init_64.c
+@@ -1163,7 +1163,7 @@ void mark_rodata_ro(void)
+        * has been zapped already via cleanup_highmem().
+        */
+       all_end = roundup((unsigned long)_brk_end, PMD_SIZE);
+-      set_memory_nx(rodata_start, (all_end - rodata_start) >> PAGE_SHIFT);
++      set_memory_nx(text_end, (all_end - text_end) >> PAGE_SHIFT);
+       rodata_test();
diff --git a/queue-3.10/x86-xen-support-kexec-kdump-in-hvm-guests-by-doing-a-soft-reset.patch b/queue-3.10/x86-xen-support-kexec-kdump-in-hvm-guests-by-doing-a-soft-reset.patch
new file mode 100644 (file)
index 0000000..a907105
--- /dev/null
@@ -0,0 +1,105 @@
+From 0b34a166f291d255755be46e43ed5497cdd194f2 Mon Sep 17 00:00:00 2001
+From: Vitaly Kuznetsov <vkuznets@redhat.com>
+Date: Fri, 25 Sep 2015 11:59:52 +0200
+Subject: x86/xen: Support kexec/kdump in HVM guests by doing a soft reset
+
+From: Vitaly Kuznetsov <vkuznets@redhat.com>
+
+commit 0b34a166f291d255755be46e43ed5497cdd194f2 upstream.
+
+Currently there is a number of issues preventing PVHVM Xen guests from
+doing successful kexec/kdump:
+
+  - Bound event channels.
+  - Registered vcpu_info.
+  - PIRQ/emuirq mappings.
+  - shared_info frame after XENMAPSPACE_shared_info operation.
+  - Active grant mappings.
+
+Basically, newly booted kernel stumbles upon already set up Xen
+interfaces and there is no way to reestablish them. In Xen-4.7 a new
+feature called 'soft reset' is coming. A guest performing kexec/kdump
+operation is supposed to call SCHEDOP_shutdown hypercall with
+SHUTDOWN_soft_reset reason before jumping to new kernel. Hypervisor
+(with some help from toolstack) will do full domain cleanup (but
+keeping its memory and vCPU contexts intact) returning the guest to
+the state it had when it was first booted and thus allowing it to
+start over.
+
+Doing SHUTDOWN_soft_reset on Xen hypervisors which don't support it is
+probably OK as by default all unknown shutdown reasons cause domain
+destroy with a message in toolstack log: 'Unknown shutdown reason code
+5. Destroying domain.'  which gives a clue to what the problem is and
+eliminates false expectations.
+
+Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
+Signed-off-by: David Vrabel <david.vrabel@citrix.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/x86/xen/enlighten.c      |   23 +++++++++++++++++++++++
+ include/xen/interface/sched.h |    8 ++++++++
+ 2 files changed, 31 insertions(+)
+
+--- a/arch/x86/xen/enlighten.c
++++ b/arch/x86/xen/enlighten.c
+@@ -33,6 +33,10 @@
+ #include <linux/memblock.h>
+ #include <linux/edd.h>
++#ifdef CONFIG_KEXEC_CORE
++#include <linux/kexec.h>
++#endif
++
+ #include <xen/xen.h>
+ #include <xen/events.h>
+ #include <xen/interface/xen.h>
+@@ -1744,6 +1748,21 @@ static struct notifier_block xen_hvm_cpu
+       .notifier_call  = xen_hvm_cpu_notify,
+ };
++#ifdef CONFIG_KEXEC_CORE
++static void xen_hvm_shutdown(void)
++{
++      native_machine_shutdown();
++      if (kexec_in_progress)
++              xen_reboot(SHUTDOWN_soft_reset);
++}
++
++static void xen_hvm_crash_shutdown(struct pt_regs *regs)
++{
++      native_machine_crash_shutdown(regs);
++      xen_reboot(SHUTDOWN_soft_reset);
++}
++#endif
++
+ static void __init xen_hvm_guest_init(void)
+ {
+       init_hvm_pv_info();
+@@ -1758,6 +1777,10 @@ static void __init xen_hvm_guest_init(vo
+       x86_init.irqs.intr_init = xen_init_IRQ;
+       xen_hvm_init_time_ops();
+       xen_hvm_init_mmu_ops();
++#ifdef CONFIG_KEXEC_CORE
++      machine_ops.shutdown = xen_hvm_shutdown;
++      machine_ops.crash_shutdown = xen_hvm_crash_shutdown;
++#endif
+ }
+ static bool __init xen_hvm_platform(void)
+--- a/include/xen/interface/sched.h
++++ b/include/xen/interface/sched.h
+@@ -107,5 +107,13 @@ struct sched_watchdog {
+ #define SHUTDOWN_suspend    2  /* Clean up, save suspend info, kill.         */
+ #define SHUTDOWN_crash      3  /* Tell controller we've crashed.             */
+ #define SHUTDOWN_watchdog   4  /* Restart because watchdog time expired.     */
++/*
++ * Domain asked to perform 'soft reset' for it. The expected behavior is to
++ * reset internal Xen state for the domain returning it to the point where it
++ * was created but leaving the domain's memory contents and vCPU contexts
++ * intact. This will allow the domain to start over and set up all Xen specific
++ * interfaces again.
++ */
++#define SHUTDOWN_soft_reset 5
+ #endif /* __XEN_PUBLIC_SCHED_H__ */