Skip to content

iommu/amd: Add AMD IOMMU emulation support for SEV-SNP guest kernel

Suravee Suthikulpanit linux-iommu lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest9 patches 9 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9iommu/amd: Introduce helper functions for managing IOMMU memorydrivers/iommu/amd/amd_iommu.h drivers/iommu/amd/amd_iommu_types.h drivers/iommu/amd/iommu.c+110 -03 replies
2/9iommu/amd: Convert Device Table pointer to use struct amd_iommu_memdrivers/iommu/amd/amd_iommu_types.h drivers/iommu/amd/init.c drivers/iommu/amd/iommu.c+15 -150 replies
3/9iommu/amd: Convert Command Buffer pointer to use struct amd_iommu_memdrivers/iommu/amd/amd_iommu_types.h drivers/iommu/amd/init.c drivers/iommu/amd/iommu.c+13 -80 replies
4/9iommu/amd: Convert Completion-Wait Semaphore pointer to use struct amd_iommu_memdrivers/iommu/amd/amd_iommu_types.h drivers/iommu/amd/init.c drivers/iommu/amd/iommu.c+15 -90 replies
5/9iommu/amd: Convert Event Log pointer to use struct amd_iommu_memdrivers/iommu/amd/amd_iommu_types.h drivers/iommu/amd/init.c drivers/iommu/amd/iommu.c+15 -90 replies
6/9iommu/amd: Convert PPR Log pointer to use the struct amd_iommu_memdrivers/iommu/amd/amd_iommu_types.h drivers/iommu/amd/init.c drivers/iommu/amd/ppr.c+16 -100 replies
7/9iommu/amd: Remove iommu_alloc_4k_pages() helper functiondrivers/iommu/amd/amd_iommu.h drivers/iommu/amd/init.c+0 -180 replies
8/9iommu/amd: Decrypt interrupt remapping table for AMD IOMMU emulation in SEV guestdrivers/iommu/amd/amd_iommu_types.h drivers/iommu/amd/init.c drivers/iommu/amd/iommu.c+41 -430 replies
9/9iommu/amd: Set default domain to IDENTITY_DOMAIN when running in SEV guestdrivers/iommu/amd/init.c drivers/iommu/amd/iommu.c+21 -03 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/9] iommu/amd: Add AMD IOMMU emulation support for SEV-SNP guest kernel

To boot a VM w/ x2APIC ID > 255, guest interrupt remapping emulation is required. For SEV guest, this can be achieved using an emulated AMD IOMMU.

In order to support emulated AMD IOMMU in SEV guest, memory pages used by the guest IOMMU data structures must be in decrypted mode. Also GPAs for these pages must not have the memory encryption bit set.

Testing:
- Booting Linux SEV guest w/ 512 vcpus w/ QEMU emulated amd-iommu with qemu-system-x86_64 option: -device amd-iommu,intremap=on,xtsup=on (emulated devices only for now).

GIT repos:
* https://github.com/AMDESE/linux-iommu/tree/iommu_next_sev-iommu-v1

Thanks,
Suravee

Suravee Suthikulpanit (9):
iommu/amd: Introduce helper functions for managing IOMMU memory iommu/amd: Convert Device Table pointer to use struct amd_iommu_mem iommu/amd: Convert Command Buffer pointer to use struct amd_iommu_mem iommu/amd: Convert Completion-Wait Semaphore pointer to use struct
amd_iommu_mem
iommu/amd: Convert Event Log pointer to use struct amd_iommu_mem iommu/amd: Convert PPR Log pointer to use the struct amd_iommu_mem iommu/amd: Remove iommu_alloc_4k_pages() helper function iommu/amd: Decrypt interrupt remapping table for AMD IOMMU emulation
in SEV guest
iommu/amd: Set default domain to IDENTITY_DOMAIN when running in SEV
guest

 drivers/iommu/amd/amd_iommu.h       |  31 +++++-
 drivers/iommu/amd/amd_iommu_types.h |  28 ++++--
 drivers/iommu/amd/init.c            | 144 +++++++++++++++-------------
 drivers/iommu/amd/iommu.c           | 133 +++++++++++++++++++------
 drivers/iommu/amd/ppr.c             |  22 +++--
 5 files changed, 246 insertions(+), 112 deletions(-)
Signature · 1 line
2.34.1