* [PATCH] msr: replace rdmsr()/wrmsr() in comments
@ 2026-11-23 8:08 Juergen Gross
2026-11-23 13:33 ` Asaf Nuri Bertizlioğlu
0 siblings, 1 reply; 3+ messages in thread
From: Juergen Gross @ 2026-11-23 8:08 UTC (permalink / raw)
To: linux-kernel, x86, linux-doc, linux-perf-users, linux-hwmon,
platform-driver-x86
Cc: Juergen Gross, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
Dave Hansen, H. Peter Anvin, Jonathan Corbet, Shuah Khan,
Randy Dunlap, Peter Zijlstra, Arnaldo Carvalho de Melo,
Namhyung Kim, Mark Rutland, Alexander Shishkin, Jiri Olsa,
Ian Rogers, Adrian Hunter, James Clark, Guenter Roeck, Tony Luck,
Ashok Raj, Hans de Goede, Ilpo Järvinen
Replace all mentioning of rdmsr() and wrmsr() in comments with
rdmsrq() and wrmsrq(), as the former functions are no longer
existing.
Signed-off-by: Juergen Gross <jgross@suse.com>
---
To be applied on top of current core/msr branch of the tip tree.
Documentation/arch/x86/microcode.rst | 2 +-
arch/x86/events/amd/ibs.c | 2 +-
arch/x86/events/intel/core.c | 2 +-
arch/x86/events/intel/lbr.c | 6 +++---
arch/x86/include/asm/shared/msr.h | 2 +-
arch/x86/kernel/cpu/feat_ctl.c | 2 +-
drivers/hwmon/coretemp.c | 2 +-
drivers/platform/x86/intel/ifs/load.c | 5 +++--
8 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/Documentation/arch/x86/microcode.rst b/Documentation/arch/x86/microcode.rst
index b627c6f36bcf..df1fb2c82333 100644
--- a/Documentation/arch/x86/microcode.rst
+++ b/Documentation/arch/x86/microcode.rst
@@ -151,7 +151,7 @@ are also treated as fatal by the kernel.
On certain Intel machines, MCEs are also broadcast to all threads in a
system. If one thread is in the middle of executing WRMSR, a MCE will be
taken at the end of the flow. Either way, they will wait for the thread
-performing the wrmsr(0x79) to rendezvous in the MCE handler and shutdown
+performing the wrmsrq(0x79) to rendezvous in the MCE handler and shutdown
eventually if any of the threads in the system fail to check in to the
MCE rendezvous.
diff --git a/arch/x86/events/amd/ibs.c b/arch/x86/events/amd/ibs.c
index f43949bde19c..2ef0530b6561 100644
--- a/arch/x86/events/amd/ibs.c
+++ b/arch/x86/events/amd/ibs.c
@@ -591,7 +591,7 @@ static void perf_ibs_start(struct perf_event *event, int flags)
* o Set VAL bit CTL2[Dis] = 1
* o Raise NMI --. o ...
* \ o ->start()
- * \ wrmsr(IBS_{FETCH|OP}_CTL, new value);
+ * \ wrmsrq(IBS_{FETCH|OP}_CTL, new value);
* \ (wrmsr clears the VAL bit)
* `--> o Receives delayed NMI
* (Unknown NMI since VAL bit is cleared)
diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c
index 96bcbf823aec..1b6213ef2ced 100644
--- a/arch/x86/events/intel/core.c
+++ b/arch/x86/events/intel/core.c
@@ -6963,7 +6963,7 @@ static bool check_msr(unsigned long msr, u64 mask)
return false;
/*
- * Quirk only affects validation in wrmsr(), so wrmsrq()'s value
+ * Quirk only affects validation in wrmsrq(), so wrmsrq()'s value
* should equal rdmsrq()'s even with the quirk.
*/
if (val_new != val_tmp)
diff --git a/arch/x86/events/intel/lbr.c b/arch/x86/events/intel/lbr.c
index beac04502b73..760d5e465a56 100644
--- a/arch/x86/events/intel/lbr.c
+++ b/arch/x86/events/intel/lbr.c
@@ -222,7 +222,7 @@ enum {
* are the TSX flags when TSX is supported, but when TSX is not supported
* they have no consistent behavior:
*
- * - For wrmsr(), bits 61:62 are considered part of the sign extension.
+ * - For wrmsrq(), bits 61:62 are considered part of the sign extension.
* - For HW updates (branch captures) bits 61:62 are always OFF and are not
* part of the sign extension.
*
@@ -231,8 +231,8 @@ enum {
* 1) LBR format LBR_FORMAT_EIP_FLAGS2
* 2) CPU has no TSX support enabled
*
- * ... then any value passed to wrmsr() must be sign extended to 63 bits and any
- * value from rdmsr() must be converted to have a 61 bits sign extension,
+ * ... then any value passed to wrmsrq() must be sign extended to 63 bits and
+ * any value from rdmsrq() must be converted to have a 61 bits sign extension,
* ignoring the TSX flags.
*/
static inline bool lbr_from_signext_quirk_needed(void)
diff --git a/arch/x86/include/asm/shared/msr.h b/arch/x86/include/asm/shared/msr.h
index a20b1c08c99f..c46188ca5403 100644
--- a/arch/x86/include/asm/shared/msr.h
+++ b/arch/x86/include/asm/shared/msr.h
@@ -13,7 +13,7 @@ struct msr {
};
/*
- * The kernel proper already defines rdmsr()/wrmsr(), but they are not for the
+ * The kernel proper already defines rdmsrq()/wrmsrq(), but they are not for the
* boot kernel since they rely on tracepoint/exception handling infrastructure
* that's not available here.
*/
diff --git a/arch/x86/kernel/cpu/feat_ctl.c b/arch/x86/kernel/cpu/feat_ctl.c
index 7228fc2bb43e..0c10b1f35270 100644
--- a/arch/x86/kernel/cpu/feat_ctl.c
+++ b/arch/x86/kernel/cpu/feat_ctl.c
@@ -36,7 +36,7 @@ static void init_vmx_capabilities(struct cpuinfo_x86 *c)
* features that can be turned off. Ignore the allowed-0 settings,
* if a feature can be turned on then it's supported.
*
- * Use raw rdmsr() for primary processor controls and pin controls MSRs
+ * Use raw rdmsrq() for primary processor controls and pin controls MSRs
* as they exist on any CPU that supports VMX, i.e. we want the WARN if
* the RDMSR faults.
*/
diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
index 96d57fe12de6..83bad446ecc2 100644
--- a/drivers/hwmon/coretemp.c
+++ b/drivers/hwmon/coretemp.c
@@ -67,7 +67,7 @@ enum coretemp_attr_index {
* @last_updated: The time when the current temperature value was updated
* earlier (in jiffies).
* @cpu_core_id: The CPU Core from which temperature values should be read
- * This value is passed as "id" field to rdmsr/wrmsr functions.
+ * This value is passed as "id" field to rdmsrq/wrmsrq functions.
* @status_reg: One of IA32_THERM_STATUS or IA32_PACKAGE_THERM_STATUS,
* from where the temperature values should be read.
* @attr_size: Number of sysfs attributes in this temperature data group.
diff --git a/drivers/platform/x86/intel/ifs/load.c b/drivers/platform/x86/intel/ifs/load.c
index 6320a0e45d38..74041a3410c3 100644
--- a/drivers/platform/x86/intel/ifs/load.c
+++ b/drivers/platform/x86/intel/ifs/load.c
@@ -110,8 +110,9 @@ static void auth_err_message(struct device *dev, u32 err_code)
/*
* To copy scan hashes and authenticate test chunks, the initiating cpu must point
* to the EDX:EAX to the test image in linear address.
- * Run wrmsr(MSR_COPY_SCAN_HASHES) for scan hash copy and run wrmsr(MSR_AUTHENTICATE_AND_COPY_CHUNK)
- * for scan hash copy and test chunk authentication.
+ * Run wrmsrq(MSR_COPY_SCAN_HASHES) for scan hash copy and run
+ * wrmsrq(MSR_AUTHENTICATE_AND_COPY_CHUNK) for scan hash copy and test chunk
+ * authentication.
*/
static void copy_hashes_authenticate_chunks(struct work_struct *work)
{
--
2.56.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] msr: replace rdmsr()/wrmsr() in comments
2026-11-23 8:08 [PATCH] msr: replace rdmsr()/wrmsr() in comments Juergen Gross
@ 2026-11-23 13:33 ` Asaf Nuri Bertizlioğlu
2026-11-23 14:02 ` Jürgen Groß
0 siblings, 1 reply; 3+ messages in thread
From: Asaf Nuri Bertizlioğlu @ 2026-11-23 13:33 UTC (permalink / raw)
To: jgross
Cc: linux-hwmon, linux-kernel, x86, linux-doc, linux-perf-users,
platform-driver-x86, linux, tglx, mingo, bp, dave.hansen, hpa,
corbet, skhan, rdunlap, peterz, acme, namhyung, mark.rutland,
alexander.shishkin, jolsa, irogers, adrian.hunter, james.clark,
tony.luck, ashok.raj.linux, hansg, ilpo.jarvinen
On Mon, Nov 23, 2026 at 09:08:22AM +0100, Juergen Gross wrote:
> diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
> --- a/drivers/hwmon/coretemp.c
> +++ b/drivers/hwmon/coretemp.c
> @@ -67,7 +67,7 @@ enum coretemp_attr_index {
> * @cpu_core_id: The CPU Core from which temperature values should be read
> - * This value is passed as "id" field to rdmsr/wrmsr functions.
> + * This value is passed as "id" field to rdmsrq/wrmsrq functions.
This sentence has been inaccurate since it was added in v3.0:
cpu_core_id is never passed to an MSR accessor. coretemp reads the
MSRs with rdmsrq_on_cpu()/rdmsrq_safe_on_cpu() on the logical CPU
(tdata->cpu), and cpu_core_id is only used for the "Core N" label,
the sysfs attribute index and sibling matching. The current driver
also does not write any MSR.
I think the sentence should be dropped rather than renamed. If you
prefer to keep this patch mechanical, I can send a separate coretemp
patch for it.
Thanks,
Asaf
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] msr: replace rdmsr()/wrmsr() in comments
2026-11-23 13:33 ` Asaf Nuri Bertizlioğlu
@ 2026-11-23 14:02 ` Jürgen Groß
0 siblings, 0 replies; 3+ messages in thread
From: Jürgen Groß @ 2026-11-23 14:02 UTC (permalink / raw)
To: Asaf Nuri Bertizlioğlu
Cc: linux-hwmon, linux-kernel, x86, linux-doc, linux-perf-users,
platform-driver-x86, linux, tglx, mingo, bp, dave.hansen, hpa,
corbet, skhan, rdunlap, peterz, acme, namhyung, mark.rutland,
alexander.shishkin, jolsa, irogers, adrian.hunter, james.clark,
tony.luck, ashok.raj.linux, hansg, ilpo.jarvinen
[-- Attachment #1.1: Type: text/plain, Size: 1135 bytes --]
On 23.11.26 14:33, Asaf Nuri Bertizlioğlu wrote:
> On Mon, Nov 23, 2026 at 09:08:22AM +0100, Juergen Gross wrote:
>> diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
>> --- a/drivers/hwmon/coretemp.c
>> +++ b/drivers/hwmon/coretemp.c
>> @@ -67,7 +67,7 @@ enum coretemp_attr_index {
>> * @cpu_core_id: The CPU Core from which temperature values should be read
>> - * This value is passed as "id" field to rdmsr/wrmsr functions.
>> + * This value is passed as "id" field to rdmsrq/wrmsrq functions.
>
> This sentence has been inaccurate since it was added in v3.0:
> cpu_core_id is never passed to an MSR accessor. coretemp reads the
> MSRs with rdmsrq_on_cpu()/rdmsrq_safe_on_cpu() on the logical CPU
> (tdata->cpu), and cpu_core_id is only used for the "Core N" label,
> the sysfs attribute index and sibling matching. The current driver
> also does not write any MSR.
>
> I think the sentence should be dropped rather than renamed. If you
> prefer to keep this patch mechanical, I can send a separate coretemp
> patch for it.
I'm happy to send a V2 with the sentence dropped.
Juergen
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-23 14:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-23 8:08 [PATCH] msr: replace rdmsr()/wrmsr() in comments Juergen Gross
2026-11-23 13:33 ` Asaf Nuri Bertizlioğlu
2026-11-23 14:02 ` Jürgen Groß
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox