aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2018-03-27 23:22:33 -0400
committerThomas Gleixner <tglx@linutronix.de>2018-03-28 04:34:13 -0400
commit9b9a51354cae933f5640b5bb73bbcd32f989122f (patch)
tree8d5a3b47268670797edbd662f69b0e13041ec5a6
parent67bbd7a8d6bcdc44cc27105ae8c374e9176ceaf1 (diff)
x86/msr: Make rdmsrl_safe_on_cpu() scheduling safe as well
When changing rdmsr_safe_on_cpu() to schedule, it was missed that __rdmsr_safe_on_cpu() was also used by rdmsrl_safe_on_cpu() Make rdmsrl_safe_on_cpu() a wrapper instead of copy/pasting the code which was added for the completion handling. Fixes: 07cde313b2d2 ("x86/msr: Allow rdmsr_safe_on_cpu() to schedule") Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Borislav Petkov <bp@alien8.de> Cc: Eric Dumazet <eric.dumazet@gmail.com> Cc: "H. Peter Anvin" <hpa@zytor.com> Link: https://lkml.kernel.org/r/20180328032233.153055-1-edumazet@google.com
-rw-r--r--arch/x86/lib/msr-smp.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/arch/x86/lib/msr-smp.c b/arch/x86/lib/msr-smp.c
index 761ba062afda..fee8b9c0520c 100644
--- a/arch/x86/lib/msr-smp.c
+++ b/arch/x86/lib/msr-smp.c
@@ -225,16 +225,13 @@ EXPORT_SYMBOL(wrmsrl_safe_on_cpu);
225 225
226int rdmsrl_safe_on_cpu(unsigned int cpu, u32 msr_no, u64 *q) 226int rdmsrl_safe_on_cpu(unsigned int cpu, u32 msr_no, u64 *q)
227{ 227{
228 u32 low, high;
228 int err; 229 int err;
229 struct msr_info rv;
230 230
231 memset(&rv, 0, sizeof(rv)); 231 err = rdmsr_safe_on_cpu(cpu, msr_no, &low, &high);
232 *q = (u64)high << 32 | low;
232 233
233 rv.msr_no = msr_no; 234 return err;
234 err = smp_call_function_single(cpu, __rdmsr_safe_on_cpu, &rv, 1);
235 *q = rv.reg.q;
236
237 return err ? err : rv.err;
238} 235}
239EXPORT_SYMBOL(rdmsrl_safe_on_cpu); 236EXPORT_SYMBOL(rdmsrl_safe_on_cpu);
240 237