[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <96f2c859-790a-4282-9eef-9863ffb42ee1@linux.microsoft.com>
Date: Fri, 21 Mar 2025 12:35:57 -0700
From: Nuno Das Neves <nunodasneves@...ux.microsoft.com>
To: mhklinux@...look.com, kys@...rosoft.com, haiyangz@...rosoft.com,
wei.liu@...nel.org, decui@...rosoft.com, tglx@...utronix.de,
mingo@...hat.com, bp@...en8.de, dave.hansen@...ux.intel.com, hpa@...or.com,
lpieralisi@...nel.org, kw@...ux.com, manivannan.sadhasivam@...aro.org,
robh@...nel.org, bhelgaas@...gle.com, arnd@...db.de
Cc: x86@...nel.org, linux-hyperv@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-pci@...r.kernel.org,
linux-arch@...r.kernel.org
Subject: Re: [PATCH v2 3/6] x86/hyperv: Use hv_hvcall_*() to set up hypercall
arguments -- part 2
On 3/12/2025 11:19 PM, mhkelley58@...il.com wrote:
> From: Michael Kelley <mhklinux@...look.com>
>
> Update hypercall call sites to use the new hv_hvcall_*() functions
> to set up hypercall arguments. Since these functions zero the
> fixed portion of input memory, remove now redundant calls to memset()
> and explicit zero'ing of input fields.
>
> For hv_mark_gpa_visibility(), use the computed batch_size instead
> of HV_MAX_MODIFY_GPA_REP_COUNT. Also update the associated gpa_page_list[]
> field to have zero size, which is more consistent with other array
> arguments to hypercalls. Due to the interaction with the calling
> hv_vtom_set_host_visibility(), HV_MAX_MODIFY_GPA_REP_COUNT cannot be
> completely eliminated without some further restructuring, but that's
> for another patch set.
>
> Similarly, for the nested flush functions, update the gpa_list[] to
> have zero size. Again, separate restructuring would be required to
> completely eliminate the need for HV_MAX_FLUSH_REP_COUNT.
>
> Finally, hyperv_flush_tlb_others_ex() requires special handling
> because the input consists of two arrays -- one for the hv_vp_set and
> another for the gva list. The batch_size computed by hv_hvcall_in_array()
> is adjusted to account for the number of entries in the hv_vp_set.
>
> Signed-off-by: Michael Kelley <mhklinux@...look.com>
> ---
>
> Notes:
> Changes in v2:
> * In hyperv_flush_tlb_others_ex(), added check of the adjusted
> max_gvas to make sure it doesn't go to zero or negative, which would
> happen if there is insufficient space to hold the hv_vpset and have
> at least one entry in the gva list. Since an hv_vpset currently
> represents a maximum of 4096 CPUs, the hv_vpset size does not exceed
> 512 bytes and there should always be sufficent space. But do the
> check just in case something changes. [Nuno Das Neves]
>
> arch/x86/hyperv/ivm.c | 18 +++++++++---------
> arch/x86/hyperv/mmu.c | 19 +++++--------------
> arch/x86/hyperv/nested.c | 14 +++++---------
> include/hyperv/hvgdk_mini.h | 4 ++--
> 4 files changed, 21 insertions(+), 34 deletions(-)
>
Reviewed-by: Nuno Das Neves <nunodasneves@...ux.microsoft.com>
Powered by blists - more mailing lists