AMD/IOMMU: guest IOMMU support is for HVM only
authorJan Beulich <jbeulich@suse.com>
Mon, 3 May 2021 13:27:42 +0000 (15:27 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 3 May 2021 13:27:42 +0000 (15:27 +0200)
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 <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
xen/drivers/passthrough/amd/Makefile
xen/drivers/passthrough/amd/iommu.h

index 95c04ed23711a5291ed2ace788d130efe99571da..a3aecd26efeb46dc7622fb3e7b158703b21321c8 100644 (file)
@@ -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
index ad089cb095e5176d3021a130f3f9d3595d266579..73f89f0f206a24311843603fb912374ba8a0bc97 100644 (file)
@@ -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)
 {