From: Greg Kroah-Hartman Date: Tue, 27 Feb 2024 09:17:20 +0000 (+0100) Subject: 4.19-stable patches X-Git-Tag: v4.19.308~28 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4f1b3fe23f7d0525d5dd2fcf5bac2e97477e725a;p=thirdparty%2Fkernel%2Fstable-queue.git 4.19-stable patches 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 --- 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 index 00000000000..6283120a9d5 --- /dev/null +++ b/queue-4.19/kvm-arm64-vgic-its-test-for-valid-irq-in-its_sync_lpi_pending_table.patch @@ -0,0 +1,36 @@ +From 8d3a7dfb801d157ac423261d7cd62c33e95375f8 Mon Sep 17 00:00:00 2001 +From: Oliver Upton +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 + +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 +Link: https://lore.kernel.org/r/20240221092732.4126848-2-oliver.upton@linux.dev +Signed-off-by: Marc Zyngier +Signed-off-by: Greg Kroah-Hartman +--- + 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 index 00000000000..83a22206426 --- /dev/null +++ b/queue-4.19/kvm-arm64-vgic-its-test-for-valid-irq-in-movall-handler.patch @@ -0,0 +1,35 @@ +From 85a71ee9a0700f6c18862ef3b0011ed9dad99aca Mon Sep 17 00:00:00 2001 +From: Oliver Upton +Date: Wed, 21 Feb 2024 09:27:32 +0000 +Subject: KVM: arm64: vgic-its: Test for valid IRQ in MOVALL handler + +From: Oliver Upton + +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 +Link: https://lore.kernel.org/r/20240221092732.4126848-3-oliver.upton@linux.dev +Signed-off-by: Marc Zyngier +Signed-off-by: Greg Kroah-Hartman +--- + 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 index 00000000000..858406b229e --- /dev/null +++ b/queue-4.19/pci-msi-prevent-msi-hardware-interrupt-number-truncation.patch @@ -0,0 +1,47 @@ +From db744ddd59be798c2627efbfc71f707f5a935a40 Mon Sep 17 00:00:00 2001 +From: Vidya Sagar +Date: Mon, 15 Jan 2024 19:26:49 +0530 +Subject: PCI/MSI: Prevent MSI hardware interrupt number truncation + +From: Vidya Sagar + +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 +Signed-off-by: Thomas Gleixner +Tested-by: Shanker Donthineni +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 +--- + 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) diff --git a/queue-4.19/s390-use-the-correct-count-for-__iowrite64_copy.patch b/queue-4.19/s390-use-the-correct-count-for-__iowrite64_copy.patch index fd71b292971..bb43fbc2fcc 100644 --- a/queue-4.19/s390-use-the-correct-count-for-__iowrite64_copy.patch +++ b/queue-4.19/s390-use-the-correct-count-for-__iowrite64_copy.patch @@ -18,14 +18,12 @@ Link: https://lore.kernel.org/r/0-v1-9223d11a7662+1d7785-s390_iowrite64_jgg@nvid Signed-off-by: Heiko Carstens Signed-off-by: Sasha Levin --- - 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 - diff --git a/queue-4.19/series b/queue-4.19/series index b5166b43692..c9c559aba85 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -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