qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] amd_iommu: Fix APIC address check
@ 2023-09-09 16:23 Akihiko Odaki
  2023-09-21  6:55 ` Akihiko Odaki
  2023-09-21 10:10 ` Philippe Mathieu-Daudé
  0 siblings, 2 replies; 3+ messages in thread
From: Akihiko Odaki @ 2023-09-09 16:23 UTC (permalink / raw)
  Cc: qemu-devel, Marcel Apfelbaum, Michael S. Tsirkin, Eduardo Habkost,
	Richard Henderson, Paolo Bonzini, Akihiko Odaki

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.
Check only the 12 bits that are known to be fixed for I/O APIC-generated
MSIs.

Fixes: 577c470f43 ("x86_iommu/amd: Prepare for interrupt remap support")
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
 hw/i386/amd_iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c
index 4655cd801f..3ac0d0098d 100644
--- a/hw/i386/amd_iommu.c
+++ b/hw/i386/amd_iommu.c
@@ -1268,7 +1268,7 @@ static int amdvi_int_remap_msi(AMDVIState *iommu,
         return -AMDVI_IR_ERR;
     }
 
-    if ((origin->address & AMDVI_MSI_ADDR_LO_MASK) != APIC_DEFAULT_ADDRESS) {
+    if ((origin->address & 0xfff00000) != APIC_DEFAULT_ADDRESS) {
         trace_amdvi_err("MSI is not from IOAPIC.");
         return -AMDVI_IR_ERR;
     }
-- 
2.41.0



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-09-21 10:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-09 16:23 [PATCH] amd_iommu: Fix APIC address check Akihiko Odaki
2023-09-21  6:55 ` Akihiko Odaki
2023-09-21 10:10 ` Philippe Mathieu-Daudé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).