lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aecdc98c-1f12-4f17-b145-9f02aebc01c2@linux.microsoft.com>
Date: Thu, 31 Oct 2024 15:59:14 -0700
From: Nuno Das Neves <nunodasneves@...ux.microsoft.com>
To: Easwar Hariharan <eahariha@...ux.microsoft.com>,
 linux-hyperv@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
 linux-kernel@...r.kernel.org, kvm@...r.kernel.org, iommu@...ts.linux.dev,
 netdev@...r.kernel.org, linux-pci@...r.kernel.org,
 linux-arch@...r.kernel.org, virtualization@...ts.linux.dev
Cc: kys@...rosoft.com, haiyangz@...rosoft.com, wei.liu@...nel.org,
 decui@...rosoft.com, catalin.marinas@....com, will@...nel.org,
 luto@...nel.org, tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
 dave.hansen@...ux.intel.com, x86@...nel.org, hpa@...or.com,
 seanjc@...gle.com, pbonzini@...hat.com, peterz@...radead.org,
 daniel.lezcano@...aro.org, joro@...tes.org, robin.murphy@....com,
 davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
 pabeni@...hat.com, lpieralisi@...nel.org, kw@...ux.com, robh@...nel.org,
 bhelgaas@...gle.com, arnd@...db.de, sgarzare@...hat.com,
 jinankjain@...ux.microsoft.com, muminulrussell@...il.com,
 skinsburskii@...ux.microsoft.com, mukeshrathor@...rosoft.com,
 tyhicks@...ux.microsoft.com
Subject: Re: [PATCH 0/5] Add new headers for Hyper-V Dom0

On 10/31/2024 12:05 PM, Easwar Hariharan wrote:
> On 10/3/2024 12:50 PM, Nuno Das Neves wrote:
>> To support Hyper-V Dom0 (aka Linux as root partition), many new
>> definitions are required.
>>
>> The plan going forward is to directly import headers from
>> Hyper-V. This is a more maintainable way to import definitions
>> rather than via the TLFS doc. This patch series introduces
>> new headers (hvhdk.h, hvgdk.h, etc, see patch #3) directly
>> derived from Hyper-V code.
>>
>> This patch series replaces hyperv-tlfs.h with hvhdk.h, but only
>> in Microsoft-maintained Hyper-V code where they are needed. This
>> leaves the existing hyperv-tlfs.h in use elsewhere - notably for
>> Hyper-V enlightenments on KVM guests.
>>
>> An intermediary header "hv_defs.h" is introduced to conditionally
>> include either hyperv-tlfs.h or hvhdk.h. This is required because
>> several headers which today include hyperv-tlfs.h, are shared
>> between Hyper-V and KVM code (e.g. mshyperv.h).
>>
>> Summary:
>> Patch 1-2: Cleanup patches
>> Patch 3: Add the new headers (hvhdk.h, etc..) in include/hyperv/
>> Patch 4: Add hv_defs.h and use it in mshyperv.h, svm.h,
>>          hyperv_timer.h
>> Patch 5: Switch to the new headers, only in Hyper-V code
>>
>> Nuno Das Neves (5):
>>   hyperv: Move hv_connection_id to hyperv-tlfs.h
>>   hyperv: Remove unnecessary #includes
>>   hyperv: Add new Hyper-V headers
>>   hyperv: Add hv_defs.h to conditionally include hyperv-tlfs.h or
>>     hvhdk.h
>>   hyperv: Use hvhdk.h instead of hyperv-tlfs.h in Hyper-V code
>>

Hi Easwar, thanks for the questions. I will attempt to clarify.
> 
> What is the model for Hyper-V code that has both guest and host roles
> where the corresponding hypercalls are available for both? As I
> understand it, those are supposed to be in hvgdk*.h.
>

It's true that the naming of the files implies hvgdk*.h is for guests,
and hvhdk*.h (which includes hvgdk*.h), is for hosts/dom0. But I would
only take that as a rough guide.

The real reason for keeping these names is to make it a easier to copy
and maintain the definitions from the Windows code into Linux, by
keeping the provenance of exactly where they came from.

> For a specific example, IOMMU hypercalls can operate on stage 2 or stage
> 1 translations depending on the role of the (hyper) caller and the input
> values provided. Should a driver using these hypercalls import both
> hvhdk* and hvgdk*? What about hyperv-tlfs?
>

I'd recommend importing hvhdk.h since it contains everything you need
(including hvgdk*.h).

The goal of this patchset is to move away from hyperv-tlfs.h, because by
definition it should only contain definitions from the TLFS document.

> Patches 4 and 5 seem to draw a bright line between host and guest roles
> while the reality is more gray. Please do correct me if I'm wrong here,
> perhaps the picture would be clearer if Stas' suggestion of a new header
> file is implemented.
> 

Patches 4 and 5 introduce the new headers in a way that avoids any
potential impact on KVM and other non-Microsoft-maintained code.

The 'line' is not between guest and host, but between Microsoft-maintained
and non-Microsoft-maintained code.

Thanks,
Nuno

> Thanks,
> Easwar


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