]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.9-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 3 Aug 2020 10:10:01 +0000 (12:10 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 3 Aug 2020 10:10:01 +0000 (12:10 +0200)
added patches:
kvm-lapic-prevent-setting-the-tscdeadline-timer-if-the-lapic-is-hw-disabled.patch
x86-i8259-use-printk_deferred-to-prevent-deadlock.patch

queue-4.9/kvm-lapic-prevent-setting-the-tscdeadline-timer-if-the-lapic-is-hw-disabled.patch [new file with mode: 0644]
queue-4.9/series
queue-4.9/x86-i8259-use-printk_deferred-to-prevent-deadlock.patch [new file with mode: 0644]

diff --git a/queue-4.9/kvm-lapic-prevent-setting-the-tscdeadline-timer-if-the-lapic-is-hw-disabled.patch b/queue-4.9/kvm-lapic-prevent-setting-the-tscdeadline-timer-if-the-lapic-is-hw-disabled.patch
new file mode 100644 (file)
index 0000000..3b7e80c
--- /dev/null
@@ -0,0 +1,33 @@
+From d2286ba7d574ba3103a421a2f9ec17cb5b0d87a1 Mon Sep 17 00:00:00 2001
+From: Wanpeng Li <wanpengli@tencent.com>
+Date: Fri, 31 Jul 2020 11:12:19 +0800
+Subject: KVM: LAPIC: Prevent setting the tscdeadline timer if the lapic is hw disabled
+
+From: Wanpeng Li <wanpengli@tencent.com>
+
+commit d2286ba7d574ba3103a421a2f9ec17cb5b0d87a1 upstream.
+
+Prevent setting the tscdeadline timer if the lapic is hw disabled.
+
+Fixes: bce87cce88 (KVM: x86: consolidate different ways to test for in-kernel LAPIC)
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Wanpeng Li <wanpengli@tencent.com>
+Message-Id: <1596165141-28874-1-git-send-email-wanpengli@tencent.com>
+Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/x86/kvm/lapic.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/x86/kvm/lapic.c
++++ b/arch/x86/kvm/lapic.c
+@@ -1756,7 +1756,7 @@ void kvm_set_lapic_tscdeadline_msr(struc
+ {
+       struct kvm_lapic *apic = vcpu->arch.apic;
+-      if (!lapic_in_kernel(vcpu) || apic_lvtt_oneshot(apic) ||
++      if (!kvm_apic_present(vcpu) || apic_lvtt_oneshot(apic) ||
+                       apic_lvtt_period(apic))
+               return;
index e277b44bddec8fca5ae1558cffcec25d798b9805..0e79a7b58c82506d230e302c5ba87bbb2d43ea16 100644 (file)
@@ -45,3 +45,5 @@ parisc-add-support-for-cmpxchg-on-u8-pointers.patch
 net-ethernet-ravb-exit-if-re-initialization-fails-in.patch
 revert-i2c-cadence-fix-the-hold-bit-setting.patch
 xen-netfront-fix-potential-deadlock-in-xennet_remove.patch
+kvm-lapic-prevent-setting-the-tscdeadline-timer-if-the-lapic-is-hw-disabled.patch
+x86-i8259-use-printk_deferred-to-prevent-deadlock.patch
diff --git a/queue-4.9/x86-i8259-use-printk_deferred-to-prevent-deadlock.patch b/queue-4.9/x86-i8259-use-printk_deferred-to-prevent-deadlock.patch
new file mode 100644 (file)
index 0000000..e125f67
--- /dev/null
@@ -0,0 +1,51 @@
+From bdd65589593edd79b6a12ce86b3b7a7c6dae5208 Mon Sep 17 00:00:00 2001
+From: Thomas Gleixner <tglx@linutronix.de>
+Date: Wed, 29 Jul 2020 10:53:28 +0200
+Subject: x86/i8259: Use printk_deferred() to prevent deadlock
+
+From: Thomas Gleixner <tglx@linutronix.de>
+
+commit bdd65589593edd79b6a12ce86b3b7a7c6dae5208 upstream.
+
+0day reported a possible circular locking dependency:
+
+Chain exists of:
+  &irq_desc_lock_class --> console_owner --> &port_lock_key
+
+ Possible unsafe locking scenario:
+
+       CPU0                    CPU1
+       ----                    ----
+  lock(&port_lock_key);
+                               lock(console_owner);
+                               lock(&port_lock_key);
+  lock(&irq_desc_lock_class);
+
+The reason for this is a printk() in the i8259 interrupt chip driver
+which is invoked with the irq descriptor lock held, which reverses the
+lock operations vs. printk() from arbitrary contexts.
+
+Switch the printk() to printk_deferred() to avoid that.
+
+Reported-by: kernel test robot <lkp@intel.com>
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Cc: stable@vger.kernel.org
+Link: https://lore.kernel.org/r/87365abt2v.fsf@nanos.tec.linutronix.de
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/x86/kernel/i8259.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/x86/kernel/i8259.c
++++ b/arch/x86/kernel/i8259.c
+@@ -205,7 +205,7 @@ spurious_8259A_irq:
+                * lets ACK and report it. [once per IRQ]
+                */
+               if (!(spurious_irq_mask & irqmask)) {
+-                      printk(KERN_DEBUG
++                      printk_deferred(KERN_DEBUG
+                              "spurious 8259A interrupt: IRQ%d.\n", irq);
+                       spurious_irq_mask |= irqmask;
+               }