From: MUKESH RATHOR <mukeshrathor@microsoft.com>
To: Michael Kelley <mhklinux@outlook.com>,
Nuno Das Neves <nunodasneves@linux.microsoft.com>,
"linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
"iommu@lists.linux.dev" <iommu@lists.linux.dev>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
"linux-arch@vger.kernel.org" <linux-arch@vger.kernel.org>,
"virtualization@lists.linux.dev" <virtualization@lists.linux.dev>
Cc: KY Srinivasan <kys@microsoft.com>,
Haiyang Zhang <haiyangz@microsoft.com>,
"wei.liu@kernel.org" <wei.liu@kernel.org>,
Dexuan Cui <decui@microsoft.com>,
"catalin.marinas@arm.com" <catalin.marinas@arm.com>,
"will@kernel.org" <will@kernel.org>,
"luto@kernel.org" <luto@kernel.org>,
"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>,
"x86@kernel.org" <x86@kernel.org>,
"hpa@zytor.com" <hpa@zytor.com>,
"seanjc@google.com" <seanjc@google.com>,
"pbonzini@redhat.com" <pbonzini@redhat.com>,
"peterz@infradead.org" <peterz@infradead.org>,
"daniel.lezcano@linaro.org" <daniel.lezcano@linaro.org>,
"joro@8bytes.org" <joro@8bytes.org>,
"robin.murphy@arm.com" <robin.murphy@arm.com>,
"davem@davemloft.net" <davem@davemloft.net>,
"edumazet@google.com" <edumazet@google.com>,
"kuba@kernel.org" <kuba@kernel.org>,
"pabeni@redhat.com" <pabeni@redhat.com>,
"lpieralisi@kernel.org" <lpieralisi@kernel.org>,
"kw@linux.com" <kw@linux.com>,
"robh@kernel.org" <robh@kernel.org>,
"bhelgaas@google.com" <bhelgaas@google.com>,
"arnd@arndb.de" <arnd@arndb.de>,
"sgarzare@redhat.com" <sgarzare@redhat.com>,
"jinankjain@linux.microsoft.com" <jinankjain@linux.microsoft.com>,
"muminulrussell@gmail.com" <muminulrussell@gmail.com>,
"skinsburskii@linux.microsoft.com"
<skinsburskii@linux.microsoft.com>
Subject: Re: [EXTERNAL] RE: [PATCH 3/5] hyperv: Add new Hyper-V headers
Date: Fri, 11 Oct 2024 01:34:50 +0000 [thread overview]
Message-ID: <3432a47a-0936-9d1a-896f-d1e019905131@microsoft.com> (raw)
In-Reply-To: <SN6PR02MB415716A55D46E5D4F37D7DD2D4782@SN6PR02MB4157.namprd02.prod.outlook.com>
Hi Michael,
I can answer some of the questions since I instigated this effort
while ago (you might find old email chain/s).
On 10/10/24 11:21, Michael Kelley wrote:
> From: Nuno Das Neves <nunodasneves@linux.microsoft.com> Sent:
Thursday, October 3, 2024 12:51 PM
>>
>> Add definitions needed for privileged Hyper-V partitions.
>>
>> These files are derived from headers exported from the hypervisor code.
>
> Could you elaborate on the naming conventions for the new files,
> and the rules that govern what goes in what files? Specifically,
> what is "hvgdk" vs. "hvhdk", and what are the _ext and _mini
> suffixes? Even if the filenames are derived from Windows
hvhdk : hyp host development kit
hvgdk : hyp guest development kit
IOW, hdk files include data structures for a privileged VM, aka
dom0/root/host, and gdk targets an unprivileged VMs, ie, guests.
The _mini implies target is host/guest kernel, and non-mini
targets VMMs, but that appears more historic as over time
things moved from kernel to user space.
The hvgdk_ext was created for extended hypercalls.
Please note, these headers are publicly exported by the hypervisor
and consumed as is by Windows today (not sure about BSD and others),
so changing them is prob not feasible.
...
>> This is a step toward importing headers directly, similar to Xen public
>> files in include/xen/interface/.
>
> I'm not understanding this statement. The new files in this patch
> are obviously following Linux kernel coding style, with Linux kernel
> types, etc. I'm guessing there was a lot of "busy work" to take
> Windows Hyper-V code and make it look like Linux kernel code. :-(
> What would "importing headers directly" look like, and how is this
> an interim step?
Correct, they are currently not directly imported. The coding style
is different and also the hyp is not built using gcc/clang. So, we've
some work to do before we can use them as is. For now, we have
"mirrored" them manually enforcing Linux style. Going forward, we
have to decide if we can use them as is (there is some precedent in
linux for drivers including headers with different coding style) or
we can auto convert them via some tool or we can keep them manual
and modify them in sync with hyp modifying them. In any case, it
should be rare operation. Matching them now allows us to get there.
You are correct, it was "busy work", took me more than two weeks in
addition to time Nuno also spent.
> Also, it looks like these new files take a different approach for
> instruction set architecture differences. There are inline #ifdef's
> instead of the current method of having a common file, and then
> architecture specific versions that include the common file. My
> sense is that Linux kernel code prefers the current approach in
> order to avoid #ifdef'ery, but maybe that's less practical when the
> definitions are derived from Windows Hyper-V code. And with
> only two architectures to deal with, the #ifdef's don't get
> wild-and-crazy, which is good.
Well, we are trying to keep them as close to the originals as
possible. But now that linux support is here, we will work with
the producers of these headers, ie, the hyp team, to make them
more linux friendly going forward. Given there are other direct
consumers of the headers, Windows/BSD/.., it won't be right away,
as we'd have to coordinate and make sure all are happy.
Hope that makes sense.
Thanks,
-Mukesh
next prev parent reply other threads:[~2024-10-11 1:34 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-03 19:50 [PATCH 0/5] Add new headers for Hyper-V Dom0 Nuno Das Neves
2024-10-03 19:51 ` [PATCH 1/5] hyperv: Move hv_connection_id to hyperv-tlfs.h Nuno Das Neves
2024-10-07 16:24 ` Wei Liu
2024-10-03 19:51 ` [PATCH 2/5] hyperv: Remove unnecessary #includes Nuno Das Neves
2024-10-07 16:24 ` Wei Liu
2024-10-10 18:21 ` Michael Kelley
2024-10-31 18:47 ` Nuno Das Neves
2024-10-03 19:51 ` [PATCH 3/5] hyperv: Add new Hyper-V headers Nuno Das Neves
2024-10-10 18:21 ` Michael Kelley
2024-10-11 1:34 ` MUKESH RATHOR [this message]
2024-10-03 19:51 ` [PATCH 4/5] hyperv: Add hv_defs.h to conditionally include hyperv-tlfs.h or hvhdk.h Nuno Das Neves
2024-10-03 19:51 ` [PATCH 5/5] hyperv: Use hvhdk.h instead of hyperv-tlfs.h in Hyper-V code Nuno Das Neves
2024-10-04 15:58 ` Stanislav Kinsburskii
2024-10-05 0:07 ` Nuno Das Neves
2024-10-04 19:11 ` Simon Horman
2024-10-04 23:36 ` Nuno Das Neves
2024-10-04 21:55 ` kernel test robot
2024-10-05 1:54 ` kernel test robot
2024-10-07 16:26 ` [PATCH 0/5] Add new headers for Hyper-V Dom0 Wei Liu
2024-10-10 18:21 ` Michael Kelley
2024-10-11 1:34 ` [EXTERNAL] " MUKESH RATHOR
2024-10-23 0:04 ` Nuno Das Neves
2024-10-23 18:39 ` Michael Kelley
2024-10-23 0:51 ` Nuno Das Neves
2024-10-23 18:32 ` Michael Kelley
2024-10-31 19:05 ` Easwar Hariharan
2024-10-31 22:59 ` Nuno Das Neves
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=3432a47a-0936-9d1a-896f-d1e019905131@microsoft.com \
--to=mukeshrathor@microsoft.com \
--cc=arnd@arndb.de \
--cc=bhelgaas@google.com \
--cc=bp@alien8.de \
--cc=catalin.marinas@arm.com \
--cc=daniel.lezcano@linaro.org \
--cc=dave.hansen@linux.intel.com \
--cc=davem@davemloft.net \
--cc=decui@microsoft.com \
--cc=edumazet@google.com \
--cc=haiyangz@microsoft.com \
--cc=hpa@zytor.com \
--cc=iommu@lists.linux.dev \
--cc=jinankjain@linux.microsoft.com \
--cc=joro@8bytes.org \
--cc=kuba@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=kw@linux.com \
--cc=kys@microsoft.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=luto@kernel.org \
--cc=mhklinux@outlook.com \
--cc=mingo@redhat.com \
--cc=muminulrussell@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=nunodasneves@linux.microsoft.com \
--cc=pabeni@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peterz@infradead.org \
--cc=robh@kernel.org \
--cc=robin.murphy@arm.com \
--cc=seanjc@google.com \
--cc=sgarzare@redhat.com \
--cc=skinsburskii@linux.microsoft.com \
--cc=tglx@linutronix.de \
--cc=virtualization@lists.linux.dev \
--cc=wei.liu@kernel.org \
--cc=will@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