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

[Xen-changelog] [xen-unstable] [IA64] sparse tree cleanups



# HG changeset patch
# User awilliam@xxxxxxxxxxx
# Node ID d8d2b5c082458152fb30e73138bd8822828247ac
# Parent  64b118cddb9a22dd9f9f6a6fcb57d3f0a7ad9ea6
[IA64] sparse tree cleanups

 Here's a first pass at some sparse tree cleanups based on feedback
 we've gotten on linux-ia64.  I haven't taken all of the comments into
 account yet, this is just a start.  Specific changes:

  - CONFIG_ARCH_XEN is no longer necessary
  - simple is_running_on_xen() checks can be handled w/o CONFIG_XEN
  - pulled forward a drivers/xen/Makefile change that broken make clean
  - changed some comments from C++ style to C
  - turned HYPERVISOR_ioremap into a macro for !CONFIG_XEN
  - made hypervisor.h and privop.h include-able for !CONFIG_XEN

Signed-off-by: Alex Williamson <alex.williamson@xxxxxx>
---
 linux-2.6-xen-sparse/arch/ia64/Kconfig              |    7 -------
 linux-2.6-xen-sparse/arch/ia64/kernel/iosapic.c     |    5 +----
 linux-2.6-xen-sparse/arch/ia64/kernel/irq_ia64.c    |   10 ++++++----
 linux-2.6-xen-sparse/arch/ia64/kernel/setup.c       |    3 +++
 linux-2.6-xen-sparse/arch/ia64/xen/drivers/Makefile |    1 -
 linux-2.6-xen-sparse/include/asm-ia64/dma-mapping.h |    9 +++++----
 linux-2.6-xen-sparse/include/asm-ia64/hypervisor.h  |   11 ++++++++++-
 linux-2.6-xen-sparse/include/asm-ia64/io.h          |   20 +++++++++-----------
 linux-2.6-xen-sparse/include/asm-ia64/page.h        |   14 ++++++++------
 linux-2.6-xen-sparse/include/asm-ia64/privop.h      |    1 -
 linux-2.6-xen-sparse/include/asm-ia64/xen/privop.h  |    3 ---
 11 files changed, 42 insertions(+), 42 deletions(-)

diff -r 64b118cddb9a -r d8d2b5c08245 linux-2.6-xen-sparse/arch/ia64/Kconfig
--- a/linux-2.6-xen-sparse/arch/ia64/Kconfig    Thu Jun 08 10:15:09 2006 -0600
+++ b/linux-2.6-xen-sparse/arch/ia64/Kconfig    Thu Jun 08 10:17:22 2006 -0600
@@ -56,13 +56,6 @@ config XEN
        help
          Enable Xen hypervisor support.  Resulting kernel runs
          both as a guest OS on Xen and natively on hardware.
-
-config ARCH_XEN
-       bool
-       default y
-       depends on XEN
-       help
-         TEMP ONLY. Needs to be on for drivers/xen to build.
 
 config XEN_IA64_DOM0_VP
        bool "dom0 vp model"
