From: Jan Beulich Date: Mon, 3 May 2021 13:27:42 +0000 (+0200) Subject: AMD/IOMMU: guest IOMMU support is for HVM only X-Git-Tag: archive/raspbian/4.16.0+51-g0941d6cb-1+rpi1~2^2~42^2~580 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=230a2f68159394b69b35c18844d621e8dcf5b28e;p=xen.git AMD/IOMMU: guest IOMMU support is for HVM only Generally all of this is dead code anyway, but there's a caller of guest_iommu_add_ppr_log(), and the code itself calls p2m_change_type_one(), which is about to become HVM-only. Hence this code, short of deleting it altogether, needs to become properly HVM- only as well. Signed-off-by: Jan Beulich Reviewed-by: Roger Pau Monné --- diff --git a/xen/drivers/passthrough/amd/Makefile b/xen/drivers/passthrough/amd/Makefile index 95c04ed237..a3aecd26ef 100644 --- a/xen/drivers/passthrough/amd/Makefile +++ b/xen/drivers/passthrough/amd/Makefile @@ -5,4 +5,4 @@ obj-y += pci_amd_iommu.o obj-bin-y += iommu_acpi.init.o obj-y += iommu_intr.o obj-y += iommu_cmd.o -obj-y += iommu_guest.o +obj-$(CONFIG_HVM) += iommu_guest.o diff --git a/xen/drivers/passthrough/amd/iommu.h b/xen/drivers/passthrough/amd/iommu.h index ad089cb095..73f89f0f20 100644 --- a/xen/drivers/passthrough/amd/iommu.h +++ b/xen/drivers/passthrough/amd/iommu.h @@ -307,12 +307,16 @@ int __must_check amd_iommu_suspend(void); void amd_iommu_crash_shutdown(void); /* guest iommu support */ +#ifdef CONFIG_HVM void amd_iommu_send_guest_cmd(struct amd_iommu *iommu, u32 cmd[]); void guest_iommu_add_ppr_log(struct domain *d, u32 entry[]); void guest_iommu_add_event_log(struct domain *d, u32 entry[]); int guest_iommu_init(struct domain* d); void guest_iommu_destroy(struct domain *d); int guest_iommu_set_base(struct domain *d, uint64_t base); +#else +static inline void guest_iommu_add_ppr_log(struct domain *d, uint32_t entry[]) {} +#endif static inline u32 get_field_from_reg_u32(u32 reg_value, u32 mask, u32 shift) {