Commit 95e74e62 authored by Robert Richter's avatar Robert Richter

x86/oprofile: use 64 bit values to save MSR states

This patch removes struct op_saved_msr and replaces it by an u64
variable. This makes code easier and it is possible to use 64 bit MSR
functions.
Signed-off-by: default avatarRobert Richter <robert.richter@amd.com>
parent bbc5986d
...@@ -78,19 +78,13 @@ static void nmi_cpu_save_registers(struct op_msrs *msrs) ...@@ -78,19 +78,13 @@ static void nmi_cpu_save_registers(struct op_msrs *msrs)
unsigned int i; unsigned int i;
for (i = 0; i < nr_ctrs; ++i) { for (i = 0; i < nr_ctrs; ++i) {
if (counters[i].addr) { if (counters[i].addr)
rdmsr(counters[i].addr, rdmsrl(counters[i].addr, counters[i].saved);
counters[i].saved.low,
counters[i].saved.high);
}
} }
for (i = 0; i < nr_ctrls; ++i) { for (i = 0; i < nr_ctrls; ++i) {
if (controls[i].addr) { if (controls[i].addr)
rdmsr(controls[i].addr, rdmsrl(controls[i].addr, controls[i].saved);
controls[i].saved.low,
controls[i].saved.high);
}
} }
} }
...@@ -204,19 +198,13 @@ static void nmi_restore_registers(struct op_msrs *msrs) ...@@ -204,19 +198,13 @@ static void nmi_restore_registers(struct op_msrs *msrs)
unsigned int i; unsigned int i;
for (i = 0; i < nr_ctrls; ++i) { for (i = 0; i < nr_ctrls; ++i) {
if (controls[i].addr) { if (controls[i].addr)
wrmsr(controls[i].addr, wrmsrl(controls[i].addr, controls[i].saved);
controls[i].saved.low,
controls[i].saved.high);
}
} }
for (i = 0; i < nr_ctrs; ++i) { for (i = 0; i < nr_ctrs; ++i) {
if (counters[i].addr) { if (counters[i].addr)
wrmsr(counters[i].addr, wrmsrl(counters[i].addr, counters[i].saved);
counters[i].saved.low,
counters[i].saved.high);
}
} }
} }
......
...@@ -15,14 +15,9 @@ ...@@ -15,14 +15,9 @@
#include <asm/types.h> #include <asm/types.h>
#include <asm/intel_arch_perfmon.h> #include <asm/intel_arch_perfmon.h>
struct op_saved_msr {
unsigned int high;
unsigned int low;
};
struct op_msr { struct op_msr {
unsigned long addr; unsigned long addr;
struct op_saved_msr saved; u64 saved;
}; };
struct op_msrs { struct op_msrs {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment