From: Easwar Hariharan <eahariha@linux.microsoft.com>
To: Michael Kelley <mhklinux@outlook.com>
Cc: eahariha@linux.microsoft.com,
"kys@microsoft.com" <kys@microsoft.com>,
"haiyangz@microsoft.com" <haiyangz@microsoft.com>,
"wei.liu@kernel.org" <wei.liu@kernel.org>,
"decui@microsoft.com" <decui@microsoft.com>,
"tglx@linutronix.de" <tglx@linutronix.de>,
"mingo@redhat.com" <mingo@redhat.com>,
"bp@alien8.de" <bp@alien8.de>,
"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
"hpa@zytor.com" <hpa@zytor.com>,
"lpieralisi@kernel.org" <lpieralisi@kernel.org>,
"kw@linux.com" <kw@linux.com>,
"manivannan.sadhasivam@linaro.org"
<manivannan.sadhasivam@linaro.org>,
"robh@kernel.org" <robh@kernel.org>,
"bhelgaas@google.com" <bhelgaas@google.com>,
"arnd@arndb.de" <arnd@arndb.de>,
"x86@kernel.org" <x86@kernel.org>,
"linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
"linux-arch@vger.kernel.org" <linux-arch@vger.kernel.org>
Subject: Re: [PATCH v3 1/7] Drivers: hv: Introduce hv_hvcall_*() functions for hypercall arguments
Date: Mon, 21 Apr 2025 16:27:40 -0700 [thread overview]
Message-ID: <1643d6a8-7d4f-4d6e-aeab-f43963644a1f@linux.microsoft.com> (raw)
In-Reply-To: <SN6PR02MB4157FEE08571B84B6CEBFC92D4B82@SN6PR02MB4157.namprd02.prod.outlook.com>
On 4/21/2025 2:24 PM, Michael Kelley wrote:
> From: Easwar Hariharan <eahariha@linux.microsoft.com> Sent: Monday, April 21, 2025 1:41 PM
>>>
<snip>
>>>
>>
>> This is very cool, thanks for taking the time! I think the function naming
>> could be more intuitive, e.g. hv_setup_*_args(). I'd not block it for that reason,
>> but would be super happy if you would update it. What do you think?
>>
>
> I'm not particularly enamored with my naming scheme, but it was the
> best I could come up with. My criteria were:
>
> * Keep the length reasonably short to not make line length problems
> any worse
> * Distinguish the input args only, input & output args, and array versions
I think the in/inout/array scheme you have does this nicely
> * Use the standard "hv_" prefix for Hyper-V related code
>
> Using "setup" instead of "hvcall" seems like an improvement to me, and
> it is 1 character shorter. The "hv" prefix would be there, but they wouldn't
> refer specifically to hypercalls. I would not add "_args" on the end because
> that's another 5 characters in length. So we would have:
>
> * hv_setup_in()
> * hv_setup_inout()
> * hv_setup_in_array()
> * hv_setup_inout_array()
> * hv_setup_in_batch_size() [??]
>
> Or maybe, something like this, or similar, which picks up the "args" string,
> but not "setup":
>
> * hv_hcargs_in()
> * hv_hcargs_inout()
> * hv_hcargs_in_array()
> * hv_hcargs_inout_array()
> * hv_hcargs_in_batch_size() [??]
>
> I'm very open to any other ideas because I'm not particularly
> happy with the hv_hvcall_* approach.
Between the two presented here, I prefer option 1, with the "setup" verb because it tells you
inline what the function will do. I agree that the "args" is unnecessary because most
hypercall args are named hv_{input, output}_* and are clearly arguments to hv_do_hypercall()
and friends.
Since hv_setup*() will normally be followed shortly after by hv_do_hypercall(), I don't
see a problem with not referring specifically to hypercalls, it should be clear in context.
For hv_hvcall_in_batch_size(), I think it serves a fundamentally different function than the
other wrappers and doesn't need to follow the "setup" pattern. Instead it could be named
hv_get_input_batch_size() for the same length and similarly tell you its purpose inline.
I am continuing to review the rest of the series, sorry for the delay, and thank you for your
patience!
Thanks,
Easwar (he/him)
next prev parent reply other threads:[~2025-04-21 23:27 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-15 18:07 [PATCH v3 0/7] hyperv: Introduce new way to manage hypercall args mhkelley58
2025-04-15 18:07 ` [PATCH v3 1/7] Drivers: hv: Introduce hv_hvcall_*() functions for hypercall arguments mhkelley58
2025-04-21 20:41 ` Easwar Hariharan
2025-04-21 21:24 ` Michael Kelley
2025-04-21 23:27 ` Easwar Hariharan [this message]
2025-06-04 17:41 ` Easwar Hariharan
2025-08-21 0:31 ` Mukesh R
2025-08-21 2:58 ` Mukesh R
2025-08-21 19:24 ` Michael Kelley
2025-08-21 20:49 ` Mukesh R
2025-08-21 21:15 ` Mukesh R
2025-08-22 2:16 ` Michael Kelley
2025-08-26 0:13 ` Nuno Das Neves
2025-08-26 1:46 ` Mukesh R
2025-08-22 2:10 ` Michael Kelley
2025-08-23 2:25 ` Mukesh R
2025-08-25 21:01 ` Michael Kelley
2025-09-12 15:25 ` Michael Kelley
2025-09-13 2:18 ` Mukesh R
2025-04-15 18:07 ` [PATCH v3 2/7] x86/hyperv: Use hv_hvcall_*() to set up hypercall arguments -- part 1 mhkelley58
2025-04-15 18:07 ` [PATCH v3 3/7] x86/hyperv: Use hv_hvcall_*() to set up hypercall arguments -- part 2 mhkelley58
2025-04-15 18:07 ` [PATCH v3 4/7] Drivers: hv: Use hv_hvcall_*() to set up hypercall arguments mhkelley58
2025-04-15 18:07 ` [PATCH v3 5/7] PCI: " mhkelley58
2025-04-15 18:07 ` [PATCH v3 6/7] Drivers: hv: Use hv_hvcall_*() to set up hypercall arguments for mshv code mhkelley58
2025-04-15 18:07 ` [PATCH v3 7/7] Drivers: hv: Replace hyperv_pcpu_input/output_arg with hyperv_pcpu_arg mhkelley58
2025-08-25 21:39 ` [PATCH v3 0/7] hyperv: Introduce new way to manage hypercall args Wei Liu
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=1643d6a8-7d4f-4d6e-aeab-f43963644a1f@linux.microsoft.com \
--to=eahariha@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
all inboxes | Powered by JetHome®