[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <323ecc55-d829-4c74-8cb6-7b3a77dd3351@oracle.com>
Date: Mon, 12 May 2025 15:09:30 +0530
From: ALOK TIWARI <alok.a.tiwari@...cle.com>
To: Roman Kisel <romank@...ux.microsoft.com>, arnd@...db.de, bp@...en8.de,
catalin.marinas@....com, corbet@....net, dave.hansen@...ux.intel.com,
decui@...rosoft.com, haiyangz@...rosoft.com, hpa@...or.com,
kys@...rosoft.com, mingo@...hat.com, tglx@...utronix.de,
wei.liu@...nel.org, will@...nel.org, x86@...nel.org,
linux-hyperv@...r.kernel.org, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-arch@...r.kernel.org
Cc: apais@...rosoft.com, benhill@...rosoft.com, bperkins@...rosoft.com,
sunilmut@...rosoft.com
Subject: Re: [PATCH hyperv-next v2 3/4] arch: hyperv: Get/set SynIC
synth.registers via paravisor
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);
Thanks,
Alok
Powered by blists - more mailing lists