[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen master] AMD/IOMMU: guest IOMMU support is for HVM only



commit 230a2f68159394b69b35c18844d621e8dcf5b28e
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Mon May 3 15:27:42 2021 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon May 3 15:27:42 2021 +0200

    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 <jbeulich@xxxxxxxx>
    Reviewed-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
 xen/drivers/passthrough/amd/Makefile | 2 +-
 xen/drivers/passthrough/amd/iommu.h  | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

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)
 {
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.