Automatic merge of rsync://rsync.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6

+222 -35
+2 -2
MAINTAINERS
··· 1023 1023 S: Maintained 1024 1024 1025 1025 SN-IA64 (Itanium) SUB-PLATFORM 1026 - P: Jesse Barnes 1027 - M: jbarnes@sgi.com 1026 + P: Greg Edwards 1027 + M: edwardsg@sgi.com 1028 1028 L: linux-altix@sgi.com 1029 1029 L: linux-ia64@vger.kernel.org 1030 1030 W: http://www.sgi.com/altix
+2 -2
arch/ia64/kernel/entry.S
··· 1182 1182 ;; 1183 1183 (pNonSys) mov out2=0 // out2==0 => not a syscall 1184 1184 .fframe 16 1185 - .spillpsp ar.unat, 16 // (note that offset is relative to psp+0x10!) 1185 + .spillsp ar.unat, 16 1186 1186 st8 [sp]=r9,-16 // allocate space for ar.unat and save it 1187 1187 st8 [out1]=loc1,-8 // save ar.pfs, out1=&sigscratch 1188 1188 .body ··· 1208 1208 adds out2=8,sp // out2=&sigscratch->ar_pfs 1209 1209 ;; 1210 1210 .fframe 16 1211 - .spillpsp ar.unat, 16 // (note that offset is relative to psp+0x10!) 1211 + .spillsp ar.unat, 16 1212 1212 st8 [sp]=r9,-16 // allocate space for ar.unat and save it 1213 1213 st8 [out2]=loc1,-8 // save ar.pfs, out2=&sigscratch 1214 1214 .body
+2 -2
arch/ia64/kernel/mca.c
··· 1390 1390 register_percpu_irq(IA64_MCA_WAKEUP_VECTOR, &mca_wkup_irqaction); 1391 1391 1392 1392 #ifdef CONFIG_ACPI 1393 - /* Setup the CPEI/P vector and handler */ 1394 - cpe_vector = acpi_request_vector(ACPI_INTERRUPT_CPEI); 1393 + /* Setup the CPEI/P handler */ 1395 1394 register_percpu_irq(IA64_CPEP_VECTOR, &mca_cpep_irqaction); 1396 1395 #endif 1397 1396 ··· 1435 1436 1436 1437 #ifdef CONFIG_ACPI 1437 1438 /* Setup the CPEI/P vector and handler */ 1439 + cpe_vector = acpi_request_vector(ACPI_INTERRUPT_CPEI); 1438 1440 init_timer(&cpe_poll_timer); 1439 1441 cpe_poll_timer.function = ia64_mca_cpe_poll; 1440 1442
+1 -2
arch/ia64/kernel/minstate.h
··· 41 41 (pKStk) addl r3=THIS_CPU(ia64_mca_data),r3;; \ 42 42 (pKStk) ld8 r3 = [r3];; \ 43 43 (pKStk) addl r3=IA64_MCA_CPU_INIT_STACK_OFFSET,r3;; \ 44 - (pKStk) addl sp=IA64_STK_OFFSET-IA64_PT_REGS_SIZE,r3; \ 44 + (pKStk) addl r1=IA64_STK_OFFSET-IA64_PT_REGS_SIZE,r3; \ 45 45 (pUStk) mov ar.rsc=0; /* set enforced lazy mode, pl 0, little-endian, loadrs=0 */ \ 46 46 (pUStk) addl r22=IA64_RBS_OFFSET,r1; /* compute base of register backing store */ \ 47 47 ;; \ ··· 50 50 (pUStk) mov r23=ar.bspstore; /* save ar.bspstore */ \ 51 51 (pUStk) dep r22=-1,r22,61,3; /* compute kernel virtual addr of RBS */ \ 52 52 ;; \ 53 - (pKStk) addl r1=-IA64_PT_REGS_SIZE,r1; /* if in kernel mode, use sp (r12) */ \ 54 53 (pUStk) mov ar.bspstore=r22; /* switch to kernel RBS */ \ 55 54 ;; \ 56 55 (pUStk) mov r18=ar.bsp; \
+160 -15
arch/ia64/kernel/perfmon.c
··· 11 11 * Version Perfmon-2.x is a rewrite of perfmon-1.x 12 12 * by Stephane Eranian, Hewlett Packard Co. 13 13 * 14 - * Copyright (C) 1999-2003, 2005 Hewlett Packard Co 14 + * Copyright (C) 1999-2005 Hewlett Packard Co 15 15 * Stephane Eranian <eranian@hpl.hp.com> 16 16 * David Mosberger-Tang <davidm@hpl.hp.com> 17 17 * ··· 497 497 static pfm_stats_t pfm_stats[NR_CPUS]; 498 498 static pfm_session_t pfm_sessions; /* global sessions information */ 499 499 500 + static spinlock_t pfm_alt_install_check = SPIN_LOCK_UNLOCKED; 501 + static pfm_intr_handler_desc_t *pfm_alt_intr_handler; 502 + 500 503 static struct proc_dir_entry *perfmon_dir; 501 504 static pfm_uuid_t pfm_null_uuid = {0,}; 502 505 ··· 609 606 DEFINE_PER_CPU(struct task_struct *, pmu_owner); 610 607 DEFINE_PER_CPU(pfm_context_t *, pmu_ctx); 611 608 DEFINE_PER_CPU(unsigned long, pmu_activation_number); 609 + EXPORT_PER_CPU_SYMBOL_GPL(pfm_syst_info); 612 610 613 611 614 612 /* forward declaration */ ··· 1329 1325 error_conflict: 1330 1326 DPRINT(("system wide not possible, conflicting session [%d] on CPU%d\n", 1331 1327 pfm_sessions.pfs_sys_session[cpu]->pid, 1332 - smp_processor_id())); 1328 + cpu)); 1333 1329 abort: 1334 1330 UNLOCK_PFS(flags); 1335 1331 ··· 5559 5555 int ret; 5560 5556 5561 5557 this_cpu = get_cpu(); 5562 - min = pfm_stats[this_cpu].pfm_ovfl_intr_cycles_min; 5563 - max = pfm_stats[this_cpu].pfm_ovfl_intr_cycles_max; 5558 + if (likely(!pfm_alt_intr_handler)) { 5559 + min = pfm_stats[this_cpu].pfm_ovfl_intr_cycles_min; 5560 + max = pfm_stats[this_cpu].pfm_ovfl_intr_cycles_max; 5564 5561 5565 - start_cycles = ia64_get_itc(); 5562 + start_cycles = ia64_get_itc(); 5566 5563 5567 - ret = pfm_do_interrupt_handler(irq, arg, regs); 5564 + ret = pfm_do_interrupt_handler(irq, arg, regs); 5568 5565 5569 - total_cycles = ia64_get_itc(); 5566 + total_cycles = ia64_get_itc(); 5570 5567 5571 - /* 5572 - * don't measure spurious interrupts 5573 - */ 5574 - if (likely(ret == 0)) { 5575 - total_cycles -= start_cycles; 5568 + /* 5569 + * don't measure spurious interrupts 5570 + */ 5571 + if (likely(ret == 0)) { 5572 + total_cycles -= start_cycles; 5576 5573 5577 - if (total_cycles < min) pfm_stats[this_cpu].pfm_ovfl_intr_cycles_min = total_cycles; 5578 - if (total_cycles > max) pfm_stats[this_cpu].pfm_ovfl_intr_cycles_max = total_cycles; 5574 + if (total_cycles < min) pfm_stats[this_cpu].pfm_ovfl_intr_cycles_min = total_cycles; 5575 + if (total_cycles > max) pfm_stats[this_cpu].pfm_ovfl_intr_cycles_max = total_cycles; 5579 5576 5580 - pfm_stats[this_cpu].pfm_ovfl_intr_cycles += total_cycles; 5577 + pfm_stats[this_cpu].pfm_ovfl_intr_cycles += total_cycles; 5578 + } 5581 5579 } 5580 + else { 5581 + (*pfm_alt_intr_handler->handler)(irq, arg, regs); 5582 + } 5583 + 5582 5584 put_cpu_no_resched(); 5583 5585 return IRQ_HANDLED; 5584 5586 } ··· 6434 6424 .flags = SA_INTERRUPT, 6435 6425 .name = "perfmon" 6436 6426 }; 6427 + 6428 + static void 6429 + pfm_alt_save_pmu_state(void *data) 6430 + { 6431 + struct pt_regs *regs; 6432 + 6433 + regs = ia64_task_regs(current); 6434 + 6435 + DPRINT(("called\n")); 6436 + 6437 + /* 6438 + * should not be necessary but 6439 + * let's take not risk 6440 + */ 6441 + pfm_clear_psr_up(); 6442 + pfm_clear_psr_pp(); 6443 + ia64_psr(regs)->pp = 0; 6444 + 6445 + /* 6446 + * This call is required 6447 + * May cause a spurious interrupt on some processors 6448 + */ 6449 + pfm_freeze_pmu(); 6450 + 6451 + ia64_srlz_d(); 6452 + } 6453 + 6454 + void 6455 + pfm_alt_restore_pmu_state(void *data) 6456 + { 6457 + struct pt_regs *regs; 6458 + 6459 + regs = ia64_task_regs(current); 6460 + 6461 + DPRINT(("called\n")); 6462 + 6463 + /* 6464 + * put PMU back in state expected 6465 + * by perfmon 6466 + */ 6467 + pfm_clear_psr_up(); 6468 + pfm_clear_psr_pp(); 6469 + ia64_psr(regs)->pp = 0; 6470 + 6471 + /* 6472 + * perfmon runs with PMU unfrozen at all times 6473 + */ 6474 + pfm_unfreeze_pmu(); 6475 + 6476 + ia64_srlz_d(); 6477 + } 6478 + 6479 + int 6480 + pfm_install_alt_pmu_interrupt(pfm_intr_handler_desc_t *hdl) 6481 + { 6482 + int ret, i; 6483 + int reserve_cpu; 6484 + 6485 + /* some sanity checks */ 6486 + if (hdl == NULL || hdl->handler == NULL) return -EINVAL; 6487 + 6488 + /* do the easy test first */ 6489 + if (pfm_alt_intr_handler) return -EBUSY; 6490 + 6491 + /* one at a time in the install or remove, just fail the others */ 6492 + if (!spin_trylock(&pfm_alt_install_check)) { 6493 + return -EBUSY; 6494 + } 6495 + 6496 + /* reserve our session */ 6497 + for_each_online_cpu(reserve_cpu) { 6498 + ret = pfm_reserve_session(NULL, 1, reserve_cpu); 6499 + if (ret) goto cleanup_reserve; 6500 + } 6501 + 6502 + /* save the current system wide pmu states */ 6503 + ret = on_each_cpu(pfm_alt_save_pmu_state, NULL, 0, 1); 6504 + if (ret) { 6505 + DPRINT(("on_each_cpu() failed: %d\n", ret)); 6506 + goto cleanup_reserve; 6507 + } 6508 + 6509 + /* officially change to the alternate interrupt handler */ 6510 + pfm_alt_intr_handler = hdl; 6511 + 6512 + spin_unlock(&pfm_alt_install_check); 6513 + 6514 + return 0; 6515 + 6516 + cleanup_reserve: 6517 + for_each_online_cpu(i) { 6518 + /* don't unreserve more than we reserved */ 6519 + if (i >= reserve_cpu) break; 6520 + 6521 + pfm_unreserve_session(NULL, 1, i); 6522 + } 6523 + 6524 + spin_unlock(&pfm_alt_install_check); 6525 + 6526 + return ret; 6527 + } 6528 + EXPORT_SYMBOL_GPL(pfm_install_alt_pmu_interrupt); 6529 + 6530 + int 6531 + pfm_remove_alt_pmu_interrupt(pfm_intr_handler_desc_t *hdl) 6532 + { 6533 + int i; 6534 + int ret; 6535 + 6536 + if (hdl == NULL) return -EINVAL; 6537 + 6538 + /* cannot remove someone else's handler! */ 6539 + if (pfm_alt_intr_handler != hdl) return -EINVAL; 6540 + 6541 + /* one at a time in the install or remove, just fail the others */ 6542 + if (!spin_trylock(&pfm_alt_install_check)) { 6543 + return -EBUSY; 6544 + } 6545 + 6546 + pfm_alt_intr_handler = NULL; 6547 + 6548 + ret = on_each_cpu(pfm_alt_restore_pmu_state, NULL, 0, 1); 6549 + if (ret) { 6550 + DPRINT(("on_each_cpu() failed: %d\n", ret)); 6551 + } 6552 + 6553 + for_each_online_cpu(i) { 6554 + pfm_unreserve_session(NULL, 1, i); 6555 + } 6556 + 6557 + spin_unlock(&pfm_alt_install_check); 6558 + 6559 + return 0; 6560 + } 6561 + EXPORT_SYMBOL_GPL(pfm_remove_alt_pmu_interrupt); 6437 6562 6438 6563 /* 6439 6564 * perfmon initialization routine, called from the initcall() table
+17 -3
arch/ia64/kernel/ptrace.c
··· 692 692 unsigned long cfm) 693 693 { 694 694 struct unw_frame_info info, prev_info; 695 - unsigned long ip, pr; 695 + unsigned long ip, sp, pr; 696 696 697 697 unw_init_from_blocked_task(&info, child); 698 698 while (1) { 699 699 prev_info = info; 700 700 if (unw_unwind(&info) < 0) 701 701 return; 702 - if (unw_get_rp(&info, &ip) < 0) 702 + 703 + unw_get_sp(&info, &sp); 704 + if ((long)((unsigned long)child + IA64_STK_OFFSET - sp) 705 + < IA64_PT_REGS_SIZE) { 706 + dprintk("ptrace.%s: ran off the top of the kernel " 707 + "stack\n", __FUNCTION__); 703 708 return; 704 - if (ip < FIXADDR_USER_END) 709 + } 710 + if (unw_get_pr (&prev_info, &pr) < 0) { 711 + unw_get_rp(&prev_info, &ip); 712 + dprintk("ptrace.%s: failed to read " 713 + "predicate register (ip=0x%lx)\n", 714 + __FUNCTION__, ip); 715 + return; 716 + } 717 + if (unw_is_intr_frame(&info) 718 + && (pr & (1UL << PRED_USER_STACK))) 705 719 break; 706 720 } 707 721
+1 -1
arch/ia64/kernel/smpboot.c
··· 624 624 __u16 thread_id; 625 625 __u16 proc_fixed_addr; 626 626 __u8 valid; 627 - }mt_info[NR_CPUS] __devinit; 627 + } mt_info[NR_CPUS] __devinitdata; 628 628 629 629 #ifdef CONFIG_HOTPLUG_CPU 630 630 static inline void
-7
arch/ia64/kernel/sys_ia64.c
··· 182 182 } 183 183 } 184 184 185 - /* 186 - * A zero mmap always succeeds in Linux, independent of whether or not the 187 - * remaining arguments are valid. 188 - */ 189 - if (len == 0) 190 - goto out; 191 - 192 185 /* Careful about overflows.. */ 193 186 len = PAGE_ALIGN(len); 194 187 if (!len || len > TASK_SIZE) {
+2
arch/ia64/sn/kernel/setup.c
··· 271 271 int major = sn_sal_rev_major(), minor = sn_sal_rev_minor(); 272 272 extern void sn_cpu_init(void); 273 273 274 + ia64_sn_plat_set_error_handling_features(); 275 + 274 276 /* 275 277 * If the generic code has enabled vga console support - lets 276 278 * get rid of it again. This is a kludge for the fact that ACPI
+8
include/asm-ia64/perfmon.h
··· 177 177 178 178 extern long perfmonctl(int fd, int cmd, void *arg, int narg); 179 179 180 + typedef struct { 181 + void (*handler)(int irq, void *arg, struct pt_regs *regs); 182 + } pfm_intr_handler_desc_t; 183 + 180 184 extern void pfm_save_regs (struct task_struct *); 181 185 extern void pfm_load_regs (struct task_struct *); 182 186 ··· 191 187 extern void pfm_inherit(struct task_struct *task, struct pt_regs *regs); 192 188 extern void pfm_init_percpu(void); 193 189 extern void pfm_handle_work(void); 190 + extern int pfm_install_alt_pmu_interrupt(pfm_intr_handler_desc_t *h); 191 + extern int pfm_remove_alt_pmu_interrupt(pfm_intr_handler_desc_t *h); 192 + 193 + 194 194 195 195 /* 196 196 * Reset PMD register flags
+27 -1
include/asm-ia64/sn/sn_sal.h
··· 115 115 #define SAL_IROUTER_INTR_XMIT SAL_CONSOLE_INTR_XMIT 116 116 #define SAL_IROUTER_INTR_RECV SAL_CONSOLE_INTR_RECV 117 117 118 + /* 119 + * Error Handling Features 120 + */ 121 + #define SAL_ERR_FEAT_MCA_SLV_TO_OS_INIT_SLV 0x1 122 + #define SAL_ERR_FEAT_LOG_SBES 0x2 123 + #define SAL_ERR_FEAT_MFR_OVERRIDE 0x4 124 + #define SAL_ERR_FEAT_SBE_THRESHOLD 0xffff0000 118 125 119 126 /* 120 127 * SAL Error Codes ··· 349 342 } 350 343 351 344 /* 345 + * Set Error Handling Features 346 + */ 347 + static inline u64 348 + ia64_sn_plat_set_error_handling_features(void) 349 + { 350 + struct ia64_sal_retval ret_stuff; 351 + 352 + ret_stuff.status = 0; 353 + ret_stuff.v0 = 0; 354 + ret_stuff.v1 = 0; 355 + ret_stuff.v2 = 0; 356 + SAL_CALL_REENTRANT(ret_stuff, SN_SAL_SET_ERROR_HANDLING_FEATURES, 357 + (SAL_ERR_FEAT_MCA_SLV_TO_OS_INIT_SLV | SAL_ERR_FEAT_LOG_SBES), 358 + 0, 0, 0, 0, 0, 0); 359 + 360 + return ret_stuff.status; 361 + } 362 + 363 + /* 352 364 * Checks for console input. 353 365 */ 354 366 static inline u64 ··· 498 472 ia64_sn_pod_mode(void) 499 473 { 500 474 struct ia64_sal_retval isrv; 501 - SAL_CALL(isrv, SN_SAL_POD_MODE, 0, 0, 0, 0, 0, 0, 0); 475 + SAL_CALL_REENTRANT(isrv, SN_SAL_POD_MODE, 0, 0, 0, 0, 0, 0, 0); 502 476 if (isrv.status) 503 477 return 0; 504 478 return isrv.v0;