From: Nuno Das Neves <nunodasneves@linux.microsoft.com>
To: mhklinux@outlook.com, kys@microsoft.com, haiyangz@microsoft.com,
wei.liu@kernel.org, decui@microsoft.com, tglx@linutronix.de,
mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com,
hpa@zytor.com, lpieralisi@kernel.org, kw@linux.com,
manivannan.sadhasivam@linaro.org, robh@kernel.org,
bhelgaas@google.com, arnd@arndb.de
Cc: x86@kernel.org, linux-hyperv@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
linux-arch@vger.kernel.org
Subject: Re: [PATCH v2 3/6] x86/hyperv: Use hv_hvcall_*() to set up hypercall arguments -- part 2
Date: Fri, 21 Mar 2025 12:35:57 -0700 [thread overview]
Message-ID: <96f2c859-790a-4282-9eef-9863ffb42ee1@linux.microsoft.com> (raw)
In-Reply-To: <20250313061911.2491-4-mhklinux@outlook.com>
On 3/12/2025 11:19 PM, mhkelley58@gmail.com wrote:
> From: Michael Kelley <mhklinux@outlook.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@outlook.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@linux.microsoft.com>
next prev parent reply other threads:[~2025-03-21 19:36 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-13 6:19 [PATCH v2 0/6] hyperv: Introduce new way to manage hypercall args mhkelley58
2025-03-13 6:19 ` [PATCH v2 1/6] Drivers: hv: Introduce hv_hvcall_*() functions for hypercall arguments mhkelley58
2025-03-13 6:19 ` [PATCH v2 2/6] x86/hyperv: Use hv_hvcall_*() to set up hypercall arguments -- part 1 mhkelley58
2025-03-21 19:21 ` Nuno Das Neves
2025-03-13 6:19 ` [PATCH v2 3/6] x86/hyperv: Use hv_hvcall_*() to set up hypercall arguments -- part 2 mhkelley58
2025-03-21 19:35 ` Nuno Das Neves [this message]
2025-03-13 6:19 ` [PATCH v2 4/6] Drivers: hv: Use hv_hvcall_*() to set up hypercall arguments mhkelley58
2025-03-21 20:11 ` Nuno Das Neves
2025-03-30 21:53 ` Michael Kelley
2025-03-13 6:19 ` [PATCH v2 5/6] PCI: " mhkelley58
2025-03-21 20:18 ` Nuno Das Neves
2025-03-30 21:53 ` Michael Kelley
2025-03-13 6:19 ` [PATCH v2 6/6] Drivers: hv: Replace hyperv_pcpu_input/output_arg with hyperv_pcpu_arg mhkelley58
2025-04-01 19:29 ` [PATCH v2 0/6] hyperv: Introduce new way to manage hypercall args Easwar Hariharan
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=96f2c859-790a-4282-9eef-9863ffb42ee1@linux.microsoft.com \
--to=nunodasneves@linux.microsoft.com \
--cc=arnd@arndb.de \
--cc=bhelgaas@google.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=decui@microsoft.com \
--cc=haiyangz@microsoft.com \
--cc=hpa@zytor.com \
--cc=kw@linux.com \
--cc=kys@microsoft.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=manivannan.sadhasivam@linaro.org \
--cc=mhklinux@outlook.com \
--cc=mingo@redhat.com \
--cc=robh@kernel.org \
--cc=tglx@linutronix.de \
--cc=wei.liu@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;
as well as URLs for NNTP newsgroup(s).