[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z7-mG7X-cyZAKa7V@skinsburskii.>
Date: Wed, 26 Feb 2025 15:39:07 -0800
From: Stanislav Kinsburskii <skinsburskii@...ux.microsoft.com>
To: Nuno Das Neves <nunodasneves@...ux.microsoft.com>
Cc: linux-hyperv@...r.kernel.org, x86@...nel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-arch@...r.kernel.org, linux-acpi@...r.kernel.org,
kys@...rosoft.com, haiyangz@...rosoft.com, wei.liu@...nel.org,
mhklinux@...look.com, decui@...rosoft.com, catalin.marinas@....com,
will@...nel.org, tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
dave.hansen@...ux.intel.com, hpa@...or.com,
daniel.lezcano@...aro.org, joro@...tes.org, robin.murphy@....com,
arnd@...db.de, jinankjain@...ux.microsoft.com,
muminulrussell@...il.com, mrathor@...ux.microsoft.com,
ssengar@...ux.microsoft.com, apais@...ux.microsoft.com,
Tianyu.Lan@...rosoft.com, stanislav.kinsburskiy@...il.com,
gregkh@...uxfoundation.org, vkuznets@...hat.com,
prapal@...ux.microsoft.com, muislam@...rosoft.com,
anrayabh@...ux.microsoft.com, rafael@...nel.org, lenb@...nel.org,
corbet@....net
Subject: Re: [PATCH v5 07/10] Drivers: hv: Introduce per-cpu event ring tail
On Wed, Feb 26, 2025 at 03:08:01PM -0800, Nuno Das Neves wrote:
> Add a pointer hv_synic_eventring_tail to track the tail pointer for the
> SynIC event ring buffer for each SINT.
>
> This will be used by the mshv driver, but must be tracked independently
> since the driver module could be removed and re-inserted.
>
> Signed-off-by: Nuno Das Neves <nunodasneves@...ux.microsoft.com>
> Reviewed-by: Wei Liu <wei.liu@...nel.org>
> ---
> drivers/hv/hv_common.c | 34 ++++++++++++++++++++++++++++++++--
> 1 file changed, 32 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/hv/hv_common.c b/drivers/hv/hv_common.c
> index 252fd66ad4db..2763cb6d3678 100644
> --- a/drivers/hv/hv_common.c
> +++ b/drivers/hv/hv_common.c
> @@ -460,6 +478,7 @@ void __init ms_hyperv_late_init(void)
> int hv_common_cpu_init(unsigned int cpu)
> {
> void **inputarg, **outputarg;
> + u8 **synic_eventring_tail;
> u64 msr_vp_index;
> gfp_t flags;
> const int pgcount = hv_output_page_exists() ? 2 : 1;
> @@ -472,8 +491,8 @@ int hv_common_cpu_init(unsigned int cpu)
> inputarg = (void **)this_cpu_ptr(hyperv_pcpu_input_arg);
>
> /*
> - * hyperv_pcpu_input_arg and hyperv_pcpu_output_arg memory is already
> - * allocated if this CPU was previously online and then taken offline
> + * The per-cpu memory is already allocated if this CPU was previously
> + * online and then taken offline
> */
> if (!*inputarg) {
> mem = kmalloc(pgcount * HV_HYP_PAGE_SIZE, flags);
> @@ -485,6 +504,17 @@ int hv_common_cpu_init(unsigned int cpu)
> *outputarg = (char *)mem + HV_HYP_PAGE_SIZE;
> }
>
> + if (hv_root_partition()) {
> + synic_eventring_tail = (u8 **)this_cpu_ptr(hv_synic_eventring_tail);
> + *synic_eventring_tail = kcalloc(HV_SYNIC_SINT_COUNT,
> + sizeof(u8), flags);
> +
Redundant empty line ^^^
> + if (unlikely(!*synic_eventring_tail)) {
> + kfree(mem);
> + return -ENOMEM;
> + }
> + }
> +
> if (!ms_hyperv.paravisor_present &&
> (hv_isolation_type_snp() || hv_isolation_type_tdx())) {
> ret = set_memory_decrypted((unsigned long)mem, pgcount);
Reviewed-by: Stanislav Kinsburskii <skinsburskii@...ux.microsoft.com>
> --
> 2.34.1
>
Powered by blists - more mailing lists