diff options
-rw-r--r-- | xen/drivers/acpi/numa.c | 10 | ||||
-rw-r--r-- | xen/drivers/acpi/pmstat.c | 2 | ||||
-rw-r--r-- | xen/drivers/cpufreq/cpufreq.c | 4 | ||||
-rw-r--r-- | xen/drivers/passthrough/ats.h | 33 | ||||
-rw-r--r-- | xen/drivers/passthrough/pci.c | 2 | ||||
-rw-r--r-- | xen/drivers/passthrough/vtd/dmar.c | 14 | ||||
-rw-r--r-- | xen/drivers/passthrough/vtd/extern.h | 20 | ||||
-rw-r--r-- | xen/drivers/passthrough/vtd/intremap.c | 14 | ||||
-rw-r--r-- | xen/drivers/passthrough/vtd/iommu.c | 17 | ||||
-rw-r--r-- | xen/drivers/passthrough/vtd/quirks.c | 6 | ||||
-rw-r--r-- | xen/drivers/passthrough/vtd/utils.c | 7 | ||||
-rw-r--r-- | xen/drivers/video/vesa.c | 8 |
12 files changed, 3 insertions, 134 deletions
diff --git a/xen/drivers/acpi/numa.c b/xen/drivers/acpi/numa.c index 9f6f36f328..ff99ffcfc6 100644 --- a/xen/drivers/acpi/numa.c +++ b/xen/drivers/acpi/numa.c @@ -121,16 +121,6 @@ static int __init acpi_parse_slit(struct acpi_table_header *table) return 0; } -#ifndef CONFIG_X86 -void __init -acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa) -{ - printk(KERN_WARNING PREFIX - "Found unsupported x2apic [0x%08x] SRAT entry\n", pa->apic_id); - return; -} -#endif - static int __init acpi_parse_x2apic_affinity(struct acpi_subtable_header *header, const unsigned long end) diff --git a/xen/drivers/acpi/pmstat.c b/xen/drivers/acpi/pmstat.c index 909426901f..6f266ef0b0 100644 --- a/xen/drivers/acpi/pmstat.c +++ b/xen/drivers/acpi/pmstat.c @@ -134,7 +134,6 @@ int do_get_pm_info(struct xen_sysctl_get_pmstat *op) break; } -#ifdef CONFIG_X86 case PMSTAT_get_max_cx: { op->u.getcx.nr = pmstat_get_cx_nr(op->cpuid); @@ -153,7 +152,6 @@ int do_get_pm_info(struct xen_sysctl_get_pmstat *op) ret = pmstat_reset_cx_stat(op->cpuid); break; } -#endif default: printk("not defined sub-hypercall @ do_get_pm_info\n"); diff --git a/xen/drivers/cpufreq/cpufreq.c b/xen/drivers/cpufreq/cpufreq.c index a15f6b50c3..1fea575374 100644 --- a/xen/drivers/cpufreq/cpufreq.c +++ b/xen/drivers/cpufreq/cpufreq.c @@ -481,8 +481,7 @@ int set_px_pminfo(uint32_t acpi_id, struct xen_processor_performance *dom0_px_in if ( dom0_px_info->flags & XEN_PX_PSD ) { -#ifdef CONFIG_X86 - /* for X86, check domain coordination */ + /* check domain coordination */ if (dom0_px_info->shared_type != CPUFREQ_SHARED_TYPE_ALL && dom0_px_info->shared_type != CPUFREQ_SHARED_TYPE_ANY && dom0_px_info->shared_type != CPUFREQ_SHARED_TYPE_HW) @@ -490,7 +489,6 @@ int set_px_pminfo(uint32_t acpi_id, struct xen_processor_performance *dom0_px_in ret = -EINVAL; goto out; } -#endif pxpt->shared_type = dom0_px_info->shared_type; memcpy ((void *)&pxpt->domain_info, diff --git a/xen/drivers/passthrough/ats.h b/xen/drivers/passthrough/ats.h index a6efa893b2..0c9f1ffd63 100644 --- a/xen/drivers/passthrough/ats.h +++ b/xen/drivers/passthrough/ats.h @@ -26,8 +26,6 @@ struct pci_ats_dev { u16 ats_queue_depth; /* ATS device invalidation queue depth */ }; -#ifdef CONFIG_X86 - #define ATS_REG_CAP 4 #define ATS_REG_CTL 6 #define ATS_QUEUE_DEPTH_MASK 0xF @@ -61,36 +59,5 @@ static inline int pci_ats_device(int seg, int bus, int devfn) return pci_find_ext_capability(seg, bus, devfn, PCI_EXT_CAP_ID_ATS); } -#else - -#define ats_enabled 0 -static inline int enable_ats_device(int seg, int bus, int devfn) -{ - BUG(); - return -ENOSYS; -} - -static inline void disable_ats_device(int seg, int bus, int devfn) -{ - BUG(); -} - -static inline int pci_ats_enabled(int seg, int bus, int devfn) -{ - return 0; -} - -static inline int pci_ats_device(int seg, int bus, int devfn) -{ - return 0; -} - -static inline struct pci_ats_dev *get_ats_device(int seg, int bus, int devfn) -{ - return NULL; -} - -#endif - #endif /* _ATS_H_ */ diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c index 6d08dc68fa..254c4c2dba 100644 --- a/xen/drivers/passthrough/pci.c +++ b/xen/drivers/passthrough/pci.c @@ -29,9 +29,7 @@ #include <xen/radix-tree.h> #include <xen/tasklet.h> #include <xsm/xsm.h> -#ifdef CONFIG_X86 #include <asm/msi.h> -#endif struct pci_seg { struct list_head alldevs_list; diff --git a/xen/drivers/passthrough/vtd/dmar.c b/xen/drivers/passthrough/vtd/dmar.c index 3fbc5e6e3a..4acce79de4 100644 --- a/xen/drivers/passthrough/vtd/dmar.c +++ b/xen/drivers/passthrough/vtd/dmar.c @@ -520,7 +520,6 @@ acpi_parse_one_rmrr(struct acpi_dmar_header *header) if ( (ret = acpi_dmar_check_length(header, sizeof(*rmrr))) != 0 ) return ret; -#ifdef CONFIG_X86 /* This check is here simply to detect when RMRR values are * not properly represented in the system memory map and * inform the user @@ -534,7 +533,6 @@ acpi_parse_one_rmrr(struct acpi_dmar_header *header) "iommu_inclusive_mapping=1 parameter may be needed.\n", base_addr, end_addr); } -#endif rmrru = xzalloc(struct acpi_rmrr_unit); if ( !rmrru ) @@ -775,14 +773,10 @@ out: return ret; } -#ifdef CONFIG_X86 #include <asm/tboot.h> /* ACPI tables may not be DMA protected by tboot, so use DMAR copy */ /* SINIT saved in SinitMleData in TXT heap (which is DMA protected) */ #define parse_dmar_table(h) tboot_parse_dmar_table(h) -#else -#define parse_dmar_table(h) acpi_table_parse(ACPI_SIG_DMAR, h) -#endif int __init acpi_dmar_init(void) { @@ -813,14 +807,8 @@ int platform_supports_intremap(void) return (dmar_flags & mask) == ACPI_DMAR_INTR_REMAP; } -#ifdef CONFIG_X86 int platform_supports_x2apic(void) { unsigned int mask = ACPI_DMAR_INTR_REMAP | ACPI_DMAR_X2APIC_OPT_OUT; - - if (!cpu_has_x2apic) - return 0; - - return (dmar_flags & mask) == ACPI_DMAR_INTR_REMAP; + return cpu_has_x2apic && ((dmar_flags & mask) == ACPI_DMAR_INTR_REMAP); } -#endif diff --git a/xen/drivers/passthrough/vtd/extern.h b/xen/drivers/passthrough/vtd/extern.h index 0823218e15..37bba8e80d 100644 --- a/xen/drivers/passthrough/vtd/extern.h +++ b/xen/drivers/passthrough/vtd/extern.h @@ -56,32 +56,12 @@ struct acpi_drhd_unit * ioapic_to_drhd(unsigned int apic_id); struct acpi_drhd_unit * iommu_to_drhd(struct iommu *iommu); struct acpi_rhsa_unit * drhd_to_rhsa(struct acpi_drhd_unit *drhd); -#ifdef CONFIG_X86 struct acpi_drhd_unit * find_ats_dev_drhd(struct iommu *iommu); int ats_device(const struct pci_dev *, const struct acpi_drhd_unit *); int dev_invalidate_iotlb(struct iommu *iommu, u16 did, u64 addr, unsigned int size_order, u64 type); -#else - -static inline struct acpi_drhd_unit *find_ats_dev_drhd(struct iommu *iommu) -{ - return NULL; -} - -static inline int ats_device(const struct pci_dev *pdev, - const struct acpi_drhd_unit *drhd) -{ - return 0; -} - -static inline int dev_invalidate_iotlb(struct iommu *iommu, u16 did, u64 addr, - unsigned int size_order, u64 type) -{ - return 0; -} -#endif int qinval_device_iotlb(struct iommu *iommu, u32 max_invs_pend, u16 sid, u16 size, u64 addr); diff --git a/xen/drivers/passthrough/vtd/intremap.c b/xen/drivers/passthrough/vtd/intremap.c index 1a13a8264d..24acd26bae 100644 --- a/xen/drivers/passthrough/vtd/intremap.c +++ b/xen/drivers/passthrough/vtd/intremap.c @@ -31,11 +31,9 @@ #include "vtd.h" #include "extern.h" -#if defined(CONFIG_X86) #include <asm/apic.h> #include <asm/io_apic.h> #define nr_ioapic_entries(i) nr_ioapic_entries[i] -#endif /* * source validation type (SVT) @@ -302,12 +300,10 @@ static int ioapic_rte_to_remap_entry(struct iommu *iommu, if ( rte_upper ) { -#if defined(CONFIG_X86) if ( x2apic_enabled ) new_ire.lo.dst = value; else new_ire.lo.dst = (value >> 24) << 8; -#endif } else { @@ -316,12 +312,8 @@ static int ioapic_rte_to_remap_entry(struct iommu *iommu, new_ire.lo.dm = new_rte.dest_mode; new_ire.lo.tm = new_rte.trigger; new_ire.lo.dlm = new_rte.delivery_mode; -#ifdef CONFIG_X86 /* Hardware require RH = 1 for LPR delivery mode */ new_ire.lo.rh = (new_ire.lo.dlm == dest_LowestPrio); -#else - new_ire.lo.rh = 0; -#endif new_ire.lo.avail = 0; new_ire.lo.res_1 = 0; new_ire.lo.vector = new_rte.vector; @@ -422,8 +414,6 @@ void io_apic_write_remap_rte( __ioapic_write_entry(apic, ioapic_pin, 1, old_rte); } -#if defined(CONFIG_X86) - static void set_msi_source_id(struct pci_dev *pdev, struct iremap_entry *ire) { int type; @@ -678,7 +668,6 @@ void msi_msg_write_remap_rte( msi_msg_to_remap_entry(iommu, pdev, msi_desc, msg); } -#endif int enable_intremap(struct iommu *iommu, int eim) { @@ -725,10 +714,9 @@ int enable_intremap(struct iommu *iommu, int eim) ir_ctrl->iremap_num = 0; } -#ifdef CONFIG_X86 /* set extended interrupt mode bit */ ir_ctrl->iremap_maddr |= eim ? IRTA_EIME : 0; -#endif + spin_lock_irqsave(&iommu->register_lock, flags); /* set size of the interrupt remapping table */ diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c index 257d1a023b..2eae02502a 100644 --- a/xen/drivers/passthrough/vtd/iommu.c +++ b/xen/drivers/passthrough/vtd/iommu.c @@ -34,11 +34,9 @@ #include <xen/softirq.h> #include <asm/msi.h> #include <asm/irq.h> -#if defined(CONFIG_X86) #include <asm/hvm/vmx/vmx.h> #include <asm/p2m.h> #include <mach_apic.h> -#endif #include "iommu.h" #include "dmar.h" #include "extern.h" @@ -1070,7 +1068,6 @@ static void dma_msi_set_affinity(struct irq_desc *desc, const cpumask_t *mask) unsigned long flags; struct iommu *iommu = desc->action->dev_id; -#ifdef CONFIG_X86 dest = set_desc_affinity(desc, mask); if (dest == BAD_APICID){ dprintk(XENLOG_ERR VTDPREFIX, "Set iommu interrupt affinity error!\n"); @@ -1094,16 +1091,6 @@ static void dma_msi_set_affinity(struct irq_desc *desc, const cpumask_t *mask) MSI_ADDR_REDIRECTION_CPU: MSI_ADDR_REDIRECTION_LOWPRI; msg.address_lo |= MSI_ADDR_DEST_ID(dest & 0xff); -#else - memset(&msg, 0, sizeof(msg)); - msg.data = desc->arch.vector & 0xff; - msg.data |= 1 << 14; - msg.address_lo = (MSI_ADDRESS_HEADER << (MSI_ADDRESS_HEADER_SHIFT + 8)); - msg.address_lo |= MSI_PHYSICAL_MODE << 2; - msg.address_lo |= MSI_REDIRECTION_HINT_MODE << 3; - dest = cpu_physical_id(cpumask_first(mask)); - msg.address_lo |= dest << MSI_TARGET_CPU_SHIFT; -#endif spin_lock_irqsave(&iommu->register_lock, flags); dmar_writel(iommu->reg, DMAR_FEDATA_REG, msg.data); @@ -1137,11 +1124,7 @@ static int __init iommu_set_interrupt(struct acpi_drhd_unit *drhd) } irq_desc[irq].handler = &dma_msi_type; -#ifdef CONFIG_X86 ret = request_irq(irq, iommu_page_fault, 0, "dmar", drhd->iommu); -#else - ret = request_irq_vector(irq, iommu_page_fault, 0, "dmar", drhd->iommu); -#endif if ( ret ) { irq_desc[irq].handler = &no_irq_type; diff --git a/xen/drivers/passthrough/vtd/quirks.c b/xen/drivers/passthrough/vtd/quirks.c index da79dd78bc..586be334d6 100644 --- a/xen/drivers/passthrough/vtd/quirks.c +++ b/xen/drivers/passthrough/vtd/quirks.c @@ -132,12 +132,8 @@ static void __init map_igd_reg(void) igd_reg = (igd_mmio & IGD_BAR_MASK) + 0x2000; /* ioremap this physical page */ -#if defined(CONFIG_X86) set_fixmap_nocache(FIX_IGD_MMIO, igd_reg); igd_reg_va = (u8 *)fix_to_virt(FIX_IGD_MMIO); -#else - igd_reg_va = ioremap_nocache(igd_reg, 0x1000); -#endif } /* @@ -363,7 +359,6 @@ void me_wifi_quirk(struct domain *domain, u8 bus, u8 devfn, int map) */ void __init pci_vtd_quirk(struct pci_dev *pdev) { -#ifdef CONFIG_X86 int seg = pdev->seg; int bus = pdev->bus; int dev = PCI_SLOT(pdev->devfn); @@ -376,5 +371,4 @@ void __init pci_vtd_quirk(struct pci_dev *pdev) val = pci_conf_read32(seg, bus, dev, func, 0x1AC); pci_conf_write32(seg, bus, dev, func, 0x1AC, val | (1 << 31)); } -#endif } diff --git a/xen/drivers/passthrough/vtd/utils.c b/xen/drivers/passthrough/vtd/utils.c index a3868eb3e3..558f779f2b 100644 --- a/xen/drivers/passthrough/vtd/utils.c +++ b/xen/drivers/passthrough/vtd/utils.c @@ -27,10 +27,7 @@ #include "dmar.h" #include "vtd.h" #include "extern.h" - -#if defined(CONFIG_X86) #include <asm/io_apic.h> -#endif int is_usb_device(u16 seg, u8 bus, u8 devfn) { @@ -188,7 +185,6 @@ void print_vtd_entries(struct iommu *iommu, int bus, int devfn, u64 gmfn) static void dump_iommu_info(unsigned char key) { -#if defined(CONFIG_X86) struct acpi_drhd_unit *drhd; struct iommu *iommu; int i; @@ -300,9 +296,6 @@ static void dump_iommu_info(unsigned char key) } } } -#else - printk("%s: not implemented for now\n", __func__); -#endif } struct keyhandler dump_iommu_info_keyhandler = { diff --git a/xen/drivers/video/vesa.c b/xen/drivers/video/vesa.c index 91b6001dec..e24eb97c4e 100644 --- a/xen/drivers/video/vesa.c +++ b/xen/drivers/video/vesa.c @@ -151,8 +151,6 @@ void __init vesa_init(void) xfree(line_len); } -#if defined(CONFIG_X86) - #include <asm/mtrr.h> static unsigned int vesa_mtrr; @@ -191,12 +189,6 @@ static void lfb_flush(void) __asm__ __volatile__ ("sfence" : : : "memory"); } -#else /* !defined(CONFIG_X86) */ - -#define lfb_flush() ((void)0) - -#endif - void __init vesa_endboot(bool_t keep) { if ( keep ) |