[PATCH v3] x86/msr: Document I/O-like write semantics in /dev/cpu/*/msr driver
From: Tim Wiederhake
Date: Mon Jun 29 2026 - 13:38:29 EST
Explain why msr_write does not advance the index.
Signed-off-by: Tim Wiederhake <twiederh@xxxxxxxxxx>
---
V2 -> V3: Standalone comment patch. Dropped read restriction per review.
V1 -> V2: Split into two patches (comment + read restriction).
v2: https://lore.kernel.org/lkml/03245373bd3912bb7421b93c383c9e07454aadd2.camel@xxxxxxxxxx/#t
v1: https://lore.kernel.org/lkml/20260626174037.1128563-1-twiederh@xxxxxxxxxx/
arch/x86/kernel/msr.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c
index 4469c784eaa0..cc719a6b2ba3 100644
--- a/arch/x86/kernel/msr.c
+++ b/arch/x86/kernel/msr.c
@@ -13,6 +13,9 @@
* and then read/write in chunks of 8 bytes. A larger size means multiple
* reads or writes of the same register.
*
+ * Writing the same register multiple times can be useful for MSRs with
+ * I/O-like semantics, e.g. a virtual MSR that accepts logging information.
+ *
* This driver uses /dev/cpu/%d/msr where %d is the minor number, and on
* an SMP box will direct the access to CPU %d.
*/
--
2.52.0