From 231b5c76fd9c93422d6980e7b207940732aaf183 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sat, 6 May 2023 15:51:52 +0900 Subject: [PATCH] 5.10-stable patches added patches: i2c-omap-fix-standard-mode-false-ack-readings.patch iommu-amd-fix-guest-virtual-apic-table-root-pointer-configuration-in-irte.patch --- ...fix-standard-mode-false-ack-readings.patch | 37 ++++++++++++++ ...e-root-pointer-configuration-in-irte.patch | 50 +++++++++++++++++++ queue-5.10/series | 2 + 3 files changed, 89 insertions(+) create mode 100644 queue-5.10/i2c-omap-fix-standard-mode-false-ack-readings.patch create mode 100644 queue-5.10/iommu-amd-fix-guest-virtual-apic-table-root-pointer-configuration-in-irte.patch diff --git a/queue-5.10/i2c-omap-fix-standard-mode-false-ack-readings.patch b/queue-5.10/i2c-omap-fix-standard-mode-false-ack-readings.patch new file mode 100644 index 00000000000..fb8ac377411 --- /dev/null +++ b/queue-5.10/i2c-omap-fix-standard-mode-false-ack-readings.patch @@ -0,0 +1,37 @@ +From c770657bd2611b077ec1e7b1fe6aa92f249399bd Mon Sep 17 00:00:00 2001 +From: Reid Tonking +Date: Wed, 26 Apr 2023 14:49:56 -0500 +Subject: i2c: omap: Fix standard mode false ACK readings + +From: Reid Tonking + +commit c770657bd2611b077ec1e7b1fe6aa92f249399bd upstream. + +Using standard mode, rare false ACK responses were appearing with +i2cdetect tool. This was happening due to NACK interrupt triggering +ISR thread before register access interrupt was ready. Removing the +NACK interrupt's ability to trigger ISR thread lets register access +ready interrupt do this instead. + +Cc: # v3.7+ +Fixes: 3b2f8f82dad7 ("i2c: omap: switch to threaded IRQ support") +Signed-off-by: Reid Tonking +Acked-by: Vignesh Raghavendra +Reviewed-by: Tony Lindgren +Signed-off-by: Wolfram Sang +Signed-off-by: Greg Kroah-Hartman +--- + drivers/i2c/busses/i2c-omap.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/i2c/busses/i2c-omap.c ++++ b/drivers/i2c/busses/i2c-omap.c +@@ -1058,7 +1058,7 @@ omap_i2c_isr(int irq, void *dev_id) + u16 stat; + + stat = omap_i2c_read_reg(omap, OMAP_I2C_STAT_REG); +- mask = omap_i2c_read_reg(omap, OMAP_I2C_IE_REG); ++ mask = omap_i2c_read_reg(omap, OMAP_I2C_IE_REG) & ~OMAP_I2C_STAT_NACK; + + if (stat & mask) + ret = IRQ_WAKE_THREAD; diff --git a/queue-5.10/iommu-amd-fix-guest-virtual-apic-table-root-pointer-configuration-in-irte.patch b/queue-5.10/iommu-amd-fix-guest-virtual-apic-table-root-pointer-configuration-in-irte.patch new file mode 100644 index 00000000000..dd30aa824fd --- /dev/null +++ b/queue-5.10/iommu-amd-fix-guest-virtual-apic-table-root-pointer-configuration-in-irte.patch @@ -0,0 +1,50 @@ +From ccc62b827775915a9b82db42a29813d04f92df7a Mon Sep 17 00:00:00 2001 +From: Kishon Vijay Abraham I +Date: Wed, 5 Apr 2023 13:03:17 +0000 +Subject: iommu/amd: Fix "Guest Virtual APIC Table Root Pointer" configuration in IRTE + +From: Kishon Vijay Abraham I + +commit ccc62b827775915a9b82db42a29813d04f92df7a upstream. + +commit b9c6ff94e43a ("iommu/amd: Re-factor guest virtual APIC +(de-)activation code") while refactoring guest virtual APIC +activation/de-activation code, stored information for activate/de-activate +in "struct amd_ir_data". It used 32-bit integer data type for storing the +"Guest Virtual APIC Table Root Pointer" (ga_root_ptr), though the +"ga_root_ptr" is actually a 40-bit field in IRTE (Interrupt Remapping +Table Entry). + +This causes interrupts from PCIe devices to not reach the guest in the case +of PCIe passthrough with SME (Secure Memory Encryption) enabled as _SME_ +bit in the "ga_root_ptr" is lost before writing it to the IRTE. + +Fix it by using 64-bit data type for storing the "ga_root_ptr". While at +that also change the data type of "ga_tag" to u32 in order to match +the IOMMU spec. + +Fixes: b9c6ff94e43a ("iommu/amd: Re-factor guest virtual APIC (de-)activation code") +Cc: stable@vger.kernel.org # v5.4+ +Reported-by: Alejandro Jimenez +Reviewed-by: Suravee Suthikulpanit +Signed-off-by: Kishon Vijay Abraham I +Link: https://lore.kernel.org/r/20230405130317.9351-1-kvijayab@amd.com +Signed-off-by: Joerg Roedel +Signed-off-by: Greg Kroah-Hartman +--- + drivers/iommu/amd/amd_iommu_types.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/iommu/amd/amd_iommu_types.h ++++ b/drivers/iommu/amd/amd_iommu_types.h +@@ -897,8 +897,8 @@ struct amd_ir_data { + */ + struct irq_cfg *cfg; + int ga_vector; +- int ga_root_ptr; +- int ga_tag; ++ u64 ga_root_ptr; ++ u32 ga_tag; + }; + + struct amd_irte_ops { diff --git a/queue-5.10/series b/queue-5.10/series index 9e133c1a129..99cb9aca077 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -42,3 +42,5 @@ reiserfs-add-security-prefix-to-xattr-name-in-reiserfs_security_write.patch kvm-nvmx-emulate-nops-in-l2-and-pause-if-it-s-not-intercepted.patch relayfs-fix-out-of-bounds-access-in-relay_file_read.patch writeback-cgroup-fix-null-ptr-deref-write-in-bdi_spl.patch +i2c-omap-fix-standard-mode-false-ack-readings.patch +iommu-amd-fix-guest-virtual-apic-table-root-pointer-configuration-in-irte.patch -- 2.47.3