diff --git a/[refs] b/[refs] index 8ab7f40adbc9..0450409454b5 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ce10d979053379553757c3b178a138facaddff82 +refs/heads/master: 8181b8c1f3a69fe5abcc51cb732eb512ccd1566a diff --git a/trunk/arch/i386/kernel/Makefile b/trunk/arch/i386/kernel/Makefile index 51ecd512603d..0fbcfe00dd8d 100644 --- a/trunk/arch/i386/kernel/Makefile +++ b/trunk/arch/i386/kernel/Makefile @@ -43,7 +43,7 @@ obj-$(CONFIG_SCx200) += scx200.o # Note: kbuild does not track this dependency due to usage of .incbin $(obj)/vsyscall.o: $(obj)/vsyscall-int80.so $(obj)/vsyscall-sysenter.so targets += $(foreach F,int80 sysenter,vsyscall-$F.o vsyscall-$F.so) -targets += vsyscall-note.o vsyscall.lds +targets += vsyscall.lds # The DSO images are built using a special linker script. quiet_cmd_syscall = SYSCALL $@ diff --git a/trunk/arch/ia64/kernel/module.c b/trunk/arch/ia64/kernel/module.c index f1aca7cffd12..febc091c2f02 100644 --- a/trunk/arch/ia64/kernel/module.c +++ b/trunk/arch/ia64/kernel/module.c @@ -825,16 +825,14 @@ apply_relocate_add (Elf64_Shdr *sechdrs, const char *strtab, unsigned int symind * XXX Should have an arch-hook for running this after final section * addresses have been selected... */ - uint64_t gp; - if (mod->core_size > MAX_LTOFF) + /* See if gp can cover the entire core module: */ + uint64_t gp = (uint64_t) mod->module_core + MAX_LTOFF / 2; + if (mod->core_size >= MAX_LTOFF) /* * This takes advantage of fact that SHF_ARCH_SMALL gets allocated * at the end of the module. */ - gp = mod->core_size - MAX_LTOFF / 2; - else - gp = mod->core_size / 2; - gp = (uint64_t) mod->module_core + ((gp + 7) & -8); + gp = (uint64_t) mod->module_core + mod->core_size - MAX_LTOFF / 2; mod->arch.gp = gp; DEBUGP("%s: placing gp at 0x%lx\n", __FUNCTION__, gp); } diff --git a/trunk/arch/ia64/kernel/ptrace.c b/trunk/arch/ia64/kernel/ptrace.c index 575a8f657b31..08c8a5eb25ab 100644 --- a/trunk/arch/ia64/kernel/ptrace.c +++ b/trunk/arch/ia64/kernel/ptrace.c @@ -635,17 +635,11 @@ ia64_flush_fph (struct task_struct *task) { struct ia64_psr *psr = ia64_psr(ia64_task_regs(task)); - /* - * Prevent migrating this task while - * we're fiddling with the FPU state - */ - preempt_disable(); if (ia64_is_local_fpu_owner(task) && psr->mfh) { psr->mfh = 0; task->thread.flags |= IA64_THREAD_FPH_VALID; ia64_save_fpu(&task->thread.fph[0]); } - preempt_enable(); } /* diff --git a/trunk/arch/ia64/kernel/setup.c b/trunk/arch/ia64/kernel/setup.c index d14692e0920a..b7e6b4cb374b 100644 --- a/trunk/arch/ia64/kernel/setup.c +++ b/trunk/arch/ia64/kernel/setup.c @@ -720,8 +720,7 @@ cpu_init (void) ia64_set_kr(IA64_KR_PT_BASE, __pa(ia64_imva(empty_zero_page))); /* - * Initialize default control register to defer speculative faults except - * for those arising from TLB misses, which are not deferred. The + * Initialize default control register to defer all speculative faults. The * kernel MUST NOT depend on a particular setting of these bits (in other words, * the kernel must have recovery code for all speculative accesses). Turn on * dcr.lc as per recommendation by the architecture team. Most IA-32 apps diff --git a/trunk/arch/ia64/kernel/traps.c b/trunk/arch/ia64/kernel/traps.c index 1861173bd4f6..e82ad78081b3 100644 --- a/trunk/arch/ia64/kernel/traps.c +++ b/trunk/arch/ia64/kernel/traps.c @@ -111,24 +111,6 @@ ia64_bad_break (unsigned long break_num, struct pt_regs *regs) siginfo_t siginfo; int sig, code; - /* break.b always sets cr.iim to 0, which causes problems for - * debuggers. Get the real break number from the original instruction, - * but only for kernel code. User space break.b is left alone, to - * preserve the existing behaviour. All break codings have the same - * format, so there is no need to check the slot type. - */ - if (break_num == 0 && !user_mode(regs)) { - struct ia64_psr *ipsr = ia64_psr(regs); - unsigned long *bundle = (unsigned long *)regs->cr_iip; - unsigned long slot; - switch (ipsr->ri) { - case 0: slot = (bundle[0] >> 5); break; - case 1: slot = (bundle[0] >> 46) | (bundle[1] << 18); break; - default: slot = (bundle[1] >> 23); break; - } - break_num = ((slot >> 36 & 1) << 20) | (slot >> 6 & 0xfffff); - } - /* SIGILL, SIGFPE, SIGSEGV, and SIGBUS want these field initialized: */ siginfo.si_addr = (void __user *) (regs->cr_iip + ia64_psr(regs)->ri); siginfo.si_imm = break_num; @@ -220,21 +202,13 @@ disabled_fph_fault (struct pt_regs *regs) /* first, grant user-level access to fph partition: */ psr->dfh = 0; - - /* - * Make sure that no other task gets in on this processor - * while we're claiming the FPU - */ - preempt_disable(); #ifndef CONFIG_SMP { struct task_struct *fpu_owner = (struct task_struct *)ia64_get_kr(IA64_KR_FPU_OWNER); - if (ia64_is_local_fpu_owner(current)) { - preempt_enable_no_resched(); + if (ia64_is_local_fpu_owner(current)) return; - } if (fpu_owner) ia64_flush_fph(fpu_owner); @@ -252,7 +226,6 @@ disabled_fph_fault (struct pt_regs *regs) */ psr->mfh = 1; } - preempt_enable_no_resched(); } static inline int diff --git a/trunk/arch/ia64/mm/init.c b/trunk/arch/ia64/mm/init.c index 4eb2f52b87a1..547785e3cba2 100644 --- a/trunk/arch/ia64/mm/init.c +++ b/trunk/arch/ia64/mm/init.c @@ -305,9 +305,8 @@ setup_gate (void) struct page *page; /* - * Map the gate page twice: once read-only to export the ELF - * headers etc. and once execute-only page to enable - * privilege-promotion via "epc": + * Map the gate page twice: once read-only to export the ELF headers etc. and once + * execute-only page to enable privilege-promotion via "epc": */ page = virt_to_page(ia64_imva(__start_gate_section)); put_kernel_page(page, GATE_ADDR, PAGE_READONLY); @@ -316,20 +315,6 @@ setup_gate (void) put_kernel_page(page, GATE_ADDR + PAGE_SIZE, PAGE_GATE); #else put_kernel_page(page, GATE_ADDR + PERCPU_PAGE_SIZE, PAGE_GATE); - /* Fill in the holes (if any) with read-only zero pages: */ - { - unsigned long addr; - - for (addr = GATE_ADDR + PAGE_SIZE; - addr < GATE_ADDR + PERCPU_PAGE_SIZE; - addr += PAGE_SIZE) - { - put_kernel_page(ZERO_PAGE(0), addr, - PAGE_READONLY); - put_kernel_page(ZERO_PAGE(0), addr + PERCPU_PAGE_SIZE, - PAGE_READONLY); - } - } #endif ia64_patch_gate(); } diff --git a/trunk/arch/ia64/sn/kernel/setup.c b/trunk/arch/ia64/sn/kernel/setup.c index 44bfc7f318cb..e64cb8175f7a 100644 --- a/trunk/arch/ia64/sn/kernel/setup.c +++ b/trunk/arch/ia64/sn/kernel/setup.c @@ -222,7 +222,7 @@ void __init early_sn_setup(void) extern int platform_intr_list[]; extern nasid_t master_nasid; -static int __initdata shub_1_1_found = 0; +static int shub_1_1_found __initdata; /* * sn_check_for_wars @@ -251,7 +251,7 @@ static void __init sn_check_for_wars(void) } else { for_each_online_node(cnode) { if (is_shub_1_1(cnodeid_to_nasid(cnode))) - shub_1_1_found = 1; + sn_hub_info->shub_1_1_found = 1; } } } diff --git a/trunk/arch/ppc/kernel/cputable.c b/trunk/arch/ppc/kernel/cputable.c index 17abf6cd0d90..d44b7dc5390a 100644 --- a/trunk/arch/ppc/kernel/cputable.c +++ b/trunk/arch/ppc/kernel/cputable.c @@ -849,17 +849,6 @@ struct cpu_spec cpu_specs[] = { .icache_bsize = 32, .dcache_bsize = 32, }, - { /* 405EP */ - .pvr_mask = 0xffff0000, - .pvr_value = 0x51210000, - .cpu_name = "405EP", - .cpu_features = CPU_FTR_SPLIT_ID_CACHE | - CPU_FTR_USE_TB, - .cpu_user_features = PPC_FEATURE_32 | - PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC, - .icache_bsize = 32, - .dcache_bsize = 32, - }, #endif /* CONFIG_40x */ #ifdef CONFIG_44x diff --git a/trunk/arch/ppc64/kernel/kprobes.c b/trunk/arch/ppc64/kernel/kprobes.c index e950a2058a19..5a9f47b18c45 100644 --- a/trunk/arch/ppc64/kernel/kprobes.c +++ b/trunk/arch/ppc64/kernel/kprobes.c @@ -45,17 +45,12 @@ static struct pt_regs jprobe_saved_regs; int arch_prepare_kprobe(struct kprobe *p) { - int ret = 0; kprobe_opcode_t insn = *p->addr; - if ((unsigned long)p->addr & 0x03) { - printk("Attempt to register kprobe at an unaligned address\n"); - ret = -EINVAL; - } else if (IS_MTMSRD(insn) || IS_RFID(insn)) { - printk("Cannot register a kprobe on rfid or mtmsrd\n"); - ret = -EINVAL; - } - return ret; + if (IS_MTMSRD(insn) || IS_RFID(insn)) + /* cannot put bp on RFID/MTMSRD */ + return 1; + return 0; } void arch_copy_kprobe(struct kprobe *p) @@ -177,6 +172,8 @@ static void resume_execution(struct kprobe *p, struct pt_regs *regs) ret = emulate_step(regs, p->ainsn.insn[0]); if (ret == 0) regs->nip = (unsigned long)p->addr + 4; + + regs->msr &= ~MSR_SE; } static inline int post_kprobe_handler(struct pt_regs *regs) @@ -213,7 +210,6 @@ static inline int kprobe_fault_handler(struct pt_regs *regs, int trapnr) if (kprobe_status & KPROBE_HIT_SS) { resume_execution(current_kprobe, regs); - regs->msr &= ~MSR_SE; regs->msr |= kprobe_saved_msr; unlock_kprobes(); diff --git a/trunk/arch/ppc64/kernel/misc.S b/trunk/arch/ppc64/kernel/misc.S index e3c73b3425dc..b944717c1dbd 100644 --- a/trunk/arch/ppc64/kernel/misc.S +++ b/trunk/arch/ppc64/kernel/misc.S @@ -792,7 +792,7 @@ _GLOBAL(sys_call_table32) .llong .compat_sys_newstat .llong .compat_sys_newlstat .llong .compat_sys_newfstat - .llong .sys32_uname + .llong .sys_uname .llong .sys_ni_syscall /* 110 old iopl syscall */ .llong .sys_vhangup .llong .sys_ni_syscall /* old idle syscall */ diff --git a/trunk/arch/ppc64/kernel/sys_ppc32.c b/trunk/arch/ppc64/kernel/sys_ppc32.c index 9c8e317c598d..7cf7a9600025 100644 --- a/trunk/arch/ppc64/kernel/sys_ppc32.c +++ b/trunk/arch/ppc64/kernel/sys_ppc32.c @@ -791,6 +791,31 @@ asmlinkage int sys32_pciconfig_iobase(u32 which, u32 in_bus, u32 in_devfn) } +asmlinkage int ppc64_newuname(struct new_utsname __user * name) +{ + int errno = sys_newuname(name); + + if (current->personality == PER_LINUX32 && !errno) { + if(copy_to_user(name->machine, "ppc\0\0", 8)) { + errno = -EFAULT; + } + } + return errno; +} + +asmlinkage int ppc64_personality(unsigned long personality) +{ + int ret; + if (current->personality == PER_LINUX32 && personality == PER_LINUX) + personality = PER_LINUX32; + ret = sys_personality(personality); + if (ret == PER_LINUX32) + ret = PER_LINUX; + return ret; +} + + + /* Note: it is necessary to treat mode as an unsigned int, * with the corresponding cast to a signed int to insure that the * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) @@ -1133,47 +1158,26 @@ asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args) } #endif -asmlinkage int sys32_uname(struct old_utsname __user * name) -{ - int err = 0; - - down_read(&uts_sem); - if (copy_to_user(name, &system_utsname, sizeof(*name))) - err = -EFAULT; - up_read(&uts_sem); - if (!err && personality(current->personality) == PER_LINUX32) { - /* change "ppc64" to "ppc" */ - if (__put_user(0, name->machine + 3) - || __put_user(0, name->machine + 4)) - err = -EFAULT; - } - return err; -} - asmlinkage int sys32_olduname(struct oldold_utsname __user * name) { int error; - + + if (!name) + return -EFAULT; if (!access_ok(VERIFY_WRITE,name,sizeof(struct oldold_utsname))) return -EFAULT; down_read(&uts_sem); error = __copy_to_user(&name->sysname,&system_utsname.sysname,__OLD_UTS_LEN); - error |= __put_user(0,name->sysname+__OLD_UTS_LEN); - error |= __copy_to_user(&name->nodename,&system_utsname.nodename,__OLD_UTS_LEN); - error |= __put_user(0,name->nodename+__OLD_UTS_LEN); - error |= __copy_to_user(&name->release,&system_utsname.release,__OLD_UTS_LEN); - error |= __put_user(0,name->release+__OLD_UTS_LEN); - error |= __copy_to_user(&name->version,&system_utsname.version,__OLD_UTS_LEN); - error |= __put_user(0,name->version+__OLD_UTS_LEN); - error |= __copy_to_user(&name->machine,&system_utsname.machine,__OLD_UTS_LEN); - error |= __put_user(0,name->machine+__OLD_UTS_LEN); - if (personality(current->personality) == PER_LINUX32) { - /* change "ppc64" to "ppc" */ - error |= __put_user(0, name->machine + 3); - error |= __put_user(0, name->machine + 4); - } - + error -= __put_user(0,name->sysname+__OLD_UTS_LEN); + error -= __copy_to_user(&name->nodename,&system_utsname.nodename,__OLD_UTS_LEN); + error -= __put_user(0,name->nodename+__OLD_UTS_LEN); + error -= __copy_to_user(&name->release,&system_utsname.release,__OLD_UTS_LEN); + error -= __put_user(0,name->release+__OLD_UTS_LEN); + error -= __copy_to_user(&name->version,&system_utsname.version,__OLD_UTS_LEN); + error -= __put_user(0,name->version+__OLD_UTS_LEN); + error -= __copy_to_user(&name->machine,&system_utsname.machine,__OLD_UTS_LEN); + error = __put_user(0,name->machine+__OLD_UTS_LEN); up_read(&uts_sem); error = error ? -EFAULT : 0; diff --git a/trunk/arch/ppc64/kernel/syscalls.c b/trunk/arch/ppc64/kernel/syscalls.c index a8cbb202b8cd..f2865ff8d2f9 100644 --- a/trunk/arch/ppc64/kernel/syscalls.c +++ b/trunk/arch/ppc64/kernel/syscalls.c @@ -199,33 +199,24 @@ unsigned long sys_mmap(unsigned long addr, size_t len, return ret; } -long ppc64_personality(unsigned long personality) +static int __init set_fakeppc(char *str) { - long ret; - - if (personality(current->personality) == PER_LINUX32 - && personality == PER_LINUX) - personality = PER_LINUX32; - ret = sys_personality(personality); - if (ret == PER_LINUX32) - ret = PER_LINUX; - return ret; + if (*str) + return 0; + init_task.personality = PER_LINUX32; + return 1; } +__setup("fakeppc", set_fakeppc); -long ppc64_newuname(struct new_utsname __user * name) +asmlinkage int sys_uname(struct old_utsname __user * name) { - int err = 0; - + int err = -EFAULT; + down_read(&uts_sem); - if (copy_to_user(name, &system_utsname, sizeof(*name))) - err = -EFAULT; + if (name && !copy_to_user(name, &system_utsname, sizeof (*name))) + err = 0; up_read(&uts_sem); - if (!err && personality(current->personality) == PER_LINUX32) { - /* change ppc64 to ppc */ - if (__put_user(0, name->machine + 3) - || __put_user(0, name->machine + 4)) - err = -EFAULT; - } + return err; } diff --git a/trunk/arch/um/Kconfig_char b/trunk/arch/um/Kconfig_char index 62d87b71179b..3e50fdb67626 100644 --- a/trunk/arch/um/Kconfig_char +++ b/trunk/arch/um/Kconfig_char @@ -204,11 +204,5 @@ config UML_RANDOM http://sourceforge.net/projects/gkernel/). rngd periodically reads /dev/hwrng and injects the entropy into /dev/random. -config MMAPPER - tristate "iomem emulation driver" - help - This driver allows a host file to be used as emulated IO memory inside - UML. - endmenu diff --git a/trunk/arch/um/drivers/chan_user.c b/trunk/arch/um/drivers/chan_user.c index 5d3768156c92..583b8e137c33 100644 --- a/trunk/arch/um/drivers/chan_user.c +++ b/trunk/arch/um/drivers/chan_user.c @@ -143,22 +143,22 @@ static int winch_tramp(int fd, struct tty_struct *tty, int *fd_out) { struct winch_data data; unsigned long stack; - int fds[2], n, err; + int fds[2], pid, n, err; char c; err = os_pipe(fds, 1, 1); if(err < 0){ printk("winch_tramp : os_pipe failed, err = %d\n", -err); - goto out; + return(err); } data = ((struct winch_data) { .pty_fd = fd, .pipe_fd = fds[1], .close_me = fds[0] } ); - err = run_helper_thread(winch_thread, &data, 0, &stack, 0); - if(err < 0){ + pid = run_helper_thread(winch_thread, &data, 0, &stack, 0); + if(pid < 0){ printk("fork of winch_thread failed - errno = %d\n", errno); - goto out_close; + return(pid); } os_close_file(fds[1]); @@ -168,22 +168,14 @@ static int winch_tramp(int fd, struct tty_struct *tty, int *fd_out) printk("winch_tramp : failed to read synchronization byte\n"); printk("read failed, err = %d\n", -n); printk("fd %d will not support SIGWINCH\n", fd); - err = -EINVAL; - goto out_close1; + *fd_out = -1; } - return err ; - - out_close: - os_close_file(fds[1]); - out_close1: - os_close_file(fds[0]); - out: - return err; + return(pid); } void register_winch(int fd, struct tty_struct *tty) { - int pid, thread, thread_fd = -1; + int pid, thread, thread_fd; int count; char c = 1; @@ -194,7 +186,7 @@ void register_winch(int fd, struct tty_struct *tty) if(!CHOOSE_MODE_PROC(is_tracer_winch, is_skas_winch, pid, fd, tty) && (pid == -1)){ thread = winch_tramp(fd, tty, &thread_fd); - if(thread > 0){ + if(fd != -1){ register_winch_irq(thread_fd, fd, thread, tty); count = os_write_file(thread_fd, &c, sizeof(c)); diff --git a/trunk/arch/um/drivers/mmapper_kern.c b/trunk/arch/um/drivers/mmapper_kern.c index a37a5ac13c22..a63231dffe05 100644 --- a/trunk/arch/um/drivers/mmapper_kern.c +++ b/trunk/arch/um/drivers/mmapper_kern.c @@ -18,7 +18,6 @@ #include #include #include -#include #include #include #include @@ -118,39 +117,24 @@ static struct file_operations mmapper_fops = { .release = mmapper_release, }; -static struct miscdevice mmapper_dev = { - .minor = MISC_DYNAMIC_MINOR, - .name = "mmapper", - .fops = &mmapper_fops -}; - static int __init mmapper_init(void) { - int err; - printk(KERN_INFO "Mapper v0.1\n"); v_buf = (char *) find_iomem("mmapper", &mmapper_size); if(mmapper_size == 0){ printk(KERN_ERR "mmapper_init - find_iomem failed\n"); - goto out; - } - - err = misc_register(&mmapper_dev); - if(err){ - printk(KERN_ERR "mmapper - misc_register failed, err = %d\n", - err); - goto out; + return(0); } p_buf = __pa(v_buf); -out: - return 0; + + devfs_mk_cdev(MKDEV(30, 0), S_IFCHR|S_IRUGO|S_IWUGO, "mmapper"); + return(0); } static void mmapper_exit(void) { - misc_deregister(&mmapper_dev); } module_init(mmapper_init); diff --git a/trunk/arch/um/drivers/net_user.c b/trunk/arch/um/drivers/net_user.c index 3730d4f12713..47229fe4a813 100644 --- a/trunk/arch/um/drivers/net_user.c +++ b/trunk/arch/um/drivers/net_user.c @@ -32,7 +32,7 @@ int tap_open_common(void *dev, char *gate_addr) return(0); } -void tap_check_ips(char *gate_addr, unsigned char *eth_addr) +void tap_check_ips(char *gate_addr, char *eth_addr) { int tap_addr[4]; diff --git a/trunk/arch/um/drivers/slip.h b/trunk/arch/um/drivers/slip.h index d523618cd5ac..495f2f1b1420 100644 --- a/trunk/arch/um/drivers/slip.h +++ b/trunk/arch/um/drivers/slip.h @@ -12,8 +12,8 @@ struct slip_data { char *addr; char *gate_addr; int slave; - unsigned char ibuf[ENC_BUF_SIZE]; - unsigned char obuf[ENC_BUF_SIZE]; + char ibuf[ENC_BUF_SIZE]; + char obuf[ENC_BUF_SIZE]; int more; /* more data: do not read fd until ibuf has been drained */ int pos; int esc; diff --git a/trunk/arch/um/drivers/slip_proto.h b/trunk/arch/um/drivers/slip_proto.h index 4c4d94a33100..7206361ace45 100644 --- a/trunk/arch/um/drivers/slip_proto.h +++ b/trunk/arch/um/drivers/slip_proto.h @@ -12,8 +12,7 @@ #define SLIP_ESC_END 0334 /* ESC ESC_END means END 'data' */ #define SLIP_ESC_ESC 0335 /* ESC ESC_ESC means ESC 'data' */ -static inline int slip_unesc(unsigned char c, unsigned char *buf, int *pos, - int *esc) +static inline int slip_unesc(unsigned char c,char *buf,int *pos, int *esc) { int ret; diff --git a/trunk/arch/um/drivers/slirp.h b/trunk/arch/um/drivers/slirp.h index afa4e30284fd..04e407d1e44a 100644 --- a/trunk/arch/um/drivers/slirp.h +++ b/trunk/arch/um/drivers/slirp.h @@ -24,8 +24,8 @@ struct slirp_data { struct arg_list_dummy_wrapper argw; int pid; int slave; - unsigned char ibuf[ENC_BUF_SIZE]; - unsigned char obuf[ENC_BUF_SIZE]; + char ibuf[ENC_BUF_SIZE]; + char obuf[ENC_BUF_SIZE]; int more; /* more data: do not read fd until ibuf has been drained */ int pos; int esc; diff --git a/trunk/arch/um/drivers/stderr_console.c b/trunk/arch/um/drivers/stderr_console.c index 429ae8e6c7e5..98565b53d170 100644 --- a/trunk/arch/um/drivers/stderr_console.c +++ b/trunk/arch/um/drivers/stderr_console.c @@ -22,9 +22,9 @@ static void stderr_console_write(struct console *console, const char *string, } static struct console stderr_console = { - .name = "stderr", - .write = stderr_console_write, - .flags = CON_PRINTBUFFER, + .name "stderr", + .write stderr_console_write, + .flags CON_PRINTBUFFER, }; static int __init stderr_console_init(void) diff --git a/trunk/arch/um/include/mconsole.h b/trunk/arch/um/include/mconsole.h index cfa368e045a5..9fbe3083fdd8 100644 --- a/trunk/arch/um/include/mconsole.h +++ b/trunk/arch/um/include/mconsole.h @@ -56,7 +56,7 @@ struct mc_request int as_interrupt; int originating_fd; - unsigned int originlen; + int originlen; unsigned char origin[128]; /* sockaddr_un */ struct mconsole_request request; diff --git a/trunk/arch/um/include/net_user.h b/trunk/arch/um/include/net_user.h index 89885a77a771..36807b796e9f 100644 --- a/trunk/arch/um/include/net_user.h +++ b/trunk/arch/um/include/net_user.h @@ -35,7 +35,7 @@ extern void *get_output_buffer(int *len_out); extern void free_output_buffer(void *buffer); extern int tap_open_common(void *dev, char *gate_addr); -extern void tap_check_ips(char *gate_addr, unsigned char *eth_addr); +extern void tap_check_ips(char *gate_addr, char *eth_addr); extern void read_output(int fd, char *output_out, int len); diff --git a/trunk/arch/um/include/os.h b/trunk/arch/um/include/os.h index 881d2988d2d8..d246d5a24609 100644 --- a/trunk/arch/um/include/os.h +++ b/trunk/arch/um/include/os.h @@ -136,7 +136,7 @@ extern int os_seek_file(int fd, __u64 offset); extern int os_open_file(char *file, struct openflags flags, int mode); extern int os_read_file(int fd, void *buf, int len); extern int os_write_file(int fd, const void *buf, int count); -extern int os_file_size(char *file, unsigned long long *size_out); +extern int os_file_size(char *file, long long *size_out); extern int os_file_modtime(char *file, unsigned long *modtime); extern int os_pipe(int *fd, int stream, int close_on_exec); extern int os_set_fd_async(int fd, int owner); diff --git a/trunk/arch/um/include/user_util.h b/trunk/arch/um/include/user_util.h index 7b6a24dfd302..b8c5b8a95250 100644 --- a/trunk/arch/um/include/user_util.h +++ b/trunk/arch/um/include/user_util.h @@ -41,6 +41,9 @@ extern unsigned long highmem; extern char host_info[]; extern char saved_command_line[]; +extern char command_line[]; + +extern char *tempdir; extern unsigned long _stext, _etext, _sdata, _edata, __bss_start, _end; extern unsigned long _unprotected_end; diff --git a/trunk/arch/um/kernel/skas/process_kern.c b/trunk/arch/um/kernel/skas/process_kern.c index fc71ef295782..ab5d3271da0b 100644 --- a/trunk/arch/um/kernel/skas/process_kern.c +++ b/trunk/arch/um/kernel/skas/process_kern.c @@ -68,11 +68,8 @@ void new_thread_handler(int sig) * 0 if it just exits */ n = run_kernel_thread(fn, arg, ¤t->thread.exec_buf); - if(n == 1){ - /* Handle any immediate reschedules or signals */ - interrupt_end(); + if(n == 1) userspace(¤t->thread.regs.regs); - } else do_exit(0); } @@ -99,8 +96,6 @@ void fork_handler(int sig) schedule_tail(current->thread.prev_sched); current->thread.prev_sched = NULL; - /* Handle any immediate reschedules or signals */ - interrupt_end(); userspace(¤t->thread.regs.regs); } diff --git a/trunk/arch/um/os-Linux/elf_aux.c b/trunk/arch/um/os-Linux/elf_aux.c index f0d6060e3e57..9aee0b62ebca 100644 --- a/trunk/arch/um/os-Linux/elf_aux.c +++ b/trunk/arch/um/os-Linux/elf_aux.c @@ -45,11 +45,7 @@ __init void scan_elf_aux( char **envp) elf_aux_hwcap = auxv->a_un.a_val; break; case AT_PLATFORM: - /* elf.h removed the pointer elements from - * a_un, so we have to use a_val, which is - * all that's left. - */ - elf_aux_platform = (char *) auxv->a_un.a_val; + elf_aux_platform = auxv->a_un.a_ptr; break; case AT_PAGESZ: page_size = auxv->a_un.a_val; diff --git a/trunk/arch/um/os-Linux/file.c b/trunk/arch/um/os-Linux/file.c index fd45bb260907..77d4066d1af8 100644 --- a/trunk/arch/um/os-Linux/file.c +++ b/trunk/arch/um/os-Linux/file.c @@ -363,7 +363,7 @@ int os_write_file(int fd, const void *buf, int len) (int (*)(int, void *, int)) write, copy_to_user_proc)); } -int os_file_size(char *file, unsigned long long *size_out) +int os_file_size(char *file, long long *size_out) { struct uml_stat buf; int err; diff --git a/trunk/arch/x86_64/kernel/aperture.c b/trunk/arch/x86_64/kernel/aperture.c index 504e63474993..a491f72cc966 100644 --- a/trunk/arch/x86_64/kernel/aperture.c +++ b/trunk/arch/x86_64/kernel/aperture.c @@ -33,11 +33,13 @@ int fallback_aper_force __initdata = 0; int fix_aperture __initdata = 1; -/* This code runs before the PCI subsystem is initialized, so just - access the northbridge directly. */ - #define NB_ID_3 (PCI_VENDOR_ID_AMD | (0x1103<<16)) +static struct resource aper_res = { + .name = "Aperture", + .flags = IORESOURCE_MEM, +}; + static u32 __init allocate_aperture(void) { #ifdef CONFIG_DISCONTIGMEM @@ -53,11 +55,24 @@ static u32 __init allocate_aperture(void) aper_size = (32 * 1024 * 1024) << fallback_aper_order; /* - * Aperture has to be naturally aligned. This means an 2GB aperture won't - * have much chances to find a place in the lower 4GB of memory. - * Unfortunately we cannot move it up because that would make the - * IOMMU useless. + * Aperture has to be naturally aligned. This means an 2GB + * aperture won't have much chances to find a place in the + * lower 4GB of memory. Unfortunately we cannot move it up + * because that would make the IOMMU useless. */ + + /* First try to find some free unused space */ + if (!allocate_resource(&iomem_resource, &aper_res, + aper_size, + 0, 0xffffffff, + aper_size, + NULL, NULL)) { + printk(KERN_INFO "Putting aperture at %lx-%lx\n", + aper_res.start, aper_res.end); + return aper_res.start; + } + + /* No free space found. Go on to waste some memory... */ p = __alloc_bootmem_node(nd0, aper_size, aper_size, 0); if (!p || __pa(p)+aper_size > 0xffffffff) { printk("Cannot allocate aperture memory hole (%p,%uK)\n", @@ -66,7 +81,7 @@ static u32 __init allocate_aperture(void) free_bootmem_node(nd0, (unsigned long)p, aper_size); return 0; } - printk("Mapping aperture over %d KB of RAM @ %lx\n", + printk("Mapping aperture over %d KB of precious RAM @ %lx\n", aper_size >> 10, __pa(p)); return (u32)__pa(p); } @@ -87,10 +102,16 @@ static int __init aperture_valid(char *name, u64 aper_base, u32 aper_size) printk("Aperture from %s pointing to e820 RAM. Ignoring.\n",name); return 0; } + /* Don't check the resource here because the aperture is usually + in an e820 reserved area, and we allocated these earlier. */ return 1; } -/* Find a PCI capability */ +/* + * Find a PCI capability. + * This code runs before the PCI subsystem is initialized, so just + * access the northbridge directly. + */ static __u32 __init find_cap(int num, int slot, int func, int cap) { u8 pos; @@ -255,8 +276,6 @@ void __init iommu_hole_init(void) fallback_aper_force) { printk("Your BIOS doesn't leave a aperture memory hole\n"); printk("Please enable the IOMMU option in the BIOS setup\n"); - printk("This costs you %d MB of RAM\n", - 32 << fallback_aper_order); aper_order = fallback_aper_order; aper_alloc = allocate_aperture(); diff --git a/trunk/drivers/md/dm-mpath.c b/trunk/drivers/md/dm-mpath.c index 0c1b8520ef86..1e97b3c12bd5 100644 --- a/trunk/drivers/md/dm-mpath.c +++ b/trunk/drivers/md/dm-mpath.c @@ -985,9 +985,6 @@ static int do_end_io(struct multipath *m, struct bio *bio, if (!error) return 0; /* I/O complete */ - if ((error == -EWOULDBLOCK) && bio_rw_ahead(bio)) - return error; - spin_lock(&m->lock); if (!m->nr_valid_paths) { if (!m->queue_if_no_path || m->suspended) { diff --git a/trunk/drivers/net/tg3.c b/trunk/drivers/net/tg3.c index a0b8848049c9..e944aac258e3 100644 --- a/trunk/drivers/net/tg3.c +++ b/trunk/drivers/net/tg3.c @@ -66,8 +66,8 @@ #define DRV_MODULE_NAME "tg3" #define PFX DRV_MODULE_NAME ": " -#define DRV_MODULE_VERSION "3.31" -#define DRV_MODULE_RELDATE "June 8, 2005" +#define DRV_MODULE_VERSION "3.30" +#define DRV_MODULE_RELDATE "June 6, 2005" #define TG3_DEF_MAC_MODE 0 #define TG3_DEF_RX_MODE 0 @@ -9695,24 +9695,10 @@ static int __devinit tg3_test_dma(struct tg3 *tp) } if ((tp->dma_rwctrl & DMA_RWCTRL_WRITE_BNDRY_MASK) != DMA_RWCTRL_WRITE_BNDRY_16) { - static struct pci_device_id dma_wait_state_chipsets[] = { - { PCI_DEVICE(PCI_VENDOR_ID_APPLE, - PCI_DEVICE_ID_APPLE_UNI_N_PCI15) }, - { }, - }; - /* DMA test passed without adjusting DMA boundary, - * now look for chipsets that are known to expose the - * DMA bug without failing the test. + * just restore the calculated DMA boundary */ - if (pci_dev_present(dma_wait_state_chipsets)) { - tp->dma_rwctrl &= ~DMA_RWCTRL_WRITE_BNDRY_MASK; - tp->dma_rwctrl |= DMA_RWCTRL_WRITE_BNDRY_16; - } - else - /* Safe to use the calculated DMA boundary. */ - tp->dma_rwctrl = saved_dma_rwctrl; - + tp->dma_rwctrl = saved_dma_rwctrl; tw32(TG3PCI_DMA_RW_CTRL, tp->dma_rwctrl); } diff --git a/trunk/include/asm-ia64/pgtable.h b/trunk/include/asm-ia64/pgtable.h index fcc9c3344ab4..ea121a002309 100644 --- a/trunk/include/asm-ia64/pgtable.h +++ b/trunk/include/asm-ia64/pgtable.h @@ -8,7 +8,7 @@ * This hopefully works with any (fixed) IA-64 page-size, as defined * in . * - * Copyright (C) 1998-2005 Hewlett-Packard Co + * Copyright (C) 1998-2004 Hewlett-Packard Co * David Mosberger-Tang */ @@ -551,11 +551,7 @@ do { \ /* These tell get_user_pages() that the first gate page is accessible from user-level. */ #define FIXADDR_USER_START GATE_ADDR -#ifdef HAVE_BUGGY_SEGREL -# define FIXADDR_USER_END (GATE_ADDR + 2*PAGE_SIZE) -#else -# define FIXADDR_USER_END (GATE_ADDR + 2*PERCPU_PAGE_SIZE) -#endif +#define FIXADDR_USER_END (GATE_ADDR + 2*PERCPU_PAGE_SIZE) #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_YOUNG #define __HAVE_ARCH_PTEP_TEST_AND_CLEAR_DIRTY diff --git a/trunk/include/asm-ia64/processor.h b/trunk/include/asm-ia64/processor.h index 91bbd1f22461..9e1ba8b7fb68 100644 --- a/trunk/include/asm-ia64/processor.h +++ b/trunk/include/asm-ia64/processor.h @@ -403,10 +403,7 @@ extern void ia64_setreg_unknown_kr (void); * task_struct at this point. */ -/* - * Return TRUE if task T owns the fph partition of the CPU we're running on. - * Must be called from code that has preemption disabled. - */ +/* Return TRUE if task T owns the fph partition of the CPU we're running on. */ #define ia64_is_local_fpu_owner(t) \ ({ \ struct task_struct *__ia64_islfo_task = (t); \ @@ -414,10 +411,7 @@ extern void ia64_setreg_unknown_kr (void); && __ia64_islfo_task == (struct task_struct *) ia64_get_kr(IA64_KR_FPU_OWNER)); \ }) -/* - * Mark task T as owning the fph partition of the CPU we're running on. - * Must be called from code that has preemption disabled. - */ +/* Mark task T as owning the fph partition of the CPU we're running on. */ #define ia64_set_local_fpu_owner(t) do { \ struct task_struct *__ia64_slfo_task = (t); \ __ia64_slfo_task->thread.last_fph_cpu = smp_processor_id(); \ diff --git a/trunk/include/asm-ppc64/elf.h b/trunk/include/asm-ppc64/elf.h index 085eedb956fe..6c42d61bedd1 100644 --- a/trunk/include/asm-ppc64/elf.h +++ b/trunk/include/asm-ppc64/elf.h @@ -221,7 +221,9 @@ do { \ set_thread_flag(TIF_ABI_PENDING); \ else \ clear_thread_flag(TIF_ABI_PENDING); \ - if (personality(current->personality) != PER_LINUX32) \ + if (ibcs2) \ + set_personality(PER_SVR4); \ + else if (current->personality != PER_LINUX32) \ set_personality(PER_LINUX); \ } while (0) diff --git a/trunk/include/asm-sparc/uaccess.h b/trunk/include/asm-sparc/uaccess.h index 0a780e84a12b..f461144067ee 100644 --- a/trunk/include/asm-sparc/uaccess.h +++ b/trunk/include/asm-sparc/uaccess.h @@ -41,11 +41,10 @@ * No one can read/write anything from userland in the kernel space by setting * large size and address near to PAGE_OFFSET - a fault will break his intentions. */ -#define __user_ok(addr, size) ({ (void)(size); (addr) < STACK_TOP; }) +#define __user_ok(addr,size) ((addr) < STACK_TOP) #define __kernel_ok (segment_eq(get_fs(), KERNEL_DS)) #define __access_ok(addr,size) (__user_ok((addr) & get_fs().seg,(size))) -#define access_ok(type, addr, size) \ - ({ (void)(type); __access_ok((unsigned long)(addr), size); }) +#define access_ok(type,addr,size) __access_ok((unsigned long)(addr),(size)) /* this function will go away soon - use access_ok() instead */ static inline int __deprecated verify_area(int type, const void __user * addr, unsigned long size) diff --git a/trunk/include/linux/pci_ids.h b/trunk/include/linux/pci_ids.h index b8b4ebf9abf1..18f734ec9181 100644 --- a/trunk/include/linux/pci_ids.h +++ b/trunk/include/linux/pci_ids.h @@ -874,7 +874,6 @@ #define PCI_DEVICE_ID_APPLE_KL_USB_P 0x0026 #define PCI_DEVICE_ID_APPLE_UNI_N_AGP_P 0x0027 #define PCI_DEVICE_ID_APPLE_UNI_N_AGP15 0x002d -#define PCI_DEVICE_ID_APPLE_UNI_N_PCI15 0x002e #define PCI_DEVICE_ID_APPLE_UNI_N_FW2 0x0030 #define PCI_DEVICE_ID_APPLE_UNI_N_GMAC2 0x0032 #define PCI_DEVIEC_ID_APPLE_UNI_N_ATA 0x0033 diff --git a/trunk/net/ipv6/ip6_tunnel.c b/trunk/net/ipv6/ip6_tunnel.c index 3b1c9fa184ae..ba3b0c267f75 100644 --- a/trunk/net/ipv6/ip6_tunnel.c +++ b/trunk/net/ipv6/ip6_tunnel.c @@ -882,6 +882,7 @@ ip6ip6_tnl_change(struct ip6_tnl *t, struct ip6_tnl_parm *p) t->parms.hop_limit = p->hop_limit; t->parms.encap_limit = p->encap_limit; t->parms.flowinfo = p->flowinfo; + t->parms.link = p->link; ip6ip6_tnl_link_config(t); return 0; }