···1182 ;;1183(pNonSys) mov out2=0 // out2==0 => not a syscall1184 .fframe 161185- .spillpsp ar.unat, 16 // (note that offset is relative to psp+0x10!)1186 st8 [sp]=r9,-16 // allocate space for ar.unat and save it1187 st8 [out1]=loc1,-8 // save ar.pfs, out1=&sigscratch1188 .body···1208 adds out2=8,sp // out2=&sigscratch->ar_pfs1209 ;;1210 .fframe 161211- .spillpsp ar.unat, 16 // (note that offset is relative to psp+0x10!)1212 st8 [sp]=r9,-16 // allocate space for ar.unat and save it1213 st8 [out2]=loc1,-8 // save ar.pfs, out2=&sigscratch1214 .body
···1182 ;;1183(pNonSys) mov out2=0 // out2==0 => not a syscall1184 .fframe 161185+ .spillsp ar.unat, 161186 st8 [sp]=r9,-16 // allocate space for ar.unat and save it1187 st8 [out1]=loc1,-8 // save ar.pfs, out1=&sigscratch1188 .body···1208 adds out2=8,sp // out2=&sigscratch->ar_pfs1209 ;;1210 .fframe 161211+ .spillsp ar.unat, 161212 st8 [sp]=r9,-16 // allocate space for ar.unat and save it1213 st8 [out2]=loc1,-8 // save ar.pfs, out2=&sigscratch1214 .body
+2-2
arch/ia64/kernel/mca.c
···1390 register_percpu_irq(IA64_MCA_WAKEUP_VECTOR, &mca_wkup_irqaction);13911392#ifdef CONFIG_ACPI1393- /* Setup the CPEI/P vector and handler */1394- cpe_vector = acpi_request_vector(ACPI_INTERRUPT_CPEI);1395 register_percpu_irq(IA64_CPEP_VECTOR, &mca_cpep_irqaction);1396#endif1397···14351436#ifdef CONFIG_ACPI1437 /* Setup the CPEI/P vector and handler */01438 init_timer(&cpe_poll_timer);1439 cpe_poll_timer.function = ia64_mca_cpe_poll;1440
···1390 register_percpu_irq(IA64_MCA_WAKEUP_VECTOR, &mca_wkup_irqaction);13911392#ifdef CONFIG_ACPI1393+ /* Setup the CPEI/P handler */01394 register_percpu_irq(IA64_CPEP_VECTOR, &mca_cpep_irqaction);1395#endif1396···14361437#ifdef CONFIG_ACPI1438 /* Setup the CPEI/P vector and handler */1439+ cpe_vector = acpi_request_vector(ACPI_INTERRUPT_CPEI);1440 init_timer(&cpe_poll_timer);1441 cpe_poll_timer.function = ia64_mca_cpe_poll;1442
+1-2
arch/ia64/kernel/minstate.h
···41(pKStk) addl r3=THIS_CPU(ia64_mca_data),r3;; \42(pKStk) ld8 r3 = [r3];; \43(pKStk) addl r3=IA64_MCA_CPU_INIT_STACK_OFFSET,r3;; \44-(pKStk) addl sp=IA64_STK_OFFSET-IA64_PT_REGS_SIZE,r3; \45(pUStk) mov ar.rsc=0; /* set enforced lazy mode, pl 0, little-endian, loadrs=0 */ \46(pUStk) addl r22=IA64_RBS_OFFSET,r1; /* compute base of register backing store */ \47 ;; \···50(pUStk) mov r23=ar.bspstore; /* save ar.bspstore */ \51(pUStk) dep r22=-1,r22,61,3; /* compute kernel virtual addr of RBS */ \52 ;; \53-(pKStk) addl r1=-IA64_PT_REGS_SIZE,r1; /* if in kernel mode, use sp (r12) */ \54(pUStk) mov ar.bspstore=r22; /* switch to kernel RBS */ \55 ;; \56(pUStk) mov r18=ar.bsp; \
···41(pKStk) addl r3=THIS_CPU(ia64_mca_data),r3;; \42(pKStk) ld8 r3 = [r3];; \43(pKStk) addl r3=IA64_MCA_CPU_INIT_STACK_OFFSET,r3;; \44+(pKStk) addl r1=IA64_STK_OFFSET-IA64_PT_REGS_SIZE,r3; \45(pUStk) mov ar.rsc=0; /* set enforced lazy mode, pl 0, little-endian, loadrs=0 */ \46(pUStk) addl r22=IA64_RBS_OFFSET,r1; /* compute base of register backing store */ \47 ;; \···50(pUStk) mov r23=ar.bspstore; /* save ar.bspstore */ \51(pUStk) dep r22=-1,r22,61,3; /* compute kernel virtual addr of RBS */ \52 ;; \053(pUStk) mov ar.bspstore=r22; /* switch to kernel RBS */ \54 ;; \55(pUStk) mov r18=ar.bsp; \
+160-15
arch/ia64/kernel/perfmon.c
···11 * Version Perfmon-2.x is a rewrite of perfmon-1.x12 * by Stephane Eranian, Hewlett Packard Co.13 *14- * Copyright (C) 1999-2003, 2005 Hewlett Packard Co15 * Stephane Eranian <eranian@hpl.hp.com>16 * David Mosberger-Tang <davidm@hpl.hp.com>17 *···497static pfm_stats_t pfm_stats[NR_CPUS];498static pfm_session_t pfm_sessions; /* global sessions information */499000500static struct proc_dir_entry *perfmon_dir;501static pfm_uuid_t pfm_null_uuid = {0,};502···609DEFINE_PER_CPU(struct task_struct *, pmu_owner);610DEFINE_PER_CPU(pfm_context_t *, pmu_ctx);611DEFINE_PER_CPU(unsigned long, pmu_activation_number);0612613614/* forward declaration */···1329error_conflict:1330 DPRINT(("system wide not possible, conflicting session [%d] on CPU%d\n",1331 pfm_sessions.pfs_sys_session[cpu]->pid,1332- smp_processor_id()));1333abort:1334 UNLOCK_PFS(flags);1335···5559 int ret;55605561 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;055645565- start_cycles = ia64_get_itc();55665567- ret = pfm_do_interrupt_handler(irq, arg, regs);55685569- total_cycles = ia64_get_itc();55705571- /*5572- * don't measure spurious interrupts5573- */5574- if (likely(ret == 0)) {5575- total_cycles -= start_cycles;55765577- 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;55795580- pfm_stats[this_cpu].pfm_ovfl_intr_cycles += total_cycles;05581 }00005582 put_cpu_no_resched();5583 return IRQ_HANDLED;5584}···6434 .flags = SA_INTERRUPT,6435 .name = "perfmon"6436};00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064376438/*6439 * perfmon initialization routine, called from the initcall() table
···11 * Version Perfmon-2.x is a rewrite of perfmon-1.x12 * by Stephane Eranian, Hewlett Packard Co.13 *14+ * Copyright (C) 1999-2005 Hewlett Packard Co15 * Stephane Eranian <eranian@hpl.hp.com>16 * David Mosberger-Tang <davidm@hpl.hp.com>17 *···497static pfm_stats_t pfm_stats[NR_CPUS];498static pfm_session_t pfm_sessions; /* global sessions information */499500+static spinlock_t pfm_alt_install_check = SPIN_LOCK_UNLOCKED;501+static pfm_intr_handler_desc_t *pfm_alt_intr_handler;502+503static struct proc_dir_entry *perfmon_dir;504static pfm_uuid_t pfm_null_uuid = {0,};505···606DEFINE_PER_CPU(struct task_struct *, pmu_owner);607DEFINE_PER_CPU(pfm_context_t *, pmu_ctx);608DEFINE_PER_CPU(unsigned long, pmu_activation_number);609+EXPORT_PER_CPU_SYMBOL_GPL(pfm_syst_info);610611612/* forward declaration */···1325error_conflict:1326 DPRINT(("system wide not possible, conflicting session [%d] on CPU%d\n",1327 pfm_sessions.pfs_sys_session[cpu]->pid,1328+ cpu));1329abort:1330 UNLOCK_PFS(flags);1331···5555 int ret;55565557 this_cpu = get_cpu();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;55615562+ start_cycles = ia64_get_itc();55635564+ ret = pfm_do_interrupt_handler(irq, arg, regs);55655566+ total_cycles = ia64_get_itc();55675568+ /*5569+ * don't measure spurious interrupts5570+ */5571+ if (likely(ret == 0)) {5572+ total_cycles -= start_cycles;55735574+ 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;55765577+ pfm_stats[this_cpu].pfm_ovfl_intr_cycles += total_cycles;5578+ }5579 }5580+ else {5581+ (*pfm_alt_intr_handler->handler)(irq, arg, regs);5582+ }5583+5584 put_cpu_no_resched();5585 return IRQ_HANDLED;5586}···6424 .flags = SA_INTERRUPT,6425 .name = "perfmon"6426};6427+6428+static void6429+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 but6439+ * let's take not risk6440+ */6441+ pfm_clear_psr_up();6442+ pfm_clear_psr_pp();6443+ ia64_psr(regs)->pp = 0;6444+6445+ /*6446+ * This call is required6447+ * May cause a spurious interrupt on some processors6448+ */6449+ pfm_freeze_pmu();6450+6451+ ia64_srlz_d();6452+}6453+6454+void6455+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 expected6465+ * by perfmon6466+ */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 times6473+ */6474+ pfm_unfreeze_pmu();6475+6476+ ia64_srlz_d();6477+}6478+6479+int6480+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+int6531+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);65626563/*6564 * perfmon initialization routine, called from the initcall() table
+17-3
arch/ia64/kernel/ptrace.c
···692 unsigned long cfm)693{694 struct unw_frame_info info, prev_info;695- unsigned long ip, pr;696697 unw_init_from_blocked_task(&info, child);698 while (1) {699 prev_info = info;700 if (unw_unwind(&info) < 0)701 return;702- if (unw_get_rp(&info, &ip) < 0)00000703 return;704- if (ip < FIXADDR_USER_END)000000000705 break;706 }707
···692 unsigned long cfm)693{694 struct unw_frame_info info, prev_info;695+ unsigned long ip, sp, pr;696697 unw_init_from_blocked_task(&info, child);698 while (1) {699 prev_info = info;700 if (unw_unwind(&info) < 0)701 return;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__);708 return;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)))719 break;720 }721
···182 }183 }184185- /*186- * A zero mmap always succeeds in Linux, independent of whether or not the187- * remaining arguments are valid.188- */189- if (len == 0)190- goto out;191-192 /* Careful about overflows.. */193 len = PAGE_ALIGN(len);194 if (!len || len > TASK_SIZE) {
···182 }183 }1840000000185 /* Careful about overflows.. */186 len = PAGE_ALIGN(len);187 if (!len || len > TASK_SIZE) {
+2
arch/ia64/sn/kernel/setup.c
···271 int major = sn_sal_rev_major(), minor = sn_sal_rev_minor();272 extern void sn_cpu_init(void);27300274 /*275 * If the generic code has enabled vga console support - lets276 * get rid of it again. This is a kludge for the fact that ACPI
···271 int major = sn_sal_rev_major(), minor = sn_sal_rev_minor();272 extern void sn_cpu_init(void);273274+ ia64_sn_plat_set_error_handling_features();275+276 /*277 * If the generic code has enabled vga console support - lets278 * get rid of it again. This is a kludge for the fact that ACPI