diff -r 64b118cddb9a -r d8d2b5c08245 
linux-2.6-xen-sparse/arch/ia64/kernel/iosapic.c
--- a/linux-2.6-xen-sparse/arch/ia64/kernel/iosapic.c   Thu Jun 08 10:15:09 
2006 -0600
+++ b/linux-2.6-xen-sparse/arch/ia64/kernel/iosapic.c   Thu Jun 08 10:17:22 
2006 -0600
@@ -670,10 +670,8 @@ register_intr (unsigned int gsi, int vec
        iosapic_intr_info[vector].dmode    = delivery;
        iosapic_intr_info[vector].trigger  = trigger;
 
-#ifdef CONFIG_XEN
        if (is_running_on_xen())
                return 0;
-#endif
 
        if (trigger == IOSAPIC_EDGE)
                irq_type = &irq_type_iosapic_edge;
@@ -1017,10 +1015,9 @@ iosapic_system_init (int system_pcat_com
        }
 
        pcat_compat = system_pcat_compat;
-#ifdef CONFIG_XEN
        if (is_running_on_xen())
                return;
-#endif
+
        if (pcat_compat) {
                /*
                 * Disable the compatibility mode interrupts (8259 style), 
needs IN/OUT support
diff -r 64b118cddb9a -r d8d2b5c08245 
linux-2.6-xen-sparse/arch/ia64/kernel/irq_ia64.c
--- a/linux-2.6-xen-sparse/arch/ia64/kernel/irq_ia64.c  Thu Jun 08 10:15:09 
2006 -0600
+++ b/linux-2.6-xen-sparse/arch/ia64/kernel/irq_ia64.c  Thu Jun 08 10:17:22 
2006 -0600
@@ -66,11 +66,13 @@ assign_irq_vector (int irq)
 assign_irq_vector (int irq)
 {
        int pos, vector;
-#ifdef CONFIG_XEN
-       extern int xen_assign_irq_vector(int);
-       if (is_running_on_xen())
+
+#ifdef CONFIG_XEN
+       if (is_running_on_xen()) {
+               extern int xen_assign_irq_vector(int);
                return xen_assign_irq_vector(irq);
-#endif /* CONFIG_XEN */
+       }
+#endif
  again:
        pos = find_first_zero_bit(ia64_vector_mask, IA64_NUM_DEVICE_VECTORS);
        vector = IA64_FIRST_DEVICE_VECTOR + pos;
diff -r 64b118cddb9a -r d8d2b5c08245 
linux-2.6-xen-sparse/arch/ia64/kernel/setup.c
--- a/linux-2.6-xen-sparse/arch/ia64/kernel/setup.c     Thu Jun 08 10:15:09 
2006 -0600
+++ b/linux-2.6-xen-sparse/arch/ia64/kernel/setup.c     Thu Jun 08 10:17:22 
2006 -0600
@@ -416,6 +416,7 @@ setup_arch (char **cmdline_p)
 setup_arch (char **cmdline_p)
 {
        unw_init();
+
 #ifdef CONFIG_XEN
        if (is_running_on_xen())
                setup_xen_features();
@@ -933,6 +934,7 @@ cpu_init (void)
        /* size of physical stacked register partition plus 8 bytes: */
        __get_cpu_var(ia64_phys_stacked_size_p8) = num_phys_stacked*8 + 8;
        platform_cpu_init();
+
 #ifdef CONFIG_XEN
        /* Need to be moved into platform_cpu_init later */
        if (is_running_on_xen()) {
@@ -940,6 +942,7 @@ cpu_init (void)
                xen_smp_intr_init();
        }
 #endif
+
        pm_idle = default_idle;
 }
 
diff -r 64b118cddb9a -r d8d2b5c08245 
linux-2.6-xen-sparse/arch/ia64/xen/drivers/Makefile
--- a/linux-2.6-xen-sparse/arch/ia64/xen/drivers/Makefile       Thu Jun 08 
10:15:09 2006 -0600
+++ b/linux-2.6-xen-sparse/arch/ia64/xen/drivers/Makefile       Thu Jun 08 
10:17:22 2006 -0600
@@ -17,6 +17,5 @@ obj-$(CONFIG_XEN_BLKDEV_FRONTEND)     += blk
 obj-$(CONFIG_XEN_BLKDEV_FRONTEND)      += blkfront/
 obj-$(CONFIG_XEN_NETDEV_FRONTEND)      += netfront/
 obj-$(CONFIG_XEN_BLKDEV_TAP)           += blktap/
-obj-$(CONFIG_XEN_TPMDEV_FRONTEND)      += tpmfront/
 obj-$(CONFIG_XEN_PCIDEV_BACKEND)       += pciback/
 obj-$(CONFIG_XEN_PCIDEV_FRONTEND)      += pcifront/
diff -r 64b118cddb9a -r d8d2b5c08245 
linux-2.6-xen-sparse/include/asm-ia64/dma-mapping.h
--- a/linux-2.6-xen-sparse/include/asm-ia64/dma-mapping.h       Thu Jun 08 
10:15:09 2006 -0600
+++ b/linux-2.6-xen-sparse/include/asm-ia64/dma-mapping.h       Thu Jun 08 
10:17:22 2006 -0600
@@ -8,9 +8,10 @@
 #include <linux/config.h>
 #include <asm/machvec.h>
 #ifdef CONFIG_XEN_IA64_DOM0_VP
-#include <asm/hypervisor.h> //XXX to compile arch/i386/kernel/swiotlb.c
-                            //    and arch/i386/kernel/pci-dma-xen.c
-#include <asm-i386/mach-xen/asm/swiotlb.h> //XXX to compile 
arch/i386/kernel/swiotlb.c
+/* Needed for arch/i386/kernel/swiotlb.c and arch/i386/kernel/pci-dma-xen.c */
+#include <asm/hypervisor.h>
+/* Needed for arch/i386/kernel/swiotlb.c */
+#include <asm-i386/mach-xen/asm/swiotlb.h>
 #endif
 
 #ifndef CONFIG_XEN_IA64_DOM0_VP
@@ -109,7 +110,7 @@ dma_cache_sync (void *vaddr, size_t size
 #define dma_is_consistent(dma_handle)  (1)     /* all we do is coherent 
memory... */
 
 #ifdef CONFIG_XEN_IA64_DOM0_VP
-// arch/i386/kernel/swiotlb.o requires
+/* arch/i386/kernel/swiotlb.o requires */
 void contiguous_bitmap_init(unsigned long end_pfn);
 
 static inline int
diff -r 64b118cddb9a -r d8d2b5c08245 
linux-2.6-xen-sparse/include/asm-ia64/hypervisor.h
--- a/linux-2.6-xen-sparse/include/asm-ia64/hypervisor.h        Thu Jun 08 
10:15:09 2006 -0600
+++ b/linux-2.6-xen-sparse/include/asm-ia64/hypervisor.h        Thu Jun 08 
10:17:22 2006 -0600
@@ -33,6 +33,15 @@
 #ifndef __HYPERVISOR_H__
 #define __HYPERVISOR_H__
 
+#ifndef CONFIG_XEN
+#define is_running_on_xen()                    (0)
+#define HYPERVISOR_ioremap(offset, size)       (offset)
+#else
+extern int running_on_xen;
+#define is_running_on_xen()                    (running_on_xen)
+#endif
+
+#ifdef CONFIG_XEN
 #include <linux/config.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
@@ -46,7 +55,6 @@
 #include <asm/hypercall.h>
 #include <asm/ptrace.h>
 #include <asm/page.h>
-#include <asm/xen/privop.h> // for is_running_on_xen()
 
 extern shared_info_t *HYPERVISOR_shared_info;
 extern start_info_t *xen_start_info;
@@ -192,5 +200,6 @@ asmlinkage int xprintk(const char *fmt, 
 asmlinkage int xprintk(const char *fmt, ...);
 #define xprintd(fmt, ...)      xprintk("%s:%d " fmt, __func__, __LINE__, \
                                        ##__VA_ARGS__)
+#endif /* CONFIG_XEN */
 
 #endif /* __HYPERVISOR_H__ */
diff -r 64b118cddb9a -r d8d2b5c08245 linux-2.6-xen-sparse/include/asm-ia64/io.h
--- a/linux-2.6-xen-sparse/include/asm-ia64/io.h        Thu Jun 08 10:15:09 
2006 -0600
+++ b/linux-2.6-xen-sparse/include/asm-ia64/io.h        Thu Jun 08 10:17:22 
2006 -0600
@@ -66,15 +66,13 @@ extern unsigned int num_io_spaces;
 #define PIO_RESERVED           __IA64_UNCACHED_OFFSET
 #define HAVE_ARCH_PIO_SIZE
 
+#include <asm/hypervisor.h>
 #include <asm/intrinsics.h>
 #include <asm/machvec.h>
 #include <asm/page.h>
+#include <asm/privop.h>
 #include <asm/system.h>
 #include <asm-generic/iomap.h>
-#ifdef CONFIG_XEN
-#include <asm/privop.h>
-#include <asm/hypervisor.h>
-#endif
 
 /*
  * Change virtual addresses to physical addresses and vv.
@@ -115,11 +113,13 @@ extern int valid_mmap_phys_addr_range (u
 
 #define page_to_pseudophys(page) \
        ((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT)
-// XXX
-// the following drivers are broken because they use page_to_phys() to
-// get bus address. fix them.
-// drivers/ide/cris/ide-cris.c
-// drivers/scsi/dec_esp.c
+
+/*
+ * Drivers that use page_to_phys() for bus addresses are broken.
+ * This includes:
+ * drivers/ide/cris/ide-cris.c
+ * drivers/scsi/dec_esp.c
+ */
 #define page_to_phys(page)     (page_to_pseudophys(page))
 #define bvec_to_bus(bv)                (page_to_bus((bv)->bv_page) + \
                                (unsigned long) (bv)->bv_offset)
@@ -459,9 +459,7 @@ static inline void __iomem *
 static inline void __iomem *
 ioremap (unsigned long offset, unsigned long size)
 {
-#ifdef CONFIG_XEN
        offset = HYPERVISOR_ioremap(offset, size);
-#endif
        return (void __iomem *) (__IA64_UNCACHED_OFFSET | (offset));
 }
 
diff -r 64b118cddb9a -r d8d2b5c08245 
linux-2.6-xen-sparse/include/asm-ia64/page.h
--- a/linux-2.6-xen-sparse/include/asm-ia64/page.h      Thu Jun 08 10:15:09 
2006 -0600
+++ b/linux-2.6-xen-sparse/include/asm-ia64/page.h      Thu Jun 08 10:17:22 
2006 -0600
@@ -237,10 +237,12 @@ get_order (unsigned long size)
 #include <xen/features.h>      // to compile netback, netfront
 typedef unsigned long maddr_t; // to compile netback, netfront
 
-// XXX hack!
-//     Linux/IA64 uses PG_arch_1.
-//     This hack will be removed once PG_foreign bit is taken.
-//#include <xen/foreign_page.h>
+/*
+ * XXX hack!
+ * Linux/IA64 uses PG_arch_1.
+ * This hack will be removed once PG_foreign bit is taken.
+ * #include <xen/foreign_page.h>
+ */
 #ifdef __ASM_XEN_FOREIGN_PAGE_H__
 # error "don't include include/xen/foreign_page.h!"
 #endif
@@ -272,7 +274,7 @@ extern struct address_space xen_ia64_for
 })
 #define HAVE_ARCH_FREE_PAGE
 
