mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Roman Kisel <romank@linux.microsoft.com>
To: ALOK TIWARI <alok.a.tiwari@oracle.com>
Cc: apais@microsoft.com, benhill@microsoft.com,
	bperkins@microsoft.com, sunilmut@microsoft.com, arnd@arndb.de,
	bp@alien8.de, catalin.marinas@arm.com, corbet@lwn.net,
	dave.hansen@linux.intel.com, decui@microsoft.com,
	haiyangz@microsoft.com, hpa@zytor.com, kys@microsoft.com,
	mingo@redhat.com, tglx@linutronix.de, wei.liu@kernel.org,
	will@kernel.org, x86@kernel.org, linux-hyperv@vger.kernel.org,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org
Subject: Re: [PATCH hyperv-next v2 3/4] arch: hyperv: Get/set SynIC synth.registers via paravisor
Date: Tue, 13 May 2025 09:31:36 -0700	[thread overview]
Message-ID: <a7ad48ca-2346-4039-a3a9-f93317b2d1a1@linux.microsoft.com> (raw)
In-Reply-To: <323ecc55-d829-4c74-8cb6-7b3a77dd3351@oracle.com>



On 5/12/2025 2:39 AM, ALOK TIWARI wrote:
> 
> 
> On 12-05-2025 04:37, Roman Kisel wrote:
>> +/*
>> + * Not every paravisor supports getting SynIC registers, and
>> + * this function may fail. The caller has to make sure that this 
>> function
>> + * runs on the CPU of interest.
>> + */
> 
> Title and Intent: Clearly state the purpose of the function in the first 
> sentence
> /*
>   * Attempt to get the SynIC register value.
>   *
>   * Not all paravisors support reading SynIC registers, so this function
>   * may fail. The caller must ensure that it is executed on the target
>   * CPU.
>   *
>   * Returns: The SynIC register value or ~0ULL on failure.
>   * Sets err to -ENODEV if the provided register is not a valid SynIC
>   * MSR.
>   */
> 
>> +u64 hv_pv_get_synic_register(unsigned int reg, int *err)
>> +{
>> +    if (!hv_is_synic_msr(reg)) {
>> +        *err = -ENODEV;
>> +        return !0ULL;
>> +    }
>> +    return native_read_msr_safe(reg, err);
>> +}
>> +EXPORT_SYMBOL_GPL(hv_pv_get_synic_register);
>> +
>> +/*
>> + * Not every paravisor supports setting SynIC registers, and
>> + * this function may fail. The caller has to make sure that this 
>> function
>> + * runs on the CPU of interest.
>> + */
> 
> ditto.
> 
>> +int hv_pv_set_synic_register(unsigned int reg, u64 val)
>> +{
>> +    if (!hv_is_synic_msr(reg))
>> +        return -ENODEV;
>> +    return wrmsrl_safe(reg, val);
>> +}
>> +EXPORT_SYMBOL_GPL(hv_pv_set_synic_register);
> 

Indeed, I wrote a bit of a novel in the comments which might be
distracting and making it harder to find the point :)

Ought to be more conscious of the reader's perhaps constrained
time budget. I'll restructure that as you suggested!

> Thanks,
> Alok
> 

-- 
Thank you,
Roman


  reply	other threads:[~2025-05-13 16:31 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-11 23:07 [PATCH hyperv-next v2 0/4] Confidential VMBus Roman Kisel
2025-05-11 23:07 ` [PATCH hyperv-next v2 1/4] Documentation: hyperv: " Roman Kisel
2025-05-12  5:22   ` ALOK TIWARI
2025-05-13 16:24     ` Roman Kisel
2025-05-18 21:15   ` Michael Kelley
2025-05-26 16:02     ` Roman Kisel
2025-05-11 23:07 ` [PATCH hyperv-next v2 2/4] drivers: hyperv: VMBus protocol version 6.0 Roman Kisel
2025-05-12  9:49   ` ALOK TIWARI
2025-05-13 16:26     ` Roman Kisel
2025-05-18 21:15   ` Michael Kelley
2025-05-11 23:07 ` [PATCH hyperv-next v2 3/4] arch: hyperv: Get/set SynIC synth.registers via paravisor Roman Kisel
2025-05-12  9:39   ` ALOK TIWARI
2025-05-13 16:31     ` Roman Kisel [this message]
2025-05-18 21:15   ` Michael Kelley
2025-05-11 23:07 ` [PATCH hyperv-next v2 4/4] arch: x86, drivers: hyperv: Enable confidential VMBus Roman Kisel
2025-05-12 13:13   ` ALOK TIWARI
2025-05-13 16:35     ` Roman Kisel
2025-05-18 21:17   ` Michael Kelley

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=a7ad48ca-2346-4039-a3a9-f93317b2d1a1@linux.microsoft.com \
    --to=romank@linux.microsoft.com \
    --cc=alok.a.tiwari@oracle.com \
    --cc=apais@microsoft.com \
    --cc=arnd@arndb.de \
    --cc=benhill@microsoft.com \
    --cc=bp@alien8.de \
    --cc=bperkins@microsoft.com \
    --cc=catalin.marinas@arm.com \
    --cc=corbet@lwn.net \
    --cc=dave.hansen@linux.intel.com \
    --cc=decui@microsoft.com \
    --cc=haiyangz@microsoft.com \
    --cc=hpa@zytor.com \
    --cc=kys@microsoft.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=sunilmut@microsoft.com \
    --cc=tglx@linutronix.de \
    --cc=wei.liu@kernel.org \
    --cc=will@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®