public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Jürgen Groß" <jgross@suse.com>
To: Yan Zhao <yan.y.zhao@intel.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	linux-kernel@vger.kernel.org, Thomas Gleixner <tglx@kernel.org>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	x86@kernel.org, virtualization@lists.linux.dev
Subject: Re: [PATCH v2 2/8] x86/msr: Consolidate rdmsr() definitions
Date: Wed, 6 May 2026 13:09:07 +0200	[thread overview]
Message-ID: <c3d08fd7-4938-4db2-9962-1c87dab74a2f@suse.com> (raw)
In-Reply-To: <afsXCIUjib70dBYz@yzhao56-desk.sh.intel.com>


[-- Attachment #1.1.1: Type: text/plain, Size: 1220 bytes --]

On 06.05.26 12:25, Yan Zhao wrote:
> On Wed, May 06, 2026 at 10:03:26AM +0800, Yan Zhao wrote:
>> On Wed, Apr 29, 2026 at 11:45:21AM -0700, Dave Hansen wrote:
>>> +/*
>>> + * Common paravirt and native helpers:
>>> + */
>>> +#define rdmsr(msr, low, high)					\
>>> +do {								\
>>> +	u64 __val = paravirt_read_msr((msr));			\
>>> +	(void)((low) = (u32)__val);				\
>>> +	(void)((high) = (u32)(__val >> 32));			\
>>> +} while (0)
>> Rather than direct all (paravirt and native) invocations of rdmsr() to
>> paravirt_*(), does it make sense to first introduce the common version of
>> helpers and direct the common version of helpers to paravirt_* or native_*?
>> So, we can have
>>
>> +/*
>> + * Common paravirt and native helpers:
>> + */
>> +#define rdmsr(msr, low, high)                                  \
>> +do {                                                           \
>> +       u64 __val = common_read_msr((msr));                     \
>> +       (void)((low) = (u32)__val);                             \
>> +       (void)((high) = (u32)(__val >> 32));                    \
>> +} while (0)
>>
> Or maybe s/common/trampoline ?

I'd suggest __read_msr() and friends.


Juergen

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3743 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

  reply	other threads:[~2026-05-06 11:09 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-29 18:45 [PATCH v2 0/8] x86/msr: Consolidate native/paravirt MSR functions Dave Hansen
2026-04-29 18:45 ` [PATCH v2 1/8] x86/msr: Use paravirt "calls" in common code Dave Hansen
2026-04-29 18:45 ` [PATCH v2 2/8] x86/msr: Consolidate rdmsr() definitions Dave Hansen
2026-05-06  2:03   ` Yan Zhao
2026-05-06 10:25     ` Yan Zhao
2026-05-06 11:09       ` Jürgen Groß [this message]
2026-04-29 18:45 ` [PATCH v2 3/8] x86/msr: Consolidate rdmsr_safe() implementations Dave Hansen
2026-04-30 19:43   ` Maciej Wieczor-Retman
2026-04-29 18:45 ` [PATCH v2 4/8] x86/msr: Consolidate rdmsrq() implementations Dave Hansen
2026-04-29 18:45 ` [PATCH v2 5/8] x86/msr: Consolidate {rd,wr}msr[q]_safe() implementations Dave Hansen
2026-04-29 18:45 ` [PATCH v2 6/8] x86/msr: Consolidate rdpmc() implementations Dave Hansen
2026-04-29 18:45 ` [PATCH v2 7/8] x86/msr: Remove old crusty comment Dave Hansen
2026-04-29 18:45 ` [PATCH v2 8/8] x86/msr: Remove duplicate #include Dave Hansen
2026-04-30  7:20   ` Jürgen Groß
2026-04-30 17:42     ` Dave Hansen
2026-04-30 19:22       ` Jürgen Groß
2026-04-30  7:21 ` [PATCH v2 0/8] x86/msr: Consolidate native/paravirt MSR functions Jürgen Groß

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=c3d08fd7-4938-4db2-9962-1c87dab74a2f@suse.com \
    --to=jgross@suse.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@kernel.org \
    --cc=virtualization@lists.linux.dev \
    --cc=x86@kernel.org \
    --cc=yan.y.zhao@intel.com \
    /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