From: tip-bot for Eric Dumazet <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: mingo@kernel.org, fengguang.wu@intel.com, bp@alien8.de,
linux-kernel@vger.kernel.org, hpa@zytor.com, edumazet@google.com,
eric.dumazet@gmail.com, tglx@linutronix.de
Subject: [tip:x86/cleanups] x86/msr: Make rdmsrl_safe_on_cpu() scheduling safe as well
Date: Wed, 28 Mar 2018 01:38:06 -0700 [thread overview]
Message-ID: <tip-9b9a51354cae933f5640b5bb73bbcd32f989122f@git.kernel.org> (raw)
In-Reply-To: <20180328032233.153055-1-edumazet@google.com>
Commit-ID: 9b9a51354cae933f5640b5bb73bbcd32f989122f
Gitweb: https://git.kernel.org/tip/9b9a51354cae933f5640b5bb73bbcd32f989122f
Author: Eric Dumazet <edumazet@google.com>
AuthorDate: Tue, 27 Mar 2018 20:22:33 -0700
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Wed, 28 Mar 2018 10:34:13 +0200
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
---
arch/x86/lib/msr-smp.c | 11 ++++-------
1 file 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);
int rdmsrl_safe_on_cpu(unsigned int cpu, u32 msr_no, u64 *q)
{
+ u32 low, high;
int err;
- struct msr_info rv;
- memset(&rv, 0, sizeof(rv));
+ err = rdmsr_safe_on_cpu(cpu, msr_no, &low, &high);
+ *q = (u64)high << 32 | low;
- rv.msr_no = msr_no;
- err = smp_call_function_single(cpu, __rdmsr_safe_on_cpu, &rv, 1);
- *q = rv.reg.q;
-
- return err ? err : rv.err;
+ return err;
}
EXPORT_SYMBOL(rdmsrl_safe_on_cpu);
next prev parent reply other threads:[~2018-03-28 8:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-28 3:22 [PATCH] x86, msr: fix rdmsrl_safe_on_cpu() Eric Dumazet
2018-03-28 8:38 ` tip-bot for Eric Dumazet [this message]
2018-03-28 10:08 ` Borislav Petkov
2018-03-28 16:33 ` Eric Dumazet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-9b9a51354cae933f5640b5bb73bbcd32f989122f@git.kernel.org \
--to=tipbot@zytor.com \
--cc=bp@alien8.de \
--cc=edumazet@google.com \
--cc=eric.dumazet@gmail.com \
--cc=fengguang.wu@intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome