kernel test patch available
Subsystems (6)
A test patch is now available at:
ftp://linux.kernel.org/pub/linux/kernel/ports/ia64/testing/test-010221.diff.gz
This is a *test* patch, so treat it with proper care. In particular, please don't make distros based on this patch.
I've got a plane to catch, so I keep this brief: read the source to see what changed. ;-)
OK, a little more: this patch cleans up various things, but the interesting stuff is:
- The local per-CPU data is now mapped at 0xa000000000000000+2*PAGE_SIZE. This allows efficient access to per-CPU variables in an MP environment.
- On an execve(), the registers are cleared, as they should be. As a heads up, in a next step I'm planning to get rid of saving/restoring the scratch registers on a system call. This will simplify the execve() register clearing and, not to mention, speed up system call execution (of course, the kernel will clear the scratch registers upon returning from the system call so as to avoid leaking kernel data to user space).
- When returning to user mode, the "invalid" partition of the stacked registers get cleared now (as they should be). Someone with access to Intel's "visual assembler" might want to double check that code to make sure it really runs at the advertised speed. ;-)
OK, that's it for now. Note: this patch is known to build and work fine on Big Sur and HP Ski simulator. No reason to believe it wouldn't work on a Lion, but, for lack of time, I wasn't able to test it.
The diff below is relative against the previous IA-64 kernel. As usual, it's fyi only.
--david
PS: Kanoj, sorry, still no percpu irq patch---it'll be the first patch
I take care of when returning. I simply didn't have the energy to add another potential source errors today...
arch/ia64/boot/bootloader.c +11 -8
@@ -3,8 +3,8 @@* * Loads an ELF kernel. * -* Copyright (C) 1998, 1999 Hewlett-Packard Co -* Copyright (C) 1998, 1999 David Mosberger-Tang <[email protected]> +* Copyright (C) 1998, 1999, 2001 Hewlett-Packard Co +* Copyright (C) 1998, 1999, 2001 David Mosberger-Tang <[email protected]> * Copyright (C) 1998, 1999 Stephane Eranian <[email protected]> * * 01/07/99 S.Eranian modified to pass command line arguments to kernel
@@ -198,19 +198,22 @@ asmvolatile ("mov ar.k0=%0" ::"r" (0xffffc000000UL ));/* -* Install a translation register that identity maps the -* kernel's 256MB page. +* Install a translation register that identity maps the kernel's 256MB page. */ ia64_clear_ic (flags);ia64_set_rr (0 , (0x1000 <<8 ) | (_PAGE_SIZE_1M <<2 ));ia64_set_rr (PAGE_OFFSET , (ia64_rid (0 ,PAGE_OFFSET ) <<8 ) | (_PAGE_SIZE_256M <<2 ));ia64_srlz_d (); -ia64_itr (0x3 ,0 ,1024 *1024 , -pte_val (mk_pte_phys (1024 *1024 ,__pgprot (__DIRTY_BITS|_PAGE_PL_0|_PAGE_AR_RWX))), - _PAGE_SIZE_1M); -ia64_itr (0x3 ,1 ,PAGE_OFFSET , +ia64_itr (0x3 ,IA64_TR_KERNEL ,PAGE_OFFSET ,pte_val (mk_pte_phys (0 ,__pgprot (__DIRTY_BITS|_PAGE_PL_0|_PAGE_AR_RWX))), _PAGE_SIZE_256M); +/* +* Map the bootloader with itr1 and dtr1; dtr1 will later be re-used for other +* purposes, but itr1 will stick. +*/ +ia64_itr (0x3 ,IA64_TR_PALCODE ,1024 *1024 , +pte_val (mk_pte_phys (1024 *1024 ,__pgprot (__DIRTY_BITS|_PAGE_PL_0|_PAGE_AR_RWX))), + _PAGE_SIZE_1M);ia64_srlz_i (); enter_virtual_mode(flags | IA64_PSR_IT | IA64_PSR_IC | IA64_PSR_DT | IA64_PSR_RT
arch/ia64/config.in +1 -2
@@ -63,7 +63,6 @@ if [ "$CONFIG_IA64_DIG" = "y" ]; then bool ' Force interrupt redirection' CONFIG_IA64_HAVE_IRQREDIR - bool ' Enable SoftSDV hacks' CONFIG_IA64_SOFTSDV_HACKS bool ' Enable IA-64 Machine Check Abort' CONFIG_IA64_MCA bool ' Enable ACPI 2.0 with errata 1.3' CONFIG_ACPI20 bool ' ACPI kernel configuration manager (EXPERIMENTAL)' CONFIG_ACPI_KERNEL_CONFIG
@@ -92,7 +91,7 @@ bool 'SMP support' CONFIG_SMP bool 'Performance monitor support' CONFIG_PERFMON -bool '/proc/pal support' CONFIG_IA64_PALINFO +tristate '/proc/pal support' CONFIG_IA64_PALINFO bool 'Networking support' CONFIG_NET bool 'System V IPC' CONFIG_SYSVIPC
arch/ia64/dig/setup.c +3 -7
@@ -1,9 +1,9 @@/* -* Platform dependent support for Intel SoftSDV simulator. +* Platform dependent support for DIG64 platforms. * * Copyright (C) 1999 Intel Corp. -* Copyright (C) 1999 Hewlett-Packard Co -* Copyright (C) 1999 David Mosberger-Tang <[email protected]> +* Copyright (C) 1999, 2001 Hewlett-Packard Co +* Copyright (C) 1999, 2001 David Mosberger-Tang <[email protected]> * Copyright (C) 1999 VA Linux Systems * Copyright (C) 1999 Walt Drummond <[email protected]> * Copyright (C) 1999 Vijay Chander <[email protected]>
@@ -47,10 +47,6 @@* physical disk 1 partition 2. */ ROOT_DEV =to_kdev_t (0x0802 );/* default to second partition on first drive */ - -#ifdef CONFIG_IA64_SOFTSDV_HACKS -ROOT_DEV =to_kdev_t (0x0302 );/* 2nd partion on 1st IDE */ -#endif /* CONFIG_IA64_SOFTSDV_HACKS */ #ifdef CONFIG_SMP init_smp_config ();
arch/ia64/ia32/binfmt_elf32.c +2 -8
@@ -125,14 +125,8 @@ : "r" ((ulong)IA32_FCR_DEFAULT)); __asm__("mov ar.fir = r0" ); __asm__("mov ar.fdr = r0" ); - __asm__("mov %0=ar.k0 ;;" :"=r" (current->thread.old_iob)); - __asm__("mov ar.k0=%0 ;;" ::"r" (IA32_IOBASE )); -/* TSS */ - __asm__("mov ar.k1 = %0" - :/* no outputs */ - : "r" IA64_SEG_DESCRIPTOR(IA32_PAGE_OFFSET + PAGE_SIZE, - 0x1FFFL, 0xBL, 1L, - 3L, 1L, 1L, 1L)); + current->thread.old_iob =ia64_get_kr (IA64_KR_IO_BASE ); +ia64_set_kr (IA64_KR_IO_BASE ,IA32_IOBASE );/* Get the segment selectors right */ regs->r16 = (__USER_DS <<16 ) | (__USER_DS);/* ES = DS, GS, FS are zero */
arch/ia64/ia32/ia32_entry.S +2 -2
@@ -254,7 +254,7 @@ data8 sys32_sigreturn data8 sys_clone /* 120 */ data8 sys_setdomainname - data8 sys_newuname + data8 sys32_newuname data8 sys_modify_ldt data8 sys_adjtimex data8 sys32_mprotect /* 125 */
@@ -281,7 +281,7 @@ data8 sys32_writev data8 sys_getsid data8 sys_fdatasync - data8 sys_sysctl + data8 sys32_sysctl data8 sys_mlock /* 150 */ data8 sys_munlock data8 sys_mlockall
arch/ia64/ia32/ia32_support.c +5 -10
@@ -2,6 +2,7 @@* IA32 helper functions * * 06/16/00 A. Mallick added csd/ssd/tssd for ia32 thread context +* 02/19/01 D. Mosberger dropped tssd; it's not needed */ #include <linux/kernel.h>
@@ -22,7 +23,7 @@void ia32_save_state (struct thread_struct *thread) { -unsigned long eflag, fsr, fcr, fir, fdr, csd, ssd, tssd; +unsigned long eflag, fsr, fcr, fir, fdr, csd, ssd; asm ("mov %0=ar.eflag;" "mov %1=ar.fsr;"
@@ -31,9 +32,7 @@ "mov %4=ar.fdr;" "mov %5=ar.csd;" "mov %6=ar.ssd;" - "mov %7=ar.k1" - : "=r"(eflag), "=r"(fsr), "=r"(fcr), "=r"(fir), "=r"(fdr), - "=r"(csd), "=r"(ssd), "=r"(tssd)); + : "=r"(eflag), "=r"(fsr), "=r"(fcr), "=r"(fir), "=r"(fdr), "=r"(csd), "=r"(ssd)); thread->eflag = eflag; thread->fsr = fsr; thread->fcr = fcr;
@@ -41,14 +40,13 @@ thread->fdr = fdr; thread->csd = csd; thread->ssd = ssd; - thread->tssd = tssd; asm ("mov ar.k0=%0 ;;" ::"r" (thread->old_iob)); }void ia32_load_state (struct thread_struct *thread) { -unsigned long eflag, fsr, fcr, fir, fdr, csd, ssd, tssd; +unsigned long eflag, fsr, fcr, fir, fdr, csd, ssd; eflag = thread->eflag; fsr = thread->fsr;
@@ -57,7 +55,6 @@ fdr = thread->fdr; csd = thread->csd; ssd = thread->ssd; - tssd = thread->tssd; asmvolatile ("mov ar.eflag=%0;" "mov ar.fsr=%1;"
@@ -66,9 +63,7 @@ "mov ar.fdr=%4;" "mov ar.csd=%5;" "mov ar.ssd=%6;" - "mov ar.k1=%7" - :: "r"(eflag), "r"(fsr), "r"(fcr), "r"(fir), "r"(fdr), - "r"(csd), "r"(ssd), "r"(tssd)); + :: "r"(eflag), "r"(fsr), "r"(fcr), "r"(fir), "r"(fdr), "r"(csd), "r"(ssd)); asm ("mov %0=ar.k0 ;;" :"=r" (thread->old_iob)); asm ("mov ar.k0=%0 ;;" ::"r" (IA32_IOBASE )); }
arch/ia64/ia32/sys_ia32.c +67 -13
98 lines not on this page · raw message
arch/ia64/kernel/acpi.c +7 -4
@@ -116,10 +116,10 @@int add =1 ;acpi20_entry_lsapic_t *lsapic = (acpi20_entry_lsapic_t *) p; -printk (" CPU %d (%.04x:%.04x): " , total_cpus, lsapic->eid, lsapic->id); +printk (" CPU %.04x:%.04x: " , lsapic->eid, lsapic->id);if ((lsapic->flags &LSAPIC_ENABLED ) =0 ) { -printk ("Disabled.\n" ); +printk ("disabled.\n" ); add =0 ; }
@@ -127,11 +127,14 @@ smp_boot_data.cpu_phys_id[total_cpus] =-1 ;#endif if (add) { -printk ("Available.\n" ); available_cpus++; +printk ("available" );#ifdef CONFIG_SMP smp_boot_data.cpu_phys_id[total_cpus] = (lsapic->id <<8 ) | lsapic->eid; -#endif /* CONFIG_SMP */ +if (hard_smp_processor_id () = smp_boot_data.cpu_phys_id[total_cpus]) +printk (" (BSP)" ); +#endif +printk (".\n" ); } total_cpus++; }
arch/ia64/kernel/brl_emu.c +4 -4
@@ -23,9 +23,9 @@* of an and operation with the mask must be all 0's * or all 1's for the address to be valid. */ -#define unimplemented_virtual_address (va) ( \ - ((va) & my_cpu_data.unimpl_va_mask) != 0 && \ - ((va) & my_cpu_data.unimpl_va_mask) != my_cpu_data.unimpl_va_mask \ +#define unimplemented_virtual_address (va) ( \ + ((va) & current_cpu_data->unimpl_va_mask) != 0 && \ + ((va) & current_cpu_data->unimpl_va_mask) != current_cpu_data->unimpl_va_mask \ )/*
@@ -35,7 +35,7 @@* address to be valid. */ #define unimplemented_physical_address (pa) ( \ - ((pa) & my_cpu_data.unimpl_pa_mask) != 0 \ + ((pa) & current_cpu_data->unimpl_pa_mask) != 0 \ )/*
arch/ia64/kernel/efi.c +14 -29
104 lines not on this page · raw message
arch/ia64/kernel/entry.S +220 -125
580 lines not on this page · raw message
arch/ia64/kernel/entry.h +2 -1
@@ -1,7 +1,7 @@#include <linux/config.h> /* XXX fixme */ -#if defined(CONFIG_ITANIUM_ASTEP_SPECIFIC ) || defined(CONFIG_ITANIUM_BSTEP_SPECIFIC ) +#if defined(CONFIG_ITANIUM_ASTEP_SPECIFIC ) || defined(CONFIG_ITANIUM_B1_SPECIFIC )# define MOVBR (type,br,gr,lbl) mov br=gr#else # define MOVBR (type,br,gr,lbl) mov##type br=gr,lbl
@@ -12,6 +12,7 @@* careful not to step on these! */ #define pKern p2/* will leave_kernel return to kernel-mode? */ +#define pUser p3/* will leave_kernel return to user-mode? */ #define pSys p4/* are we processing a (synchronous) system call? */ #define pNonSys p5/* complement of pSys */
arch/ia64/kernel/fw-emu.c +13 -12
@@ -1,8 +1,8 @@/* * PAL & SAL emulation. * -* Copyright (C) 1998-2000 Hewlett-Packard Co -* Copyright (C) 1998-2000 David Mosberger-Tang <[email protected]> +* Copyright (C) 1998-2001 Hewlett-Packard Co +* Copyright (C) 1998-2001 David Mosberger-Tang <[email protected]> * * For the HP simulator, this file gets include in boot/bootloader.c. * For SoftSDV, this file gets included in sys_softsdv.c.
@@ -151,6 +151,14 @@ movl r10=0x100000100 /* bus_ratio<<32 (1/256) */movl r11=0x100000064 /* itc_ratio<<32 (1/100) */ ;; +1: cmp.eq p6,p7,r28 /* PAL_RSE_INFO */ +(p7) br.cond.sptk.few 1f + mov r8=0 /* status = 0 */ + mov r9– /* num phys stacked */ + mov r10=0 /* hints */ + mov r11=0 + br.cond.sptk.few rp + 1: cmp.eq p6,p7=1,r28 /* PAL_CACHE_FLUSH */ (p7) br.cond.sptk.few 1f mov r9=ar.lc
@@ -168,8 +176,7 @@ ;; mov ar.lc=r9mov r8=r0 -1: - br.cond.sptk.few rp +1: br.cond.sptk.few rp stacked: br.ret.sptk.few rp
@@ -249,13 +256,7 @@* or something platform specific? The SAL * doc ain't exactly clear on this... */ -#if defined(CONFIG_IA64_SOFTSDV_HACKS ) - r9 =4000000 ; -#elif defined(CONFIG_IA64_SDV ) - r9 =300000000 ; -#else r9 =700000000 ; -#endif break ;case SAL_FREQ_BASE_REALTIME_CLOCK :
@@ -445,10 +446,10 @@/* descriptor for firmware emulator: */ md = &efi_memmap[1 ]; - md->type =EFI_RUNTIME_SERVICES_DATA ; + md->type =EFI_PAL_CODE ; md->pad =0 ; md->phys_addr =1 *MB ; - md->virt_addr =0 ; + md->virt_addr =1 *MB ; md->num_pages = (1 *MB ) >>12 ;/* 1MB (in 4KB pages) */ md->attribute =EFI_MEMORY_WB ;
arch/ia64/kernel/gate.S +18 -23
63 lines not on this page · raw message
arch/ia64/kernel/head.S +6 -7
@@ -19,6 +19,7 @@ #include <asm/asmmacro.h> #include <asm/fpu.h> #include <asm/pal.h> +#include <asm/pgtable.h> #include <asm/offsets.h> #include <asm/processor.h> #include <asm/ptrace.h>
@@ -85,11 +86,13 @@ #define isAP p2 // are we booting an Application Processor (not the BSP)? - // Find the init_task for the currently booting CPU. At poweron, and in - // UP mode, cpu_now_booting is 0 + /* + * Find the init_task for the currently booting CPU. At poweron, and in + * UP mode, cpu_now_booting is 0. + */ movl r3=cpu_now_booting ;; - ld4 r3=[r3] + ld4 r3=[r3] // r3 <- smp_processor_id() movl r2=init_tasks ;; shladd r2=r3,3,r2
@@ -103,7 +106,6 @@ // load the "current" pointer (r13) and ar.k6 with the current task mov r13=r2 mov ar.k6=r3 // Physical address - ;; /* * Reserve space at the top of the stack for "struct pt_regs". Kernel threads * don't store interesting values in that structure, but the space still needs
@@ -117,11 +119,8 @@ ;; mov ar.bspstore=r2 // establish the new RSE stack ;; - loadrs // load zero bytes from the register stack - ;; mov ar.rsc=0x3 // place RSE in eager mode ;; - #ifdef CONFIG_IA64_EARLY_PRINTK .rodata alive_msg:
arch/ia64/kernel/ia64_ksyms.c +9 -0
@@ -74,6 +74,8 @@#include <asm/smp.h> EXPORT_SYMBOL (smp_call_function); +EXPORT_SYMBOL (smp_call_function_single); +EXPORT_SYMBOL (cpu_online_map);#include <linux/smp.h> EXPORT_SYMBOL (smp_num_cpus);
@@ -120,3 +122,10 @@extern unsigned long ia64_iobase;EXPORT_SYMBOL (ia64_iobase); + +#include <asm/pal.h> +EXPORT_SYMBOL (ia64_pal_call_phys_stacked); +EXPORT_SYMBOL (ia64_pal_call_phys_static); +EXPORT_SYMBOL (ia64_pal_call_stacked); +EXPORT_SYMBOL (ia64_pal_call_static); +
arch/ia64/kernel/iosapic.c +0 -2
@@ -392,7 +392,6 @@set_rte (vector, (ia64_get_lid () >>16 ) &0xffff ); } -#ifndef CONFIG_IA64_SOFTSDV_HACKS for (i =0 ; i < pci_irq.num_routes; i++) { irq = pci_irq.route[i].irq;
@@ -433,7 +432,6 @@/* program the IOSAPIC routing table: */ set_rte (vector, (ia64_get_lid () >>16 ) &0xffff ); } -#endif /* !CONFIG_IA64_SOFTSDV_HACKS */ }void
arch/ia64/kernel/ivt.S +206 -202
878 lines not on this page · raw message
arch/ia64/kernel/mca_asm.S +385 -390
919 lines not on this page · raw message
arch/ia64/kernel/minstate.h +25 -25
50 lines not on this page · raw message
arch/ia64/kernel/palinfo.c +11 -44
55 lines not on this page · raw message
arch/ia64/kernel/setup.c +27 -26
53 lines not on this page · raw message
arch/ia64/kernel/signal.c +18 -26
44 lines not on this page · raw message
arch/ia64/kernel/smp.c +94 -102
196 lines not on this page · raw message
arch/ia64/kernel/time.c +35 -57
92 lines not on this page · raw message
arch/ia64/kernel/traps.c +20 -22
42 lines not on this page · raw message
arch/ia64/mm/init.c +33 -22
55 lines not on this page · raw message
drivers/scsi/simscsi.c +37 -19
56 lines not on this page · raw message
include/asm-ia64/hardirq.h +27 -27
54 lines not on this page · raw message
include/asm-ia64/page.h +39 -38
77 lines not on this page · raw message
include/asm-ia64/processor.h +151 -76
227 lines not on this page · raw message
include/asm-ia64/smp.h +30 -26
56 lines not on this page · raw message
include/asm-ia64/system.h +3 -43
46 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.