-//XXX xen page size != page size
+/* XXX xen page size != page size */
 
 static inline unsigned long
 pfn_to_mfn_for_dma(unsigned long pfn)
@@ -316,7 +318,7 @@ machine_to_phys_for_dma(unsigned long ma
 #define set_phys_to_machine(pfn, mfn) do { } while (0)
 #define xen_machphys_update(mfn, pfn) do { } while (0)
 
-//XXX to compile set_phys_to_machine(vaddr, FOREIGN_FRAME(m))
+/* XXX to compile set_phys_to_machine(vaddr, FOREIGN_FRAME(m)) */
 #define FOREIGN_FRAME(m)        (INVALID_P2M_ENTRY)
 
 #define mfn_to_pfn(mfn)                        (mfn)
diff -r 64b118cddb9a -r d8d2b5c08245 
linux-2.6-xen-sparse/include/asm-ia64/privop.h
--- a/linux-2.6-xen-sparse/include/asm-ia64/privop.h    Thu Jun 08 10:15:09 
2006 -0600
+++ b/linux-2.6-xen-sparse/include/asm-ia64/privop.h    Thu Jun 08 10:17:22 
2006 -0600
@@ -7,7 +7,6 @@
  *
  */
 
-#include <linux/config.h>
 #ifdef CONFIG_XEN
 #include <asm/xen/privop.h>
 #endif
diff -r 64b118cddb9a -r d8d2b5c08245 
linux-2.6-xen-sparse/include/asm-ia64/xen/privop.h
--- a/linux-2.6-xen-sparse/include/asm-ia64/xen/privop.h        Thu Jun 08 
10:15:09 2006 -0600
+++ b/linux-2.6-xen-sparse/include/asm-ia64/xen/privop.h        Thu Jun 08 
10:17:22 2006 -0600
@@ -44,9 +44,6 @@
 #endif
 
 #ifndef __ASSEMBLY__
-extern int running_on_xen;
-#define is_running_on_xen() running_on_xen
-
 #define        XEN_HYPER_SSM_I         asm("break %0" : : "i" 
(HYPERPRIVOP_SSM_I))
 #define        XEN_HYPER_GET_IVR       asm("break %0" : : "i" 
(HYPERPRIVOP_GET_IVR))
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
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®.