From: Nuno Das Neves <nunodasneves@linux.microsoft.com>
To: Stanislav Kinsburskii <skinsburskii@linux.microsoft.com>
Cc: linux-hyperv@vger.kernel.org, x86@kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org,
linux-acpi@vger.kernel.org, kys@microsoft.com,
haiyangz@microsoft.com, wei.liu@kernel.org, mhklinux@outlook.com,
decui@microsoft.com, catalin.marinas@arm.com, will@kernel.org,
tglx@linutronix.de, mingo@redhat.com, bp@alien8.de,
dave.hansen@linux.intel.com, hpa@zytor.com,
daniel.lezcano@linaro.org, joro@8bytes.org, robin.murphy@arm.com,
arnd@arndb.de, jinankjain@linux.microsoft.com,
muminulrussell@gmail.com, mrathor@linux.microsoft.com,
ssengar@linux.microsoft.com, apais@linux.microsoft.com,
Tianyu.Lan@microsoft.com, stanislav.kinsburskiy@gmail.com,
gregkh@linuxfoundation.org, vkuznets@redhat.com,
prapal@linux.microsoft.com, muislam@microsoft.com,
anrayabh@linux.microsoft.com, rafael@kernel.org, lenb@kernel.org,
corbet@lwn.net
Subject: Re: [PATCH v5 09/10] hyperv: Add definitions for root partition driver to hv headers
Date: Fri, 28 Feb 2025 16:46:44 -0800 [thread overview]
Message-ID: <8a475342-62b6-4669-8baf-10279cdc3835@linux.microsoft.com> (raw)
In-Reply-To: <Z7-o-VnE6iffOi7Z@skinsburskii.>
On 2/26/2025 3:51 PM, Stanislav Kinsburskii wrote:
> On Wed, Feb 26, 2025 at 03:08:03PM -0800, Nuno Das Neves wrote:
>> A few additional definitions are required for the mshv driver code
>> (to follow). Introduce those here and clean up a little bit while
>> at it.
>>
>> Signed-off-by: Nuno Das Neves <nunodasneves@linux.microsoft.com>
>> ---
>> include/hyperv/hvgdk_mini.h | 64 ++++++++++++++++-
>> include/hyperv/hvhdk.h | 132 ++++++++++++++++++++++++++++++++++--
>> include/hyperv/hvhdk_mini.h | 91 +++++++++++++++++++++++++
>> 3 files changed, 280 insertions(+), 7 deletions(-)
>>
>> diff --git a/include/hyperv/hvgdk_mini.h b/include/hyperv/hvgdk_mini.h
>> index 58895883f636..e4a3cca0cbce 100644
>> --- a/include/hyperv/hvgdk_mini.h
>> +++ b/include/hyperv/hvgdk_mini.h
> @@ -1325,6 +1344,49 @@ struct hv_retarget_device_interrupt { /* HV_INPUT_RETARGET_DEVICE_INTERRUPT */
>> struct hv_device_interrupt_target int_target;
>> } __packed __aligned(8);
>>
>> +enum hv_intercept_type {
>> +#if defined(CONFIG_X86_64)
>
> Prehaps it would be nice to have per-arch headers for such structures
> instead.
>
The goal with these files is to reflect the Hyper-V code closely, in order
to make porting the definitions to Linux as easy as possible. Splitting
these into per-arch headers is not my preferred approach because it is
counter to that goal.
>> + HV_INTERCEPT_TYPE_X64_IO_PORT = 0x00000000,
>> + HV_INTERCEPT_TYPE_X64_MSR = 0x00000001,
>> + HV_INTERCEPT_TYPE_X64_CPUID = 0x00000002,
>> +#endif
>> + HV_INTERCEPT_TYPE_EXCEPTION = 0x00000003,
>> + /* Used to be HV_INTERCEPT_TYPE_REGISTER */
>> + HV_INTERCEPT_TYPE_RESERVED0 = 0x00000004,
>> + HV_INTERCEPT_TYPE_MMIO = 0x00000005,
>> +#if defined(CONFIG_X86_64)
>> + HV_INTERCEPT_TYPE_X64_GLOBAL_CPUID = 0x00000006,
>> + HV_INTERCEPT_TYPE_X64_APIC_SMI = 0x00000007,
>> +#endif
>> + HV_INTERCEPT_TYPE_HYPERCALL = 0x00000008,
>> +#if defined(CONFIG_X86_64)
>> + HV_INTERCEPT_TYPE_X64_APIC_INIT_SIPI = 0x00000009,
>> + HV_INTERCEPT_MC_UPDATE_PATCH_LEVEL_MSR_READ = 0x0000000A,
>> + HV_INTERCEPT_TYPE_X64_APIC_WRITE = 0x0000000B,
>> + HV_INTERCEPT_TYPE_X64_MSR_INDEX = 0x0000000C,
>> +#endif
>> + HV_INTERCEPT_TYPE_MAX,
>> + HV_INTERCEPT_TYPE_INVALID = 0xFFFFFFFF,
>> +};
>> +
>> +union hv_intercept_parameters {
>> + /* HV_INTERCEPT_PARAMETERS is defined to be an 8-byte field. */
>> + __u64 as_uint64;
>
> Should this one be "u64" instead of "__u64" (here and below) ?
>
Yes, it looks like a few of the uapi types are still lingering, oops!
>> +#if defined(CONFIG_X86_64)
>> + /* HV_INTERCEPT_TYPE_X64_IO_PORT */
>> + __u16 io_port;
>> + /* HV_INTERCEPT_TYPE_X64_CPUID */
>> + __u32 cpuid_index;
>> + /* HV_INTERCEPT_TYPE_X64_APIC_WRITE */
>> + __u32 apic_write_mask;
>> + /* HV_INTERCEPT_TYPE_EXCEPTION */
>> + __u16 exception_vector;
>> + /* HV_INTERCEPT_TYPE_X64_MSR_INDEX */
>> + __u32 msr_index;
>> +#endif
>> + /* N.B. Other intercept types do not have any parameters. */
>> +};
>> +
>> /* Data structures for HVCALL_MMIO_READ and HVCALL_MMIO_WRITE */
>> #define HV_HYPERCALL_MMIO_MAX_DATA_LENGTH 64
>>
>> diff --git a/include/hyperv/hvhdk.h b/include/hyperv/hvhdk.h
>> index 64407c2a3809..1b447155c338 100644
>> --- a/include/hyperv/hvhdk.h
>> +++ b/include/hyperv/hvhdk.h
>> @@ -19,11 +19,24 @@
>>
>> #define HV_VP_REGISTER_PAGE_VERSION_1 1u
>>
>> +#define HV_VP_REGISTER_PAGE_MAX_VECTOR_COUNT 7
>> +
>> +union hv_vp_register_page_interrupt_vectors {
>> + u64 as_uint64;
>> + struct {
>> + u8 vector_count;
>> + u8 vector[HV_VP_REGISTER_PAGE_MAX_VECTOR_COUNT];
>> + } __packed;
>> +} __packed;
>
> Packed attribute for the union looks redundant.
>
Good point, I can remove it in the next version
> Reviewed-by: Stanislav Kinsburskii <skinsburskii@linux.microsoft.com>
next prev parent reply other threads:[~2025-03-01 0:46 UTC|newest]
Thread overview: 108+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-26 23:07 [PATCH v5 00/10] Introduce /dev/mshv root partition driver Nuno Das Neves
2025-02-26 23:07 ` [PATCH v5 01/10] hyperv: Convert Hyper-V status codes to strings Nuno Das Neves
2025-02-26 23:26 ` Stanislav Kinsburskii
2025-02-27 4:22 ` Easwar Hariharan
2025-02-27 23:48 ` Nuno Das Neves
2025-02-27 17:02 ` Roman Kisel
2025-02-27 22:54 ` Easwar Hariharan
2025-02-27 23:08 ` Roman Kisel
2025-02-27 23:25 ` Easwar Hariharan
2025-02-28 17:20 ` Roman Kisel
2025-02-28 20:22 ` Easwar Hariharan
2025-02-28 22:26 ` Roman Kisel
2025-02-27 23:21 ` Roman Kisel
2025-02-28 0:15 ` Nuno Das Neves
2025-02-28 16:40 ` Roman Kisel
2025-03-06 17:57 ` Michael Kelley
2025-03-06 18:09 ` Michael Kelley
2025-03-06 18:40 ` Nuno Das Neves
2025-03-06 18:57 ` Michael Kelley
2025-03-07 19:38 ` Nuno Das Neves
2025-02-26 23:07 ` [PATCH v5 02/10] x86/mshyperv: Add support for extended Hyper-V features Nuno Das Neves
2025-02-26 23:27 ` Stanislav Kinsburskii
2025-02-27 17:59 ` Roman Kisel
2025-02-28 0:17 ` Nuno Das Neves
2025-02-28 16:42 ` Roman Kisel
2025-02-27 18:17 ` Easwar Hariharan
2025-03-06 18:30 ` Michael Kelley
2025-03-12 18:04 ` Nuno Das Neves
2025-03-10 13:17 ` Tianyu Lan
2025-02-26 23:07 ` [PATCH v5 03/10] arm64/hyperv: Add some missing functions to arm64 Nuno Das Neves
2025-02-26 23:27 ` Stanislav Kinsburskii
2025-02-27 5:56 ` Easwar Hariharan
2025-02-28 0:21 ` Nuno Das Neves
2025-03-06 19:05 ` Michael Kelley
2025-03-07 21:36 ` Nuno Das Neves
2025-03-07 21:55 ` Easwar Hariharan
2025-02-27 18:09 ` Roman Kisel
2025-02-26 23:07 ` [PATCH v5 04/10] hyperv: Introduce hv_recommend_using_aeoi() Nuno Das Neves
2025-02-26 23:28 ` Stanislav Kinsburskii
2025-02-27 18:04 ` Roman Kisel
2025-02-28 0:21 ` Nuno Das Neves
2025-02-27 23:03 ` Easwar Hariharan
2025-02-28 0:33 ` Nuno Das Neves
2025-02-28 0:49 ` Easwar Hariharan
2025-03-06 19:12 ` Michael Kelley
2025-03-10 12:51 ` Tianyu Lan
2025-02-26 23:07 ` [PATCH v5 05/10] acpi: numa: Export node_to_pxm() Nuno Das Neves
2025-02-26 23:31 ` Stanislav Kinsburskii
2025-02-27 23:05 ` Easwar Hariharan
2025-03-06 19:16 ` Michael Kelley
2025-03-10 12:50 ` Tianyu Lan
2025-02-26 23:08 ` [PATCH v5 06/10] Drivers/hv: Export some functions for use by root partition module Nuno Das Neves
2025-02-26 23:32 ` Stanislav Kinsburskii
2025-02-27 18:11 ` Roman Kisel
2025-02-28 0:51 ` Easwar Hariharan
2025-03-06 19:23 ` Michael Kelley
2025-03-07 21:38 ` Nuno Das Neves
2025-02-26 23:08 ` [PATCH v5 07/10] Drivers: hv: Introduce per-cpu event ring tail Nuno Das Neves
2025-02-26 23:39 ` Stanislav Kinsburskii
2025-03-07 17:02 ` Michael Kelley
2025-03-07 22:06 ` Nuno Das Neves
2025-03-07 23:21 ` Michael Kelley
2025-03-07 23:31 ` Nuno Das Neves
2025-03-07 23:37 ` Michael Kelley
2025-03-10 13:01 ` Tianyu Lan
2025-03-12 19:44 ` Nuno Das Neves
2025-03-13 7:34 ` Tianyu Lan
2025-03-13 15:56 ` Nuno Das Neves
2025-03-13 16:00 ` Tianyu Lan
2025-02-26 23:08 ` [PATCH v5 08/10] x86: hyperv: Add mshv_handler irq handler and setup function Nuno Das Neves
2025-02-26 23:43 ` Stanislav Kinsburskii
2025-03-01 0:38 ` Nuno Das Neves
2025-03-07 17:38 ` Michael Kelley
2025-03-10 21:46 ` Nuno Das Neves
2025-03-10 22:23 ` Michael Kelley
2025-03-07 17:44 ` Michael Kelley
2025-03-07 23:29 ` Nuno Das Neves
2025-03-07 23:45 ` Michael Kelley
2025-02-26 23:08 ` [PATCH v5 09/10] hyperv: Add definitions for root partition driver to hv headers Nuno Das Neves
2025-02-26 23:51 ` Stanislav Kinsburskii
2025-03-01 0:46 ` Nuno Das Neves [this message]
2025-02-27 18:13 ` Roman Kisel
2025-02-28 1:27 ` Easwar Hariharan
2025-03-01 0:52 ` Nuno Das Neves
2025-03-07 17:26 ` Michael Kelley
2025-03-07 23:35 ` Nuno Das Neves
2025-03-10 12:40 ` Tianyu Lan
2025-03-12 20:17 ` Nuno Das Neves
2025-02-26 23:08 ` [PATCH v5 10/10] Drivers: hv: Introduce mshv_root module to expose /dev/mshv to VMMs Nuno Das Neves
2025-02-27 4:59 ` Easwar Hariharan
2025-03-01 1:29 ` Nuno Das Neves
2025-02-27 18:50 ` Roman Kisel
2025-03-01 1:38 ` Nuno Das Neves
2025-03-06 17:32 ` Wei Liu
2025-03-07 18:06 ` Roman Kisel
2025-03-11 18:01 ` Jeff Johnson
2025-03-14 19:25 ` Nuno Das Neves
2025-03-13 16:43 ` Michael Kelley
2025-03-14 2:15 ` Nuno Das Neves
2025-03-14 3:27 ` Michael Kelley
2025-03-17 23:51 ` Michael Kelley
2025-03-18 17:24 ` Wei Liu
2025-03-18 17:45 ` Michael Kelley
2025-03-18 20:07 ` Wei Liu
2025-03-19 0:34 ` Nuno Das Neves
2025-03-19 2:10 ` Michael Kelley
2025-03-19 15:26 ` Michael Kelley
2025-03-19 18:04 ` 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=8a475342-62b6-4669-8baf-10279cdc3835@linux.microsoft.com \
--to=nunodasneves@linux.microsoft.com \
--cc=Tianyu.Lan@microsoft.com \
--cc=anrayabh@linux.microsoft.com \
--cc=apais@linux.microsoft.com \
--cc=arnd@arndb.de \
--cc=bp@alien8.de \
--cc=catalin.marinas@arm.com \
--cc=corbet@lwn.net \
--cc=daniel.lezcano@linaro.org \
--cc=dave.hansen@linux.intel.com \
--cc=decui@microsoft.com \
--cc=gregkh@linuxfoundation.org \
--cc=haiyangz@microsoft.com \
--cc=hpa@zytor.com \
--cc=jinankjain@linux.microsoft.com \
--cc=joro@8bytes.org \
--cc=kys@microsoft.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--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=mhklinux@outlook.com \
--cc=mingo@redhat.com \
--cc=mrathor@linux.microsoft.com \
--cc=muislam@microsoft.com \
--cc=muminulrussell@gmail.com \
--cc=prapal@linux.microsoft.com \
--cc=rafael@kernel.org \
--cc=robin.murphy@arm.com \
--cc=skinsburskii@linux.microsoft.com \
--cc=ssengar@linux.microsoft.com \
--cc=stanislav.kinsburskiy@gmail.com \
--cc=tglx@linutronix.de \
--cc=vkuznets@redhat.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.