Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6

* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6:
[IA64] minor reformatting to vmlinux.lds.S
[IA64] CMC/CPE: Reverse the order of fetching log and checking poll threshold
[IA64] PAL calls need physical mode, stacked
[IA64] ar.fpsr not set on MCA/INIT kernel entry
[IA64] printing support for MCA/INIT
[IA64] trim output of show_mem()
[IA64] show_mem() printk levels
[IA64] Make gp value point to Region 5 in mca handler
Revert "[IA64] Unwire set/get_robust_list"
[IA64] Implement futex primitives
[IA64-SGI] Do not request DMA memory for BTE
[IA64] Move perfmon tables from thread_struct to pfm_context
[IA64] Add interface so modules can discover whether multithreading is on.
[IA64] kprobes: fixup the pagefault exception caused by probehandlers
[IA64] kprobe opcode 16 bytes alignment on IA64
[IA64] esi-support
[IA64] Add "model name" to /proc/cpuinfo

+920 -198
+8
arch/ia64/Kconfig
··· 423 423 config SGI_SN 424 424 def_bool y if (IA64_SGI_SN2 || IA64_GENERIC) 425 425 426 + config IA64_ESI 427 + bool "ESI (Extensible SAL Interface) support" 428 + help 429 + If you say Y here, support is built into the kernel to 430 + make ESI calls. ESI calls are used to support vendor-specific 431 + firmware extensions, such as the ability to inject memory-errors 432 + for test-purposes. If you're unsure, say N. 433 + 426 434 source "drivers/sn/Kconfig" 427 435 428 436 source "drivers/firmware/Kconfig"
+5
arch/ia64/kernel/Makefile
··· 32 32 obj-$(CONFIG_AUDIT) += audit.o 33 33 mca_recovery-y += mca_drv.o mca_drv_asm.o 34 34 35 + obj-$(CONFIG_IA64_ESI) += esi.o 36 + ifneq ($(CONFIG_IA64_ESI),) 37 + obj-y += esi_stub.o # must be in kernel proper 38 + endif 39 + 35 40 # The gate DSO image is built using a special linker script. 36 41 targets += gate.so gate-syms.o 37 42
+2 -2
arch/ia64/kernel/entry.S
··· 1605 1605 data8 sys_ni_syscall // 1295 reserved for ppoll 1606 1606 data8 sys_unshare 1607 1607 data8 sys_splice 1608 - data8 sys_ni_syscall // reserved for set_robust_list 1609 - data8 sys_ni_syscall // reserved for get_robust_list 1608 + data8 sys_set_robust_list 1609 + data8 sys_get_robust_list 1610 1610 data8 sys_sync_file_range // 1300 1611 1611 data8 sys_tee 1612 1612 data8 sys_vmsplice
+205
arch/ia64/kernel/esi.c
··· 1 + /* 2 + * Extensible SAL Interface (ESI) support routines. 3 + * 4 + * Copyright (C) 2006 Hewlett-Packard Co 5 + * Alex Williamson <alex.williamson@hp.com> 6 + */ 7 + #include <linux/kernel.h> 8 + #include <linux/init.h> 9 + #include <linux/module.h> 10 + #include <linux/string.h> 11 + 12 + #include <asm/esi.h> 13 + #include <asm/sal.h> 14 + 15 + MODULE_AUTHOR("Alex Williamson <alex.williamson@hp.com>"); 16 + MODULE_DESCRIPTION("Extensible SAL Interface (ESI) support"); 17 + MODULE_LICENSE("GPL"); 18 + 19 + #define MODULE_NAME "esi" 20 + 21 + #define ESI_TABLE_GUID \ 22 + EFI_GUID(0x43EA58DC, 0xCF28, 0x4b06, 0xB3, \ 23 + 0x91, 0xB7, 0x50, 0x59, 0x34, 0x2B, 0xD4) 24 + 25 + enum esi_systab_entry_type { 26 + ESI_DESC_ENTRY_POINT = 0 27 + }; 28 + 29 + /* 30 + * Entry type: Size: 31 + * 0 48 32 + */ 33 + #define ESI_DESC_SIZE(type) "\060"[(unsigned) (type)] 34 + 35 + typedef struct ia64_esi_desc_entry_point { 36 + u8 type; 37 + u8 reserved1[15]; 38 + u64 esi_proc; 39 + u64 gp; 40 + efi_guid_t guid; 41 + } ia64_esi_desc_entry_point_t; 42 + 43 + struct pdesc { 44 + void *addr; 45 + void *gp; 46 + }; 47 + 48 + static struct ia64_sal_systab *esi_systab; 49 + 50 + static int __init esi_init (void) 51 + { 52 + efi_config_table_t *config_tables; 53 + struct ia64_sal_systab *systab; 54 + unsigned long esi = 0; 55 + char *p; 56 + int i; 57 + 58 + config_tables = __va(efi.systab->tables); 59 + 60 + for (i = 0; i < (int) efi.systab->nr_tables; ++i) { 61 + if (efi_guidcmp(config_tables[i].guid, ESI_TABLE_GUID) == 0) { 62 + esi = config_tables[i].table; 63 + break; 64 + } 65 + } 66 + 67 + if (!esi) 68 + return -ENODEV;; 69 + 70 + systab = __va(esi); 71 + 72 + if (strncmp(systab->signature, "ESIT", 4) != 0) { 73 + printk(KERN_ERR "bad signature in ESI system table!"); 74 + return -ENODEV; 75 + } 76 + 77 + p = (char *) (systab + 1); 78 + for (i = 0; i < systab->entry_count; i++) { 79 + /* 80 + * The first byte of each entry type contains the type 81 + * descriptor. 82 + */ 83 + switch (*p) { 84 + case ESI_DESC_ENTRY_POINT: 85 + break; 86 + default: 87 + printk(KERN_WARNING "Unkown table type %d found in " 88 + "ESI table, ignoring rest of table\n", *p); 89 + return -ENODEV; 90 + } 91 + 92 + p += ESI_DESC_SIZE(*p); 93 + } 94 + 95 + esi_systab = systab; 96 + return 0; 97 + } 98 + 99 + 100 + int ia64_esi_call (efi_guid_t guid, struct ia64_sal_retval *isrvp, 101 + enum esi_proc_type proc_type, u64 func, 102 + u64 arg1, u64 arg2, u64 arg3, u64 arg4, u64 arg5, u64 arg6, 103 + u64 arg7) 104 + { 105 + struct ia64_fpreg fr[6]; 106 + unsigned long flags = 0; 107 + int i; 108 + char *p; 109 + 110 + if (!esi_systab) 111 + return -1; 112 + 113 + p = (char *) (esi_systab + 1); 114 + for (i = 0; i < esi_systab->entry_count; i++) { 115 + if (*p == ESI_DESC_ENTRY_POINT) { 116 + ia64_esi_desc_entry_point_t *esi = (void *)p; 117 + if (!efi_guidcmp(guid, esi->guid)) { 118 + ia64_sal_handler esi_proc; 119 + struct pdesc pdesc; 120 + 121 + pdesc.addr = __va(esi->esi_proc); 122 + pdesc.gp = __va(esi->gp); 123 + 124 + esi_proc = (ia64_sal_handler) &pdesc; 125 + 126 + ia64_save_scratch_fpregs(fr); 127 + if (proc_type == ESI_PROC_SERIALIZED) 128 + spin_lock_irqsave(&sal_lock, flags); 129 + else if (proc_type == ESI_PROC_MP_SAFE) 130 + local_irq_save(flags); 131 + else 132 + preempt_disable(); 133 + *isrvp = (*esi_proc)(func, arg1, arg2, arg3, 134 + arg4, arg5, arg6, arg7); 135 + if (proc_type == ESI_PROC_SERIALIZED) 136 + spin_unlock_irqrestore(&sal_lock, 137 + flags); 138 + else if (proc_type == ESI_PROC_MP_SAFE) 139 + local_irq_restore(flags); 140 + else 141 + preempt_enable(); 142 + ia64_load_scratch_fpregs(fr); 143 + return 0; 144 + } 145 + } 146 + p += ESI_DESC_SIZE(*p); 147 + } 148 + return -1; 149 + } 150 + EXPORT_SYMBOL_GPL(ia64_esi_call); 151 + 152 + int ia64_esi_call_phys (efi_guid_t guid, struct ia64_sal_retval *isrvp, 153 + u64 func, u64 arg1, u64 arg2, u64 arg3, u64 arg4, 154 + u64 arg5, u64 arg6, u64 arg7) 155 + { 156 + struct ia64_fpreg fr[6]; 157 + unsigned long flags; 158 + u64 esi_params[8]; 159 + char *p; 160 + int i; 161 + 162 + if (!esi_systab) 163 + return -1; 164 + 165 + p = (char *) (esi_systab + 1); 166 + for (i = 0; i < esi_systab->entry_count; i++) { 167 + if (*p == ESI_DESC_ENTRY_POINT) { 168 + ia64_esi_desc_entry_point_t *esi = (void *)p; 169 + if (!efi_guidcmp(guid, esi->guid)) { 170 + ia64_sal_handler esi_proc; 171 + struct pdesc pdesc; 172 + 173 + pdesc.addr = (void *)esi->esi_proc; 174 + pdesc.gp = (void *)esi->gp; 175 + 176 + esi_proc = (ia64_sal_handler) &pdesc; 177 + 178 + esi_params[0] = func; 179 + esi_params[1] = arg1; 180 + esi_params[2] = arg2; 181 + esi_params[3] = arg3; 182 + esi_params[4] = arg4; 183 + esi_params[5] = arg5; 184 + esi_params[6] = arg6; 185 + esi_params[7] = arg7; 186 + ia64_save_scratch_fpregs(fr); 187 + spin_lock_irqsave(&sal_lock, flags); 188 + *isrvp = esi_call_phys(esi_proc, esi_params); 189 + spin_unlock_irqrestore(&sal_lock, flags); 190 + ia64_load_scratch_fpregs(fr); 191 + return 0; 192 + } 193 + } 194 + p += ESI_DESC_SIZE(*p); 195 + } 196 + return -1; 197 + } 198 + EXPORT_SYMBOL_GPL(ia64_esi_call_phys); 199 + 200 + static void __exit esi_exit (void) 201 + { 202 + } 203 + 204 + module_init(esi_init); 205 + module_exit(esi_exit); /* makes module removable... */
+96
arch/ia64/kernel/esi_stub.S
··· 1 + /* 2 + * ESI call stub. 3 + * 4 + * Copyright (C) 2005 Hewlett-Packard Co 5 + * Alex Williamson <alex.williamson@hp.com> 6 + * 7 + * Based on EFI call stub by David Mosberger. The stub is virtually 8 + * identical to the one for EFI phys-mode calls, except that ESI 9 + * calls may have up to 8 arguments, so they get passed to this routine 10 + * through memory. 11 + * 12 + * This stub allows us to make ESI calls in physical mode with interrupts 13 + * turned off. ESI calls may not support calling from virtual mode. 14 + * 15 + * Google for "Extensible SAL specification" for a document describing the 16 + * ESI standard. 17 + */ 18 + 19 + /* 20 + * PSR settings as per SAL spec (Chapter 8 in the "IA-64 System 21 + * Abstraction Layer Specification", revision 2.6e). Note that 22 + * psr.dfl and psr.dfh MUST be cleared, despite what this manual says. 23 + * Otherwise, SAL dies whenever it's trying to do an IA-32 BIOS call 24 + * (the br.ia instruction fails unless psr.dfl and psr.dfh are 25 + * cleared). Fortunately, SAL promises not to touch the floating 26 + * point regs, so at least we don't have to save f2-f127. 27 + */ 28 + #define PSR_BITS_TO_CLEAR \ 29 + (IA64_PSR_I | IA64_PSR_IT | IA64_PSR_DT | IA64_PSR_RT | \ 30 + IA64_PSR_DD | IA64_PSR_SS | IA64_PSR_RI | IA64_PSR_ED | \ 31 + IA64_PSR_DFL | IA64_PSR_DFH) 32 + 33 + #define PSR_BITS_TO_SET \ 34 + (IA64_PSR_BN) 35 + 36 + #include <asm/processor.h> 37 + #include <asm/asmmacro.h> 38 + 39 + /* 40 + * Inputs: 41 + * in0 = address of function descriptor of ESI routine to call 42 + * in1 = address of array of ESI parameters 43 + * 44 + * Outputs: 45 + * r8 = result returned by called function 46 + */ 47 + GLOBAL_ENTRY(esi_call_phys) 48 + .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(2) 49 + alloc loc1=ar.pfs,2,7,8,0 50 + ld8 r2=[in0],8 // load ESI function's entry point 51 + mov loc0=rp 52 + .body 53 + ;; 54 + ld8 out0=[in1],8 // ESI params loaded from array 55 + ;; // passing all as inputs doesn't work 56 + ld8 out1=[in1],8 57 + ;; 58 + ld8 out2=[in1],8 59 + ;; 60 + ld8 out3=[in1],8 61 + ;; 62 + ld8 out4=[in1],8 63 + ;; 64 + ld8 out5=[in1],8 65 + ;; 66 + ld8 out6=[in1],8 67 + ;; 68 + ld8 out7=[in1] 69 + mov loc2=gp // save global pointer 70 + mov loc4=ar.rsc // save RSE configuration 71 + mov ar.rsc=0 // put RSE in enforced lazy, LE mode 72 + ;; 73 + ld8 gp=[in0] // load ESI function's global pointer 74 + movl r16=PSR_BITS_TO_CLEAR 75 + mov loc3=psr // save processor status word 76 + movl r17=PSR_BITS_TO_SET 77 + ;; 78 + or loc3=loc3,r17 79 + mov b6=r2 80 + ;; 81 + andcm r16=loc3,r16 // get psr with IT, DT, and RT bits cleared 82 + br.call.sptk.many rp=ia64_switch_mode_phys 83 + .ret0: mov loc5=r19 // old ar.bsp 84 + mov loc6=r20 // old sp 85 + br.call.sptk.many rp=b6 // call the ESI function 86 + .ret1: mov ar.rsc=0 // put RSE in enforced lazy, LE mode 87 + mov r16=loc3 // save virtual mode psr 88 + mov r19=loc5 // save virtual mode bspstore 89 + mov r20=loc6 // save virtual mode sp 90 + br.call.sptk.many rp=ia64_switch_mode_virt // return to virtual mode 91 + .ret2: mov ar.rsc=loc4 // restore RSE configuration 92 + mov ar.pfs=loc1 93 + mov rp=loc0 94 + mov gp=loc2 95 + br.ret.sptk.many rp 96 + END(esi_call_phys)
+4
arch/ia64/kernel/ia64_ksyms.c
··· 105 105 # endif 106 106 #endif 107 107 108 + #if defined(CONFIG_IA64_ESI) || defined(CONFIG_IA64_ESI_MODULE) 109 + extern void esi_call_phys (void); 110 + EXPORT_SYMBOL_GPL(esi_call_phys); 111 + #endif 108 112 extern char ia64_ivt[]; 109 113 EXPORT_SYMBOL(ia64_ivt);
+35 -26
arch/ia64/kernel/kprobes.c
··· 136 136 static int __kprobes unsupported_inst(uint template, uint slot, 137 137 uint major_opcode, 138 138 unsigned long kprobe_inst, 139 - struct kprobe *p) 139 + unsigned long addr) 140 140 { 141 - unsigned long addr = (unsigned long)p->addr; 142 - 143 141 if (bundle_encoding[template][slot] == I) { 144 142 switch (major_opcode) { 145 143 case 0x0: //I_UNIT_MISC_OPCODE: ··· 215 217 struct kprobe *p) 216 218 { 217 219 unsigned long break_inst = BREAK_INST; 218 - bundle_t *bundle = &p->ainsn.insn.bundle; 220 + bundle_t *bundle = &p->opcode.bundle; 219 221 220 222 /* 221 223 * Copy the original kprobe_inst qualifying predicate(qp) ··· 421 423 unsigned long *kprobe_addr = (unsigned long *)(addr & ~0xFULL); 422 424 unsigned long kprobe_inst=0; 423 425 unsigned int slot = addr & 0xf, template, major_opcode = 0; 424 - bundle_t *bundle = &p->ainsn.insn.bundle; 426 + bundle_t *bundle; 425 427 426 - memcpy(&p->opcode.bundle, kprobe_addr, sizeof(bundle_t)); 427 - memcpy(&p->ainsn.insn.bundle, kprobe_addr, sizeof(bundle_t)); 428 - 428 + bundle = &((kprobe_opcode_t *)kprobe_addr)->bundle; 429 429 template = bundle->quad0.template; 430 430 431 431 if(valid_kprobe_addr(template, slot, addr)) ··· 436 440 /* Get kprobe_inst and major_opcode from the bundle */ 437 441 get_kprobe_inst(bundle, slot, &kprobe_inst, &major_opcode); 438 442 439 - if (unsupported_inst(template, slot, major_opcode, kprobe_inst, p)) 443 + if (unsupported_inst(template, slot, major_opcode, kprobe_inst, addr)) 440 444 return -EINVAL; 445 + 446 + 447 + p->ainsn.insn = get_insn_slot(); 448 + if (!p->ainsn.insn) 449 + return -ENOMEM; 450 + memcpy(&p->opcode, kprobe_addr, sizeof(kprobe_opcode_t)); 451 + memcpy(p->ainsn.insn, kprobe_addr, sizeof(kprobe_opcode_t)); 441 452 442 453 prepare_break_inst(template, slot, major_opcode, kprobe_inst, p); 443 454 444 455 return 0; 445 - } 446 - 447 - void __kprobes flush_insn_slot(struct kprobe *p) 448 - { 449 - unsigned long arm_addr; 450 - 451 - arm_addr = ((unsigned long)&p->opcode.bundle) & ~0xFULL; 452 - flush_icache_range(arm_addr, arm_addr + sizeof(bundle_t)); 453 456 } 454 457 455 458 void __kprobes arch_arm_kprobe(struct kprobe *p) ··· 456 461 unsigned long addr = (unsigned long)p->addr; 457 462 unsigned long arm_addr = addr & ~0xFULL; 458 463 459 - flush_insn_slot(p); 460 - memcpy((char *)arm_addr, &p->ainsn.insn.bundle, sizeof(bundle_t)); 461 - flush_icache_range(arm_addr, arm_addr + sizeof(bundle_t)); 464 + flush_icache_range((unsigned long)p->ainsn.insn, 465 + (unsigned long)p->ainsn.insn + sizeof(kprobe_opcode_t)); 466 + memcpy((char *)arm_addr, &p->opcode, sizeof(kprobe_opcode_t)); 467 + flush_icache_range(arm_addr, arm_addr + sizeof(kprobe_opcode_t)); 462 468 } 463 469 464 470 void __kprobes arch_disarm_kprobe(struct kprobe *p) ··· 467 471 unsigned long addr = (unsigned long)p->addr; 468 472 unsigned long arm_addr = addr & ~0xFULL; 469 473 470 - /* p->opcode contains the original unaltered bundle */ 471 - memcpy((char *) arm_addr, (char *) &p->opcode.bundle, sizeof(bundle_t)); 472 - flush_icache_range(arm_addr, arm_addr + sizeof(bundle_t)); 474 + /* p->ainsn.insn contains the original unaltered kprobe_opcode_t */ 475 + memcpy((char *) arm_addr, (char *) p->ainsn.insn, 476 + sizeof(kprobe_opcode_t)); 477 + flush_icache_range(arm_addr, arm_addr + sizeof(kprobe_opcode_t)); 473 478 } 474 479 480 + void __kprobes arch_remove_kprobe(struct kprobe *p) 481 + { 482 + mutex_lock(&kprobe_mutex); 483 + free_insn_slot(p->ainsn.insn); 484 + mutex_unlock(&kprobe_mutex); 485 + } 475 486 /* 476 487 * We are resuming execution after a single step fault, so the pt_regs 477 488 * structure reflects the register state after we executed the instruction ··· 489 486 */ 490 487 static void __kprobes resume_execution(struct kprobe *p, struct pt_regs *regs) 491 488 { 492 - unsigned long bundle_addr = ((unsigned long) (&p->opcode.bundle)) & ~0xFULL; 489 + unsigned long bundle_addr = (unsigned long) (&p->ainsn.insn->bundle); 493 490 unsigned long resume_addr = (unsigned long)p->addr & ~0xFULL; 494 491 unsigned long template; 495 492 int slot = ((unsigned long)p->addr & 0xf); 496 493 497 - template = p->opcode.bundle.quad0.template; 494 + template = p->ainsn.insn->bundle.quad0.template; 498 495 499 496 if (slot == 1 && bundle_encoding[template][1] == L) 500 497 slot = 2; ··· 556 553 557 554 static void __kprobes prepare_ss(struct kprobe *p, struct pt_regs *regs) 558 555 { 559 - unsigned long bundle_addr = (unsigned long) &p->opcode.bundle; 556 + unsigned long bundle_addr = (unsigned long) &p->ainsn.insn->bundle; 560 557 unsigned long slot = (unsigned long)p->addr & 0xf; 561 558 562 559 /* single step inline if break instruction */ ··· 770 767 * user-specified handler try to fix it first. 771 768 */ 772 769 if (cur->fault_handler && cur->fault_handler(cur, regs, trapnr)) 770 + return 1; 771 + /* 772 + * In case the user-specified fault handler returned 773 + * zero, try to fix up. 774 + */ 775 + if (ia64_done_with_exception(regs)) 773 776 return 1; 774 777 775 778 /*
+208 -26
arch/ia64/kernel/mca.c
··· 54 54 * 55 55 * 2005-10-07 Keith Owens <kaos@sgi.com> 56 56 * Add notify_die() hooks. 57 + * 58 + * 2006-09-15 Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> 59 + * Add printing support for MCA/INIT. 57 60 */ 58 61 #include <linux/types.h> 59 62 #include <linux/init.h> ··· 139 136 140 137 static int mca_init __initdata; 141 138 139 + /* 140 + * limited & delayed printing support for MCA/INIT handler 141 + */ 142 + 143 + #define mprintk(fmt...) ia64_mca_printk(fmt) 144 + 145 + #define MLOGBUF_SIZE (512+256*NR_CPUS) 146 + #define MLOGBUF_MSGMAX 256 147 + static char mlogbuf[MLOGBUF_SIZE]; 148 + static DEFINE_SPINLOCK(mlogbuf_wlock); /* mca context only */ 149 + static DEFINE_SPINLOCK(mlogbuf_rlock); /* normal context only */ 150 + static unsigned long mlogbuf_start; 151 + static unsigned long mlogbuf_end; 152 + static unsigned int mlogbuf_finished = 0; 153 + static unsigned long mlogbuf_timestamp = 0; 154 + 155 + static int loglevel_save = -1; 156 + #define BREAK_LOGLEVEL(__console_loglevel) \ 157 + oops_in_progress = 1; \ 158 + if (loglevel_save < 0) \ 159 + loglevel_save = __console_loglevel; \ 160 + __console_loglevel = 15; 161 + 162 + #define RESTORE_LOGLEVEL(__console_loglevel) \ 163 + if (loglevel_save >= 0) { \ 164 + __console_loglevel = loglevel_save; \ 165 + loglevel_save = -1; \ 166 + } \ 167 + mlogbuf_finished = 0; \ 168 + oops_in_progress = 0; 169 + 170 + /* 171 + * Push messages into buffer, print them later if not urgent. 172 + */ 173 + void ia64_mca_printk(const char *fmt, ...) 174 + { 175 + va_list args; 176 + int printed_len; 177 + char temp_buf[MLOGBUF_MSGMAX]; 178 + char *p; 179 + 180 + va_start(args, fmt); 181 + printed_len = vscnprintf(temp_buf, sizeof(temp_buf), fmt, args); 182 + va_end(args); 183 + 184 + /* Copy the output into mlogbuf */ 185 + if (oops_in_progress) { 186 + /* mlogbuf was abandoned, use printk directly instead. */ 187 + printk(temp_buf); 188 + } else { 189 + spin_lock(&mlogbuf_wlock); 190 + for (p = temp_buf; *p; p++) { 191 + unsigned long next = (mlogbuf_end + 1) % MLOGBUF_SIZE; 192 + if (next != mlogbuf_start) { 193 + mlogbuf[mlogbuf_end] = *p; 194 + mlogbuf_end = next; 195 + } else { 196 + /* buffer full */ 197 + break; 198 + } 199 + } 200 + mlogbuf[mlogbuf_end] = '\0'; 201 + spin_unlock(&mlogbuf_wlock); 202 + } 203 + } 204 + EXPORT_SYMBOL(ia64_mca_printk); 205 + 206 + /* 207 + * Print buffered messages. 208 + * NOTE: call this after returning normal context. (ex. from salinfod) 209 + */ 210 + void ia64_mlogbuf_dump(void) 211 + { 212 + char temp_buf[MLOGBUF_MSGMAX]; 213 + char *p; 214 + unsigned long index; 215 + unsigned long flags; 216 + unsigned int printed_len; 217 + 218 + /* Get output from mlogbuf */ 219 + while (mlogbuf_start != mlogbuf_end) { 220 + temp_buf[0] = '\0'; 221 + p = temp_buf; 222 + printed_len = 0; 223 + 224 + spin_lock_irqsave(&mlogbuf_rlock, flags); 225 + 226 + index = mlogbuf_start; 227 + while (index != mlogbuf_end) { 228 + *p = mlogbuf[index]; 229 + index = (index + 1) % MLOGBUF_SIZE; 230 + if (!*p) 231 + break; 232 + p++; 233 + if (++printed_len >= MLOGBUF_MSGMAX - 1) 234 + break; 235 + } 236 + *p = '\0'; 237 + if (temp_buf[0]) 238 + printk(temp_buf); 239 + mlogbuf_start = index; 240 + 241 + mlogbuf_timestamp = 0; 242 + spin_unlock_irqrestore(&mlogbuf_rlock, flags); 243 + } 244 + } 245 + EXPORT_SYMBOL(ia64_mlogbuf_dump); 246 + 247 + /* 248 + * Call this if system is going to down or if immediate flushing messages to 249 + * console is required. (ex. recovery was failed, crash dump is going to be 250 + * invoked, long-wait rendezvous etc.) 251 + * NOTE: this should be called from monarch. 252 + */ 253 + static void ia64_mlogbuf_finish(int wait) 254 + { 255 + BREAK_LOGLEVEL(console_loglevel); 256 + 257 + spin_lock_init(&mlogbuf_rlock); 258 + ia64_mlogbuf_dump(); 259 + printk(KERN_EMERG "mlogbuf_finish: printing switched to urgent mode, " 260 + "MCA/INIT might be dodgy or fail.\n"); 261 + 262 + if (!wait) 263 + return; 264 + 265 + /* wait for console */ 266 + printk("Delaying for 5 seconds...\n"); 267 + udelay(5*1000000); 268 + 269 + mlogbuf_finished = 1; 270 + } 271 + EXPORT_SYMBOL(ia64_mlogbuf_finish); 272 + 273 + /* 274 + * Print buffered messages from INIT context. 275 + */ 276 + static void ia64_mlogbuf_dump_from_init(void) 277 + { 278 + if (mlogbuf_finished) 279 + return; 280 + 281 + if (mlogbuf_timestamp && (mlogbuf_timestamp + 30*HZ > jiffies)) { 282 + printk(KERN_ERR "INIT: mlogbuf_dump is interrupted by INIT " 283 + " and the system seems to be messed up.\n"); 284 + ia64_mlogbuf_finish(0); 285 + return; 286 + } 287 + 288 + if (!spin_trylock(&mlogbuf_rlock)) { 289 + printk(KERN_ERR "INIT: mlogbuf_dump is interrupted by INIT. " 290 + "Generated messages other than stack dump will be " 291 + "buffered to mlogbuf and will be printed later.\n"); 292 + printk(KERN_ERR "INIT: If messages would not printed after " 293 + "this INIT, wait 30sec and assert INIT again.\n"); 294 + if (!mlogbuf_timestamp) 295 + mlogbuf_timestamp = jiffies; 296 + return; 297 + } 298 + spin_unlock(&mlogbuf_rlock); 299 + ia64_mlogbuf_dump(); 300 + } 142 301 143 302 static void inline 144 303 ia64_mca_spin(const char *func) 145 304 { 146 - printk(KERN_EMERG "%s: spinning here, not returning to SAL\n", func); 305 + if (monarch_cpu == smp_processor_id()) 306 + ia64_mlogbuf_finish(0); 307 + mprintk(KERN_EMERG "%s: spinning here, not returning to SAL\n", func); 147 308 while (1) 148 309 cpu_relax(); 149 310 } ··· 511 344 /* SAL spec states this should run w/ interrupts enabled */ 512 345 local_irq_enable(); 513 346 514 - /* Get the CPE error record and log it */ 515 - ia64_mca_log_sal_error_record(SAL_INFO_TYPE_CPE); 516 - 517 347 spin_lock(&cpe_history_lock); 518 348 if (!cpe_poll_enabled && cpe_vector >= 0) { 519 349 ··· 539 375 mod_timer(&cpe_poll_timer, jiffies + MIN_CPE_POLL_INTERVAL); 540 376 541 377 /* lock already released, get out now */ 542 - return IRQ_HANDLED; 378 + goto out; 543 379 } else { 544 380 cpe_history[index++] = now; 545 381 if (index == CPE_HISTORY_LENGTH) ··· 547 383 } 548 384 } 549 385 spin_unlock(&cpe_history_lock); 386 + out: 387 + /* Get the CPE error record and log it */ 388 + ia64_mca_log_sal_error_record(SAL_INFO_TYPE_CPE); 389 + 550 390 return IRQ_HANDLED; 551 391 } 552 392 ··· 1156 988 } 1157 989 if (!missing) 1158 990 goto all_in; 1159 - printk(KERN_INFO "OS %s slave did not rendezvous on cpu", type); 991 + /* 992 + * Maybe slave(s) dead. Print buffered messages immediately. 993 + */ 994 + ia64_mlogbuf_finish(0); 995 + mprintk(KERN_INFO "OS %s slave did not rendezvous on cpu", type); 1160 996 for_each_online_cpu(c) { 1161 997 if (c == monarch) 1162 998 continue; 1163 999 if (ia64_mc_info.imi_rendez_checkin[c] == IA64_MCA_RENDEZ_CHECKIN_NOTDONE) 1164 - printk(" %d", c); 1000 + mprintk(" %d", c); 1165 1001 } 1166 - printk("\n"); 1002 + mprintk("\n"); 1167 1003 return; 1168 1004 1169 1005 all_in: 1170 - printk(KERN_INFO "All OS %s slaves have reached rendezvous\n", type); 1006 + mprintk(KERN_INFO "All OS %s slaves have reached rendezvous\n", type); 1171 1007 return; 1172 1008 } 1173 1009 ··· 1199 1027 struct ia64_mca_notify_die nd = 1200 1028 { .sos = sos, .monarch_cpu = &monarch_cpu }; 1201 1029 1202 - oops_in_progress = 1; /* FIXME: make printk NMI/MCA/INIT safe */ 1203 - console_loglevel = 15; /* make sure printks make it to console */ 1204 - printk(KERN_INFO "Entered OS MCA handler. PSP=%lx cpu=%d monarch=%ld\n", 1205 - sos->proc_state_param, cpu, sos->monarch); 1030 + mprintk(KERN_INFO "Entered OS MCA handler. PSP=%lx cpu=%d " 1031 + "monarch=%ld\n", sos->proc_state_param, cpu, sos->monarch); 1206 1032 1207 1033 previous_current = ia64_mca_modify_original_stack(regs, sw, sos, "MCA"); 1208 1034 monarch_cpu = cpu; ··· 1236 1066 rh->severity = sal_log_severity_corrected; 1237 1067 ia64_sal_clear_state_info(SAL_INFO_TYPE_MCA); 1238 1068 sos->os_status = IA64_MCA_CORRECTED; 1069 + } else { 1070 + /* Dump buffered message to console */ 1071 + ia64_mlogbuf_finish(1); 1239 1072 } 1240 1073 if (notify_die(DIE_MCA_MONARCH_LEAVE, "MCA", regs, (long)&nd, 0, recover) 1241 1074 == NOTIFY_STOP) ··· 1279 1106 /* SAL spec states this should run w/ interrupts enabled */ 1280 1107 local_irq_enable(); 1281 1108 1282 - /* Get the CMC error record and log it */ 1283 - ia64_mca_log_sal_error_record(SAL_INFO_TYPE_CMC); 1284 - 1285 1109 spin_lock(&cmc_history_lock); 1286 1110 if (!cmc_polling_enabled) { 1287 1111 int i, count = 1; /* we know 1 happened now */ ··· 1311 1141 mod_timer(&cmc_poll_timer, jiffies + CMC_POLL_INTERVAL); 1312 1142 1313 1143 /* lock already released, get out now */ 1314 - return IRQ_HANDLED; 1144 + goto out; 1315 1145 } else { 1316 1146 cmc_history[index++] = now; 1317 1147 if (index == CMC_HISTORY_LENGTH) ··· 1319 1149 } 1320 1150 } 1321 1151 spin_unlock(&cmc_history_lock); 1152 + out: 1153 + /* Get the CMC error record and log it */ 1154 + ia64_mca_log_sal_error_record(SAL_INFO_TYPE_CMC); 1155 + 1322 1156 return IRQ_HANDLED; 1323 1157 } 1324 1158 ··· 1479 1305 struct task_struct *g, *t; 1480 1306 if (val != DIE_INIT_MONARCH_PROCESS) 1481 1307 return NOTIFY_DONE; 1308 + 1309 + /* 1310 + * FIXME: mlogbuf will brim over with INIT stack dumps. 1311 + * To enable show_stack from INIT, we use oops_in_progress which should 1312 + * be used in real oops. This would cause something wrong after INIT. 1313 + */ 1314 + BREAK_LOGLEVEL(console_loglevel); 1315 + ia64_mlogbuf_dump_from_init(); 1316 + 1482 1317 printk(KERN_ERR "Processes interrupted by INIT -"); 1483 1318 for_each_online_cpu(c) { 1484 1319 struct ia64_sal_os_state *s; ··· 1509 1326 } while_each_thread (g, t); 1510 1327 read_unlock(&tasklist_lock); 1511 1328 } 1329 + /* FIXME: This will not restore zapped printk locks. */ 1330 + RESTORE_LOGLEVEL(console_loglevel); 1512 1331 return NOTIFY_DONE; 1513 1332 } 1514 1333 ··· 1542 1357 struct ia64_mca_notify_die nd = 1543 1358 { .sos = sos, .monarch_cpu = &monarch_cpu }; 1544 1359 1545 - oops_in_progress = 1; /* FIXME: make printk NMI/MCA/INIT safe */ 1546 - console_loglevel = 15; /* make sure printks make it to console */ 1547 - 1548 1360 (void) notify_die(DIE_INIT_ENTER, "INIT", regs, (long)&nd, 0, 0); 1549 1361 1550 - printk(KERN_INFO "Entered OS INIT handler. PSP=%lx cpu=%d monarch=%ld\n", 1362 + mprintk(KERN_INFO "Entered OS INIT handler. PSP=%lx cpu=%d monarch=%ld\n", 1551 1363 sos->proc_state_param, cpu, sos->monarch); 1552 1364 salinfo_log_wakeup(SAL_INFO_TYPE_INIT, NULL, 0, 0); 1553 1365 ··· 1557 1375 * fix their proms and get their customers updated. 1558 1376 */ 1559 1377 if (!sos->monarch && atomic_add_return(1, &slaves) == num_online_cpus()) { 1560 - printk(KERN_WARNING "%s: Promoting cpu %d to monarch.\n", 1378 + mprintk(KERN_WARNING "%s: Promoting cpu %d to monarch.\n", 1561 1379 __FUNCTION__, cpu); 1562 1380 atomic_dec(&slaves); 1563 1381 sos->monarch = 1; ··· 1569 1387 * fix their proms and get their customers updated. 1570 1388 */ 1571 1389 if (sos->monarch && atomic_add_return(1, &monarchs) > 1) { 1572 - printk(KERN_WARNING "%s: Demoting cpu %d to slave.\n", 1390 + mprintk(KERN_WARNING "%s: Demoting cpu %d to slave.\n", 1573 1391 __FUNCTION__, cpu); 1574 1392 atomic_dec(&monarchs); 1575 1393 sos->monarch = 0; ··· 1590 1408 if (notify_die(DIE_INIT_SLAVE_LEAVE, "INIT", regs, (long)&nd, 0, 0) 1591 1409 == NOTIFY_STOP) 1592 1410 ia64_mca_spin(__FUNCTION__); 1593 - printk("Slave on cpu %d returning to normal service.\n", cpu); 1411 + mprintk("Slave on cpu %d returning to normal service.\n", cpu); 1594 1412 set_curr_task(cpu, previous_current); 1595 1413 ia64_mc_info.imi_rendez_checkin[cpu] = IA64_MCA_RENDEZ_CHECKIN_NOTDONE; 1596 1414 atomic_dec(&slaves); ··· 1608 1426 * same serial line, the user will need some time to switch out of the BMC before 1609 1427 * the dump begins. 1610 1428 */ 1611 - printk("Delaying for 5 seconds...\n"); 1429 + mprintk("Delaying for 5 seconds...\n"); 1612 1430 udelay(5*1000000); 1613 1431 ia64_wait_for_slaves(cpu, "INIT"); 1614 1432 /* If nobody intercepts DIE_INIT_MONARCH_PROCESS then we drop through ··· 1621 1439 if (notify_die(DIE_INIT_MONARCH_LEAVE, "INIT", regs, (long)&nd, 0, 0) 1622 1440 == NOTIFY_STOP) 1623 1441 ia64_mca_spin(__FUNCTION__); 1624 - printk("\nINIT dump complete. Monarch on cpu %d returning to normal service.\n", cpu); 1442 + mprintk("\nINIT dump complete. Monarch on cpu %d returning to normal service.\n", cpu); 1625 1443 atomic_dec(&monarchs); 1626 1444 set_curr_task(cpu, previous_current); 1627 1445 monarch_cpu = -1;
+4 -5
arch/ia64/kernel/mca_asm.S
··· 1025 1025 1026 1026 ia64_set_kernel_registers: 1027 1027 add temp3=MCA_SP_OFFSET, r3 1028 - add temp4=MCA_SOS_OFFSET+SOS(OS_GP), r3 1029 1028 mov b0=r2 // save return address 1030 1029 GET_IA64_MCA_DATA(temp1) 1031 1030 ;; 1032 - add temp4=temp4, temp1 // &struct ia64_sal_os_state.os_gp 1033 1031 add r12=temp1, temp3 // kernel stack pointer on MCA/INIT stack 1034 1032 add r13=temp1, r3 // set current to start of MCA/INIT stack 1035 1033 add r20=temp1, r3 // physical start of MCA/INIT stack 1036 1034 ;; 1037 - ld8 r1=[temp4] // OS GP from SAL OS state 1038 - ;; 1039 - DATA_PA_TO_VA(r1,temp1) 1040 1035 DATA_PA_TO_VA(r12,temp2) 1041 1036 DATA_PA_TO_VA(r13,temp3) 1042 1037 ;; ··· 1062 1067 mov cr.itir=r18 1063 1068 mov cr.ifa=r13 1064 1069 mov r20=IA64_TR_CURRENT_STACK 1070 + 1071 + movl r17=FPSR_DEFAULT 1072 + ;; 1073 + mov.m ar.fpsr=r17 // set ar.fpsr to kernel default value 1065 1074 ;; 1066 1075 itr.d dtr[r20]=r21 1067 1076 ;;
+36 -18
arch/ia64/kernel/mca_drv.c
··· 79 79 fatal_mca(const char *fmt, ...) 80 80 { 81 81 va_list args; 82 + char buf[256]; 82 83 83 84 va_start(args, fmt); 84 - vprintk(fmt, args); 85 + vsnprintf(buf, sizeof(buf), fmt, args); 85 86 va_end(args); 87 + ia64_mca_printk(KERN_ALERT "MCA: %s\n", buf); 86 88 87 89 return MCA_NOT_RECOVERED; 90 + } 91 + 92 + static int 93 + mca_recovered(const char *fmt, ...) 94 + { 95 + va_list args; 96 + char buf[256]; 97 + 98 + va_start(args, fmt); 99 + vsnprintf(buf, sizeof(buf), fmt, args); 100 + va_end(args); 101 + ia64_mca_printk(KERN_INFO "MCA: %s\n", buf); 102 + 103 + return MCA_RECOVERED; 88 104 } 89 105 90 106 /** ··· 156 140 void 157 141 mca_handler_bh(unsigned long paddr, void *iip, unsigned long ipsr) 158 142 { 143 + ia64_mlogbuf_dump(); 159 144 printk(KERN_ERR "OS_MCA: process [cpu %d, pid: %d, uid: %d, " 160 145 "iip: %p, psr: 0x%lx,paddr: 0x%lx](%s) encounters MCA.\n", 161 146 raw_smp_processor_id(), current->pid, current->uid, ··· 457 440 458 441 /* Is target address valid? */ 459 442 if (!pbci->tv) 460 - return fatal_mca(KERN_ALERT "MCA: target address not valid\n"); 443 + return fatal_mca("target address not valid"); 461 444 462 445 /* 463 446 * cpu read or memory-mapped io read ··· 475 458 476 459 /* Is minstate valid? */ 477 460 if (!peidx_bottom(peidx) || !(peidx_bottom(peidx)->valid.minstate)) 478 - return fatal_mca(KERN_ALERT "MCA: minstate not valid\n"); 461 + return fatal_mca("minstate not valid"); 479 462 psr1 =(struct ia64_psr *)&(peidx_minstate_area(peidx)->pmsa_ipsr); 480 463 psr2 =(struct ia64_psr *)&(peidx_minstate_area(peidx)->pmsa_xpsr); 481 464 ··· 509 492 psr2->bn = 1; 510 493 psr2->i = 0; 511 494 512 - return MCA_RECOVERED; 495 + return mca_recovered("user memory corruption. " 496 + "kill affected process - recovered."); 513 497 } 514 498 515 499 } 516 500 517 - return fatal_mca(KERN_ALERT "MCA: kernel context not recovered," 518 - " iip 0x%lx\n", pmsa->pmsa_iip); 501 + return fatal_mca("kernel context not recovered, iip 0x%lx\n", 502 + pmsa->pmsa_iip); 519 503 } 520 504 521 505 /** ··· 602 584 * The machine check is corrected. 603 585 */ 604 586 if (psp->cm == 1) 605 - return MCA_RECOVERED; 587 + return mca_recovered("machine check is already corrected."); 606 588 607 589 /* 608 590 * The error was not contained. Software must be reset. 609 591 */ 610 592 if (psp->us || psp->ci == 0) 611 - return fatal_mca(KERN_ALERT "MCA: error not contained\n"); 593 + return fatal_mca("error not contained"); 612 594 613 595 /* 614 596 * The cache check and bus check bits have four possible states ··· 619 601 * 1 1 Memory error, attempt recovery 620 602 */ 621 603 if (psp->bc == 0 || pbci == NULL) 622 - return fatal_mca(KERN_ALERT "MCA: No bus check\n"); 604 + return fatal_mca("No bus check"); 623 605 624 606 /* 625 607 * Sorry, we cannot handle so many. 626 608 */ 627 609 if (peidx_bus_check_num(peidx) > 1) 628 - return fatal_mca(KERN_ALERT "MCA: Too many bus checks\n"); 610 + return fatal_mca("Too many bus checks"); 629 611 /* 630 612 * Well, here is only one bus error. 631 613 */ 632 614 if (pbci->ib) 633 - return fatal_mca(KERN_ALERT "MCA: Internal Bus error\n"); 615 + return fatal_mca("Internal Bus error"); 634 616 if (pbci->cc) 635 - return fatal_mca(KERN_ALERT "MCA: Cache-cache error\n"); 617 + return fatal_mca("Cache-cache error"); 636 618 if (pbci->eb && pbci->bsi > 0) 637 - return fatal_mca(KERN_ALERT "MCA: External bus check fatal status\n"); 619 + return fatal_mca("External bus check fatal status"); 638 620 639 621 /* 640 622 * This is a local MCA and estimated as recoverble external bus error. ··· 646 628 /* 647 629 * On account of strange SAL error record, we cannot recover. 648 630 */ 649 - return fatal_mca(KERN_ALERT "MCA: Strange SAL record\n"); 631 + return fatal_mca("Strange SAL record"); 650 632 } 651 633 652 634 /** ··· 675 657 676 658 /* Now, OS can recover when there is one processor error section */ 677 659 if (n_proc_err > 1) 678 - return fatal_mca(KERN_ALERT "MCA: Too Many Errors\n"); 660 + return fatal_mca("Too Many Errors"); 679 661 else if (n_proc_err == 0) 680 - /* Weird SAL record ... We need not to recover */ 681 - return fatal_mca(KERN_ALERT "MCA: Weird SAL record\n"); 662 + /* Weird SAL record ... We can't do anything */ 663 + return fatal_mca("Weird SAL record"); 682 664 683 665 /* Make index of processor error section */ 684 666 mca_make_peidx((sal_log_processor_info_t*) ··· 689 671 690 672 /* Check whether MCA is global or not */ 691 673 if (is_mca_global(&peidx, &pbci, sos)) 692 - return fatal_mca(KERN_ALERT "MCA: global MCA\n"); 674 + return fatal_mca("global MCA"); 693 675 694 676 /* Try to recover a processor error */ 695 677 return recover_from_processor_error(platform_err, &slidx, &peidx,
+4
arch/ia64/kernel/mca_drv.h
··· 118 118 119 119 extern const struct mca_table_entry *search_mca_tables (unsigned long addr); 120 120 extern int mca_recover_range(unsigned long); 121 + extern void ia64_mca_printk(const char * fmt, ...) 122 + __attribute__ ((format (printf, 1, 2))); 123 + extern void ia64_mlogbuf_dump(void); 124 +
+49 -64
arch/ia64/kernel/perfmon.c
··· 63 63 64 64 #define PFM_INVALID_ACTIVATION (~0UL) 65 65 66 + #define PFM_NUM_PMC_REGS 64 /* PMC save area for ctxsw */ 67 + #define PFM_NUM_PMD_REGS 64 /* PMD save area for ctxsw */ 68 + 66 69 /* 67 70 * depth of message queue 68 71 */ ··· 300 297 unsigned long ctx_reload_pmcs[4]; /* bitmask of force reload PMC on ctxsw in */ 301 298 unsigned long ctx_used_monitors[4]; /* bitmask of monitor PMC being used */ 302 299 303 - unsigned long ctx_pmcs[IA64_NUM_PMC_REGS]; /* saved copies of PMC values */ 300 + unsigned long ctx_pmcs[PFM_NUM_PMC_REGS]; /* saved copies of PMC values */ 304 301 305 302 unsigned int ctx_used_ibrs[1]; /* bitmask of used IBR (speedup ctxsw in) */ 306 303 unsigned int ctx_used_dbrs[1]; /* bitmask of used DBR (speedup ctxsw in) */ 307 304 unsigned long ctx_dbrs[IA64_NUM_DBG_REGS]; /* DBR values (cache) when not loaded */ 308 305 unsigned long ctx_ibrs[IA64_NUM_DBG_REGS]; /* IBR values (cache) when not loaded */ 309 306 310 - pfm_counter_t ctx_pmds[IA64_NUM_PMD_REGS]; /* software state for PMDS */ 307 + pfm_counter_t ctx_pmds[PFM_NUM_PMD_REGS]; /* software state for PMDS */ 308 + 309 + unsigned long th_pmcs[PFM_NUM_PMC_REGS]; /* PMC thread save state */ 310 + unsigned long th_pmds[PFM_NUM_PMD_REGS]; /* PMD thread save state */ 311 311 312 312 u64 ctx_saved_psr_up; /* only contains psr.up value */ 313 313 ··· 874 868 pfm_mask_monitoring(struct task_struct *task) 875 869 { 876 870 pfm_context_t *ctx = PFM_GET_CTX(task); 877 - struct thread_struct *th = &task->thread; 878 871 unsigned long mask, val, ovfl_mask; 879 872 int i; 880 873 ··· 894 889 * So in both cases, the live register contains the owner's 895 890 * state. We can ONLY touch the PMU registers and NOT the PSR. 896 891 * 897 - * As a consequence to this call, the thread->pmds[] array 892 + * As a consequence to this call, the ctx->th_pmds[] array 898 893 * contains stale information which must be ignored 899 894 * when context is reloaded AND monitoring is active (see 900 895 * pfm_restart). ··· 929 924 mask = ctx->ctx_used_monitors[0] >> PMU_FIRST_COUNTER; 930 925 for(i= PMU_FIRST_COUNTER; mask; i++, mask>>=1) { 931 926 if ((mask & 0x1) == 0UL) continue; 932 - ia64_set_pmc(i, th->pmcs[i] & ~0xfUL); 933 - th->pmcs[i] &= ~0xfUL; 934 - DPRINT_ovfl(("pmc[%d]=0x%lx\n", i, th->pmcs[i])); 927 + ia64_set_pmc(i, ctx->th_pmcs[i] & ~0xfUL); 928 + ctx->th_pmcs[i] &= ~0xfUL; 929 + DPRINT_ovfl(("pmc[%d]=0x%lx\n", i, ctx->th_pmcs[i])); 935 930 } 936 931 /* 937 932 * make all of this visible ··· 948 943 pfm_restore_monitoring(struct task_struct *task) 949 944 { 950 945 pfm_context_t *ctx = PFM_GET_CTX(task); 951 - struct thread_struct *th = &task->thread; 952 946 unsigned long mask, ovfl_mask; 953 947 unsigned long psr, val; 954 948 int i, is_system; ··· 1013 1009 mask = ctx->ctx_used_monitors[0] >> PMU_FIRST_COUNTER; 1014 1010 for(i= PMU_FIRST_COUNTER; mask; i++, mask>>=1) { 1015 1011 if ((mask & 0x1) == 0UL) continue; 1016 - th->pmcs[i] = ctx->ctx_pmcs[i]; 1017 - ia64_set_pmc(i, th->pmcs[i]); 1018 - DPRINT(("[%d] pmc[%d]=0x%lx\n", task->pid, i, th->pmcs[i])); 1012 + ctx->th_pmcs[i] = ctx->ctx_pmcs[i]; 1013 + ia64_set_pmc(i, ctx->th_pmcs[i]); 1014 + DPRINT(("[%d] pmc[%d]=0x%lx\n", task->pid, i, ctx->th_pmcs[i])); 1019 1015 } 1020 1016 ia64_srlz_d(); 1021 1017 ··· 1074 1070 static inline void 1075 1071 pfm_copy_pmds(struct task_struct *task, pfm_context_t *ctx) 1076 1072 { 1077 - struct thread_struct *thread = &task->thread; 1078 1073 unsigned long ovfl_val = pmu_conf->ovfl_val; 1079 1074 unsigned long mask = ctx->ctx_all_pmds[0]; 1080 1075 unsigned long val; ··· 1095 1092 ctx->ctx_pmds[i].val = val & ~ovfl_val; 1096 1093 val &= ovfl_val; 1097 1094 } 1098 - thread->pmds[i] = val; 1095 + ctx->th_pmds[i] = val; 1099 1096 1100 1097 DPRINT(("pmd[%d]=0x%lx soft_val=0x%lx\n", 1101 1098 i, 1102 - thread->pmds[i], 1099 + ctx->th_pmds[i], 1103 1100 ctx->ctx_pmds[i].val)); 1104 1101 } 1105 1102 } ··· 1110 1107 static inline void 1111 1108 pfm_copy_pmcs(struct task_struct *task, pfm_context_t *ctx) 1112 1109 { 1113 - struct thread_struct *thread = &task->thread; 1114 1110 unsigned long mask = ctx->ctx_all_pmcs[0]; 1115 1111 int i; 1116 1112 ··· 1117 1115 1118 1116 for (i=0; mask; i++, mask>>=1) { 1119 1117 /* masking 0 with ovfl_val yields 0 */ 1120 - thread->pmcs[i] = ctx->ctx_pmcs[i]; 1121 - DPRINT(("pmc[%d]=0x%lx\n", i, thread->pmcs[i])); 1118 + ctx->th_pmcs[i] = ctx->ctx_pmcs[i]; 1119 + DPRINT(("pmc[%d]=0x%lx\n", i, ctx->th_pmcs[i])); 1122 1120 } 1123 1121 } 1124 1122 ··· 2862 2860 static int 2863 2861 pfm_write_pmcs(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs) 2864 2862 { 2865 - struct thread_struct *thread = NULL; 2866 2863 struct task_struct *task; 2867 2864 pfarg_reg_t *req = (pfarg_reg_t *)arg; 2868 2865 unsigned long value, pmc_pm; ··· 2882 2881 if (state == PFM_CTX_ZOMBIE) return -EINVAL; 2883 2882 2884 2883 if (is_loaded) { 2885 - thread = &task->thread; 2886 2884 /* 2887 2885 * In system wide and when the context is loaded, access can only happen 2888 2886 * when the caller is running on the CPU being monitored by the session. ··· 3036 3036 * 3037 3037 * The value in ctx_pmcs[] can only be changed in pfm_write_pmcs(). 3038 3038 * 3039 - * The value in thread->pmcs[] may be modified on overflow, i.e., when 3039 + * The value in th_pmcs[] may be modified on overflow, i.e., when 3040 3040 * monitoring needs to be stopped. 3041 3041 */ 3042 3042 if (is_monitor) CTX_USED_MONITOR(ctx, 1UL << cnum); ··· 3050 3050 /* 3051 3051 * write thread state 3052 3052 */ 3053 - if (is_system == 0) thread->pmcs[cnum] = value; 3053 + if (is_system == 0) ctx->th_pmcs[cnum] = value; 3054 3054 3055 3055 /* 3056 3056 * write hardware register if we can ··· 3102 3102 static int 3103 3103 pfm_write_pmds(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs) 3104 3104 { 3105 - struct thread_struct *thread = NULL; 3106 3105 struct task_struct *task; 3107 3106 pfarg_reg_t *req = (pfarg_reg_t *)arg; 3108 3107 unsigned long value, hw_value, ovfl_mask; ··· 3125 3126 * the owner of the local PMU. 3126 3127 */ 3127 3128 if (likely(is_loaded)) { 3128 - thread = &task->thread; 3129 3129 /* 3130 3130 * In system wide and when the context is loaded, access can only happen 3131 3131 * when the caller is running on the CPU being monitored by the session. ··· 3232 3234 /* 3233 3235 * write thread state 3234 3236 */ 3235 - if (is_system == 0) thread->pmds[cnum] = hw_value; 3237 + if (is_system == 0) ctx->th_pmds[cnum] = hw_value; 3236 3238 3237 3239 /* 3238 3240 * write hardware register if we can ··· 3298 3300 static int 3299 3301 pfm_read_pmds(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs) 3300 3302 { 3301 - struct thread_struct *thread = NULL; 3302 3303 struct task_struct *task; 3303 3304 unsigned long val = 0UL, lval, ovfl_mask, sval; 3304 3305 pfarg_reg_t *req = (pfarg_reg_t *)arg; ··· 3321 3324 if (state == PFM_CTX_ZOMBIE) return -EINVAL; 3322 3325 3323 3326 if (likely(is_loaded)) { 3324 - thread = &task->thread; 3325 3327 /* 3326 3328 * In system wide and when the context is loaded, access can only happen 3327 3329 * when the caller is running on the CPU being monitored by the session. ··· 3382 3386 * if context is zombie, then task does not exist anymore. 3383 3387 * In this case, we use the full value saved in the context (pfm_flush_regs()). 3384 3388 */ 3385 - val = is_loaded ? thread->pmds[cnum] : 0UL; 3389 + val = is_loaded ? ctx->th_pmds[cnum] : 0UL; 3386 3390 } 3387 3391 rd_func = pmu_conf->pmd_desc[cnum].read_check; 3388 3392 ··· 4351 4355 pfm_copy_pmds(task, ctx); 4352 4356 pfm_copy_pmcs(task, ctx); 4353 4357 4354 - pmcs_source = thread->pmcs; 4355 - pmds_source = thread->pmds; 4358 + pmcs_source = ctx->th_pmcs; 4359 + pmds_source = ctx->th_pmds; 4356 4360 4357 4361 /* 4358 4362 * always the case for system-wide ··· 5861 5865 pfm_save_regs(struct task_struct *task) 5862 5866 { 5863 5867 pfm_context_t *ctx; 5864 - struct thread_struct *t; 5865 5868 unsigned long flags; 5866 5869 u64 psr; 5867 5870 5868 5871 5869 5872 ctx = PFM_GET_CTX(task); 5870 5873 if (ctx == NULL) return; 5871 - t = &task->thread; 5872 5874 5873 5875 /* 5874 5876 * we always come here with interrupts ALREADY disabled by ··· 5924 5930 * guarantee we will be schedule at that same 5925 5931 * CPU again. 5926 5932 */ 5927 - pfm_save_pmds(t->pmds, ctx->ctx_used_pmds[0]); 5933 + pfm_save_pmds(ctx->th_pmds, ctx->ctx_used_pmds[0]); 5928 5934 5929 5935 /* 5930 5936 * save pmc0 ia64_srlz_d() done in pfm_save_pmds() 5931 5937 * we will need it on the restore path to check 5932 5938 * for pending overflow. 5933 5939 */ 5934 - t->pmcs[0] = ia64_get_pmc(0); 5940 + ctx->th_pmcs[0] = ia64_get_pmc(0); 5935 5941 5936 5942 /* 5937 5943 * unfreeze PMU if had pending overflows 5938 5944 */ 5939 - if (t->pmcs[0] & ~0x1UL) pfm_unfreeze_pmu(); 5945 + if (ctx->th_pmcs[0] & ~0x1UL) pfm_unfreeze_pmu(); 5940 5946 5941 5947 /* 5942 5948 * finally, allow context access. ··· 5981 5987 pfm_lazy_save_regs (struct task_struct *task) 5982 5988 { 5983 5989 pfm_context_t *ctx; 5984 - struct thread_struct *t; 5985 5990 unsigned long flags; 5986 5991 5987 5992 { u64 psr = pfm_get_psr(); ··· 5988 5995 } 5989 5996 5990 5997 ctx = PFM_GET_CTX(task); 5991 - t = &task->thread; 5992 5998 5993 5999 /* 5994 6000 * we need to mask PMU overflow here to ··· 6012 6020 /* 6013 6021 * save all the pmds we use 6014 6022 */ 6015 - pfm_save_pmds(t->pmds, ctx->ctx_used_pmds[0]); 6023 + pfm_save_pmds(ctx->th_pmds, ctx->ctx_used_pmds[0]); 6016 6024 6017 6025 /* 6018 6026 * save pmc0 ia64_srlz_d() done in pfm_save_pmds() 6019 6027 * it is needed to check for pended overflow 6020 6028 * on the restore path 6021 6029 */ 6022 - t->pmcs[0] = ia64_get_pmc(0); 6030 + ctx->th_pmcs[0] = ia64_get_pmc(0); 6023 6031 6024 6032 /* 6025 6033 * unfreeze PMU if had pending overflows 6026 6034 */ 6027 - if (t->pmcs[0] & ~0x1UL) pfm_unfreeze_pmu(); 6035 + if (ctx->th_pmcs[0] & ~0x1UL) pfm_unfreeze_pmu(); 6028 6036 6029 6037 /* 6030 6038 * now get can unmask PMU interrupts, they will ··· 6043 6051 pfm_load_regs (struct task_struct *task) 6044 6052 { 6045 6053 pfm_context_t *ctx; 6046 - struct thread_struct *t; 6047 6054 unsigned long pmc_mask = 0UL, pmd_mask = 0UL; 6048 6055 unsigned long flags; 6049 6056 u64 psr, psr_up; ··· 6053 6062 6054 6063 BUG_ON(GET_PMU_OWNER()); 6055 6064 6056 - t = &task->thread; 6057 6065 /* 6058 6066 * possible on unload 6059 6067 */ 6060 - if (unlikely((t->flags & IA64_THREAD_PM_VALID) == 0)) return; 6068 + if (unlikely((task->thread.flags & IA64_THREAD_PM_VALID) == 0)) return; 6061 6069 6062 6070 /* 6063 6071 * we always come here with interrupts ALREADY disabled by ··· 6138 6148 * 6139 6149 * XXX: optimize here 6140 6150 */ 6141 - if (pmd_mask) pfm_restore_pmds(t->pmds, pmd_mask); 6142 - if (pmc_mask) pfm_restore_pmcs(t->pmcs, pmc_mask); 6151 + if (pmd_mask) pfm_restore_pmds(ctx->th_pmds, pmd_mask); 6152 + if (pmc_mask) pfm_restore_pmcs(ctx->th_pmcs, pmc_mask); 6143 6153 6144 6154 /* 6145 6155 * check for pending overflow at the time the state 6146 6156 * was saved. 6147 6157 */ 6148 - if (unlikely(PMC0_HAS_OVFL(t->pmcs[0]))) { 6158 + if (unlikely(PMC0_HAS_OVFL(ctx->th_pmcs[0]))) { 6149 6159 /* 6150 6160 * reload pmc0 with the overflow information 6151 6161 * On McKinley PMU, this will trigger a PMU interrupt 6152 6162 */ 6153 - ia64_set_pmc(0, t->pmcs[0]); 6163 + ia64_set_pmc(0, ctx->th_pmcs[0]); 6154 6164 ia64_srlz_d(); 6155 - t->pmcs[0] = 0UL; 6165 + ctx->th_pmcs[0] = 0UL; 6156 6166 6157 6167 /* 6158 6168 * will replay the PMU interrupt ··· 6205 6215 void 6206 6216 pfm_load_regs (struct task_struct *task) 6207 6217 { 6208 - struct thread_struct *t; 6209 6218 pfm_context_t *ctx; 6210 6219 struct task_struct *owner; 6211 6220 unsigned long pmd_mask, pmc_mask; ··· 6213 6224 6214 6225 owner = GET_PMU_OWNER(); 6215 6226 ctx = PFM_GET_CTX(task); 6216 - t = &task->thread; 6217 6227 psr = pfm_get_psr(); 6218 6228 6219 6229 BUG_ON(psr & (IA64_PSR_UP|IA64_PSR_PP)); ··· 6275 6287 */ 6276 6288 pmc_mask = ctx->ctx_all_pmcs[0]; 6277 6289 6278 - pfm_restore_pmds(t->pmds, pmd_mask); 6279 - pfm_restore_pmcs(t->pmcs, pmc_mask); 6290 + pfm_restore_pmds(ctx->th_pmds, pmd_mask); 6291 + pfm_restore_pmcs(ctx->th_pmcs, pmc_mask); 6280 6292 6281 6293 /* 6282 6294 * check for pending overflow at the time the state 6283 6295 * was saved. 6284 6296 */ 6285 - if (unlikely(PMC0_HAS_OVFL(t->pmcs[0]))) { 6297 + if (unlikely(PMC0_HAS_OVFL(ctx->th_pmcs[0]))) { 6286 6298 /* 6287 6299 * reload pmc0 with the overflow information 6288 6300 * On McKinley PMU, this will trigger a PMU interrupt 6289 6301 */ 6290 - ia64_set_pmc(0, t->pmcs[0]); 6302 + ia64_set_pmc(0, ctx->th_pmcs[0]); 6291 6303 ia64_srlz_d(); 6292 6304 6293 - t->pmcs[0] = 0UL; 6305 + ctx->th_pmcs[0] = 0UL; 6294 6306 6295 6307 /* 6296 6308 * will replay the PMU interrupt ··· 6365 6377 */ 6366 6378 pfm_unfreeze_pmu(); 6367 6379 } else { 6368 - pmc0 = task->thread.pmcs[0]; 6380 + pmc0 = ctx->th_pmcs[0]; 6369 6381 /* 6370 6382 * clear whatever overflow status bits there were 6371 6383 */ 6372 - task->thread.pmcs[0] = 0; 6384 + ctx->th_pmcs[0] = 0; 6373 6385 } 6374 6386 ovfl_val = pmu_conf->ovfl_val; 6375 6387 /* ··· 6390 6402 /* 6391 6403 * can access PMU always true in system wide mode 6392 6404 */ 6393 - val = pmd_val = can_access_pmu ? ia64_get_pmd(i) : task->thread.pmds[i]; 6405 + val = pmd_val = can_access_pmu ? ia64_get_pmd(i) : ctx->th_pmds[i]; 6394 6406 6395 6407 if (PMD_IS_COUNTING(i)) { 6396 6408 DPRINT(("[%d] pmd[%d] ctx_pmd=0x%lx hw_pmd=0x%lx\n", ··· 6422 6434 6423 6435 DPRINT(("[%d] ctx_pmd[%d]=0x%lx pmd_val=0x%lx\n", task->pid, i, val, pmd_val)); 6424 6436 6425 - if (is_self) task->thread.pmds[i] = pmd_val; 6437 + if (is_self) ctx->th_pmds[i] = pmd_val; 6426 6438 6427 6439 ctx->ctx_pmds[i].val = val; 6428 6440 } ··· 6666 6678 ffz(pmu_conf->ovfl_val)); 6667 6679 6668 6680 /* sanity check */ 6669 - if (pmu_conf->num_pmds >= IA64_NUM_PMD_REGS || pmu_conf->num_pmcs >= IA64_NUM_PMC_REGS) { 6681 + if (pmu_conf->num_pmds >= PFM_NUM_PMD_REGS || pmu_conf->num_pmcs >= PFM_NUM_PMC_REGS) { 6670 6682 printk(KERN_ERR "perfmon: not enough pmc/pmd, perfmon disabled\n"); 6671 6683 pmu_conf = NULL; 6672 6684 return -1; ··· 6741 6753 dump_pmu_state(const char *from) 6742 6754 { 6743 6755 struct task_struct *task; 6744 - struct thread_struct *t; 6745 6756 struct pt_regs *regs; 6746 6757 pfm_context_t *ctx; 6747 6758 unsigned long psr, dcr, info, flags; ··· 6785 6798 ia64_psr(regs)->up = 0; 6786 6799 ia64_psr(regs)->pp = 0; 6787 6800 6788 - t = &current->thread; 6789 - 6790 6801 for (i=1; PMC_IS_LAST(i) == 0; i++) { 6791 6802 if (PMC_IS_IMPL(i) == 0) continue; 6792 - printk("->CPU%d pmc[%d]=0x%lx thread_pmc[%d]=0x%lx\n", this_cpu, i, ia64_get_pmc(i), i, t->pmcs[i]); 6803 + printk("->CPU%d pmc[%d]=0x%lx thread_pmc[%d]=0x%lx\n", this_cpu, i, ia64_get_pmc(i), i, ctx->th_pmcs[i]); 6793 6804 } 6794 6805 6795 6806 for (i=1; PMD_IS_LAST(i) == 0; i++) { 6796 6807 if (PMD_IS_IMPL(i) == 0) continue; 6797 - printk("->CPU%d pmd[%d]=0x%lx thread_pmd[%d]=0x%lx\n", this_cpu, i, ia64_get_pmd(i), i, t->pmds[i]); 6808 + printk("->CPU%d pmd[%d]=0x%lx thread_pmd[%d]=0x%lx\n", this_cpu, i, ia64_get_pmd(i), i, ctx->th_pmds[i]); 6798 6809 } 6799 6810 6800 6811 if (ctx) {
+4
arch/ia64/kernel/salinfo.c
··· 266 266 /* Check for outstanding MCA/INIT records every minute (arbitrary) */ 267 267 #define SALINFO_TIMER_DELAY (60*HZ) 268 268 static struct timer_list salinfo_timer; 269 + extern void ia64_mlogbuf_dump(void); 269 270 270 271 static void 271 272 salinfo_timeout_check(struct salinfo_data *data) ··· 284 283 static void 285 284 salinfo_timeout (unsigned long arg) 286 285 { 286 + ia64_mlogbuf_dump(); 287 287 salinfo_timeout_check(salinfo_data + SAL_INFO_TYPE_MCA); 288 288 salinfo_timeout_check(salinfo_data + SAL_INFO_TYPE_INIT); 289 289 salinfo_timer.expires = jiffies + SALINFO_TIMER_DELAY; ··· 333 331 334 332 if (cpu == -1) 335 333 goto retry; 334 + 335 + ia64_mlogbuf_dump(); 336 336 337 337 /* for next read, start checking at next CPU */ 338 338 data->cpu_check = cpu;
+31 -10
arch/ia64/kernel/setup.c
··· 509 509 { 1UL << 1, "spontaneous deferral"}, 510 510 { 1UL << 2, "16-byte atomic ops" } 511 511 }; 512 - char family[32], features[128], *cp, sep; 512 + char features[128], *cp, sep; 513 513 struct cpuinfo_ia64 *c = v; 514 514 unsigned long mask; 515 515 unsigned long proc_freq; 516 516 int i; 517 517 518 518 mask = c->features; 519 - 520 - switch (c->family) { 521 - case 0x07: memcpy(family, "Itanium", 8); break; 522 - case 0x1f: memcpy(family, "Itanium 2", 10); break; 523 - default: sprintf(family, "%u", c->family); break; 524 - } 525 519 526 520 /* build the feature string: */ 527 521 memcpy(features, " standard", 10); ··· 547 553 "processor : %d\n" 548 554 "vendor : %s\n" 549 555 "arch : IA-64\n" 550 - "family : %s\n" 556 + "family : %u\n" 551 557 "model : %u\n" 558 + "model name : %s\n" 552 559 "revision : %u\n" 553 560 "archrev : %u\n" 554 561 "features :%s\n" /* don't change this---it _is_ right! */ ··· 558 563 "cpu MHz : %lu.%06lu\n" 559 564 "itc MHz : %lu.%06lu\n" 560 565 "BogoMIPS : %lu.%02lu\n", 561 - cpunum, c->vendor, family, c->model, c->revision, c->archrev, 566 + cpunum, c->vendor, c->family, c->model, 567 + c->model_name, c->revision, c->archrev, 562 568 features, c->ppn, c->number, 563 569 proc_freq / 1000, proc_freq % 1000, 564 570 c->itc_freq / 1000000, c->itc_freq % 1000000, ··· 607 611 .show = show_cpuinfo 608 612 }; 609 613 614 + static char brandname[128]; 615 + 616 + static char * __cpuinit 617 + get_model_name(__u8 family, __u8 model) 618 + { 619 + char brand[128]; 620 + 621 + if (ia64_pal_get_brand_info(brand)) { 622 + if (family == 0x7) 623 + memcpy(brand, "Merced", 7); 624 + else if (family == 0x1f) switch (model) { 625 + case 0: memcpy(brand, "McKinley", 9); break; 626 + case 1: memcpy(brand, "Madison", 8); break; 627 + case 2: memcpy(brand, "Madison up to 9M cache", 23); break; 628 + } else 629 + memcpy(brand, "Unknown", 8); 630 + } 631 + if (brandname[0] == '\0') 632 + return strcpy(brandname, brand); 633 + else if (strcmp(brandname, brand) == 0) 634 + return brandname; 635 + else 636 + return kstrdup(brand, GFP_KERNEL); 637 + } 638 + 610 639 static void __cpuinit 611 640 identify_cpu (struct cpuinfo_ia64 *c) 612 641 { ··· 661 640 pal_status_t status; 662 641 unsigned long impl_va_msb = 50, phys_addr_size = 44; /* Itanium defaults */ 663 642 int i; 664 - 665 643 for (i = 0; i < 5; ++i) 666 644 cpuid.bits[i] = ia64_get_cpuid(i); 667 645 ··· 683 663 c->family = cpuid.field.family; 684 664 c->archrev = cpuid.field.archrev; 685 665 c->features = cpuid.field.features; 666 + c->model_name = get_model_name(c->family, c->model); 686 667 687 668 status = ia64_pal_vm_summary(&vm1, &vm2); 688 669 if (status == PAL_STATUS_SUCCESS) {
+24
arch/ia64/kernel/smpboot.c
··· 879 879 c->core_id = info.log1_cid; 880 880 c->thread_id = info.log1_tid; 881 881 } 882 + 883 + /* 884 + * returns non zero, if multi-threading is enabled 885 + * on at least one physical package. Due to hotplug cpu 886 + * and (maxcpus=), all threads may not necessarily be enabled 887 + * even though the processor supports multi-threading. 888 + */ 889 + int is_multithreading_enabled(void) 890 + { 891 + int i, j; 892 + 893 + for_each_present_cpu(i) { 894 + for_each_present_cpu(j) { 895 + if (j == i) 896 + continue; 897 + if ((cpu_data(j)->socket_id == cpu_data(i)->socket_id)) { 898 + if (cpu_data(j)->core_id == cpu_data(i)->core_id) 899 + return 1; 900 + } 901 + } 902 + } 903 + return 0; 904 + } 905 + EXPORT_SYMBOL_GPL(is_multithreading_enabled);
+6 -2
arch/ia64/kernel/vmlinux.lds.S
··· 184 184 *(.data.gate) 185 185 __stop_gate_section = .; 186 186 } 187 - . = ALIGN(PAGE_SIZE); /* make sure the gate page doesn't expose kernel data */ 187 + . = ALIGN(PAGE_SIZE); /* make sure the gate page doesn't expose 188 + * kernel data 189 + */ 188 190 189 191 .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) 190 192 { *(.data.read_mostly) } ··· 204 202 *(.data.percpu) 205 203 __per_cpu_end = .; 206 204 } 207 - . = __phys_per_cpu_start + PERCPU_PAGE_SIZE; /* ensure percpu data fits into percpu page size */ 205 + . = __phys_per_cpu_start + PERCPU_PAGE_SIZE; /* ensure percpu data fits 206 + * into percpu page size 207 + */ 208 208 209 209 data : { } :data 210 210 .data : AT(ADDR(.data) - LOAD_OFFSET)
+9 -8
arch/ia64/mm/contig.c
··· 40 40 int i, total = 0, reserved = 0; 41 41 int shared = 0, cached = 0; 42 42 43 - printk("Mem-info:\n"); 43 + printk(KERN_INFO "Mem-info:\n"); 44 44 show_free_areas(); 45 45 46 - printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10)); 46 + printk(KERN_INFO "Free swap: %6ldkB\n", 47 + nr_swap_pages<<(PAGE_SHIFT-10)); 47 48 i = max_mapnr; 48 49 for (i = 0; i < max_mapnr; i++) { 49 50 if (!pfn_valid(i)) { ··· 63 62 else if (page_count(mem_map + i)) 64 63 shared += page_count(mem_map + i) - 1; 65 64 } 66 - printk("%d pages of RAM\n", total); 67 - printk("%d reserved pages\n", reserved); 68 - printk("%d pages shared\n", shared); 69 - printk("%d pages swap cached\n", cached); 70 - printk("%ld pages in page table cache\n", 71 - pgtable_quicklist_total_size()); 65 + printk(KERN_INFO "%d pages of RAM\n", total); 66 + printk(KERN_INFO "%d reserved pages\n", reserved); 67 + printk(KERN_INFO "%d pages shared\n", shared); 68 + printk(KERN_INFO "%d pages swap cached\n", cached); 69 + printk(KERN_INFO "%ld pages in page table cache\n", 70 + pgtable_quicklist_total_size()); 72 71 } 73 72 74 73 /* physical address where the bootmem map is located */
+14 -14
arch/ia64/mm/discontig.c
··· 547 547 unsigned long total_present = 0; 548 548 pg_data_t *pgdat; 549 549 550 - printk("Mem-info:\n"); 550 + printk(KERN_INFO "Mem-info:\n"); 551 551 show_free_areas(); 552 - printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10)); 552 + printk(KERN_INFO "Free swap: %6ldkB\n", 553 + nr_swap_pages<<(PAGE_SHIFT-10)); 554 + printk(KERN_INFO "Node memory in pages:\n"); 553 555 for_each_online_pgdat(pgdat) { 554 556 unsigned long present; 555 557 unsigned long flags; 556 558 int shared = 0, cached = 0, reserved = 0; 557 559 558 - printk("Node ID: %d\n", pgdat->node_id); 559 560 pgdat_resize_lock(pgdat, &flags); 560 561 present = pgdat->node_present_pages; 561 562 for(i = 0; i < pgdat->node_spanned_pages; i++) { ··· 580 579 total_reserved += reserved; 581 580 total_cached += cached; 582 581 total_shared += shared; 583 - printk("\t%ld pages of RAM\n", present); 584 - printk("\t%d reserved pages\n", reserved); 585 - printk("\t%d pages shared\n", shared); 586 - printk("\t%d pages swap cached\n", cached); 582 + printk(KERN_INFO "Node %4d: RAM: %11ld, rsvd: %8d, " 583 + "shrd: %10d, swpd: %10d\n", pgdat->node_id, 584 + present, reserved, shared, cached); 587 585 } 588 - printk("%ld pages of RAM\n", total_present); 589 - printk("%d reserved pages\n", total_reserved); 590 - printk("%d pages shared\n", total_shared); 591 - printk("%d pages swap cached\n", total_cached); 592 - printk("Total of %ld pages in page table cache\n", 593 - pgtable_quicklist_total_size()); 594 - printk("%d free buffer pages\n", nr_free_buffer_pages()); 586 + printk(KERN_INFO "%ld pages of RAM\n", total_present); 587 + printk(KERN_INFO "%d reserved pages\n", total_reserved); 588 + printk(KERN_INFO "%d pages shared\n", total_shared); 589 + printk(KERN_INFO "%d pages swap cached\n", total_cached); 590 + printk(KERN_INFO "Total of %ld pages in page table cache\n", 591 + pgtable_quicklist_total_size()); 592 + printk(KERN_INFO "%d free buffer pages\n", nr_free_buffer_pages()); 595 593 } 596 594 597 595 /**
+1 -2
arch/ia64/sn/kernel/bte.c
··· 277 277 } 278 278 279 279 /* temporary buffer used during unaligned transfers */ 280 - bteBlock_unaligned = kmalloc(len + 3 * L1_CACHE_BYTES, 281 - GFP_KERNEL | GFP_DMA); 280 + bteBlock_unaligned = kmalloc(len + 3 * L1_CACHE_BYTES, GFP_KERNEL); 282 281 if (bteBlock_unaligned == NULL) { 283 282 return BTEFAIL_NOTAVAIL; 284 283 }
+30
include/asm-ia64/esi.h
··· 1 + /* 2 + * ESI service calls. 3 + * 4 + * Copyright (c) Copyright 2005-2006 Hewlett-Packard Development Company, L.P. 5 + * Alex Williamson <alex.williamson@hp.com> 6 + */ 7 + #ifndef esi_h 8 + #define esi_h 9 + 10 + #include <linux/efi.h> 11 + 12 + #define ESI_QUERY 0x00000001 13 + #define ESI_OPEN_HANDLE 0x02000000 14 + #define ESI_CLOSE_HANDLE 0x02000001 15 + 16 + enum esi_proc_type { 17 + ESI_PROC_SERIALIZED, /* calls need to be serialized */ 18 + ESI_PROC_MP_SAFE, /* MP-safe, but not reentrant */ 19 + ESI_PROC_REENTRANT /* MP-safe and reentrant */ 20 + }; 21 + 22 + extern int ia64_esi_init (void); 23 + extern struct ia64_sal_retval esi_call_phys (void *, u64 *); 24 + extern int ia64_esi_call(efi_guid_t, struct ia64_sal_retval *, 25 + enum esi_proc_type, 26 + u64, u64, u64, u64, u64, u64, u64, u64); 27 + extern int ia64_esi_call_phys(efi_guid_t, struct ia64_sal_retval *, u64, u64, 28 + u64, u64, u64, u64, u64, u64); 29 + 30 + #endif /* esi_h */
+120 -2
include/asm-ia64/futex.h
··· 1 1 #ifndef _ASM_FUTEX_H 2 2 #define _ASM_FUTEX_H 3 3 4 - #include <asm-generic/futex.h> 4 + #include <linux/futex.h> 5 + #include <asm/errno.h> 6 + #include <asm/system.h> 7 + #include <asm/uaccess.h> 5 8 6 - #endif 9 + #define __futex_atomic_op1(insn, ret, oldval, uaddr, oparg) \ 10 + do { \ 11 + register unsigned long r8 __asm ("r8") = 0; \ 12 + __asm__ __volatile__( \ 13 + " mf;; \n" \ 14 + "[1:] " insn ";; \n" \ 15 + " .xdata4 \"__ex_table\", 1b-., 2f-. \n" \ 16 + "[2:]" \ 17 + : "+r" (r8), "=r" (oldval) \ 18 + : "r" (uaddr), "r" (oparg) \ 19 + : "memory"); \ 20 + ret = r8; \ 21 + } while (0) 22 + 23 + #define __futex_atomic_op2(insn, ret, oldval, uaddr, oparg) \ 24 + do { \ 25 + register unsigned long r8 __asm ("r8") = 0; \ 26 + int val, newval; \ 27 + do { \ 28 + __asm__ __volatile__( \ 29 + " mf;; \n" \ 30 + "[1:] ld4 %3=[%4];; \n" \ 31 + " mov %2=%3 \n" \ 32 + insn ";; \n" \ 33 + " mov ar.ccv=%2;; \n" \ 34 + "[2:] cmpxchg4.acq %1=[%4],%3,ar.ccv;; \n" \ 35 + " .xdata4 \"__ex_table\", 1b-., 3f-.\n" \ 36 + " .xdata4 \"__ex_table\", 2b-., 3f-.\n" \ 37 + "[3:]" \ 38 + : "+r" (r8), "=r" (val), "=&r" (oldval), \ 39 + "=&r" (newval) \ 40 + : "r" (uaddr), "r" (oparg) \ 41 + : "memory"); \ 42 + if (unlikely (r8)) \ 43 + break; \ 44 + } while (unlikely (val != oldval)); \ 45 + ret = r8; \ 46 + } while (0) 47 + 48 + static inline int 49 + futex_atomic_op_inuser (int encoded_op, int __user *uaddr) 50 + { 51 + int op = (encoded_op >> 28) & 7; 52 + int cmp = (encoded_op >> 24) & 15; 53 + int oparg = (encoded_op << 8) >> 20; 54 + int cmparg = (encoded_op << 20) >> 20; 55 + int oldval = 0, ret; 56 + if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) 57 + oparg = 1 << oparg; 58 + 59 + if (! access_ok (VERIFY_WRITE, uaddr, sizeof(int))) 60 + return -EFAULT; 61 + 62 + inc_preempt_count(); 63 + 64 + switch (op) { 65 + case FUTEX_OP_SET: 66 + __futex_atomic_op1("xchg4 %1=[%2],%3", ret, oldval, uaddr, 67 + oparg); 68 + break; 69 + case FUTEX_OP_ADD: 70 + __futex_atomic_op2("add %3=%3,%5", ret, oldval, uaddr, oparg); 71 + break; 72 + case FUTEX_OP_OR: 73 + __futex_atomic_op2("or %3=%3,%5", ret, oldval, uaddr, oparg); 74 + break; 75 + case FUTEX_OP_ANDN: 76 + __futex_atomic_op2("and %3=%3,%5", ret, oldval, uaddr, 77 + ~oparg); 78 + break; 79 + case FUTEX_OP_XOR: 80 + __futex_atomic_op2("xor %3=%3,%5", ret, oldval, uaddr, oparg); 81 + break; 82 + default: 83 + ret = -ENOSYS; 84 + } 85 + 86 + dec_preempt_count(); 87 + 88 + if (!ret) { 89 + switch (cmp) { 90 + case FUTEX_OP_CMP_EQ: ret = (oldval == cmparg); break; 91 + case FUTEX_OP_CMP_NE: ret = (oldval != cmparg); break; 92 + case FUTEX_OP_CMP_LT: ret = (oldval < cmparg); break; 93 + case FUTEX_OP_CMP_GE: ret = (oldval >= cmparg); break; 94 + case FUTEX_OP_CMP_LE: ret = (oldval <= cmparg); break; 95 + case FUTEX_OP_CMP_GT: ret = (oldval > cmparg); break; 96 + default: ret = -ENOSYS; 97 + } 98 + } 99 + return ret; 100 + } 101 + 102 + static inline int 103 + futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval) 104 + { 105 + if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int))) 106 + return -EFAULT; 107 + 108 + { 109 + register unsigned long r8 __asm ("r8"); 110 + __asm__ __volatile__( 111 + " mf;; \n" 112 + " mov ar.ccv=%3;; \n" 113 + "[1:] cmpxchg4.acq %0=[%1],%2,ar.ccv \n" 114 + " .xdata4 \"__ex_table\", 1b-., 2f-. \n" 115 + "[2:]" 116 + : "=r" (r8) 117 + : "r" (uaddr), "r" (newval), 118 + "rO" ((long) (unsigned) oldval) 119 + : "memory"); 120 + return r8; 121 + } 122 + } 123 + 124 + #endif /* _ASM_FUTEX_H */
+5 -4
include/asm-ia64/kprobes.h
··· 29 29 #include <linux/percpu.h> 30 30 #include <asm/break.h> 31 31 32 - #define MAX_INSN_SIZE 16 32 + #define __ARCH_WANT_KPROBES_INSN_SLOT 33 + #define MAX_INSN_SIZE 1 33 34 #define BREAK_INST (long)(__IA64_BREAK_KPROBE << 6) 34 35 35 36 typedef union cmp_inst { ··· 95 94 #define IP_RELATIVE_PREDICT_OPCODE (7) 96 95 #define LONG_BRANCH_OPCODE (0xC) 97 96 #define LONG_CALL_OPCODE (0xD) 98 - #define arch_remove_kprobe(p) do {} while (0) 97 + #define flush_insn_slot(p) do { } while (0) 99 98 100 99 typedef struct kprobe_opcode { 101 100 bundle_t bundle; ··· 109 108 /* Architecture specific copy of original instruction*/ 110 109 struct arch_specific_insn { 111 110 /* copy of the instruction to be emulated */ 112 - kprobe_opcode_t insn; 111 + kprobe_opcode_t *insn; 113 112 #define INST_FLAG_FIX_RELATIVE_IP_ADDR 1 114 113 #define INST_FLAG_FIX_BRANCH_REG 2 115 114 #define INST_FLAG_BREAK_INST 4 ··· 126 125 } 127 126 extern void invalidate_stacked_regs(void); 128 127 extern void flush_register_stack(void); 129 - extern void flush_insn_slot(struct kprobe *p); 128 + extern void arch_remove_kprobe(struct kprobe *p); 130 129 131 130 #endif /* _ASM_KPROBES_H */
+1 -1
include/asm-ia64/mca_asm.h
··· 197 197 movl temp2 = start_addr; \ 198 198 ;; \ 199 199 mov cr.iip = temp2; \ 200 + movl gp = __gp \ 200 201 ;; \ 201 202 DATA_PA_TO_VA(sp, temp1); \ 202 - DATA_PA_TO_VA(gp, temp2); \ 203 203 srlz.i; \ 204 204 ;; \ 205 205 nop 1; \
+14 -2
include/asm-ia64/pal.h
··· 78 78 #define PAL_VM_TR_READ 261 /* read contents of translation register */ 79 79 #define PAL_GET_PSTATE 262 /* get the current P-state */ 80 80 #define PAL_SET_PSTATE 263 /* set the P-state */ 81 + #define PAL_BRAND_INFO 274 /* Processor branding information */ 81 82 82 83 #ifndef __ASSEMBLY__ 83 84 ··· 964 963 ia64_pal_cache_read (pal_cache_line_id_u_t line_id, u64 physical_addr) 965 964 { 966 965 struct ia64_pal_retval iprv; 967 - PAL_CALL(iprv, PAL_CACHE_READ, line_id.pclid_data, physical_addr, 0); 966 + PAL_CALL_PHYS_STK(iprv, PAL_CACHE_READ, line_id.pclid_data, 967 + physical_addr, 0); 968 968 return iprv.status; 969 969 } 970 970 ··· 987 985 ia64_pal_cache_write (pal_cache_line_id_u_t line_id, u64 physical_addr, u64 data) 988 986 { 989 987 struct ia64_pal_retval iprv; 990 - PAL_CALL(iprv, PAL_CACHE_WRITE, line_id.pclid_data, physical_addr, data); 988 + PAL_CALL_PHYS_STK(iprv, PAL_CACHE_WRITE, line_id.pclid_data, 989 + physical_addr, data); 991 990 return iprv.status; 992 991 } 993 992 ··· 1133 1130 { 1134 1131 struct ia64_pal_retval iprv; 1135 1132 PAL_CALL_STK(iprv, PAL_SET_PSTATE, pstate_index, 0, 0); 1133 + return iprv.status; 1134 + } 1135 + 1136 + /* Processor branding information*/ 1137 + static inline s64 1138 + ia64_pal_get_brand_info (char *brand_info) 1139 + { 1140 + struct ia64_pal_retval iprv; 1141 + PAL_CALL_STK(iprv, PAL_BRAND_INFO, 0, (u64)brand_info, 0); 1136 1142 return iprv.status; 1137 1143 } 1138 1144
+2 -11
include/asm-ia64/processor.h
··· 20 20 #include <asm/ustack.h> 21 21 22 22 #define IA64_NUM_DBG_REGS 8 23 - /* 24 - * Limits for PMC and PMD are set to less than maximum architected values 25 - * but should be sufficient for a while 26 - */ 27 - #define IA64_NUM_PMC_REGS 64 28 - #define IA64_NUM_PMD_REGS 64 29 23 30 24 #define DEFAULT_MAP_BASE __IA64_UL_CONST(0x2000000000000000) 31 25 #define DEFAULT_TASK_SIZE __IA64_UL_CONST(0xa000000000000000) ··· 157 163 __u8 family; 158 164 __u8 archrev; 159 165 char vendor[16]; 166 + char *model_name; 160 167 161 168 #ifdef CONFIG_NUMA 162 169 struct ia64_node_data *node_data; ··· 257 262 # define INIT_THREAD_IA32 258 263 #endif /* CONFIG_IA32_SUPPORT */ 259 264 #ifdef CONFIG_PERFMON 260 - __u64 pmcs[IA64_NUM_PMC_REGS]; 261 - __u64 pmds[IA64_NUM_PMD_REGS]; 262 265 void *pfm_context; /* pointer to detailed PMU context */ 263 266 unsigned long pfm_needs_checking; /* when >0, pending perfmon work on kernel exit */ 264 - # define INIT_THREAD_PM .pmcs = {0UL, }, \ 265 - .pmds = {0UL, }, \ 266 - .pfm_context = NULL, \ 267 + # define INIT_THREAD_PM .pfm_context = NULL, \ 267 268 .pfm_needs_checking = 0UL, 268 269 #else 269 270 # define INIT_THREAD_PM
+1
include/asm-ia64/smp.h
··· 126 126 extern void lock_ipi_calllock(void); 127 127 extern void unlock_ipi_calllock(void); 128 128 extern void identify_siblings (struct cpuinfo_ia64 *); 129 + extern int is_multithreading_enabled(void); 129 130 130 131 #else 131 132
+2 -1
include/asm-ia64/unistd.h
··· 286 286 /* 1294, 1295 reserved for pselect/ppoll */ 287 287 #define __NR_unshare 1296 288 288 #define __NR_splice 1297 289 - /* 1298, 1299 reserved for set_robust_list/get_robust_list */ 289 + #define __NR_set_robust_list 1298 290 + #define __NR_get_robust_list 1299 290 291 #define __NR_sync_file_range 1300 291 292 #define __NR_tee 1301 292 293 #define __NR_vmsplice 1302