1 #include <linux/module.h>
6 static void __rdmsr_on_cpu(
void *
info)
8 struct msr_info *rv =
info;
17 rdmsr(rv->msr_no, reg->l, reg->h);
20 static void __wrmsr_on_cpu(
void *info)
22 struct msr_info *rv =
info;
31 wrmsr(rv->msr_no, reg->l, reg->h);
39 memset(&rv, 0,
sizeof(rv));
55 memset(&rv, 0,
sizeof(rv));
66 static void __rwmsr_on_cpus(
const struct cpumask *
mask,
u32 msr_no,
68 void (*msr_func) (
void *info))
73 memset(&rv, 0,
sizeof(rv));
96 __rwmsr_on_cpus(mask, msr_no, msrs, __rdmsr_on_cpu);
110 __rwmsr_on_cpus(mask, msr_no, msrs, __wrmsr_on_cpu);
116 static void __rdmsr_safe_on_cpu(
void *info)
118 struct msr_info *rv =
info;
120 rv->err = rdmsr_safe(rv->msr_no, &rv->reg.l, &rv->reg.h);
123 static void __wrmsr_safe_on_cpu(
void *info)
125 struct msr_info *rv =
info;
127 rv->err = wrmsr_safe(rv->msr_no, rv->reg.l, rv->reg.h);
135 memset(&rv, 0,
sizeof(rv));
142 return err ? err : rv.err;
151 memset(&rv, 0,
sizeof(rv));
158 return err ? err : rv.err;
166 static void __rdmsr_safe_regs_on_cpu(
void *info)
168 struct msr_regs_info *rv =
info;
170 rv->err = rdmsr_safe_regs(rv->regs);
173 static void __wrmsr_safe_regs_on_cpu(
void *info)
175 struct msr_regs_info *rv =
info;
177 rv->err = wrmsr_safe_regs(rv->regs);
183 struct msr_regs_info rv;
189 return err ? err : rv.err;
196 struct msr_regs_info rv;
202 return err ? err : rv.err;