direct-io.hg

changeset 10385:d8d2b5c08245

[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@hp.com>
author awilliam@xenbuild.aw
date Thu Jun 08 10:17:22 2006 -0600 (2006-06-08)
parents 64b118cddb9a
children b20733e82ab6
files linux-2.6-xen-sparse/arch/ia64/Kconfig linux-2.6-xen-sparse/arch/ia64/kernel/iosapic.c linux-2.6-xen-sparse/arch/ia64/kernel/irq_ia64.c linux-2.6-xen-sparse/arch/ia64/kernel/setup.c linux-2.6-xen-sparse/arch/ia64/xen/drivers/Makefile linux-2.6-xen-sparse/include/asm-ia64/dma-mapping.h linux-2.6-xen-sparse/include/asm-ia64/hypervisor.h linux-2.6-xen-sparse/include/asm-ia64/io.h linux-2.6-xen-sparse/include/asm-ia64/page.h linux-2.6-xen-sparse/include/asm-ia64/privop.h linux-2.6-xen-sparse/include/asm-ia64/xen/privop.h
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/ia64/Kconfig	Thu Jun 08 10:15:09 2006 -0600
     1.2 +++ b/linux-2.6-xen-sparse/arch/ia64/Kconfig	Thu Jun 08 10:17:22 2006 -0600
     1.3 @@ -57,13 +57,6 @@ config XEN
     1.4  	  Enable Xen hypervisor support.  Resulting kernel runs
     1.5  	  both as a guest OS on Xen and natively on hardware.
     1.6  
     1.7 -config ARCH_XEN
     1.8 -	bool
     1.9 -	default y
    1.10 -	depends on XEN
    1.11 -	help
    1.12 -	  TEMP ONLY. Needs to be on for drivers/xen to build.
    1.13 -
    1.14  config XEN_IA64_DOM0_VP
    1.15  	bool "dom0 vp model"
    1.16  	depends on XEN
     2.1 --- a/linux-2.6-xen-sparse/arch/ia64/kernel/iosapic.c	Thu Jun 08 10:15:09 2006 -0600
     2.2 +++ b/linux-2.6-xen-sparse/arch/ia64/kernel/iosapic.c	Thu Jun 08 10:17:22 2006 -0600
     2.3 @@ -670,10 +670,8 @@ register_intr (unsigned int gsi, int vec
     2.4  	iosapic_intr_info[vector].dmode    = delivery;
     2.5  	iosapic_intr_info[vector].trigger  = trigger;
     2.6  
     2.7 -#ifdef CONFIG_XEN
     2.8  	if (is_running_on_xen())
     2.9  		return 0;
    2.10 -#endif
    2.11  
    2.12  	if (trigger == IOSAPIC_EDGE)
    2.13  		irq_type = &irq_type_iosapic_edge;
    2.14 @@ -1017,10 +1015,9 @@ iosapic_system_init (int system_pcat_com
    2.15  	}
    2.16  
    2.17  	pcat_compat = system_pcat_compat;
    2.18 -#ifdef CONFIG_XEN
    2.19  	if (is_running_on_xen())
    2.20  		return;
    2.21 -#endif
    2.22 +
    2.23  	if (pcat_compat) {
    2.24  		/*
    2.25  		 * Disable the compatibility mode interrupts (8259 style), needs IN/OUT support
     3.1 --- a/linux-2.6-xen-sparse/arch/ia64/kernel/irq_ia64.c	Thu Jun 08 10:15:09 2006 -0600
     3.2 +++ b/linux-2.6-xen-sparse/arch/ia64/kernel/irq_ia64.c	Thu Jun 08 10:17:22 2006 -0600
     3.3 @@ -66,11 +66,13 @@ int
     3.4  assign_irq_vector (int irq)
     3.5  {
     3.6  	int pos, vector;
     3.7 +
     3.8  #ifdef CONFIG_XEN
     3.9 -	extern int xen_assign_irq_vector(int);
    3.10 -	if (is_running_on_xen())
    3.11 +	if (is_running_on_xen()) {
    3.12 +		extern int xen_assign_irq_vector(int);
    3.13  		return xen_assign_irq_vector(irq);
    3.14 -#endif /* CONFIG_XEN */
    3.15 +	}
    3.16 +#endif
    3.17   again:
    3.18  	pos = find_first_zero_bit(ia64_vector_mask, IA64_NUM_DEVICE_VECTORS);
    3.19  	vector = IA64_FIRST_DEVICE_VECTOR + pos;
     4.1 --- a/linux-2.6-xen-sparse/arch/ia64/kernel/setup.c	Thu Jun 08 10:15:09 2006 -0600
     4.2 +++ b/linux-2.6-xen-sparse/arch/ia64/kernel/setup.c	Thu Jun 08 10:17:22 2006 -0600
     4.3 @@ -416,6 +416,7 @@ void __init
     4.4  setup_arch (char **cmdline_p)
     4.5  {
     4.6  	unw_init();
     4.7 +
     4.8  #ifdef CONFIG_XEN
     4.9  	if (is_running_on_xen())
    4.10  		setup_xen_features();
    4.11 @@ -933,6 +934,7 @@ cpu_init (void)
    4.12  	/* size of physical stacked register partition plus 8 bytes: */
    4.13  	__get_cpu_var(ia64_phys_stacked_size_p8) = num_phys_stacked*8 + 8;
    4.14  	platform_cpu_init();
    4.15 +
    4.16  #ifdef CONFIG_XEN
    4.17  	/* Need to be moved into platform_cpu_init later */
    4.18  	if (is_running_on_xen()) {
    4.19 @@ -940,6 +942,7 @@ cpu_init (void)
    4.20  		xen_smp_intr_init();
    4.21  	}
    4.22  #endif
    4.23 +
    4.24  	pm_idle = default_idle;
    4.25  }
    4.26  
     5.1 --- a/linux-2.6-xen-sparse/arch/ia64/xen/drivers/Makefile	Thu Jun 08 10:15:09 2006 -0600
     5.2 +++ b/linux-2.6-xen-sparse/arch/ia64/xen/drivers/Makefile	Thu Jun 08 10:17:22 2006 -0600
     5.3 @@ -17,6 +17,5 @@ obj-$(CONFIG_XEN_TPMDEV_BACKEND)	+= tpmb
     5.4  obj-$(CONFIG_XEN_BLKDEV_FRONTEND)	+= blkfront/
     5.5  obj-$(CONFIG_XEN_NETDEV_FRONTEND)	+= netfront/
     5.6  obj-$(CONFIG_XEN_BLKDEV_TAP)		+= blktap/
     5.7 -obj-$(CONFIG_XEN_TPMDEV_FRONTEND)	+= tpmfront/
     5.8  obj-$(CONFIG_XEN_PCIDEV_BACKEND)	+= pciback/
     5.9  obj-$(CONFIG_XEN_PCIDEV_FRONTEND)	+= pcifront/
     6.1 --- a/linux-2.6-xen-sparse/include/asm-ia64/dma-mapping.h	Thu Jun 08 10:15:09 2006 -0600
     6.2 +++ b/linux-2.6-xen-sparse/include/asm-ia64/dma-mapping.h	Thu Jun 08 10:17:22 2006 -0600
     6.3 @@ -8,9 +8,10 @@
     6.4  #include <linux/config.h>
     6.5  #include <asm/machvec.h>
     6.6  #ifdef CONFIG_XEN_IA64_DOM0_VP
     6.7 -#include <asm/hypervisor.h> //XXX to compile arch/i386/kernel/swiotlb.c
     6.8 -                            //    and arch/i386/kernel/pci-dma-xen.c
     6.9 -#include <asm-i386/mach-xen/asm/swiotlb.h> //XXX to compile arch/i386/kernel/swiotlb.c
    6.10 +/* Needed for arch/i386/kernel/swiotlb.c and arch/i386/kernel/pci-dma-xen.c */
    6.11 +#include <asm/hypervisor.h>
    6.12 +/* Needed for arch/i386/kernel/swiotlb.c */
    6.13 +#include <asm-i386/mach-xen/asm/swiotlb.h>
    6.14  #endif
    6.15  
    6.16  #ifndef CONFIG_XEN_IA64_DOM0_VP
    6.17 @@ -109,7 +110,7 @@ dma_cache_sync (void *vaddr, size_t size
    6.18  #define dma_is_consistent(dma_handle)	(1)	/* all we do is coherent memory... */
    6.19  
    6.20  #ifdef CONFIG_XEN_IA64_DOM0_VP
    6.21 -// arch/i386/kernel/swiotlb.o requires
    6.22 +/* arch/i386/kernel/swiotlb.o requires */
    6.23  void contiguous_bitmap_init(unsigned long end_pfn);
    6.24  
    6.25  static inline int
     7.1 --- a/linux-2.6-xen-sparse/include/asm-ia64/hypervisor.h	Thu Jun 08 10:15:09 2006 -0600
     7.2 +++ b/linux-2.6-xen-sparse/include/asm-ia64/hypervisor.h	Thu Jun 08 10:17:22 2006 -0600
     7.3 @@ -33,6 +33,15 @@
     7.4  #ifndef __HYPERVISOR_H__
     7.5  #define __HYPERVISOR_H__
     7.6  
     7.7 +#ifndef CONFIG_XEN
     7.8 +#define is_running_on_xen()			(0)
     7.9 +#define HYPERVISOR_ioremap(offset, size)	(offset)
    7.10 +#else
    7.11 +extern int running_on_xen;
    7.12 +#define is_running_on_xen()			(running_on_xen)
    7.13 +#endif
    7.14 +
    7.15 +#ifdef CONFIG_XEN
    7.16  #include <linux/config.h>
    7.17  #include <linux/types.h>
    7.18  #include <linux/kernel.h>
    7.19 @@ -46,7 +55,6 @@
    7.20  #include <asm/hypercall.h>
    7.21  #include <asm/ptrace.h>
    7.22  #include <asm/page.h>
    7.23 -#include <asm/xen/privop.h> // for is_running_on_xen()
    7.24  
    7.25  extern shared_info_t *HYPERVISOR_shared_info;
    7.26  extern start_info_t *xen_start_info;
    7.27 @@ -192,5 +200,6 @@ MULTI_update_va_mapping(
    7.28  asmlinkage int xprintk(const char *fmt, ...);
    7.29  #define xprintd(fmt, ...)	xprintk("%s:%d " fmt, __func__, __LINE__, \
    7.30  					##__VA_ARGS__)
    7.31 +#endif /* CONFIG_XEN */
    7.32  
    7.33  #endif /* __HYPERVISOR_H__ */
     8.1 --- a/linux-2.6-xen-sparse/include/asm-ia64/io.h	Thu Jun 08 10:15:09 2006 -0600
     8.2 +++ b/linux-2.6-xen-sparse/include/asm-ia64/io.h	Thu Jun 08 10:17:22 2006 -0600
     8.3 @@ -66,15 +66,13 @@ extern unsigned int num_io_spaces;
     8.4  #define PIO_RESERVED		__IA64_UNCACHED_OFFSET
     8.5  #define HAVE_ARCH_PIO_SIZE
     8.6  
     8.7 +#include <asm/hypervisor.h>
     8.8  #include <asm/intrinsics.h>
     8.9  #include <asm/machvec.h>
    8.10  #include <asm/page.h>
    8.11 +#include <asm/privop.h>
    8.12  #include <asm/system.h>
    8.13  #include <asm-generic/iomap.h>
    8.14 -#ifdef CONFIG_XEN
    8.15 -#include <asm/privop.h>
    8.16 -#include <asm/hypervisor.h>
    8.17 -#endif
    8.18  
    8.19  /*
    8.20   * Change virtual addresses to physical addresses and vv.
    8.21 @@ -115,11 +113,13 @@ extern int valid_mmap_phys_addr_range (u
    8.22  
    8.23  #define page_to_pseudophys(page) \
    8.24  	((dma_addr_t)page_to_pfn(page) << PAGE_SHIFT)
    8.25 -// XXX
    8.26 -// the following drivers are broken because they use page_to_phys() to
    8.27 -// get bus address. fix them.
    8.28 -// drivers/ide/cris/ide-cris.c
    8.29 -// drivers/scsi/dec_esp.c
    8.30 +
    8.31 +/*
    8.32 + * Drivers that use page_to_phys() for bus addresses are broken.
    8.33 + * This includes:
    8.34 + * drivers/ide/cris/ide-cris.c
    8.35 + * drivers/scsi/dec_esp.c
    8.36 + */
    8.37  #define page_to_phys(page)	(page_to_pseudophys(page))
    8.38  #define bvec_to_bus(bv)		(page_to_bus((bv)->bv_page) + \
    8.39  				(unsigned long) (bv)->bv_offset)
    8.40 @@ -459,9 +459,7 @@ static inline void
    8.41  static inline void __iomem *
    8.42  ioremap (unsigned long offset, unsigned long size)
    8.43  {
    8.44 -#ifdef CONFIG_XEN
    8.45  	offset = HYPERVISOR_ioremap(offset, size);
    8.46 -#endif
    8.47  	return (void __iomem *) (__IA64_UNCACHED_OFFSET | (offset));
    8.48  }
    8.49  
     9.1 --- a/linux-2.6-xen-sparse/include/asm-ia64/page.h	Thu Jun 08 10:15:09 2006 -0600
     9.2 +++ b/linux-2.6-xen-sparse/include/asm-ia64/page.h	Thu Jun 08 10:17:22 2006 -0600
     9.3 @@ -237,10 +237,12 @@ get_order (unsigned long size)
     9.4  #include <xen/features.h>	// to compile netback, netfront
     9.5  typedef unsigned long maddr_t;	// to compile netback, netfront
     9.6  
     9.7 -// XXX hack!
     9.8 -//     Linux/IA64 uses PG_arch_1.
     9.9 -//     This hack will be removed once PG_foreign bit is taken.
    9.10 -//#include <xen/foreign_page.h>
    9.11 +/*
    9.12 + * XXX hack!
    9.13 + * Linux/IA64 uses PG_arch_1.
    9.14 + * This hack will be removed once PG_foreign bit is taken.
    9.15 + * #include <xen/foreign_page.h>
    9.16 + */
    9.17  #ifdef __ASM_XEN_FOREIGN_PAGE_H__
    9.18  # error "don't include include/xen/foreign_page.h!"
    9.19  #endif
    9.20 @@ -272,7 +274,7 @@ extern struct address_space xen_ia64_for
    9.21  })
    9.22  #define HAVE_ARCH_FREE_PAGE
    9.23  
    9.24 -//XXX xen page size != page size
    9.25 +/* XXX xen page size != page size */
    9.26  
    9.27  static inline unsigned long
    9.28  pfn_to_mfn_for_dma(unsigned long pfn)
    9.29 @@ -316,7 +318,7 @@ machine_to_phys_for_dma(unsigned long ma
    9.30  #define set_phys_to_machine(pfn, mfn) do { } while (0)
    9.31  #define xen_machphys_update(mfn, pfn) do { } while (0)
    9.32  
    9.33 -//XXX to compile set_phys_to_machine(vaddr, FOREIGN_FRAME(m))
    9.34 +/* XXX to compile set_phys_to_machine(vaddr, FOREIGN_FRAME(m)) */
    9.35  #define FOREIGN_FRAME(m)        (INVALID_P2M_ENTRY)
    9.36  
    9.37  #define mfn_to_pfn(mfn)			(mfn)
    10.1 --- a/linux-2.6-xen-sparse/include/asm-ia64/privop.h	Thu Jun 08 10:15:09 2006 -0600
    10.2 +++ b/linux-2.6-xen-sparse/include/asm-ia64/privop.h	Thu Jun 08 10:17:22 2006 -0600
    10.3 @@ -7,7 +7,6 @@
    10.4   *
    10.5   */
    10.6  
    10.7 -#include <linux/config.h>
    10.8  #ifdef CONFIG_XEN
    10.9  #include <asm/xen/privop.h>
   10.10  #endif
    11.1 --- a/linux-2.6-xen-sparse/include/asm-ia64/xen/privop.h	Thu Jun 08 10:15:09 2006 -0600
    11.2 +++ b/linux-2.6-xen-sparse/include/asm-ia64/xen/privop.h	Thu Jun 08 10:17:22 2006 -0600
    11.3 @@ -44,9 +44,6 @@
    11.4  #endif
    11.5  
    11.6  #ifndef __ASSEMBLY__
    11.7 -extern int running_on_xen;
    11.8 -#define is_running_on_xen() running_on_xen
    11.9 -
   11.10  #define	XEN_HYPER_SSM_I		asm("break %0" : : "i" (HYPERPRIVOP_SSM_I))
   11.11  #define	XEN_HYPER_GET_IVR	asm("break %0" : : "i" (HYPERPRIVOP_GET_IVR))
   11.12