67 lines
2.3 KiB
Diff
67 lines
2.3 KiB
Diff
From 0397ebacdba6539147d9986255c3f81cbfdabf1e Mon Sep 17 00:00:00 2001
|
|
From: John Allen <john.allen@amd.com>
|
|
Date: Wed, 11 Dec 2024 15:07:03 -0600
|
|
Subject: [PATCH 07/57] amd_iommu: Check APIC ID > 255 for XTSup
|
|
|
|
RH-Author: John Allen <None>
|
|
RH-MergeRequest: 303: Interrupt Remap support for emulated amd viommu
|
|
RH-Jira: RHEL-66202
|
|
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
RH-Commit: [5/5] f39b3e3cdefc2b562f1ad2ef939a37bf404f355a (johnalle/qemu-kvm-fork)
|
|
|
|
JIRA: https://issues.redhat.com/browse/RHEL-66202
|
|
|
|
commit b12cb3819baf6d9ee8140d4dd6d36fa829e2c6d9
|
|
Author: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
|
|
Date: Fri Sep 27 12:29:13 2024 -0500
|
|
|
|
amd_iommu: Check APIC ID > 255 for XTSup
|
|
|
|
The XTSup mode enables x2APIC support for AMD IOMMU, which is needed
|
|
to support vcpu w/ APIC ID > 255.
|
|
|
|
Reviewed-by: Alejandro Jimenez <alejandro.j.jimenez@oracle.com>
|
|
Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
|
|
Signed-off-by: Santosh Shukla <santosh.shukla@amd.com>
|
|
Message-Id: <20240927172913.121477-6-santosh.shukla@amd.com>
|
|
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
|
|
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
|
|
|
|
Signed-off-by: John Allen <john.allen@amd.com>
|
|
---
|
|
hw/i386/amd_iommu.c | 11 +++++++++++
|
|
1 file changed, 11 insertions(+)
|
|
|
|
diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c
|
|
index 82d76dfca9..d804656ea8 100644
|
|
--- a/hw/i386/amd_iommu.c
|
|
+++ b/hw/i386/amd_iommu.c
|
|
@@ -32,6 +32,7 @@
|
|
#include "trace.h"
|
|
#include "hw/i386/apic-msidef.h"
|
|
#include "hw/qdev-properties.h"
|
|
+#include "kvm/kvm_i386.h"
|
|
|
|
/* used AMD-Vi MMIO registers */
|
|
const char *amdvi_mmio_low[] = {
|
|
@@ -1651,6 +1652,16 @@ static void amdvi_sysbus_realize(DeviceState *dev, Error **errp)
|
|
memory_region_add_subregion_overlap(&s->mr_sys, AMDVI_INT_ADDR_FIRST,
|
|
&s->mr_ir, 1);
|
|
|
|
+ /* AMD IOMMU with x2APIC mode requires xtsup=on */
|
|
+ if (x86ms->apic_id_limit > 255 && !s->xtsup) {
|
|
+ error_report("AMD IOMMU with x2APIC confguration requires xtsup=on");
|
|
+ exit(EXIT_FAILURE);
|
|
+ }
|
|
+ if (s->xtsup && kvm_irqchip_is_split() && !kvm_enable_x2apic()) {
|
|
+ error_report("AMD IOMMU xtsup=on requires support on the KVM side");
|
|
+ exit(EXIT_FAILURE);
|
|
+ }
|
|
+
|
|
pci_setup_iommu(bus, &amdvi_iommu_ops, s);
|
|
amdvi_init(s);
|
|
}
|
|
--
|
|
2.39.3
|
|
|