[Linux-ia64] ia32 & perfmon fix (relative to 2.4.4 + 010508 ia64 patch)

From: David Mosberger <davidm_at_hpl.hp.com>
Date: 2001-05-18 00:58:21
The patch below fixes a silly typo in the ia32 support and a buglet in
the PMU support.  I also noticed that "strace -f" is currently broken
for ia64 processes.  I tracked it down to the coredump related changes
in ptrace(), but don't have a complete fix yet.

	--david

--- arch/ia64/kernel/process.c~	Wed May 16 18:27:32 2001
+++ arch/ia64/kernel/process.c	Wed May 16 23:18:57 2001
@@ -285,7 +285,7 @@
 	 * state from the current task to the new task
 	 */
 	if (IS_IA32_PROCESS(ia64_task_regs(current)))
-		ia32_save_state(&p->thread);
+		ia32_save_state(p);
 #endif
 #ifdef CONFIG_PERFMON
 	p->thread.pfm_pend_notify = 0;
--- ../lia64/arch/ia64/kernel/perfmon.c	Sun Apr 29 17:09:23 2001
+++ arch/ia64/kernel/perfmon.c	Wed May 16 18:13:26 2001
@@ -787,26 +787,22 @@
 	/* XXX: ctx locking may be required here */
 
 	for (i = 0; i < count; i++, req++) {
-		int k;
-
 		if (copy_from_user(&tmp, req, sizeof(tmp))) return -EFAULT;
 
 		if (!PMD_IS_IMPL(tmp.pfr_reg.reg_num)) return -EINVAL;
 
-		k = tmp.pfr_reg.reg_num - PMU_FIRST_COUNTER;
-
 		if (PMD_IS_COUNTER(tmp.pfr_reg.reg_num)) {
 			if (ta == current){
 				val = ia64_get_pmd(tmp.pfr_reg.reg_num);
 			} else {
-				val = th->pmd[k];
+				val = th->pmd[tmp.pfr_reg.reg_num];
 			}
 			val &= pmu_conf.perf_ovfl_val;
 			/*
 			 * lower part of .val may not be zero, so we must be an addition because of
 			 * residual count (see update_counters).
 			 */
-			val += ctx->ctx_pmds[k].val;
+			val += ctx->ctx_pmds[tmp.pfr_reg.reg_num - PMU_FIRST_COUNTER].val;
 		} else {
 			/* for now */
 			if (ta != current) return -EINVAL;
Received on Thu May 17 08:01:26 2001

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:03 EST