[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Stable-7.2.7 30/62] amd_iommu: Fix APIC address check
From: |
Michael Tokarev |
Subject: |
[Stable-7.2.7 30/62] amd_iommu: Fix APIC address check |
Date: |
Thu, 9 Nov 2023 16:58:58 +0300 |
From: Akihiko Odaki <akihiko.odaki@daynix.com>
An MSI from I/O APIC may not exactly equal to APIC_DEFAULT_ADDRESS. In
fact, Windows 17763.3650 configures I/O APIC to set the dest_mode bit.
Cover the range assigned to APIC.
Fixes: 577c470f43 ("x86_iommu/amd: Prepare for interrupt remap support")
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Message-Id: <20230921114612.40671-1-akihiko.odaki@daynix.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit 0114c4513095598cdf1cd8d7dacdfff757628121)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c
index 725f69095b..a20f3e1d50 100644
--- a/hw/i386/amd_iommu.c
+++ b/hw/i386/amd_iommu.c
@@ -1246,13 +1246,8 @@ static int amdvi_int_remap_msi(AMDVIState *iommu,
return -AMDVI_IR_ERR;
}
- if (origin->address & AMDVI_MSI_ADDR_HI_MASK) {
- trace_amdvi_err("MSI address high 32 bits non-zero when "
- "Interrupt Remapping enabled.");
- return -AMDVI_IR_ERR;
- }
-
- if ((origin->address & AMDVI_MSI_ADDR_LO_MASK) != APIC_DEFAULT_ADDRESS) {
+ if (origin->address < AMDVI_INT_ADDR_FIRST ||
+ origin->address + sizeof(origin->data) > AMDVI_INT_ADDR_LAST + 1) {
trace_amdvi_err("MSI is not from IOAPIC.");
return -AMDVI_IR_ERR;
}
diff --git a/hw/i386/amd_iommu.h b/hw/i386/amd_iommu.h
index 79d38a3e41..210a37dfb1 100644
--- a/hw/i386/amd_iommu.h
+++ b/hw/i386/amd_iommu.h
@@ -210,8 +210,6 @@
#define AMDVI_INT_ADDR_FIRST 0xfee00000
#define AMDVI_INT_ADDR_LAST 0xfeefffff
#define AMDVI_INT_ADDR_SIZE (AMDVI_INT_ADDR_LAST - AMDVI_INT_ADDR_FIRST +
1)
-#define AMDVI_MSI_ADDR_HI_MASK (0xffffffff00000000ULL)
-#define AMDVI_MSI_ADDR_LO_MASK (0x00000000ffffffffULL)
/* SB IOAPIC is always on this device in AMD systems */
#define AMDVI_IOAPIC_SB_DEVID PCI_BUILD_BDF(0, PCI_DEVFN(0x14, 0))
--
2.39.2
- [Stable-7.2.7 19/62] scsi-disk: ensure that FORMAT UNIT commands are terminated, (continued)
- [Stable-7.2.7 19/62] scsi-disk: ensure that FORMAT UNIT commands are terminated, Michael Tokarev, 2023/11/09
- [Stable-7.2.7 18/62] esp: restrict non-DMA transfer length to that of available data, Michael Tokarev, 2023/11/09
- [Stable-7.2.7 20/62] target/i386: fix operand size of unary SSE operations, Michael Tokarev, 2023/11/09
- [Stable-7.2.7 24/62] target/i386: Fix exception classes for MOVNTPS/MOVNTPD., Michael Tokarev, 2023/11/09
- [Stable-7.2.7 23/62] target/i386: Fix exception classes for SSE/AVX instructions., Michael Tokarev, 2023/11/09
- [Stable-7.2.7 26/62] target/i386: fix memory operand size for CVTPS2PD, Michael Tokarev, 2023/11/09
- [Stable-7.2.7 17/62] esp: use correct type for esp_dma_enable() in sysbus_esp_gpio_demux(), Michael Tokarev, 2023/11/09
- [Stable-7.2.7 27/62] hw/display/ramfb: plug slight guest-triggerable leak on mode setting, Michael Tokarev, 2023/11/09
- [Stable-7.2.7 25/62] target/i386: generalize operand size "ph" for use in CVTPS2PD, Michael Tokarev, 2023/11/09
- [Stable-7.2.7 28/62] chardev/char-pty: Avoid losing bytes when the other side just (re-)connected, Michael Tokarev, 2023/11/09
- [Stable-7.2.7 30/62] amd_iommu: Fix APIC address check,
Michael Tokarev <=
- [Stable-7.2.7 29/62] linux-user/hppa: Fix struct target_sigcontext layout, Michael Tokarev, 2023/11/09
- [Stable-7.2.7 31/62] migration/qmp: Fix crash on setting tls-authz with null, Michael Tokarev, 2023/11/09
- [Stable-7.2.7 32/62] hw/audio/es1370: reset current sample counter, Michael Tokarev, 2023/11/09
- [Stable-7.2.7 33/62] disas/riscv: Fix the typo of inverted order of pmpaddr13 and pmpaddr14, Michael Tokarev, 2023/11/09
- [Stable-7.2.7 34/62] hw/pvrdma: Protect against buggy or malicious guest driver, Michael Tokarev, 2023/11/09
- [Stable-7.2.7 36/62] linux-user/mips: fix abort on integer overflow, Michael Tokarev, 2023/11/09
- [Stable-7.2.7 38/62] lasips2: LASI PS/2 devices are not user-createable, Michael Tokarev, 2023/11/09
- [Stable-7.2.7 37/62] linux-user/sh4: Fix crashes on signal delivery, Michael Tokarev, 2023/11/09
- [Stable-7.2.7 42/62] tests/tcg: Add -fno-stack-protector, Michael Tokarev, 2023/11/09
- [Stable-7.2.7 43/62] qemu-img: rebase: stop when reaching EOF of old backing file, Michael Tokarev, 2023/11/09