- kvm-s390x-Fix-leak-in-machine_set_loadparm.patch [RHEL-98554] - kvm-hw-s390x-ccw-device-Fix-memory-leak-in-loadparm-sett.patch [RHEL-98554] - kvm-amd_iommu-Rename-variable-mmio-to-mr_mmio.patch [RHEL-66202] - kvm-amd_iommu-Add-support-for-pass-though-mode.patch [RHEL-66202] - kvm-amd_iommu-Use-shared-memory-region-for-Interrupt-Rem.patch [RHEL-66202] - kvm-amd_iommu-Send-notification-when-invalidate-interrup.patch [RHEL-66202] - kvm-amd_iommu-Check-APIC-ID-255-for-XTSup.patch [RHEL-66202] - kvm-io-Fix-partial-struct-copy-in-qio_dns_resolver_looku.patch [RHEL-67104] - kvm-util-qemu-sockets-Refactor-setting-client-sockopts-i.patch [RHEL-67104] - kvm-util-qemu-sockets-Refactor-success-and-failure-paths.patch [RHEL-67104] - kvm-util-qemu-sockets-Add-support-for-keep-alive-flag-to.patch [RHEL-67104] - kvm-util-qemu-sockets-Refactor-inet_parse-to-use-QemuOpt.patch [RHEL-67104] - kvm-util-qemu-sockets-Introduce-inet-socket-options-cont.patch [RHEL-67104] - kvm-tests-unit-test-util-sockets-fix-mem-leak-on-error-o.patch [RHEL-67104] - kvm-target-i386-Expose-bits-related-to-SRSO-vulnerabilit.patch [RHEL-52649] - kvm-target-i386-Add-PerfMonV2-feature-bit.patch [RHEL-52649] - kvm-target-i386-Update-EPYC-CPU-model-for-Cache-property.patch [RHEL-52649] - kvm-target-i386-Update-EPYC-Rome-CPU-model-for-Cache-pro.patch [RHEL-52649] - kvm-target-i386-Update-EPYC-Milan-CPU-model-for-Cache-pr.patch [RHEL-52649] - kvm-target-i386-Add-couple-of-feature-bits-in-CPUID_Fn80.patch [RHEL-52649] - kvm-target-i386-Update-EPYC-Genoa-for-Cache-property-per.patch [RHEL-52649] - kvm-target-i386-Add-support-for-EPYC-Turin-model.patch [RHEL-52649] - kvm-hw-i386-amd_iommu-Assign-pci-id-0x1419-for-the-AMD-I.patch [RHEL-70926] - kvm-hw-i386-amd_iommu-Isolate-AMDVI-PCI-from-amd-iommu-d.patch [RHEL-70925] - kvm-hw-i386-amd_iommu-Allow-migration-when-explicitly-cr.patch [RHEL-70925] - kvm-Enable-amd-iommu-device.patch [RHEL-70925] - kvm-include-qemu-compiler-add-QEMU_UNINITIALIZED-attribu.patch [RHEL-99888] - kvm-hw-virtio-virtio-avoid-cost-of-ftrivial-auto-var-ini.patch [RHEL-99888] - kvm-block-skip-automatic-zero-init-of-large-array-in-ioq.patch [RHEL-99888] - kvm-chardev-char-fd-skip-automatic-zero-init-of-large-ar.patch [RHEL-99888] - kvm-chardev-char-pty-skip-automatic-zero-init-of-large-a.patch [RHEL-99888] - kvm-chardev-char-socket-skip-automatic-zero-init-of-larg.patch [RHEL-99888] - kvm-hw-audio-ac97-skip-automatic-zero-init-of-large-arra.patch [RHEL-99888] - kvm-hw-audio-cs4231a-skip-automatic-zero-init-of-large-a.patch [RHEL-99888] - kvm-hw-audio-es1370-skip-automatic-zero-init-of-large-ar.patch [RHEL-99888] - kvm-hw-audio-gus-skip-automatic-zero-init-of-large-array.patch [RHEL-99888] - kvm-hw-audio-marvell_88w8618-skip-automatic-zero-init-of.patch [RHEL-99888] - kvm-hw-audio-sb16-skip-automatic-zero-init-of-large-arra.patch [RHEL-99888] - kvm-hw-audio-via-ac97-skip-automatic-zero-init-of-large-.patch [RHEL-99888] - kvm-hw-char-sclpconsole-lm-skip-automatic-zero-init-of-l.patch [RHEL-99888] - kvm-hw-dma-xlnx_csu_dma-skip-automatic-zero-init-of-larg.patch [RHEL-99888] - kvm-hw-display-vmware_vga-skip-automatic-zero-init-of-la.patch [RHEL-99888] - kvm-hw-hyperv-syndbg-skip-automatic-zero-init-of-large-a.patch [RHEL-99888] - kvm-hw-misc-aspeed_hace-skip-automatic-zero-init-of-larg.patch [RHEL-99888] - kvm-hw-net-rtl8139-skip-automatic-zero-init-of-large-arr.patch [RHEL-99888] - kvm-hw-net-tulip-skip-automatic-zero-init-of-large-array.patch [RHEL-99888] - kvm-hw-net-virtio-net-skip-automatic-zero-init-of-large-.patch [RHEL-99888] - kvm-hw-net-xgamc-skip-automatic-zero-init-of-large-array.patch [RHEL-99888] - kvm-hw-nvme-ctrl-skip-automatic-zero-init-of-large-array.patch [RHEL-99888] - kvm-hw-ppc-spapr_tpm_proxy-skip-automatic-zero-init-of-l.patch [RHEL-99888] - kvm-hw-usb-hcd-ohci-skip-automatic-zero-init-of-large-ar.patch [RHEL-99888] - kvm-hw-scsi-lsi53c895a-skip-automatic-zero-init-of-large.patch [RHEL-99888] - kvm-hw-scsi-megasas-skip-automatic-zero-init-of-large-ar.patch [RHEL-99888] - kvm-hw-ufs-lu-skip-automatic-zero-init-of-large-array.patch [RHEL-99888] - kvm-net-socket-skip-automatic-zero-init-of-large-array.patch [RHEL-99888] - kvm-net-stream-skip-automatic-zero-init-of-large-array.patch [RHEL-99888] - kvm-ui-vnc-Update-display-update-interval-when-VM-state-.patch [RHEL-100741] - Resolves: RHEL-98554 ([s390x][RHEL9.7.0][virtio_block] there would be memory leak with virtio_blk disks) - Resolves: RHEL-66202 ([AMDSERVER 9.6 Feature] qemu: Interrupt Remap support for emulated amd viommu) - Resolves: RHEL-67104 (postcopy on the destination host can't switch into pause status under the network issue if boot VM with '-S') - Resolves: RHEL-52649 ([AMDSERVER 9.6 Feature] Turin: Qemu EPYC-Turin Model) - Resolves: RHEL-70926 (Qemu/amd-iommu: Advertise a suitable device id) - Resolves: RHEL-70925 (Qemu/amd-iommu: Add ability to manually specify the AMDVI-PCI device) - Resolves: RHEL-99888 (-ftrivial-auto-var-init=zero reduced performance [rhel-9]) - Resolves: RHEL-100741 (Video stuck after switchover phase when play one video during migration [rhel-9])
106 lines
5.0 KiB
Diff
106 lines
5.0 KiB
Diff
From 4859d41adfaae8933e074dcefdc81edd3832c914 Mon Sep 17 00:00:00 2001
|
|
From: John Allen <john.allen@amd.com>
|
|
Date: Wed, 11 Dec 2024 15:06:55 -0600
|
|
Subject: [PATCH 05/57] amd_iommu: Use shared memory region for Interrupt
|
|
Remapping
|
|
|
|
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: [3/5] 48c0513c80257bfbd12c2cf3bab2503bd95d0b1c (johnalle/qemu-kvm-fork)
|
|
|
|
JIRA: https://issues.redhat.com/browse/RHEL-66202
|
|
|
|
commit 9fc9dbac61ddde7d8df37e84c8e02cec249d3222
|
|
Author: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
|
|
Date: Fri Sep 27 12:29:11 2024 -0500
|
|
|
|
amd_iommu: Use shared memory region for Interrupt Remapping
|
|
|
|
Use shared memory region for interrupt remapping which can be
|
|
aliased by all devices.
|
|
|
|
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-4-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 | 22 ++++++++++++++--------
|
|
hw/i386/amd_iommu.h | 1 +
|
|
2 files changed, 15 insertions(+), 8 deletions(-)
|
|
|
|
diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c
|
|
index 567cb8adc9..8fcf5eacb4 100644
|
|
--- a/hw/i386/amd_iommu.c
|
|
+++ b/hw/i386/amd_iommu.c
|
|
@@ -1443,7 +1443,7 @@ static AddressSpace *amdvi_host_dma_iommu(PCIBus *bus, void *opaque, int devfn)
|
|
* |--------------------+-------------------+----------+
|
|
* | amdvi-root | 00000000-ffffffff | 0 |
|
|
* | amdvi-iommu_nodma | 00000000-ffffffff | 0 |
|
|
- * | amdvi-iommu_ir | fee00000-feefffff | 64 |
|
|
+ * | amdvi-iommu_ir | fee00000-feefffff | 1 |
|
|
* |--------------------+-------------------+----------|
|
|
*/
|
|
memory_region_init_iommu(&amdvi_dev_as->iommu,
|
|
@@ -1454,13 +1454,6 @@ static AddressSpace *amdvi_host_dma_iommu(PCIBus *bus, void *opaque, int devfn)
|
|
memory_region_init(&amdvi_dev_as->root, OBJECT(s),
|
|
"amdvi_root", UINT64_MAX);
|
|
address_space_init(&amdvi_dev_as->as, &amdvi_dev_as->root, name);
|
|
- memory_region_init_io(&amdvi_dev_as->iommu_ir, OBJECT(s),
|
|
- &amdvi_ir_ops, s, "amd_iommu_ir",
|
|
- AMDVI_INT_ADDR_SIZE);
|
|
- memory_region_add_subregion_overlap(&amdvi_dev_as->root,
|
|
- AMDVI_INT_ADDR_FIRST,
|
|
- &amdvi_dev_as->iommu_ir,
|
|
- 64);
|
|
memory_region_add_subregion_overlap(&amdvi_dev_as->root, 0,
|
|
MEMORY_REGION(&amdvi_dev_as->iommu),
|
|
0);
|
|
@@ -1472,6 +1465,13 @@ static AddressSpace *amdvi_host_dma_iommu(PCIBus *bus, void *opaque, int devfn)
|
|
memory_region_add_subregion_overlap(&amdvi_dev_as->root, 0,
|
|
&amdvi_dev_as->iommu_nodma,
|
|
0);
|
|
+ /* Build the Interrupt Remapping alias to shared memory */
|
|
+ memory_region_init_alias(&amdvi_dev_as->iommu_ir, OBJECT(s),
|
|
+ "amdvi-ir", &s->mr_ir, 0,
|
|
+ memory_region_size(&s->mr_ir));
|
|
+ memory_region_add_subregion_overlap(MEMORY_REGION(&amdvi_dev_as->iommu),
|
|
+ AMDVI_INT_ADDR_FIRST,
|
|
+ &amdvi_dev_as->iommu_ir, 1);
|
|
|
|
if (!x86_iommu->pt_supported) {
|
|
memory_region_set_enabled(&amdvi_dev_as->iommu_nodma, false);
|
|
@@ -1633,6 +1633,12 @@ static void amdvi_sysbus_realize(DeviceState *dev, Error **errp)
|
|
memory_region_add_subregion_overlap(&s->mr_sys, 0,
|
|
&s->mr_nodma, 0);
|
|
|
|
+ /* set up the Interrupt Remapping memory region */
|
|
+ memory_region_init_io(&s->mr_ir, OBJECT(s), &amdvi_ir_ops,
|
|
+ s, "amdvi-ir", AMDVI_INT_ADDR_SIZE);
|
|
+ memory_region_add_subregion_overlap(&s->mr_sys, AMDVI_INT_ADDR_FIRST,
|
|
+ &s->mr_ir, 1);
|
|
+
|
|
pci_setup_iommu(bus, &amdvi_iommu_ops, s);
|
|
amdvi_init(s);
|
|
}
|
|
diff --git a/hw/i386/amd_iommu.h b/hw/i386/amd_iommu.h
|
|
index be417e51c4..e0dac4d9a9 100644
|
|
--- a/hw/i386/amd_iommu.h
|
|
+++ b/hw/i386/amd_iommu.h
|
|
@@ -356,6 +356,7 @@ struct AMDVIState {
|
|
MemoryRegion mr_mmio; /* MMIO region */
|
|
MemoryRegion mr_sys;
|
|
MemoryRegion mr_nodma;
|
|
+ MemoryRegion mr_ir;
|
|
uint8_t mmior[AMDVI_MMIO_SIZE]; /* read/write MMIO */
|
|
uint8_t w1cmask[AMDVI_MMIO_SIZE]; /* read/write 1 clear mask */
|
|
uint8_t romask[AMDVI_MMIO_SIZE]; /* MMIO read/only mask */
|
|
--
|
|
2.39.3
|
|
|