mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "tip-bot2 for Juergen Gross" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: K Prateek Nayak <kprateek.nayak@amd.com>,
	Juergen Gross <jgross@suse.com>, Ingo Molnar <mingo@kernel.org>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: x86/msr] x86/msr: Don't use rdmsr_safe_on_cpu() in rdmsrq_safe_on_cpu()
Date: Mon, 08 Jun 2026 08:03:23 -0000	[thread overview]
Message-ID: <178090580391.529383.13599502807908666887.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20260608051741.3207435-8-jgross@suse.com>

The following commit has been merged into the x86/msr branch of tip:

Commit-ID:     dfaf45fba11642893ed3d28c1aa9f516330147f1
Gitweb:        https://git.kernel.org/tip/dfaf45fba11642893ed3d28c1aa9f516330147f1
Author:        Juergen Gross <jgross@suse.com>
AuthorDate:    Mon, 08 Jun 2026 07:17:37 +02:00
Committer:     Ingo Molnar <mingo@kernel.org>
CommitterDate: Mon, 08 Jun 2026 10:01:49 +02:00

x86/msr: Don't use rdmsr_safe_on_cpu() in rdmsrq_safe_on_cpu()

In order to prepare removal of rdmsr_safe_on_cpu(), don't use it in
rdmsrq_safe_on_cpu(), but replace it with open coding it.

This will create a nearly verbatim copy of the same code, but this is
only temporary until rdmsr_safe_on_cpu() is removed.

Tested-by: K Prateek Nayak <kprateek.nayak@amd.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Dave Hansen <dave.hansen@linux.intel.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Link: https://patch.msgid.link/20260608051741.3207435-8-jgross@suse.com
---
 arch/x86/lib/msr-smp.c | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/arch/x86/lib/msr-smp.c b/arch/x86/lib/msr-smp.c
index a434c80..f3c75b6 100644
--- a/arch/x86/lib/msr-smp.c
+++ b/arch/x86/lib/msr-smp.c
@@ -190,11 +190,22 @@ EXPORT_SYMBOL(wrmsrq_safe_on_cpu);
 
 int rdmsrq_safe_on_cpu(unsigned int cpu, u32 msr_no, u64 *q)
 {
-	u32 low, high;
+	struct msr_info_completion rv;
+	call_single_data_t csd;
 	int err;
 
-	err = rdmsr_safe_on_cpu(cpu, msr_no, &low, &high);
-	*q = (u64)high << 32 | low;
+	INIT_CSD(&csd, __rdmsr_safe_on_cpu, &rv);
+
+	memset(&rv, 0, sizeof(rv));
+	init_completion(&rv.done);
+	rv.msr.msr_no = msr_no;
+
+	err = smp_call_function_single_async(cpu, &csd);
+	if (!err) {
+		wait_for_completion(&rv.done);
+		err = rv.msr.err;
+	}
+	*q = rv.msr.reg.q;
 
 	return err;
 }

  reply	other threads:[~2026-06-08  8:03 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-08  5:17 [PATCH v3 00/11] x86/msr: Drop 32-bit variants of *_on_cpu() MSR functions Juergen Gross
2026-06-08  5:17 ` [PATCH v3 01/11] x86/msr: Switch rdmsrl_on_cpu() users to rdmsrq_on_cpu() Juergen Gross
2026-06-08  5:54   ` K Prateek Nayak
2026-06-08  8:03   ` [tip: x86/msr] x86/msr: Switch rdmsrl_on_cpu() user " tip-bot2 for Juergen Gross
2026-06-08  5:17 ` [PATCH v3 02/11] x86/msr: Remove rdmsrl_on_cpu() Juergen Gross
2026-06-08  7:01   ` [PATCH 01.5/11] x86/msr: Switch rdmsrl_on_cpu() user to rdmsrq_on_cpu() Ingo Molnar
2026-06-08  7:11     ` Jürgen Groß
2026-06-08  7:58       ` Ingo Molnar
2026-06-08  8:03   ` [tip: x86/msr] x86/msr: Remove rdmsrl_on_cpu() tip-bot2 for Juergen Gross
2026-06-08  5:17 ` [PATCH v3 03/11] x86/msr: Switch rdmsr_on_cpu() users to rdmsrq_on_cpu() Juergen Gross
2026-06-08  8:03   ` [tip: x86/msr] " tip-bot2 for Juergen Gross
2026-06-08  5:17 ` [PATCH v3 04/11] x86/msr: Remove rdmsr_on_cpu() Juergen Gross
2026-06-08  8:03   ` [tip: x86/msr] " tip-bot2 for Juergen Gross
2026-06-08  5:17 ` [PATCH v3 05/11] x86/msr: Switch wrmsr_on_cpu() users to wrmsrq_on_cpu() Juergen Gross
2026-06-08  8:03   ` [tip: x86/msr] " tip-bot2 for Juergen Gross
2026-06-08  5:17 ` [PATCH v3 06/11] x86/msr: Remove wrmsr_on_cpu() Juergen Gross
2026-06-08  8:03   ` [tip: x86/msr] " tip-bot2 for Juergen Gross
2026-06-08  5:17 ` [PATCH v3 07/11] x86/msr: Don't use rdmsr_safe_on_cpu() in rdmsrq_safe_on_cpu() Juergen Gross
2026-06-08  8:03   ` tip-bot2 for Juergen Gross [this message]
2026-06-08  5:17 ` [PATCH v3 08/11] x86/msr: Switch rdmsr_safe_on_cpu() users to rdmsrq_safe_on_cpu() Juergen Gross
2026-06-08  8:03   ` [tip: x86/msr] " tip-bot2 for Juergen Gross
2026-06-08  5:17 ` [PATCH v3 09/11] x86/msr: Remove rdmsr_safe_on_cpu() Juergen Gross
2026-06-08  8:03   ` [tip: x86/msr] " tip-bot2 for Juergen Gross
2026-06-08  5:17 ` [PATCH v3 10/11] x86/msr: Switch wrmsr_safe_on_cpu() users to wrmsrq_safe_on_cpu() Juergen Gross
2026-06-08  8:03   ` [tip: x86/msr] " tip-bot2 for Juergen Gross
2026-06-08  5:17 ` [PATCH v3 11/11] x86/msr: Remove wrmsr_safe_on_cpu() Juergen Gross
2026-06-08  8:03   ` [tip: x86/msr] " tip-bot2 for Juergen Gross
2026-06-08  5:59 ` [PATCH v3 00/11] x86/msr: Drop 32-bit variants of *_on_cpu() MSR functions K Prateek Nayak

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=178090580391.529383.13599502807908666887.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=jgross@suse.com \
    --cc=kprateek.nayak@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=x86@kernel.org \
    /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

all inboxes | Powered by JetHome®