mbox series

[0/5] Interrupt Remap support for emulated amd viommu

Message ID 20240904100257.184851-1-santosh.shukla@amd.com
Headers show
Series Interrupt Remap support for emulated amd viommu | expand

Message

Santosh Shukla Sept. 4, 2024, 10:02 a.m. UTC
Series adds following feature support for emulated amd vIOMMU
1) Pass Through(PT) mode
2) Interrupt Remapping(IR) mode

1) PT mode
Introducing the shared 'nodma' memory region that can be aliased
by all the devices in the PT mode. Shared memory with aliasing
approach will help run VM faster when lot of devices attached to
VM.

2) IR mode
Shared IR memory region with aliasing approach proposed for the
reason mentioned in 1). Also add support to invalidate Interrupt
remaping table(IRT).

Series based on f259e4cb8a8b4ef5463326fc214a7d8d7703d5de.

Testing:
1. nvme/fio testing for VM with > 255 vCPU with xtsup=on and x2apic
enabled
2. Windows Server 2022 VM testing for > 255 vCPU.

Suravee Suthikulpanit (5):
  amd_iommu: Rename variable mmio to mr_mmio
  amd_iommu: Add support for pass though mode
  amd_iommu: Use shared memory region for Interrupt Remapping
  amd_iommu: Send notification when invaldate interrupt entry cache
  amd_iommu: Check APIC ID > 255 for XTSup

 hw/i386/acpi-build.c |  4 +-
 hw/i386/amd_iommu.c  | 98 +++++++++++++++++++++++++++++++++++---------
 hw/i386/amd_iommu.h  |  5 ++-
 3 files changed, 85 insertions(+), 22 deletions(-)

Comments

Michael S. Tsirkin Sept. 10, 2024, 8:14 p.m. UTC | #1
On Wed, Sep 04, 2024 at 05:02:52AM -0500, Santosh Shukla wrote:
> Series adds following feature support for emulated amd vIOMMU
> 1) Pass Through(PT) mode
> 2) Interrupt Remapping(IR) mode
> 
> 1) PT mode
> Introducing the shared 'nodma' memory region that can be aliased
> by all the devices in the PT mode. Shared memory with aliasing
> approach will help run VM faster when lot of devices attached to
> VM.
> 
> 2) IR mode
> Shared IR memory region with aliasing approach proposed for the
> reason mentioned in 1). Also add support to invalidate Interrupt
> remaping table(IRT).
> 
> Series based on f259e4cb8a8b4ef5463326fc214a7d8d7703d5de.


Fails build on non-kvm:

https://gitlab.com/mstredhat/qemu/-/jobs/7791357916

/usr/lib/gcc-cross/i686-linux-gnu/10/../../../../i686-linux-gnu/bin/ld: libqemu-x86_64-softmmu.a.p/hw_i386_amd_iommu.c.o: in function `amdvi_sysbus_realize':
/builds/mstredhat/qemu/build/../hw/i386/amd_iommu.c:1660: undefined reference to `kvm_enable_x2apic'
collect2: error: ld returned 1 exit status


> Testing:
> 1. nvme/fio testing for VM with > 255 vCPU with xtsup=on and x2apic
> enabled
> 2. Windows Server 2022 VM testing for > 255 vCPU.
> 
> Suravee Suthikulpanit (5):
>   amd_iommu: Rename variable mmio to mr_mmio
>   amd_iommu: Add support for pass though mode
>   amd_iommu: Use shared memory region for Interrupt Remapping
>   amd_iommu: Send notification when invaldate interrupt entry cache
>   amd_iommu: Check APIC ID > 255 for XTSup
> 
>  hw/i386/acpi-build.c |  4 +-
>  hw/i386/amd_iommu.c  | 98 +++++++++++++++++++++++++++++++++++---------
>  hw/i386/amd_iommu.h  |  5 ++-
>  3 files changed, 85 insertions(+), 22 deletions(-)
> 
> -- 
> 2.43.5
Santosh Shukla Sept. 12, 2024, 5:40 a.m. UTC | #2
Hi Michael,

On 9/11/2024 1:44 AM, Michael S. Tsirkin wrote:
> On Wed, Sep 04, 2024 at 05:02:52AM -0500, Santosh Shukla wrote:
>> Series adds following feature support for emulated amd vIOMMU
>> 1) Pass Through(PT) mode
>> 2) Interrupt Remapping(IR) mode
>>
>> 1) PT mode
>> Introducing the shared 'nodma' memory region that can be aliased
>> by all the devices in the PT mode. Shared memory with aliasing
>> approach will help run VM faster when lot of devices attached to
>> VM.
>>
>> 2) IR mode
>> Shared IR memory region with aliasing approach proposed for the
>> reason mentioned in 1). Also add support to invalidate Interrupt
>> remaping table(IRT).
>>
>> Series based on f259e4cb8a8b4ef5463326fc214a7d8d7703d5de.
> 
> 
> Fails build on non-kvm:
> 
> https://gitlab.com/mstredhat/qemu/-/jobs/7791357916
> 
> /usr/lib/gcc-cross/i686-linux-gnu/10/../../../../i686-linux-gnu/bin/ld: libqemu-x86_64-softmmu.a.p/hw_i386_amd_iommu.c.o: in function `amdvi_sysbus_realize':
> /builds/mstredhat/qemu/build/../hw/i386/amd_iommu.c:1660: undefined reference to `kvm_enable_x2apic'
> collect2: error: ld returned 1 exit status
> 
Thank you for reporting, Fix in v2.

- Santosh