From 327b9bfff178cbabd66fa35d6cc2dc38935d31e4 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Mon, 20 Oct 2008 15:13:02 +0100 Subject: iommu: make some functions (mainly MSI-related) dummy on IA64 for now. Signed-off-by: Anthony Xu Signed-off-by: Dexuan Cui --- xen/drivers/passthrough/io.c | 5 +++++ xen/drivers/passthrough/pci.c | 5 ++++- xen/drivers/passthrough/vtd/iommu.c | 8 ++++++++ xen/drivers/passthrough/vtd/utils.c | 5 +++++ xen/include/asm-x86/hvm/irq.h | 8 ++++++++ 5 files changed, 30 insertions(+), 1 deletion(-) diff --git a/xen/drivers/passthrough/io.c b/xen/drivers/passthrough/io.c index d5a337ab08..a74fcb2f89 100644 --- a/xen/drivers/passthrough/io.c +++ b/xen/drivers/passthrough/io.c @@ -20,6 +20,9 @@ #include #include +#include +#include +#include static void pt_irq_time_out(void *data) { @@ -245,6 +248,7 @@ int hvm_do_IRQ_dpci(struct domain *d, unsigned int mirq) return 1; } +#ifdef SUPPORT_MSI_REMAPPING void hvm_dpci_msi_eoi(struct domain *d, int vector) { struct hvm_irq_dpci *hvm_irq_dpci = d->arch.hvm_domain.irq.dpci; @@ -277,6 +281,7 @@ void hvm_dpci_msi_eoi(struct domain *d, int vector) spin_unlock(&d->event_lock); } +#endif void hvm_dpci_eoi(struct domain *d, unsigned int guest_gsi, union vioapic_redir_entry *ent) diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c index da39b475f2..72c123ada4 100644 --- a/xen/drivers/passthrough/pci.c +++ b/xen/drivers/passthrough/pci.c @@ -21,6 +21,8 @@ #include #include #include +#include +#include #include #include @@ -207,6 +209,7 @@ void pci_release_devices(struct domain *d) } } +#ifdef SUPPORT_MSI_REMAPPING static void dump_pci_devices(unsigned char ch) { struct pci_dev *pdev; @@ -236,7 +239,7 @@ static int __init setup_dump_pcidevs(void) return 0; } __initcall(setup_dump_pcidevs); - +#endif /* diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c index 6009871575..dd5d7a4e79 100644 --- a/xen/drivers/passthrough/vtd/iommu.c +++ b/xen/drivers/passthrough/vtd/iommu.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -857,6 +858,7 @@ static void dma_msi_data_init(struct iommu *iommu, int vector) spin_unlock_irqrestore(&iommu->register_lock, flags); } +#ifdef SUPPORT_MSI_REMAPPING static void dma_msi_addr_init(struct iommu *iommu, int phy_cpu) { u64 msi_address; @@ -873,6 +875,12 @@ static void dma_msi_addr_init(struct iommu *iommu, int phy_cpu) dmar_writel(iommu->reg, DMAR_FEUADDR_REG, (u32)(msi_address >> 32)); spin_unlock_irqrestore(&iommu->register_lock, flags); } +#else +static void dma_msi_addr_init(struct iommu *iommu, int phy_cpu) +{ + /* ia64: TODO */ +} +#endif static void dma_msi_set_affinity(unsigned int vector, cpumask_t dest) { diff --git a/xen/drivers/passthrough/vtd/utils.c b/xen/drivers/passthrough/vtd/utils.c index 4404a1f1c1..c720030c0a 100644 --- a/xen/drivers/passthrough/vtd/utils.c +++ b/xen/drivers/passthrough/vtd/utils.c @@ -204,6 +204,7 @@ void print_vtd_entries(struct iommu *iommu, int bus, int devfn, u64 gmfn) void dump_iommu_info(unsigned char key) { +#if defined(__i386__) || defined(__x86_64__) struct acpi_drhd_unit *drhd; struct iommu *iommu; int i; @@ -305,6 +306,10 @@ void dump_iommu_info(unsigned char key) } } } +#else + printk("%s: not implemnted on IA64 for now.\n", __func__); + /* ia64: TODO */ +#endif } /* diff --git a/xen/include/asm-x86/hvm/irq.h b/xen/include/asm-x86/hvm/irq.h index 89a799f601..f2220526fd 100644 --- a/xen/include/asm-x86/hvm/irq.h +++ b/xen/include/asm-x86/hvm/irq.h @@ -102,4 +102,12 @@ struct hvm_irq { struct hvm_intack hvm_vcpu_has_pending_irq(struct vcpu *v); struct hvm_intack hvm_vcpu_ack_pending_irq(struct vcpu *v, struct hvm_intack intack); + +/* + * Currently IA64 Xen doesn't support MSI. So for x86, we define this macro + * to control the conditional compilation of some MSI-related functions. + * This macro will be removed once IA64 has MSI support. + */ +#define SUPPORT_MSI_REMAPPING 1 + #endif /* __ASM_X86_HVM_IRQ_H__ */ -- cgit v1.2.3