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

[Xen-changelog] [xen-unstable] drivers: Remove some CONFIG_X86 ifdef'ery.


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-unstable <patchbot@xxxxxxx>
  • Date: Fri, 14 Sep 2012 10:55:38 +0000
  • Delivery-date: Fri, 14 Sep 2012 10:55:53 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Keir Fraser <keir@xxxxxxx>
# Date 1347479663 -3600
# Node ID 3afa736ba7a57766c5ed72835e8d97affc951771
# Parent  d4761aa7daa244d8aae2496cb7eac9981c84c246
drivers: Remove some CONFIG_X86 ifdef'ery.

Not quite all, but a great deal was to specifically allow ia64 support
to be retrofitted to x86 platform code. Since we no longer support
ia64 we can happily remove the ifdefs. Any new platform which wanted
to share this code would likely need a different set of ifdefs in any
case, making it a brand new porting effort.

Signed-off-by: Keir Fraser <keir@xxxxxxx>
---


diff -r d4761aa7daa2 -r 3afa736ba7a5 xen/drivers/acpi/numa.c
--- a/xen/drivers/acpi/numa.c   Wed Sep 12 20:41:01 2012 +0100
+++ b/xen/drivers/acpi/numa.c   Wed Sep 12 20:54:23 2012 +0100
@@ -121,16 +121,6 @@ static int __init acpi_parse_slit(struct
        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 -r d4761aa7daa2 -r 3afa736ba7a5 xen/drivers/acpi/pmstat.c
--- a/xen/drivers/acpi/pmstat.c Wed Sep 12 20:41:01 2012 +0100
+++ b/xen/drivers/acpi/pmstat.c Wed Sep 12 20:54:23 2012 +0100
@@ -134,7 +134,6 @@ int do_get_pm_info(struct xen_sysctl_get
         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
         ret = pmstat_reset_cx_stat(op->cpuid);
         break;
     }
-#endif
 
     default:
         printk("not defined sub-hypercall @ do_get_pm_info\n");
diff -r d4761aa7daa2 -r 3afa736ba7a5 xen/drivers/cpufreq/cpufreq.c
--- a/xen/drivers/cpufreq/cpufreq.c     Wed Sep 12 20:41:01 2012 +0100
+++ b/xen/drivers/cpufreq/cpufreq.c     Wed Sep 12 20:54:23 2012 +0100
@@ -481,8 +481,7 @@ int set_px_pminfo(uint32_t acpi_id, stru
 
     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, stru
             ret = -EINVAL;
             goto out;
         }
-#endif
 
         pxpt->shared_type = dom0_px_info->shared_type;
         memcpy ((void *)&pxpt->domain_info,
diff -r d4761aa7daa2 -r 3afa736ba7a5 xen/drivers/passthrough/ats.h
--- a/xen/drivers/passthrough/ats.h     Wed Sep 12 20:41:01 2012 +0100
+++ b/xen/drivers/passthrough/ats.h     Wed Sep 12 20:54:23 2012 +0100
@@ -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
     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 -r d4761aa7daa2 -r 3afa736ba7a5 xen/drivers/passthrough/pci.c
--- a/xen/drivers/passthrough/pci.c     Wed Sep 12 20:41:01 2012 +0100
+++ b/xen/drivers/passthrough/pci.c     Wed Sep 12 20:54:23 2012 +0100
@@ -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 -r d4761aa7daa2 -r 3afa736ba7a5 xen/drivers/passthrough/vtd/dmar.c
--- a/xen/drivers/passthrough/vtd/dmar.c        Wed Sep 12 20:41:01 2012 +0100
+++ b/xen/drivers/passthrough/vtd/dmar.c        Wed Sep 12 20:54:23 2012 +0100
@@ -520,7 +520,6 @@ acpi_parse_one_rmrr(struct acpi_dmar_hea
     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_hea
                 "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 -r d4761aa7daa2 -r 3afa736ba7a5 xen/drivers/passthrough/vtd/extern.h
--- a/xen/drivers/passthrough/vtd/extern.h      Wed Sep 12 20:41:01 2012 +0100
+++ b/xen/drivers/passthrough/vtd/extern.h      Wed Sep 12 20:54:23 2012 +0100
@@ -56,32 +56,12 @@ struct acpi_drhd_unit * ioapic_to_drhd(u
 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 -r d4761aa7daa2 -r 3afa736ba7a5 xen/drivers/passthrough/vtd/intremap.c
--- a/xen/drivers/passthrough/vtd/intremap.c    Wed Sep 12 20:41:01 2012 +0100
+++ b/xen/drivers/passthrough/vtd/intremap.c    Wed Sep 12 20:54:23 2012 +0100
@@ -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(str
 
     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(str
         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,
         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 -r d4761aa7daa2 -r 3afa736ba7a5 xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c       Wed Sep 12 20:41:01 2012 +0100
+++ b/xen/drivers/passthrough/vtd/iommu.c       Wed Sep 12 20:54:23 2012 +0100
@@ -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 
     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 
                     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(st
     }
 
     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 -r d4761aa7daa2 -r 3afa736ba7a5 xen/drivers/passthrough/vtd/quirks.c
--- a/xen/drivers/passthrough/vtd/quirks.c      Wed Sep 12 20:41:01 2012 +0100
+++ b/xen/drivers/passthrough/vtd/quirks.c      Wed Sep 12 20:54:23 2012 +0100
@@ -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
  */
 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
         val = pci_conf_read32(seg, bus, dev, func, 0x1AC);
         pci_conf_write32(seg, bus, dev, func, 0x1AC, val | (1 << 31));
     }
-#endif
 }
diff -r d4761aa7daa2 -r 3afa736ba7a5 xen/drivers/passthrough/vtd/utils.c
--- a/xen/drivers/passthrough/vtd/utils.c       Wed Sep 12 20:41:01 2012 +0100
+++ b/xen/drivers/passthrough/vtd/utils.c       Wed Sep 12 20:54:23 2012 +0100
@@ -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 *iom
 
 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 cha
             }
         }
     }
-#else
-    printk("%s: not implemented for now\n", __func__);
-#endif
 }
 
 struct keyhandler dump_iommu_info_keyhandler = {
diff -r d4761aa7daa2 -r 3afa736ba7a5 xen/drivers/video/vesa.c
--- a/xen/drivers/video/vesa.c  Wed Sep 12 20:41:01 2012 +0100
+++ b/xen/drivers/video/vesa.c  Wed Sep 12 20:54:23 2012 +0100
@@ -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 )

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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