]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 27 Feb 2024 09:17:20 +0000 (10:17 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 27 Feb 2024 09:17:20 +0000 (10:17 +0100)
added patches:
kvm-arm64-vgic-its-test-for-valid-irq-in-its_sync_lpi_pending_table.patch
kvm-arm64-vgic-its-test-for-valid-irq-in-movall-handler.patch
pci-msi-prevent-msi-hardware-interrupt-number-truncation.patch

queue-4.19/kvm-arm64-vgic-its-test-for-valid-irq-in-its_sync_lpi_pending_table.patch [new file with mode: 0644]
queue-4.19/kvm-arm64-vgic-its-test-for-valid-irq-in-movall-handler.patch [new file with mode: 0644]
queue-4.19/pci-msi-prevent-msi-hardware-interrupt-number-truncation.patch [new file with mode: 0644]
queue-4.19/s390-use-the-correct-count-for-__iowrite64_copy.patch
queue-4.19/series

diff --git a/queue-4.19/kvm-arm64-vgic-its-test-for-valid-irq-in-its_sync_lpi_pending_table.patch b/queue-4.19/kvm-arm64-vgic-its-test-for-valid-irq-in-its_sync_lpi_pending_table.patch
new file mode 100644 (file)
index 0000000..6283120
--- /dev/null
@@ -0,0 +1,36 @@
+From 8d3a7dfb801d157ac423261d7cd62c33e95375f8 Mon Sep 17 00:00:00 2001
+From: Oliver Upton <oliver.upton@linux.dev>
+Date: Wed, 21 Feb 2024 09:27:31 +0000
+Subject: KVM: arm64: vgic-its: Test for valid IRQ in its_sync_lpi_pending_table()
+
+From: Oliver Upton <oliver.upton@linux.dev>
+
+commit 8d3a7dfb801d157ac423261d7cd62c33e95375f8 upstream.
+
+vgic_get_irq() may not return a valid descriptor if there is no ITS that
+holds a valid translation for the specified INTID. If that is the case,
+it is safe to silently ignore it and continue processing the LPI pending
+table.
+
+Cc: stable@vger.kernel.org
+Fixes: 33d3bc9556a7 ("KVM: arm64: vgic-its: Read initial LPI pending table")
+Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
+Link: https://lore.kernel.org/r/20240221092732.4126848-2-oliver.upton@linux.dev
+Signed-off-by: Marc Zyngier <maz@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ virt/kvm/arm/vgic/vgic-its.c |    3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/virt/kvm/arm/vgic/vgic-its.c
++++ b/virt/kvm/arm/vgic/vgic-its.c
+@@ -469,6 +469,9 @@ static int its_sync_lpi_pending_table(st
+               }
+               irq = vgic_get_irq(vcpu->kvm, NULL, intids[i]);
++              if (!irq)
++                      continue;
++
+               spin_lock_irqsave(&irq->irq_lock, flags);
+               irq->pending_latch = pendmask & (1U << bit_nr);
+               vgic_queue_irq_unlock(vcpu->kvm, irq, flags);
diff --git a/queue-4.19/kvm-arm64-vgic-its-test-for-valid-irq-in-movall-handler.patch b/queue-4.19/kvm-arm64-vgic-its-test-for-valid-irq-in-movall-handler.patch
new file mode 100644 (file)
index 0000000..83a2220
--- /dev/null
@@ -0,0 +1,35 @@
+From 85a71ee9a0700f6c18862ef3b0011ed9dad99aca Mon Sep 17 00:00:00 2001
+From: Oliver Upton <oliver.upton@linux.dev>
+Date: Wed, 21 Feb 2024 09:27:32 +0000
+Subject: KVM: arm64: vgic-its: Test for valid IRQ in MOVALL handler
+
+From: Oliver Upton <oliver.upton@linux.dev>
+
+commit 85a71ee9a0700f6c18862ef3b0011ed9dad99aca upstream.
+
+It is possible that an LPI mapped in a different ITS gets unmapped while
+handling the MOVALL command. If that is the case, there is no state that
+can be migrated to the destination. Silently ignore it and continue
+migrating other LPIs.
+
+Cc: stable@vger.kernel.org
+Fixes: ff9c114394aa ("KVM: arm/arm64: GICv4: Handle MOVALL applied to a vPE")
+Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
+Link: https://lore.kernel.org/r/20240221092732.4126848-3-oliver.upton@linux.dev
+Signed-off-by: Marc Zyngier <maz@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ virt/kvm/arm/vgic/vgic-its.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/virt/kvm/arm/vgic/vgic-its.c
++++ b/virt/kvm/arm/vgic/vgic-its.c
+@@ -1232,6 +1232,8 @@ static int vgic_its_cmd_handle_movall(st
+       for (i = 0; i < irq_count; i++) {
+               irq = vgic_get_irq(kvm, NULL, intids[i]);
++              if (!irq)
++                      continue;
+               update_affinity(irq, vcpu2);
diff --git a/queue-4.19/pci-msi-prevent-msi-hardware-interrupt-number-truncation.patch b/queue-4.19/pci-msi-prevent-msi-hardware-interrupt-number-truncation.patch
new file mode 100644 (file)
index 0000000..858406b
--- /dev/null
@@ -0,0 +1,47 @@
+From db744ddd59be798c2627efbfc71f707f5a935a40 Mon Sep 17 00:00:00 2001
+From: Vidya Sagar <vidyas@nvidia.com>
+Date: Mon, 15 Jan 2024 19:26:49 +0530
+Subject: PCI/MSI: Prevent MSI hardware interrupt number truncation
+
+From: Vidya Sagar <vidyas@nvidia.com>
+
+commit db744ddd59be798c2627efbfc71f707f5a935a40 upstream.
+
+While calculating the hardware interrupt number for a MSI interrupt, the
+higher bits (i.e. from bit-5 onwards a.k.a domain_nr >= 32) of the PCI
+domain number gets truncated because of the shifted value casting to return
+type of pci_domain_nr() which is 'int'. This for example is resulting in
+same hardware interrupt number for devices 0019:00:00.0 and 0039:00:00.0.
+
+To address this cast the PCI domain number to 'irq_hw_number_t' before left
+shifting it to calculate the hardware interrupt number.
+
+Please note that this fixes the issue only on 64-bit systems and doesn't
+change the behavior for 32-bit systems i.e. the 32-bit systems continue to
+have the issue. Since the issue surfaces only if there are too many PCIe
+controllers in the system which usually is the case in modern server
+systems and they don't tend to run 32-bit kernels.
+
+Fixes: 3878eaefb89a ("PCI/MSI: Enhance core to support hierarchy irqdomain")
+Signed-off-by: Vidya Sagar <vidyas@nvidia.com>
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+Tested-by: Shanker Donthineni <sdonthineni@nvidia.com>
+Cc: stable@vger.kernel.org
+Link: https://lore.kernel.org/r/20240115135649.708536-1-vidyas@nvidia.com
+[ tglx: Backport to linux-4.19.y ]
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/pci/msi.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/pci/msi.c
++++ b/drivers/pci/msi.c
+@@ -1382,7 +1382,7 @@ irq_hw_number_t pci_msi_domain_calc_hwir
+ {
+       return (irq_hw_number_t)desc->msi_attrib.entry_nr |
+               PCI_DEVID(dev->bus->number, dev->devfn) << 11 |
+-              (pci_domain_nr(dev->bus) & 0xFFFFFFFF) << 27;
++              ((irq_hw_number_t)(pci_domain_nr(dev->bus) & 0xFFFFFFFF)) << 27;
+ }
+ static inline bool pci_msi_desc_is_multi_msi(struct msi_desc *desc)
index fd71b292971f4e24482293b6917daaa69b70629b..bb43fbc2fcc9d74fa3f29da8a2f45cca0b868ea6 100644 (file)
@@ -18,14 +18,12 @@ Link: https://lore.kernel.org/r/0-v1-9223d11a7662+1d7785-s390_iowrite64_jgg@nvid
 Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
 Signed-off-by: Sasha Levin <sashal@kernel.org>
 ---
- arch/s390/pci/pci.c | 2 +-
+ arch/s390/pci/pci.c |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
-diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c
-index 9f6f392a44619..66c7f13b0c990 100644
 --- a/arch/s390/pci/pci.c
 +++ b/arch/s390/pci/pci.c
-@@ -273,7 +273,7 @@ resource_size_t pcibios_align_resource(void *data, const struct resource *res,
+@@ -273,7 +273,7 @@ resource_size_t pcibios_align_resource(v
  /* combine single writes by using store-block insn */
  void __iowrite64_copy(void __iomem *to, const void *from, size_t count)
  {
@@ -34,6 +32,3 @@ index 9f6f392a44619..66c7f13b0c990 100644
  }
  
  /* Create a virtual mapping cookie for a PCI BAR */
--- 
-2.43.0
-
index b5166b436927ab8d6018add6c523dfe927caf514..c9c559aba85c993c904209c622dbc1c0e71785f2 100644 (file)
@@ -45,3 +45,6 @@ nouveau-fix-function-cast-warnings.patch
 ipv6-sr-fix-possible-use-after-free-and-null-ptr-der.patch
 packet-move-from-strlcpy-with-unused-retval-to-strsc.patch
 s390-use-the-correct-count-for-__iowrite64_copy.patch
+pci-msi-prevent-msi-hardware-interrupt-number-truncation.patch
+kvm-arm64-vgic-its-test-for-valid-irq-in-its_sync_lpi_pending_table.patch
+kvm-arm64-vgic-its-test-for-valid-irq-in-movall-handler.patch