From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B8CD839B949; Mon, 8 Jun 2026 08:03:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780905808; cv=none; b=cTwCIrgS9BxDeierwT2SJcMJ0cL9UmLo2NBp4d3uDPhrJKpmOcr5ZDSkqyWE4fOmdY7nU8t340yLwPXBKojYBF1B/75DxCNCLGt0Cfps3JQMjijPMzajgvNISaP4UviVhJz+4kYwoqijDXw4zoka2crUmcWdee9vdcWQ1VlLchE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780905808; c=relaxed/simple; bh=Kn/WQeawODAmFXvy8leObl0Ij29YDmOHHEUw0+KYvew=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=lM3JVyIU6a3P78M7m77zRUoRvyIZ5dfEeS1ZVZPlvf8GT9JCuQQDMFuErGnZtyOmbw2Wxf9yBUiPnQiI9RLBHZYQP90kPkHqNeGnBIxFCocOfj/PQPqpsRKjmED/VGNnJAEhdfkfYocc5KQ/qPHxpTR4ozUvzy1zE9pl6T9ogow= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=ZauIJgnO; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=pfuWO4CU; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="ZauIJgnO"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="pfuWO4CU" Date: Mon, 08 Jun 2026 08:03:23 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1780905805; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WMB59dn/w1FK899JiuEnEqmm8EQ0pu5DkxLLGZ7gdiE=; b=ZauIJgnOW606e0puIAfTFAcsXT5vFsus/A/HM40M5Kb3kJRPfHk8Lt1VpKmUz6q4udHp3/ OWABQWmRj64r74oX49g/oltY9iCxYKMdaCyM8SSiSR43FCanbGWwfLPgKNw7F77C2sFkGw RN5Kn8X1kRMepV9ix9WljIhF+nN7nkYFg6bYZ7pN1TI4YT8gOKrgSZaKMb5g8u3m6E4EgN TvZ0sWMPF+xOWlQvN5DoBUNbsrBbH+efwB0OoZNoxJlH90SyUD1XdyCXh8LNMTLSnu5hLJ 3IbShFkJ//pQIZlZjgeTu3NEM8yMyKywyv1qemqbm6WwfvXfDw/OWkjWzhKBBw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1780905805; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WMB59dn/w1FK899JiuEnEqmm8EQ0pu5DkxLLGZ7gdiE=; b=pfuWO4CUUwYPE+uBMKG5wVT/FI63gEABRAlPk5rkMAXny5mOzFiDCRM/nrns+bIKU8hD8D QobupZqEWY8+fgCw== From: "tip-bot2 for Juergen Gross" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/msr] x86/msr: Don't use rdmsr_safe_on_cpu() in rdmsrq_safe_on_cpu() Cc: K Prateek Nayak , Juergen Gross , Ingo Molnar , Dave Hansen , "H. Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260608051741.3207435-8-jgross@suse.com> References: <20260608051741.3207435-8-jgross@suse.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <178090580391.529383.13599502807908666887.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the x86/msr branch of tip: Commit-ID: dfaf45fba11642893ed3d28c1aa9f516330147f1 Gitweb: https://git.kernel.org/tip/dfaf45fba11642893ed3d28c1aa9f516330= 147f1 Author: Juergen Gross AuthorDate: Mon, 08 Jun 2026 07:17:37 +02:00 Committer: Ingo Molnar 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 Signed-off-by: Juergen Gross Signed-off-by: Ingo Molnar Reviewed-by: Dave Hansen Cc: H. Peter Anvin 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); =20 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; =20 - err =3D rdmsr_safe_on_cpu(cpu, msr_no, &low, &high); - *q =3D (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 =3D msr_no; + + err =3D smp_call_function_single_async(cpu, &csd); + if (!err) { + wait_for_completion(&rv.done); + err =3D rv.msr.err; + } + *q =3D rv.msr.reg.q; =20 return err; }