diff options
Diffstat (limited to 'arch')
59 files changed, 258 insertions, 270 deletions
diff --git a/arch/blackfin/kernel/dma-mapping.c b/arch/blackfin/kernel/dma-mapping.c index a16cb03..d6b61d5 100644 --- a/arch/blackfin/kernel/dma-mapping.c +++ b/arch/blackfin/kernel/dma-mapping.c @@ -35,6 +35,7 @@ #include <linux/device.h> #include <linux/dma-mapping.h> #include <linux/io.h> +#include <linux/scatterlist.h> #include <asm/cacheflush.h> #include <asm/bfin-global.h> diff --git a/arch/frv/mb93090-mb00/pci-dma.c b/arch/frv/mb93090-mb00/pci-dma.c index 671ce1e..662f7b1 100644 --- a/arch/frv/mb93090-mb00/pci-dma.c +++ b/arch/frv/mb93090-mb00/pci-dma.c @@ -15,6 +15,7 @@ #include <linux/list.h> #include <linux/pci.h> #include <linux/highmem.h> +#include <linux/scatterlist.h> #include <asm/io.h> void *dma_alloc_coherent(struct device *hwdev, size_t size, dma_addr_t *dma_handle, gfp_t gfp) @@ -86,7 +87,7 @@ int dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, dampr2 = __get_DAMPR(2); for (i = 0; i < nents; i++) { - vaddr = kmap_atomic(sg[i].page, __KM_CACHE); + vaddr = kmap_atomic(sg_page(&sg[i]), __KM_CACHE); frv_dcache_writeback((unsigned long) vaddr, (unsigned long) vaddr + PAGE_SIZE); diff --git a/arch/i386/.gitignore b/arch/i386/.gitignore deleted file mode 100644 index 36ef4c3..0000000 --- a/arch/i386/.gitignore +++ /dev/null @@ -1 +0,0 @@ -boot diff --git a/arch/m68k/kernel/dma.c b/arch/m68k/kernel/dma.c index ef490e1..6f8c080 100644 --- a/arch/m68k/kernel/dma.c +++ b/arch/m68k/kernel/dma.c @@ -9,10 +9,10 @@ #include <linux/dma-mapping.h> #include <linux/device.h> #include <linux/kernel.h> +#include <linux/scatterlist.h> #include <linux/vmalloc.h> #include <asm/pgalloc.h> -#include <asm/scatterlist.h> void *dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *handle, gfp_t flag) diff --git a/arch/sparc/kernel/pcic.c b/arch/sparc/kernel/pcic.c index f2eae45..f2d432e 100644 --- a/arch/sparc/kernel/pcic.c +++ b/arch/sparc/kernel/pcic.c @@ -753,7 +753,7 @@ void __init pci_time_init(void) local_irq_enable(); } -static __inline__ unsigned long do_gettimeoffset(void) +static inline unsigned long do_gettimeoffset(void) { /* * We divide all by 100 diff --git a/arch/sparc/kernel/process.c b/arch/sparc/kernel/process.c index 33f7a3d..77460e3 100644 --- a/arch/sparc/kernel/process.c +++ b/arch/sparc/kernel/process.c @@ -1,7 +1,6 @@ -/* $Id: process.c,v 1.161 2002/01/23 11:27:32 davem Exp $ - * linux/arch/sparc/kernel/process.c +/* linux/arch/sparc/kernel/process.c * - * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) + * Copyright (C) 1995 David S. Miller (davem@davemloft.net) * Copyright (C) 1996 Eddie C. Dost (ecd@skynet.be) */ @@ -397,7 +396,7 @@ void flush_thread(void) } } -static __inline__ struct sparc_stackf __user * +static inline struct sparc_stackf __user * clone_stackframe(struct sparc_stackf __user *dst, struct sparc_stackf __user *src) { diff --git a/arch/sparc/kernel/time.c b/arch/sparc/kernel/time.c index 4bf78a5..45cb7c5 100644 --- a/arch/sparc/kernel/time.c +++ b/arch/sparc/kernel/time.c @@ -1,7 +1,6 @@ -/* $Id: time.c,v 1.60 2002/01/23 14:33:55 davem Exp $ - * linux/arch/sparc/kernel/time.c +/* linux/arch/sparc/kernel/time.c * - * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) + * Copyright (C) 1995 David S. Miller (davem@davemloft.net) * Copyright (C) 1996 Thomas K. Dyas (tdyas@eden.rutgers.edu) * * Chris Davis (cdavis@cois.on.ca) 03/27/1998 @@ -210,7 +209,7 @@ static void __devinit kick_start_clock(void) } /* Return nonzero if the clock chip battery is low. */ -static __inline__ int has_low_battery(void) +static inline int has_low_battery(void) { struct mostek48t02 *regs = (struct mostek48t02 *)mstk48t02_regs; unsigned char data1, data2; @@ -252,7 +251,7 @@ static void __devinit mostek_set_system_time(void) } /* Probe for the real time clock chip on Sun4 */ -static __inline__ void sun4_clock_probe(void) +static inline void sun4_clock_probe(void) { #ifdef CONFIG_SUN4 int temp; diff --git a/arch/sparc/mm/btfixup.c b/arch/sparc/mm/btfixup.c index ec4231c..a312d12 100644 --- a/arch/sparc/mm/btfixup.c +++ b/arch/sparc/mm/btfixup.c @@ -1,5 +1,4 @@ -/* $Id: btfixup.c,v 1.10 2000/05/09 17:40:13 davem Exp $ - * btfixup.c: Boot time code fixup and relocator, so that +/* btfixup.c: Boot time code fixup and relocator, so that * we can get rid of most indirect calls to achieve single * image sun4c and srmmu kernel. * @@ -69,7 +68,7 @@ static void __init set_addr(unsigned int *addr, unsigned int q1, int fmangled, u } } #else -static __inline__ void set_addr(unsigned int *addr, unsigned int q1, int fmangled, unsigned int value) +static inline void set_addr(unsigned int *addr, unsigned int q1, int fmangled, unsigned int value) { *addr = value; } diff --git a/arch/sparc/mm/io-unit.c b/arch/sparc/mm/io-unit.c index 1666087..b86dfce 100644 --- a/arch/sparc/mm/io-unit.c +++ b/arch/sparc/mm/io-unit.c @@ -144,7 +144,7 @@ static void iounit_get_scsi_sgl(struct scatterlist *sg, int sz, struct sbus_bus spin_lock_irqsave(&iounit->lock, flags); while (sz != 0) { --sz; - sg->dvma_address = iounit_get_area(iounit, sg_virt(sg), sg->length); + sg->dvma_address = iounit_get_area(iounit, (unsigned long) sg_virt(sg), sg->length); sg->dvma_length = sg->length; sg = sg_next(sg); } diff --git a/arch/sparc/mm/sun4c.c b/arch/sparc/mm/sun4c.c index a2cc141..0729305 100644 --- a/arch/sparc/mm/sun4c.c +++ b/arch/sparc/mm/sun4c.c @@ -1,7 +1,6 @@ -/* $Id: sun4c.c,v 1.212 2001/12/21 04:56:15 davem Exp $ - * sun4c.c: Doing in software what should be done in hardware. +/* sun4c.c: Doing in software what should be done in hardware. * - * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) + * Copyright (C) 1996 David S. Miller (davem@davemloft.net) * Copyright (C) 1996 Eddie C. Dost (ecd@skynet.be) * Copyright (C) 1996 Andrew Tridgell (Andrew.Tridgell@anu.edu.au) * Copyright (C) 1997-2000 Anton Blanchard (anton@samba.org) @@ -719,7 +718,7 @@ static void add_ring(struct sun4c_mmu_ring *ring, ring->num_entries++; } -static __inline__ void add_lru(struct sun4c_mmu_entry *entry) +static inline void add_lru(struct sun4c_mmu_entry *entry) { struct sun4c_mmu_ring *ring = &sun4c_ulru_ring; struct sun4c_mmu_entry *head = &ring->ringhd; @@ -746,7 +745,7 @@ static void add_ring_ordered(struct sun4c_mmu_ring *ring, add_lru(entry); } -static __inline__ void remove_ring(struct sun4c_mmu_ring *ring, +static inline void remove_ring(struct sun4c_mmu_ring *ring, struct sun4c_mmu_entry *entry) { struct sun4c_mmu_entry *next = entry->next; @@ -1836,7 +1835,7 @@ static unsigned long sun4c_pte_to_pgoff(pte_t pte) } -static __inline__ unsigned long sun4c_pmd_page_v(pmd_t pmd) +static inline unsigned long sun4c_pmd_page_v(pmd_t pmd) { return (pmd_val(pmd) & PAGE_MASK); } @@ -1922,7 +1921,7 @@ static void sun4c_free_pgd_fast(pgd_t *pgd) } -static __inline__ pte_t * +static inline pte_t * sun4c_pte_alloc_one_fast(struct mm_struct *mm, unsigned long address) { unsigned long *ret; @@ -1956,7 +1955,7 @@ static struct page *sun4c_pte_alloc_one(struct mm_struct *mm, unsigned long addr return virt_to_page(pte); } -static __inline__ void sun4c_free_pte_fast(pte_t *pte) +static inline void sun4c_free_pte_fast(pte_t *pte) { *(unsigned long *)pte = (unsigned long) pte_quicklist; pte_quicklist = (unsigned long *) pte; diff --git a/arch/sparc64/kernel/binfmt_elf32.c b/arch/sparc64/kernel/binfmt_elf32.c index 9ad84ff..1587a29 100644 --- a/arch/sparc64/kernel/binfmt_elf32.c +++ b/arch/sparc64/kernel/binfmt_elf32.c @@ -1,7 +1,7 @@ /* * binfmt_elf32.c: Support 32-bit Sparc ELF binaries on Ultra. * - * Copyright (C) 1995, 1996, 1997, 1998 David S. Miller (davem@redhat.com) + * Copyright (C) 1995, 1996, 1997, 1998 David S. Miller (davem@davemloft.net) * Copyright (C) 1995, 1996, 1997, 1998 Jakub Jelinek (jj@ultra.linux.cz) */ @@ -133,7 +133,7 @@ struct elf_prpsinfo32 #undef cputime_to_timeval #define cputime_to_timeval cputime_to_compat_timeval -static __inline__ void +static inline void cputime_to_compat_timeval(const cputime_t cputime, struct compat_timeval *value) { unsigned long jiffies = cputime_to_jiffies(cputime); diff --git a/arch/sparc64/kernel/central.c b/arch/sparc64/kernel/central.c index 8230099..b61b8df 100644 --- a/arch/sparc64/kernel/central.c +++ b/arch/sparc64/kernel/central.c @@ -1,7 +1,6 @@ -/* $Id: central.c,v 1.15 2001/12/19 00:29:51 davem Exp $ - * central.c: Central FHC driver for Sunfire/Starfire/Wildfire. +/* central.c: Central FHC driver for Sunfire/Starfire/Wildfire. * - * Copyright (C) 1997, 1999 David S. Miller (davem@redhat.com) + * Copyright (C) 1997, 1999 David S. Miller (davem@davemloft.net) */ #include <linux/kernel.h> @@ -385,7 +384,7 @@ void __init central_probe(void) init_all_fhc_hw(); } -static __inline__ void fhc_ledblink(struct linux_fhc *fhc, int on) +static inline void fhc_ledblink(struct linux_fhc *fhc, int on) { u32 tmp; @@ -402,7 +401,7 @@ static __inline__ void fhc_ledblink(struct linux_fhc *fhc, int on) upa_readl(fhc->fhc_regs.pregs + FHC_PREGS_CTRL); } -static __inline__ void central_ledblink(struct linux_central *central, int on) +static inline void central_ledblink(struct linux_central *central, int on) { u8 tmp; diff --git a/arch/sparc64/kernel/iommu_common.c b/arch/sparc64/kernel/iommu_common.c index b70324e..efd5dff 100644 --- a/arch/sparc64/kernel/iommu_common.c +++ b/arch/sparc64/kernel/iommu_common.c @@ -234,7 +234,7 @@ unsigned long prepare_sg(struct scatterlist *sg, int nents) dma_sg->dma_length = dent_len; if (dma_sg != sg) { - dma_sg = next_sg(dma_sg); + dma_sg = sg_next(dma_sg); dma_sg->dma_length = 0; } diff --git a/arch/sparc64/kernel/ldc.c b/arch/sparc64/kernel/ldc.c index c8313cb..217478a 100644 --- a/arch/sparc64/kernel/ldc.c +++ b/arch/sparc64/kernel/ldc.c @@ -2121,7 +2121,7 @@ int ldc_map_sg(struct ldc_channel *lp, state.nc = 0; for (i = 0; i < num_sg; i++) - fill_cookies(&state, page_to_pfn(sg[i].page) << PAGE_SHIFT, + fill_cookies(&state, page_to_pfn(sg_page(&sg[i])) << PAGE_SHIFT, sg[i].offset, sg[i].length); return state.nc; diff --git a/arch/sparc64/kernel/semaphore.c b/arch/sparc64/kernel/semaphore.c index a809e63..9974a68 100644 --- a/arch/sparc64/kernel/semaphore.c +++ b/arch/sparc64/kernel/semaphore.c @@ -1,5 +1,4 @@ -/* $Id: semaphore.c,v 1.9 2001/11/18 00:12:56 davem Exp $ - * semaphore.c: Sparc64 semaphore implementation. +/* semaphore.c: Sparc64 semaphore implementation. * * This is basically the PPC semaphore scheme ported to use * the sparc64 atomic instructions, so see the PPC code for @@ -19,7 +18,7 @@ * sem->count = tmp; * return old_count; */ -static __inline__ int __sem_update_count(struct semaphore *sem, int incr) +static inline int __sem_update_count(struct semaphore *sem, int incr) { int old_count, tmp; diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c index 407d74a..7cd8d94 100644 --- a/arch/sparc64/kernel/smp.c +++ b/arch/sparc64/kernel/smp.c @@ -459,7 +459,7 @@ again: } } -static __inline__ void spitfire_xcall_deliver(u64 data0, u64 data1, u64 data2, cpumask_t mask) +static inline void spitfire_xcall_deliver(u64 data0, u64 data1, u64 data2, cpumask_t mask) { u64 pstate; int i; @@ -906,7 +906,7 @@ extern atomic_t dcpage_flushes; extern atomic_t dcpage_flushes_xcall; #endif -static __inline__ void __local_flush_dcache_page(struct page *page) +static inline void __local_flush_dcache_page(struct page *page) { #ifdef DCACHE_ALIASING_POSSIBLE __flush_dcache_page(page_address(page), diff --git a/arch/sparc64/kernel/sys_sparc.c b/arch/sparc64/kernel/sys_sparc.c index 560cb1e..c56573a 100644 --- a/arch/sparc64/kernel/sys_sparc.c +++ b/arch/sparc64/kernel/sys_sparc.c @@ -318,7 +318,7 @@ unsigned long get_fb_unmapped_area(struct file *filp, unsigned long orig_addr, u if (flags & MAP_FIXED) { /* Ok, don't mess with it. */ - return get_unmapped_area(NULL, addr, len, pgoff, flags); + return get_unmapped_area(NULL, orig_addr, len, pgoff, flags); } flags &= ~MAP_SHARED; diff --git a/arch/sparc64/kernel/traps.c b/arch/sparc64/kernel/traps.c index e9c7e4f..0499838 100644 --- a/arch/sparc64/kernel/traps.c +++ b/arch/sparc64/kernel/traps.c @@ -1,7 +1,6 @@ -/* $Id: traps.c,v 1.85 2002/02/09 19:49:31 davem Exp $ - * arch/sparc64/kernel/traps.c +/* arch/sparc64/kernel/traps.c * - * Copyright (C) 1995,1997 David S. Miller (davem@caip.rutgers.edu) + * Copyright (C) 1995,1997 David S. Miller (davem@davemloft.net) * Copyright (C) 1997,1999,2000 Jakub Jelinek (jakub@redhat.com) */ @@ -765,7 +764,7 @@ static unsigned long cheetah_afsr_errors; */ struct cheetah_err_info *cheetah_error_log; -static __inline__ struct cheetah_err_info *cheetah_get_error_log(unsigned long afsr) +static inline struct cheetah_err_info *cheetah_get_error_log(unsigned long afsr) { struct cheetah_err_info *p; int cpu = smp_processor_id(); @@ -1085,7 +1084,7 @@ static unsigned char cheetah_mtag_syntab[] = { }; /* Return the highest priority error conditon mentioned. */ -static __inline__ unsigned long cheetah_get_hipri(unsigned long afsr) +static inline unsigned long cheetah_get_hipri(unsigned long afsr) { unsigned long tmp = 0; int i; diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c index 100c445..e18ccf8 100644 --- a/arch/sparc64/mm/init.c +++ b/arch/sparc64/mm/init.c @@ -201,7 +201,7 @@ inline void flush_dcache_page_impl(struct page *page) #define dcache_dirty_cpu(page) \ (((page)->flags >> PG_dcache_cpu_shift) & PG_dcache_cpu_mask) -static __inline__ void set_dcache_dirty(struct page *page, int this_cpu) +static inline void set_dcache_dirty(struct page *page, int this_cpu) { unsigned long mask = this_cpu; unsigned long non_cpu_bits; @@ -223,7 +223,7 @@ static __inline__ void set_dcache_dirty(struct page *page, int this_cpu) : "g1", "g7"); } -static __inline__ void clear_dcache_dirty_cpu(struct page *page, unsigned long cpu) +static inline void clear_dcache_dirty_cpu(struct page *page, unsigned long cpu) { unsigned long mask = (1UL << PG_dcache_dirty); diff --git a/arch/sparc64/prom/console.c b/arch/sparc64/prom/console.c index 3fafa9a..e1c3fc8 100644 --- a/arch/sparc64/prom/console.c +++ b/arch/sparc64/prom/console.c @@ -1,8 +1,7 @@ -/* $Id: console.c,v 1.9 1997/10/29 07:41:43 ecd Exp $ - * console.c: Routines that deal with sending and receiving IO +/* console.c: Routines that deal with sending and receiving IO * to/from the current console device using the PROM. * - * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) + * Copyright (C) 1995 David S. Miller (davem@davemloft.net) * Copyright (C) 1996,1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) */ @@ -19,7 +18,7 @@ extern int prom_stdin, prom_stdout; /* Non blocking get character from console input device, returns -1 * if no input was taken. This can be used for polling. */ -__inline__ int +inline int prom_nbgetchar(void) { char inc; @@ -35,7 +34,7 @@ prom_nbgetchar(void) /* Non blocking put character to console device, returns -1 if * unsuccessful. */ -__inline__ int +inline int prom_nbputchar(char c) { char outc; diff --git a/arch/sparc64/prom/tree.c b/arch/sparc64/prom/tree.c index b2c5b12..a99ccd7 100644 --- a/arch/sparc64/prom/tree.c +++ b/arch/sparc64/prom/tree.c @@ -18,14 +18,12 @@ /* Return the child of node 'node' or zero if no this node has no * direct descendent. */ -__inline__ int -__prom_getchild(int node) +inline int __prom_getchild(int node) { return p1275_cmd ("child", P1275_INOUT(1, 1), node); } -__inline__ int -prom_getchild(int node) +inline int prom_getchild(int node) { int cnode; @@ -35,8 +33,7 @@ prom_getchild(int node) return (int)cnode; } -__inline__ int -prom_getparent(int node) +inline int prom_getparent(int node) { int cnode; @@ -49,14 +46,12 @@ prom_getparent(int node) /* Return the next sibling of node 'node' or zero if no more siblings * at this level of depth in the tree. */ -__inline__ int -__prom_getsibling(int node) +inline int __prom_getsibling(int node) { return p1275_cmd(prom_peer_name, P1275_INOUT(1, 1), node); } -__inline__ int -prom_getsibling(int node) +inline int prom_getsibling(int node) { int sibnode; @@ -72,8 +67,7 @@ prom_getsibling(int node) /* Return the length in bytes of property 'prop' at node 'node'. * Return -1 on error. */ -__inline__ int -prom_getproplen(int node, const char *prop) +inline int prom_getproplen(int node, const char *prop) { if((!node) || (!prop)) return -1; return p1275_cmd ("getproplen", @@ -86,8 +80,8 @@ prom_getproplen(int node, const char *prop) * 'buffer' which has a size of 'bufsize'. If the acquisition * was successful the length will be returned, else -1 is returned. */ -__inline__ int -prom_getproperty(int node, const char *prop, char *buffer, int bufsize) +inline int prom_getproperty(int node, const char *prop, + char *buffer, int bufsize) { int plen; @@ -107,8 +101,7 @@ prom_getproperty(int node, const char *prop, char *buffer, int bufsize) /* Acquire an integer property and return its value. Returns -1 * on failure. */ -__inline__ int -prom_getint(int node, const char *prop) +inline int prom_getint(int node, const char *prop) { int intprop; @@ -122,8 +115,7 @@ prom_getint(int node, const char *prop) * integer. */ -int -prom_getintdefault(int node, const char *property, int deflt) +int prom_getintdefault(int node, const char *property, int deflt) { int retval; @@ -134,8 +126,7 @@ prom_getintdefault(int node, const char *property, int deflt) } /* Acquire a boolean property, 1=TRUE 0=FALSE. */ -int -prom_getbool(int node, const char *prop) +int prom_getbool(int node, const char *prop) { int retval; @@ -148,8 +139,7 @@ prom_getbool(int node, const char *prop) * string on error. The char pointer is the user supplied string * buffer. */ -void -prom_getstring(int node, const char *prop, char *user_buf, int ubuf_size) +void prom_getstring(int node, const char *prop, char *user_buf, int ubuf_size) { int len; @@ -163,8 +153,7 @@ prom_getstring(int node, const char *prop, char *user_buf, int ubuf_size) /* Does the device at node 'node' have name 'name'? * YES = 1 NO = 0 */ -int -prom_nodematch(int node, const char *name) +int prom_nodematch(int node, const char *name) { char namebuf[128]; prom_getproperty(node, "name", namebuf, sizeof(namebuf)); @@ -175,8 +164,7 @@ prom_nodematch(int node, const char *name) /* Search siblings at 'node_start' for a node with name * 'nodename'. Return node if successful, zero if not. */ -int -prom_searchsiblings(int node_start, const char *nodename) +int prom_searchsiblings(int node_start, const char *nodename) { int thisnode, error; @@ -197,8 +185,7 @@ prom_searchsiblings(int node_start, const char *nodename) /* Return the first property type for node 'node'. * buffer should be at least 32B in length */ -__inline__ char * -prom_firstprop(int node, char *buffer) +inline char *prom_firstprop(int node, char *buffer) { *buffer = 0; if(node == -1) return buffer; @@ -212,8 +199,7 @@ prom_firstprop(int node, char *buffer) * at node 'node' . Returns NULL string if no more * property types for this node. */ -__inline__ char * -prom_nextprop(int node, const char *oprop, char *buffer) +inline char *prom_nextprop(int node, const char *oprop, char *buffer) { char buf[32]; @@ -279,8 +265,7 @@ prom_setprop(int node, const char *pname, char *value, int size) node, pname, value, P1275_SIZE(size)); } -__inline__ int -prom_inst2pkg(int inst) +inline int prom_inst2pkg(int inst) { int node; diff --git a/arch/um/Kconfig.i386 b/arch/um/Kconfig.i386 index 9876d80..e0ac74e 100644 --- a/arch/um/Kconfig.i386 +++ b/arch/um/Kconfig.i386 @@ -1,6 +1,6 @@ menu "Host processor type and features" -source "arch/i386/Kconfig.cpu" +source "arch/x86/Kconfig.cpu" endmenu diff --git a/arch/um/Makefile-i386 b/arch/um/Makefile-i386 index 0178df3..b01dfb0 100644 --- a/arch/um/Makefile-i386 +++ b/arch/um/Makefile-i386 @@ -9,6 +9,7 @@ ELF_ARCH := $(SUBARCH) ELF_FORMAT := elf32-$(SUBARCH) OBJCOPYFLAGS := -O binary -R .note -R .comment -S HEADER_ARCH := x86 +CHECKFLAGS += -D__i386__ ifeq ("$(origin SUBARCH)", "command line") ifneq ("$(shell uname -m | sed -e s/i.86/i386/)", "$(SUBARCH)") @@ -26,10 +27,8 @@ AFLAGS += -DCONFIG_X86_32 CONFIG_X86_32 := y export CONFIG_X86_32 -ARCH_KERNEL_DEFINES += -U__$(SUBARCH)__ -U$(SUBARCH) - # First of all, tune CFLAGS for the specific CPU. This actually sets cflags-y. -include $(srctree)/arch/i386/Makefile.cpu +include $(srctree)/arch/x86/Makefile_32.cpu # prevent gcc from keeping the stack 16 byte aligned. Taken from i386. cflags-y += $(call cc-option,-mpreferred-stack-boundary=2) diff --git a/arch/um/Makefile-x86_64 b/arch/um/Makefile-x86_64 index fe5316f..8ed362f 100644 --- a/arch/um/Makefile-x86_64 +++ b/arch/um/Makefile-x86_64 @@ -6,12 +6,9 @@ START := 0x60000000 _extra_flags_ = -fno-builtin -m64 -#We #undef __x86_64__ for kernelspace, not for userspace where -#it's needed for headers to work! -ARCH_KERNEL_DEFINES = -U__$(SUBARCH)__ KBUILD_CFLAGS += $(_extra_flags_) -CHECKFLAGS += -m64 +CHECKFLAGS += -m64 -D__x86_64__ KBUILD_AFLAGS += -m64 LDFLAGS += -m elf_x86_64 KBUILD_CPPFLAGS += -m64 diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c index 3a8cd3d..e184b44 100644 --- a/arch/um/drivers/ubd_kern.c +++ b/arch/um/drivers/ubd_kern.c @@ -35,6 +35,7 @@ #include "linux/genhd.h" #include "linux/spinlock.h" #include "linux/platform_device.h" +#include "linux/scatterlist.h" #include "asm/segment.h" #include "asm/uaccess.h" #include "asm/irq.h" @@ -704,6 +705,7 @@ static int ubd_add(int n, char **error_out) ubd_dev->size = ROUND_BLOCK(ubd_dev->size); INIT_LIST_HEAD(&ubd_dev->restart); + sg_init_table(&ubd_dev->sg, MAX_SG); err = -ENOMEM; ubd_dev->queue = blk_init_queue(do_ubd_request, &ubd_dev->lock); diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c index 8456397..59822dee 100644 --- a/arch/um/kernel/mem.c +++ b/arch/um/kernel/mem.c @@ -165,7 +165,7 @@ static void __init kmap_init(void) kmap_prot = PAGE_KERNEL; } -static void init_highmem(void) +static void __init init_highmem(void) { pgd_t *pgd; pud_t *pud; diff --git a/arch/um/sys-i386/ptrace.c b/arch/um/sys-i386/ptrace.c index 9657c89..bd3da8a 100644 --- a/arch/um/sys-i386/ptrace.c +++ b/arch/um/sys-i386/ptrace.c @@ -155,7 +155,7 @@ int get_fpregs(struct user_i387_struct __user *buf, struct task_struct *child) if (err) return err; - n = copy_to_user((void *) buf, fpregs, sizeof(fpregs)); + n = copy_to_user(buf, fpregs, sizeof(fpregs)); if(n > 0) return -EFAULT; @@ -168,7 +168,7 @@ int set_fpregs(struct user_i387_struct __user *buf, struct task_struct *child) long fpregs[HOST_FP_SIZE]; BUG_ON(sizeof(*buf) != sizeof(fpregs)); - n = copy_from_user(fpregs, (void *) buf, sizeof(fpregs)); + n = copy_from_user(fpregs, buf, sizeof(fpregs)); if (n > 0) return -EFAULT; @@ -185,7 +185,7 @@ int get_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *child) if (err) return err; - n = copy_to_user((void *) buf, fpregs, sizeof(fpregs)); + n = copy_to_user(buf, fpregs, sizeof(fpregs)); if(n > 0) return -EFAULT; @@ -198,7 +198,7 @@ int set_fpxregs(struct user_fxsr_struct __user *buf, struct task_struct *child) long fpregs[HOST_XFP_SIZE]; BUG_ON(sizeof(*buf) != sizeof(fpregs)); - n = copy_from_user(fpregs, (void *) buf, sizeof(fpregs)); + n = copy_from_user(fpregs, buf, sizeof(fpregs)); if (n > 0) return -EFAULT; diff --git a/arch/um/sys-x86_64/ptrace.c b/arch/um/sys-x86_64/ptrace.c index a3cfeed..b7631b0 100644 --- a/arch/um/sys-x86_64/ptrace.c +++ b/arch/um/sys-x86_64/ptrace.c @@ -154,7 +154,7 @@ int get_fpregs(struct user_i387_struct __user *buf, struct task_struct *child) if (err) return err; - n = copy_to_user((void *) buf, fpregs, sizeof(fpregs)); + n = copy_to_user(buf, fpregs, sizeof(fpregs)); if(n > 0) return -EFAULT; @@ -167,7 +167,7 @@ int set_fpregs(struct user_i387_struct __user *buf, struct task_struct *child) long fpregs[HOST_FP_SIZE]; BUG_ON(sizeof(*buf) != sizeof(fpregs)); - n = copy_from_user(fpregs, (void *) buf, sizeof(fpregs)); + n = copy_from_user(fpregs, buf, sizeof(fpregs)); if (n > 0) return -EFAULT; diff --git a/arch/i386/Kconfig.cpu b/arch/x86/Kconfig.cpu index 0e2adad..0e2adad 100644 --- a/arch/i386/Kconfig.cpu +++ b/arch/x86/Kconfig.cpu diff --git a/arch/i386/Kconfig.debug b/arch/x86/Kconfig.debug index f03531e..970b2de 100644 --- a/arch/i386/Kconfig.debug +++ b/arch/x86/Kconfig.debug @@ -1,14 +1,14 @@ menu "Kernel hacking" config TRACE_IRQFLAGS_SUPPORT - bool - default y + def_bool y source "lib/Kconfig.debug" config EARLY_PRINTK bool "Early printk" if EMBEDDED && DEBUG_KERNEL default y + depends on X86_32 help Write kernel log output directly into the VGA buffer or to a serial port. @@ -37,10 +37,12 @@ config DEBUG_STACK_USAGE comment "Page alloc debug is incompatible with Software Suspend on i386" depends on DEBUG_KERNEL && HIBERNATION + depends on X86_32 config DEBUG_PAGEALLOC bool "Debug page memory allocations" depends on DEBUG_KERNEL && !HIBERNATION && !HUGETLBFS + depends on X86_32 help Unmap pages from the kernel linear mapping after free_pages(). This results in a large slowdown, but helps to find certain types @@ -59,6 +61,7 @@ config DEBUG_RODATA config 4KSTACKS bool "Use 4Kb for kernel stacks instead of 8Kb" depends on DEBUG_KERNEL + depends on X86_32 help If you say Y here the kernel will use a 4Kb stacksize for the kernel stack attached to each process/thread. This facilitates @@ -67,22 +70,50 @@ config 4KSTACKS will also use IRQ stacks to compensate for the reduced stackspace. config X86_FIND_SMP_CONFIG - bool + def_bool y depends on X86_LOCAL_APIC || X86_VOYAGER - default y + depends on X86_32 config X86_MPPARSE - bool + def_bool y depends on X86_LOCAL_APIC && !X86_VISWS - default y + depends on X86_32 config DOUBLEFAULT default y bool "Enable doublefault exception handler" if EMBEDDED + depends on X86_32 + help + This option allows trapping of rare doublefault exceptions that + would otherwise cause a system to silently reboot. Disabling this + option saves about 4k and might cause you much additional grey + hair. + +config IOMMU_DEBUG + bool "Enable IOMMU debugging" + depends on IOMMU && DEBUG_KERNEL + depends on X86_64 help - This option allows trapping of rare doublefault exceptions that - would otherwise cause a system to silently reboot. Disabling this - option saves about 4k and might cause you much additional grey - hair. + Force the IOMMU to on even when you have less than 4GB of + memory and add debugging code. On overflow always panic. And + allow to enable IOMMU leak tracing. Can be disabled at boot + time with iommu=noforce. This will also enable scatter gather + list merging. Currently not recommended for production + code. When you use it make sure you have a big enough + IOMMU/AGP aperture. Most of the options enabled by this can + be set more finegrained using the iommu= command line + options. See Documentation/x86_64/boot-options.txt for more + details. + +config IOMMU_LEAK + bool "IOMMU leak tracing" + depends on DEBUG_KERNEL + depends on IOMMU_DEBUG + help + Add a simple leak tracer to the IOMMU code. This is useful when you + are debugging a buggy device driver that leaks IOMMU mappings. + +#config X86_REMOTE_DEBUG +# bool "kgdb debugging stub" endmenu diff --git a/arch/i386/Kconfig b/arch/x86/Kconfig.i386 index b4437ce..7331efe 100644 --- a/arch/i386/Kconfig +++ b/arch/x86/Kconfig.i386 @@ -287,7 +287,7 @@ config ES7000_CLUSTERED_APIC default y depends on SMP && X86_ES7000 && MPENTIUMIII -source "arch/i386/Kconfig.cpu" +source "arch/x86/Kconfig.cpu" config HPET_TIMER bool "HPET Timer Support" @@ -1272,7 +1272,7 @@ source "fs/Kconfig" source "kernel/Kconfig.instrumentation" -source "arch/i386/Kconfig.debug" +source "arch/x86/Kconfig.debug" source "security/Kconfig" diff --git a/arch/x86_64/Kconfig b/arch/x86/Kconfig.x86_64 index 308970a..e2542e5 100644 --- a/arch/x86_64/Kconfig +++ b/arch/x86/Kconfig.x86_64 @@ -835,7 +835,7 @@ source fs/Kconfig source "kernel/Kconfig.instrumentation" -source "arch/x86_64/Kconfig.debug" +source "arch/x86/Kconfig.debug" source "security/Kconfig" diff --git a/arch/x86/Makefile b/arch/x86/Makefile new file mode 100644 index 0000000..3095973 --- /dev/null +++ b/arch/x86/Makefile @@ -0,0 +1,16 @@ +# Unified Makefile for i386 and x86_64 + +# select defconfig based on actual architecture +KBUILD_DEFCONFIG := $(ARCH)_defconfig + +# # No need to remake these files +$(srctree)/arch/x86/Makefile%: ; + +ifeq ($(ARCH),i386) + include $(srctree)/arch/x86/Makefile_32 +else + include $(srctree)/arch/x86/Makefile_64 +endif + + + diff --git a/arch/i386/Makefile b/arch/x86/Makefile_32 index f5b9a37..346ac07 100644 --- a/arch/i386/Makefile +++ b/arch/x86/Makefile_32 @@ -1,5 +1,5 @@ # -# i386/Makefile +# i386 Makefile # # This file is included by the global makefile so that you can add your own # architecture-specific flags and dependencies. Remember to do have actions @@ -17,9 +17,6 @@ # 20050320 Kianusch Sayah Karadji <kianusch@sk-tech.net> # Added support for GEODE CPU -# Fill in SRCARCH -SRCARCH := x86 - # BITS is used as extension for files which are available in a 32 bit # and a 64 bit version to simplify shared Makefiles. # e.g.: obj-y += foo_$(BITS).o @@ -46,7 +43,7 @@ KBUILD_CFLAGS += -pipe -msoft-float -mregparm=3 -freg-struct-return KBUILD_CFLAGS += $(call cc-option,-mpreferred-stack-boundary=2) # CPU-specific tuning. Anything which can be shared with UML should go here. -include $(srctree)/arch/i386/Makefile.cpu +include $(srctree)/arch/x86/Makefile_32.cpu # temporary until string.h is fixed cflags-y += -ffreestanding diff --git a/arch/i386/Makefile.cpu b/arch/x86/Makefile_32.cpu index e372b58..e372b58 100644 --- a/arch/i386/Makefile.cpu +++ b/arch/x86/Makefile_32.cpu diff --git a/arch/x86_64/Makefile b/arch/x86/Makefile_64 index 20eb69b..57e714a 100644 --- a/arch/x86_64/Makefile +++ b/arch/x86/Makefile_64 @@ -1,5 +1,5 @@ # -# x86_64/Makefile +# x86_64 Makefile # # This file is included by the global makefile so that you can add your own # architecture-specific flags and dependencies. Remember to do have actions @@ -21,9 +21,6 @@ # # $Id: Makefile,v 1.31 2002/03/22 15:56:07 ak Exp $ -# Fill in SRCARCH -SRCARCH := x86 - # BITS is used as extension for files which are available in a 32 bit # and a 64 bit version to simplify shared Makefiles. # e.g.: obj-y += foo_$(BITS).o diff --git a/arch/x86/boot/boot.h b/arch/x86/boot/boot.h index 5f9a2e7..d2b5adf 100644 --- a/arch/x86/boot/boot.h +++ b/arch/x86/boot/boot.h @@ -17,6 +17,8 @@ #ifndef BOOT_BOOT_H #define BOOT_BOOT_H +#define STACK_SIZE 512 /* Minimum number of bytes for stack */ + #ifndef __ASSEMBLY__ #include <stdarg.h> @@ -198,8 +200,6 @@ static inline int isdigit(int ch) } /* Heap -- available for dynamic lists. */ -#define STACK_SIZE 512 /* Minimum number of bytes for stack */ - extern char _end[]; extern char *HEAP; extern char *heap_end; @@ -216,9 +216,9 @@ static inline char *__get_heap(size_t s, size_t a, size_t n) #define GET_HEAP(type, n) \ ((type *)__get_heap(sizeof(type),__alignof__(type),(n))) -static inline int heap_free(void) +static inline bool heap_free(size_t n) { - return heap_end-HEAP; + return (int)(heap_end-HEAP) >= (int)n; } /* copy.S */ diff --git a/arch/x86/boot/compressed/head_32.S b/arch/x86/boot/compressed/head_32.S index a0ae2e7..036e635 100644 --- a/arch/x86/boot/compressed/head_32.S +++ b/arch/x86/boot/compressed/head_32.S @@ -33,24 +33,20 @@ .globl startup_32 startup_32: - /* check to see if KEEP_SEGMENTS flag is meaningful */ - cmpw $0x207, BP_version(%esi) - jb 1f - + cld /* test KEEP_SEGMENTS flag to see if the bootloader is asking * us to not reload segments */ testb $(1<<6), BP_loadflags(%esi) - jnz 2f + jnz 1f -1: cli + cli movl $(__BOOT_DS),%eax movl %eax,%ds movl %eax,%es movl %eax,%fs movl %eax,%gs movl %eax,%ss - -2: cld +1: /* Calculate the delta between where we were compiled to run * at and where we were actually loaded at. This can only be done diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S index 4946764..1ccb38a 100644 --- a/arch/x86/boot/compressed/head_64.S +++ b/arch/x86/boot/compressed/head_64.S @@ -29,6 +29,7 @@ #include <asm/pgtable.h> #include <asm/page.h> #include <asm/msr.h> +#include <asm/asm-offsets.h> .section ".text.head" .code32 @@ -36,11 +37,17 @@ startup_32: cld + /* test KEEP_SEGMENTS flag to see if the bootloader is asking + * us to not reload segments */ + testb $(1<<6), BP_loadflags(%esi) + jnz 1f + cli movl $(__KERNEL_DS), %eax movl %eax, %ds movl %eax, %es movl %eax, %ss +1: /* Calculate the delta between where we were compiled to run * at and where we were actually loaded at. This can only be done diff --git a/arch/x86/boot/header.S b/arch/x86/boot/header.S index 8353c81..6ef5a06 100644 --- a/arch/x86/boot/header.S +++ b/arch/x86/boot/header.S @@ -173,7 +173,8 @@ ramdisk_size: .long 0 # its size in bytes bootsect_kludge: .long 0 # obsolete -heap_end_ptr: .word _end+1024 # (Header version 0x0201 or later) +heap_end_ptr: .word _end+STACK_SIZE-512 + # (Header version 0x0201 or later) # space from here (exclusive) down to # end of setup code can be used by setup # for local heap purposes. @@ -230,28 +231,53 @@ start_of_setup: int $0x13 #endif -# We will have entered with %cs = %ds+0x20, normalize %cs so -# it is on par with the other segments. - pushw %ds - pushw $setup2 - lretw - -setup2: # Force %es = %ds movw %ds, %ax movw %ax, %es cld -# Stack paranoia: align the stack and make sure it is good -# for both 16- and 32-bit references. In particular, if we -# were meant to have been using the full 16-bit segment, the -# caller might have set %sp to zero, which breaks %esp-based -# references. - andw $~3, %sp # dword align (might as well...) - jnz 1f - movw $0xfffc, %sp # Make sure we're not zero -1: movzwl %sp, %esp # Clear upper half of %esp - sti +# Apparently some ancient versions of LILO invoked the kernel +# with %ss != %ds, which happened to work by accident for the +# old code. If the CAN_USE_HEAP flag is set in loadflags, or +# %ss != %ds, then adjust the stack pointer. + + # Smallest possible stack we can tolerate + movw $(_end+STACK_SIZE), %cx + + movw heap_end_ptr, %dx + addw $512, %dx + jnc 1f + xorw %dx, %dx # Wraparound - whole segment available +1: testb $CAN_USE_HEAP, loadflags + jnz 2f + + # No CAN_USE_HEAP + movw %ss, %dx + cmpw %ax, %dx # %ds == %ss? + movw %sp, %dx + # If so, assume %sp is reasonably set, otherwise use + # the smallest possible stack. + jne 4f # -> Smallest possible stack... + + # Make sure the stack is at least minimum size. Take a value + # of zero to mean "full segment." +2: + andw $~3, %dx # dword align (might as well...) + jnz 3f + movw $0xfffc, %dx # Make sure we're not zero +3: cmpw %cx, %dx + jnb 5f +4: movw %cx, %dx # Minimum value we can possibly use +5: movw %ax, %ss + movzwl %dx, %esp # Clear upper half of %esp + sti # Now we should have a working stack + +# We will have entered with %cs = %ds+0x20, normalize %cs so +# it is on par with the other segments. + pushw %ds + pushw $6f + lretw +6: # Check signature at end of setup cmpl $0x5a5aaa55, setup_sig diff --git a/arch/x86/boot/video-bios.c b/arch/x86/boot/video-bios.c index 68e65d9..ed0672a 100644 --- a/arch/x86/boot/video-bios.c +++ b/arch/x86/boot/video-bios.c @@ -79,7 +79,7 @@ static int bios_probe(void) video_bios.modes = GET_HEAP(struct mode_info, 0); for (mode = 0x14; mode <= 0x7f; mode++) { - if (heap_free() < sizeof(struct mode_info)) + if (!heap_free(sizeof(struct mode_info))) break; if (mode_defined(VIDEO_FIRST_BIOS+mode)) diff --git a/arch/x86/boot/video-vesa.c b/arch/x86/boot/video-vesa.c index 1921907..4716b9a 100644 --- a/arch/x86/boot/video-vesa.c +++ b/arch/x86/boot/video-vesa.c @@ -57,7 +57,7 @@ static int vesa_probe(void) while ((mode = rdfs16(mode_ptr)) != 0xffff) { mode_ptr += 2; - if (heap_free() < sizeof(struct mode_info)) + if (!heap_free(sizeof(struct mode_info))) break; /* Heap full, can't save mode info */ if (mode & ~0x1ff) diff --git a/arch/x86/boot/video.c b/arch/x86/boot/video.c index e4ba897..ad9712f 100644 --- a/arch/x86/boot/video.c +++ b/arch/x86/boot/video.c @@ -371,7 +371,7 @@ static void save_screen(void) saved.curx = boot_params.screen_info.orig_x; saved.cury = boot_params.screen_info.orig_y; - if (heap_free() < saved.x*saved.y*sizeof(u16)+512) + if (!heap_free(saved.x*saved.y*sizeof(u16)+512)) return; /* Not enough heap to save the screen */ saved.data = GET_HEAP(u16, saved.x*saved.y); diff --git a/arch/i386/defconfig b/arch/x86/configs/i386_defconfig index 54ee176..54ee176 100644 --- a/arch/i386/defconfig +++ b/arch/x86/configs/i386_defconfig diff --git a/arch/x86_64/defconfig b/arch/x86/configs/x86_64_defconfig index b091c5e..b091c5e 100644 --- a/arch/x86_64/defconfig +++ b/arch/x86/configs/x86_64_defconfig diff --git a/arch/x86/kernel/acpi/processor.c b/arch/x86/kernel/acpi/processor.c index 2ed0a4c..f63e5ff 100644 --- a/arch/x86/kernel/acpi/processor.c +++ b/arch/x86/kernel/acpi/processor.c @@ -62,8 +62,7 @@ static void init_intel_pdc(struct acpi_processor *pr, struct cpuinfo_x86 *c) /* Initialize _PDC data based on the CPU vendor */ void arch_acpi_processor_init_pdc(struct acpi_processor *pr) { - unsigned int cpu = pr->id; - struct cpuinfo_x86 *c = &cpu_data(cpu); + struct cpuinfo_x86 *c = &cpu_data(pr->id); pr->pdc = NULL; if (c->x86_vendor == X86_VENDOR_INTEL) diff --git a/arch/x86/kernel/asm-offsets_64.c b/arch/x86/kernel/asm-offsets_64.c index 7e50bda..d1b6ed9 100644 --- a/arch/x86/kernel/asm-offsets_64.c +++ b/arch/x86/kernel/asm-offsets_64.c @@ -15,12 +15,16 @@ #include <asm/segment.h> #include <asm/thread_info.h> #include <asm/ia32.h> +#include <asm/bootparam.h> #define DEFINE(sym, val) \ asm volatile("\n->" #sym " %0 " #val : : "i" (val)) #define BLANK() asm volatile("\n->" : : ) +#define OFFSET(sym, str, mem) \ + DEFINE(sym, offsetof(struct str, mem)) + #define __NO_STUBS 1 #undef __SYSCALL #undef _ASM_X86_64_UNISTD_H_ @@ -109,5 +113,11 @@ int main(void) DEFINE(crypto_tfm_ctx_offset, offsetof(struct crypto_tfm, __crt_ctx)); BLANK(); DEFINE(__NR_syscall_max, sizeof(syscalls) - 1); + + BLANK(); + OFFSET(BP_scratch, boot_params, scratch); + OFFSET(BP_loadflags, boot_params, hdr.loadflags); + OFFSET(BP_hardware_subarch, boot_params, hdr.hardware_subarch); + OFFSET(BP_version, boot_params, hdr.version); return 0; } diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c index af0253f..8bb482f 100644 --- a/arch/x86/kernel/crash.c +++ b/arch/x86/kernel/crash.c @@ -25,7 +25,7 @@ #include <linux/kdebug.h> #include <asm/smp.h> -#ifdef X86_32 +#ifdef CONFIG_X86_32 #include <mach_ipi.h> #else #include <asm/mach_apic.h> @@ -41,7 +41,7 @@ static int crash_nmi_callback(struct notifier_block *self, unsigned long val, void *data) { struct pt_regs *regs; -#ifdef X86_32 +#ifdef CONFIG_X86_32 struct pt_regs fixed_regs; #endif int cpu; @@ -60,7 +60,7 @@ static int crash_nmi_callback(struct notifier_block *self, return NOTIFY_STOP; local_irq_disable(); -#ifdef X86_32 +#ifdef CONFIG_X86_32 if (!user_mode_vm(regs)) { crash_fixup_ss_esp(&fixed_regs, regs); regs = &fixed_regs; diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c index dc34acb..639e632 100644 --- a/arch/x86/kernel/early-quirks.c +++ b/arch/x86/kernel/early-quirks.c @@ -35,12 +35,14 @@ static void __init via_bugs(void) } #ifdef CONFIG_ACPI +#ifdef CONFIG_X86_IO_APIC static int __init nvidia_hpet_check(struct acpi_table_header *header) { return 0; } -#endif +#endif /* CONFIG_X86_IO_APIC */ +#endif /* CONFIG_ACPI */ static void __init nvidia_bugs(void) { diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c index 0d8577f..aa3d2c8 100644 --- a/arch/x86/kernel/machine_kexec_64.c +++ b/arch/x86/kernel/machine_kexec_64.c @@ -233,6 +233,8 @@ NORET_TYPE void machine_kexec(struct kimage *image) void arch_crash_save_vmcoreinfo(void) { + VMCOREINFO_SYMBOL(init_level4_pgt); + #ifdef CONFIG_ARCH_DISCONTIGMEM_ENABLE VMCOREINFO_SYMBOL(node_data); VMCOREINFO_LENGTH(node_data, MAX_NUMNODES); diff --git a/arch/x86/kernel/pci-gart_64.c b/arch/x86/kernel/pci-gart_64.c index c56e9ee..79b514b 100644 --- a/arch/x86/kernel/pci-gart_64.c +++ b/arch/x86/kernel/pci-gart_64.c @@ -338,7 +338,6 @@ static int __dma_map_cont(struct scatterlist *start, int nelems, BUG_ON(s != start && s->offset); if (s == start) { - *sout = *s; sout->dma_address = iommu_bus_base; sout->dma_address += iommu_page*PAGE_SIZE + s->offset; sout->dma_length = s->length; @@ -365,7 +364,7 @@ static inline int dma_map_cont(struct scatterlist *start, int nelems, { if (!need) { BUG_ON(nelems != 1); - *sout = *start; + sout->dma_address = start->dma_address; sout->dma_length = start->length; return 0; } @@ -436,7 +435,7 @@ static int gart_map_sg(struct device *dev, struct scatterlist *sg, int nents, error: flush_gart(); - gart_unmap_sg(dev, sg, nents, dir); + gart_unmap_sg(dev, sg, out, dir); /* When it was forced or merged try again in a dumb way */ if (force_iommu || iommu_merge) { out = dma_map_sg_nonforce(dev, sg, nents, dir); diff --git a/arch/x86/kernel/smp_32.c b/arch/x86/kernel/smp_32.c index f321153..fcaa026 100644 --- a/arch/x86/kernel/smp_32.c +++ b/arch/x86/kernel/smp_32.c @@ -708,10 +708,4 @@ struct smp_ops smp_ops = { .smp_send_reschedule = native_smp_send_reschedule, .smp_call_function_mask = native_smp_call_function_mask, }; - -int smp_call_function_mask(cpumask_t mask, void (*func) (void *info), - void *info, int wait) -{ - return smp_ops.smp_call_function_mask(mask, func, info, wait); -} -EXPORT_SYMBOL(smp_call_function_mask); +EXPORT_SYMBOL_GPL(smp_ops); diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c index d2235db..a55b090 100644 --- a/arch/x86/lguest/boot.c +++ b/arch/x86/lguest/boot.c @@ -56,6 +56,7 @@ #include <linux/lguest.h> #include <linux/lguest_launcher.h> #include <linux/virtio_console.h> +#include <linux/pm.h> #include <asm/paravirt.h> #include <asm/param.h> #include <asm/page.h> @@ -98,7 +99,7 @@ static cycle_t clock_base; * When lazy_mode is set, it means we're allowed to defer all hypercalls and do * them as a batch when lazy_mode is eventually turned off. Because hypercalls * are reasonably expensive, batching them up makes sense. For example, a - * large mmap might update dozens of page table entries: that code calls + * large munmap might update dozens of page table entries: that code calls * paravirt_enter_lazy_mmu(), does the dozen updates, then calls * lguest_leave_lazy_mode(). * @@ -163,8 +164,8 @@ void async_hcall(unsigned long call, /*:*/ /*G:033 - * Here are our first native-instruction replacements: four functions for - * interrupt control. + * After that diversion we return to our first native-instruction + * replacements: four functions for interrupt control. * * The simplest way of implementing these would be to have "turn interrupts * off" and "turn interrupts on" hypercalls. Unfortunately, this is too slow: @@ -183,7 +184,7 @@ static unsigned long save_fl(void) return lguest_data.irq_enabled; } -/* "restore_flags" just sets the flags back to the value given. */ +/* restore_flags() just sets the flags back to the value given. */ static void restore_fl(unsigned long flags) { lguest_data.irq_enabled = flags; @@ -356,7 +357,7 @@ static void lguest_cpuid(unsigned int *eax, unsigned int *ebx, * it. The Host needs to know when the Guest wants to change them, so we have * a whole series of functions like read_cr0() and write_cr0(). * - * We start with CR0. CR0 allows you to turn on and off all kinds of basic + * We start with cr0. cr0 allows you to turn on and off all kinds of basic * features, but Linux only really cares about one: the horrifically-named Task * Switched (TS) bit at bit 3 (ie. 8) * @@ -371,8 +372,7 @@ static void lguest_cpuid(unsigned int *eax, unsigned int *ebx, static unsigned long current_cr0, current_cr3; static void lguest_write_cr0(unsigned long val) { - /* 8 == TS bit. */ - lazy_hcall(LHCALL_TS, val & 8, 0, 0); + lazy_hcall(LHCALL_TS, val & X86_CR0_TS, 0, 0); current_cr0 = val; } @@ -387,10 +387,10 @@ static unsigned long lguest_read_cr0(void) static void lguest_clts(void) { lazy_hcall(LHCALL_TS, 0, 0, 0); - current_cr0 &= ~8U; + current_cr0 &= ~X86_CR0_TS; } -/* CR2 is the virtual address of the last page fault, which the Guest only ever +/* cr2 is the virtual address of the last page fault, which the Guest only ever * reads. The Host kindly writes this into our "struct lguest_data", so we * just read it out of there. */ static unsigned long lguest_read_cr2(void) @@ -398,7 +398,7 @@ static unsigned long lguest_read_cr2(void) return lguest_data.cr2; } -/* CR3 is the current toplevel pagetable page: the principle is the same as +/* cr3 is the current toplevel pagetable page: the principle is the same as * cr0. Keep a local copy, and tell the Host when it changes. */ static void lguest_write_cr3(unsigned long cr3) { @@ -411,7 +411,7 @@ static unsigned long lguest_read_cr3(void) return current_cr3; } -/* CR4 is used to enable and disable PGE, but we don't care. */ +/* cr4 is used to enable and disable PGE, but we don't care. */ static unsigned long lguest_read_cr4(void) { return 0; @@ -432,7 +432,7 @@ static void lguest_write_cr4(unsigned long val) * maps virtual addresses to physical addresses using "page tables". We could * use one huge index of 1 million entries: each address is 4 bytes, so that's * 1024 pages just to hold the page tables. But since most virtual addresses - * are unused, we use a two level index which saves space. The CR3 register + * are unused, we use a two level index which saves space. The cr3 register * contains the physical address of the top level "page directory" page, which * contains physical addresses of up to 1024 second-level pages. Each of these * second level pages contains up to 1024 physical addresses of actual pages, @@ -440,7 +440,7 @@ static void lguest_write_cr4(unsigned long val) * * Here's a diagram, where arrows indicate physical addresses: * - * CR3 ---> +---------+ + * cr3 ---> +---------+ * | --------->+---------+ * | | | PADDR1 | * Top-level | | PADDR2 | @@ -498,8 +498,7 @@ static void lguest_set_pmd(pmd_t *pmdp, pmd_t pmdval) * * ... except in early boot when the kernel sets up the initial pagetables, * which makes booting astonishingly slow. So we don't even tell the Host - * anything changed until we've done the first page table switch. - */ + * anything changed until we've done the first page table switch. */ static void lguest_set_pte(pte_t *ptep, pte_t pteval) { *ptep = pteval; @@ -720,10 +719,10 @@ static void lguest_time_init(void) /* Set up the timer interrupt (0) to go to our simple timer routine */ set_irq_handler(0, lguest_time_irq); - /* Our clock structure look like arch/i386/kernel/tsc.c if we can use - * the TSC, otherwise it's a dumb nanosecond-resolution clock. Either - * way, the "rating" is initialized so high that it's always chosen - * over any other clocksource. */ + /* Our clock structure looks like arch/x86/kernel/tsc_32.c if we can + * use the TSC, otherwise it's a dumb nanosecond-resolution clock. + * Either way, the "rating" is set so high that it's always chosen over + * any other clocksource. */ if (lguest_data.tsc_khz) lguest_clock.mult = clocksource_khz2mult(lguest_data.tsc_khz, lguest_clock.shift); @@ -749,7 +748,7 @@ static void lguest_time_init(void) * to work. They're pretty simple. */ -/* The Guest needs to tell the host what stack it expects traps to use. For +/* The Guest needs to tell the Host what stack it expects traps to use. For * native hardware, this is part of the Task State Segment mentioned above in * lguest_load_tr_desc(), but to help hypervisors there's this special call. * @@ -850,13 +849,16 @@ static __init char *lguest_memory_setup(void) return "LGUEST"; } -/* Before virtqueues are set up, we use LHCALL_NOTIFY on normal memory to - * produce console output. */ +/* We will eventually use the virtio console device to produce console output, + * but before that is set up we use LHCALL_NOTIFY on normal memory to produce + * console output. */ static __init int early_put_chars(u32 vtermno, const char *buf, int count) { char scratch[17]; unsigned int len = count; + /* We use a nul-terminated string, so we have to make a copy. Icky, + * huh? */ if (len > sizeof(scratch) - 1) len = sizeof(scratch) - 1; scratch[len] = '\0'; @@ -883,7 +885,7 @@ static __init int early_put_chars(u32 vtermno, const char *buf, int count) * Our current solution is to allow the paravirt back end to optionally patch * over the indirect calls to replace them with something more efficient. We * patch the four most commonly called functions: disable interrupts, enable - * interrupts, restore interrupts and save interrupts. We usually have 10 + * interrupts, restore interrupts and save interrupts. We usually have 6 or 10 * bytes to patch into: the Guest versions of these operations are small enough * that we can fit comfortably. * @@ -1015,7 +1017,7 @@ __init void lguest_init(void) asm volatile ("mov %0, %%fs" : : "r" (__KERNEL_DS) : "memory"); /* The Host uses the top of the Guest's virtual address space for the - * Host<->Guest Switcher, and it tells us how much it needs in + * Host<->Guest Switcher, and it tells us how big that is in * lguest_data.reserve_mem, set up on the LGUEST_INIT hypercall. */ reserve_top_address(lguest_data.reserve_mem); @@ -1065,6 +1067,6 @@ __init void lguest_init(void) /* * This marks the end of stage II of our journey, The Guest. * - * It is now time for us to explore the nooks and crannies of the three Guest - * devices and complete our understanding of the Guest in "make Drivers". + * It is now time for us to explore the layer of virtual drivers and complete + * our understanding of the Guest in "make Drivers". */ diff --git a/arch/x86/lguest/i386_head.S b/arch/x86/lguest/i386_head.S index ebc6ac7..95b6fbc 100644 --- a/arch/x86/lguest/i386_head.S +++ b/arch/x86/lguest/i386_head.S @@ -6,7 +6,7 @@ #include <asm/processor-flags.h> /*G:020 This is where we begin: head.S notes that the boot header's platform - * type field is "1" (lguest), so calls us here. The boot header is in %esi. + * type field is "1" (lguest), so calls us here. * * WARNING: be very careful here! We're running at addresses equal to physical * addesses (around 0), not above PAGE_OFFSET as most code expectes @@ -17,13 +17,15 @@ * boot. */ .section .init.text, "ax", @progbits ENTRY(lguest_entry) - /* Make initial hypercall now, so we can set up the pagetables. */ + /* We make the "initialization" hypercall now to tell the Host about + * us, and also find out where it put our page tables. */ movl $LHCALL_LGUEST_INIT, %eax movl $lguest_data - __PAGE_OFFSET, %edx int $LGUEST_TRAP_ENTRY /* The Host put the toplevel pagetable in lguest_data.pgdir. The movsl - * instruction uses %esi implicitly. */ + * instruction uses %esi implicitly as the source for the copy we' + * about to do. */ movl lguest_data - __PAGE_OFFSET + LGUEST_DATA_pgdir, %esi /* Copy first 32 entries of page directory to __PAGE_OFFSET entries. diff --git a/arch/x86/mach-voyager/voyager_smp.c b/arch/x86/mach-voyager/voyager_smp.c index 361ac51..6937143 100644 --- a/arch/x86/mach-voyager/voyager_smp.c +++ b/arch/x86/mach-voyager/voyager_smp.c @@ -29,14 +29,14 @@ #include <asm/arch_hooks.h> /* TLB state -- visible externally, indexed physically */ -DEFINE_PER_CPU(struct tlb_state, cpu_tlbstate) ____cacheline_aligned = { &init_mm, 0 }; +DEFINE_PER_CPU_SHARED_ALIGNED(struct tlb_state, cpu_tlbstate) = { &init_mm, 0 }; /* CPU IRQ affinity -- set to all ones initially */ static unsigned long cpu_irq_affinity[NR_CPUS] __cacheline_aligned = { [0 ... NR_CPUS-1] = ~0UL }; /* per CPU data structure (for /proc/cpuinfo et al), visible externally * indexed physically */ -DEFINE_PER_CPU(cpuinfo_x86, cpu_info) __cacheline_aligned; +DEFINE_PER_CPU_SHARED_ALIGNED(struct cpuinfo_x86, cpu_info); EXPORT_PER_CPU_SYMBOL(cpu_info); /* physical ID of the CPU used to boot the system */ diff --git a/arch/x86/mm/fault_32.c b/arch/x86/mm/fault_32.c index 503dfc0..33563ee 100644 --- a/arch/x86/mm/fault_32.c +++ b/arch/x86/mm/fault_32.c @@ -550,7 +550,7 @@ no_context: page &= PAGE_MASK; page = ((__typeof__(page) *) __va(page))[(address >> PMD_SHIFT) & (PTRS_PER_PMD - 1)]; - printk(KERN_ALERT "*pde = %016Lx ", page); + printk(KERN_CONT "*pde = %016Lx ", page); page &= ~_PAGE_NX; } #else diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index 1e3862e..a7308b2 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c @@ -728,12 +728,6 @@ int in_gate_area_no_task(unsigned long addr) return (addr >= VSYSCALL_START) && (addr < VSYSCALL_END); } -void * __init alloc_bootmem_high_node(pg_data_t *pgdat, unsigned long size) -{ - return __alloc_bootmem_core(pgdat->bdata, size, - SMP_CACHE_BYTES, (4UL*1024*1024*1024), 0); -} - const char *arch_vma_name(struct vm_area_struct *vma) { if (vma->vm_mm && vma->vm_start == (long)vma->vm_mm->context.vdso) diff --git a/arch/x86_64/.gitignore b/arch/x86_64/.gitignore deleted file mode 100644 index 36ef4c3..0000000 --- a/arch/x86_64/.gitignore +++ /dev/null @@ -1 +0,0 @@ -boot diff --git a/arch/x86_64/Kconfig.debug b/arch/x86_64/Kconfig.debug deleted file mode 100644 index 775d211..0000000 --- a/arch/x86_64/Kconfig.debug +++ /dev/null @@ -1,61 +0,0 @@ -menu "Kernel hacking" - -config TRACE_IRQFLAGS_SUPPORT - bool - default y - -source "lib/Kconfig.debug" - -config DEBUG_RODATA - bool "Write protect kernel read-only data structures" - depends on DEBUG_KERNEL - help - Mark the kernel read-only data as write-protected in the pagetables, - in order to catch accidental (and incorrect) writes to such const data. - This option may have a slight performance impact because a portion - of the kernel code won't be covered by a 2MB TLB anymore. - If in doubt, say "N". - -config IOMMU_DEBUG - depends on IOMMU && DEBUG_KERNEL - bool "Enable IOMMU debugging" - help - Force the IOMMU to on even when you have less than 4GB of - memory and add debugging code. On overflow always panic. And - allow to enable IOMMU leak tracing. Can be disabled at boot - time with iommu=noforce. This will also enable scatter gather - list merging. Currently not recommended for production - code. When you use it make sure you have a big enough - IOMMU/AGP aperture. Most of the options enabled by this can - be set more finegrained using the iommu= command line - options. See Documentation/x86_64/boot-options.txt for more - details. - -config IOMMU_LEAK - bool "IOMMU leak tracing" - depends on DEBUG_KERNEL - depends on IOMMU_DEBUG - help - Add a simple leak tracer to the IOMMU code. This is useful when you - are debugging a buggy device driver that leaks IOMMU mappings. - -config DEBUG_STACKOVERFLOW - bool "Check for stack overflows" - depends on DEBUG_KERNEL - help - This option will cause messages to be printed if free stack space - drops below a certain limit. - -config DEBUG_STACK_USAGE - bool "Stack utilization instrumentation" - depends on DEBUG_KERNEL - help - Enables the display of the minimum amount of free stack which each - task has ever had available in the sysrq-T and sysrq-P debug output. - - This option will slow down process creation somewhat. - -#config X86_REMOTE_DEBUG -# bool "kgdb debugging stub" - -endmenu |