aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/oprofile
diff options
context:
space:
mode:
authorRobert Richter <robert.richter@amd.com>2009-05-25 11:38:19 -0400
committerRobert Richter <robert.richter@amd.com>2009-06-11 13:42:17 -0400
commitbbc5986d2db427fdd61b6116ff8b9ed988e663a8 (patch)
treedb39521e332170b30b3c6d83cf13ad5911256344 /arch/x86/oprofile
parent217d3cfb959756cb493fc03106c0253baa420ce8 (diff)
x86/oprofile: use 64 bit wrmsr functions
This patch replaces some wrmsr() functions with wrmsrl(). Signed-off-by: Robert Richter <robert.richter@amd.com>
Diffstat (limited to 'arch/x86/oprofile')
-rw-r--r--arch/x86/oprofile/op_model_amd.c7
-rw-r--r--arch/x86/oprofile/op_model_p4.c12
2 files changed, 10 insertions, 9 deletions
diff --git a/arch/x86/oprofile/op_model_amd.c b/arch/x86/oprofile/op_model_amd.c
index c5c5eec2fa74..9bf901762411 100644
--- a/arch/x86/oprofile/op_model_amd.c
+++ b/arch/x86/oprofile/op_model_amd.c
@@ -101,14 +101,15 @@ static void op_amd_setup_ctrs(struct op_x86_model_spec const *model,
101 for (i = 0; i < NUM_COUNTERS; ++i) { 101 for (i = 0; i < NUM_COUNTERS; ++i) {
102 if (unlikely(!msrs->counters[i].addr)) 102 if (unlikely(!msrs->counters[i].addr))
103 continue; 103 continue;
104 wrmsr(msrs->counters[i].addr, -1, -1); 104 wrmsrl(msrs->counters[i].addr, -1LL);
105 } 105 }
106 106
107 /* enable active counters */ 107 /* enable active counters */
108 for (i = 0; i < NUM_COUNTERS; ++i) { 108 for (i = 0; i < NUM_COUNTERS; ++i) {
109 if (counter_config[i].enabled && msrs->counters[i].addr) { 109 if (counter_config[i].enabled && msrs->counters[i].addr) {
110 reset_value[i] = counter_config[i].count; 110 reset_value[i] = counter_config[i].count;
111 wrmsr(msrs->counters[i].addr, -(unsigned int)counter_config[i].count, -1); 111 wrmsrl(msrs->counters[i].addr,
112 -(s64)counter_config[i].count);
112 rdmsrl(msrs->controls[i].addr, val); 113 rdmsrl(msrs->controls[i].addr, val);
113 val &= model->reserved; 114 val &= model->reserved;
114 val |= op_x86_get_ctrl(model, &counter_config[i]); 115 val |= op_x86_get_ctrl(model, &counter_config[i]);
@@ -251,7 +252,7 @@ static int op_amd_check_ctrs(struct pt_regs * const regs,
251 if (val & OP_CTR_OVERFLOW) 252 if (val & OP_CTR_OVERFLOW)
252 continue; 253 continue;
253 oprofile_add_sample(regs, i); 254 oprofile_add_sample(regs, i);
254 wrmsr(msrs->counters[i].addr, -(unsigned int)reset_value[i], -1); 255 wrmsrl(msrs->counters[i].addr, -(s64)reset_value[i]);
255 } 256 }
256 257
257 op_amd_handle_ibs(regs, msrs); 258 op_amd_handle_ibs(regs, msrs);
diff --git a/arch/x86/oprofile/op_model_p4.c b/arch/x86/oprofile/op_model_p4.c
index 9db0ca9af764..f01e53b118fa 100644
--- a/arch/x86/oprofile/op_model_p4.c
+++ b/arch/x86/oprofile/op_model_p4.c
@@ -579,8 +579,8 @@ static void p4_setup_ctrs(struct op_x86_model_spec const *model,
579 if (counter_config[i].enabled && msrs->controls[i].addr) { 579 if (counter_config[i].enabled && msrs->controls[i].addr) {
580 reset_value[i] = counter_config[i].count; 580 reset_value[i] = counter_config[i].count;
581 pmc_setup_one_p4_counter(i); 581 pmc_setup_one_p4_counter(i);
582 wrmsr(p4_counters[VIRT_CTR(stag, i)].counter_address, 582 wrmsrl(p4_counters[VIRT_CTR(stag, i)].counter_address,
583 -(u32)counter_config[i].count, -1); 583 -(s64)counter_config[i].count);
584 } else { 584 } else {
585 reset_value[i] = 0; 585 reset_value[i] = 0;
586 } 586 }
@@ -624,12 +624,12 @@ static int p4_check_ctrs(struct pt_regs * const regs,
624 rdmsr(p4_counters[real].counter_address, ctr, high); 624 rdmsr(p4_counters[real].counter_address, ctr, high);
625 if (CCCR_OVF_P(low) || !(ctr & OP_CTR_OVERFLOW)) { 625 if (CCCR_OVF_P(low) || !(ctr & OP_CTR_OVERFLOW)) {
626 oprofile_add_sample(regs, i); 626 oprofile_add_sample(regs, i);
627 wrmsr(p4_counters[real].counter_address, 627 wrmsrl(p4_counters[real].counter_address,
628 -(u32)reset_value[i], -1); 628 -(s64)reset_value[i]);
629 CCCR_CLEAR_OVF(low); 629 CCCR_CLEAR_OVF(low);
630 wrmsr(p4_counters[real].cccr_address, low, high); 630 wrmsr(p4_counters[real].cccr_address, low, high);
631 wrmsr(p4_counters[real].counter_address, 631 wrmsrl(p4_counters[real].counter_address,
632 -(u32)reset_value[i], -1); 632 -(s64)reset_value[i]);
633 } 633 }
634 } 634 }
635 635