From: Saurabh Singh Sengar <ssengar@microsoft.com>
To: Saurabh Singh Sengar <ssengar@linux.microsoft.com>,
Stanislav Kinsburskii <skinsburskii@linux.microsoft.com>
Cc: "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>,
KY Srinivasan <kys@microsoft.com>,
Haiyang Zhang <haiyangz@microsoft.com>,
"wei.liu@kernel.org" <wei.liu@kernel.org>,
Dexuan Cui <decui@microsoft.com>, "arnd@arndb.de" <arnd@arndb.de>,
Tianyu Lan <Tianyu.Lan@microsoft.com>,
"Michael Kelley (LINUX)" <mikelley@microsoft.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>,
"linux-arch@vger.kernel.org" <linux-arch@vger.kernel.org>,
"jgross@suse.com" <jgross@suse.com>,
"mat.jonczyk@o2.pl" <mat.jonczyk@o2.pl>
Subject: RE: [EXTERNAL] Re: [PATCH v4 2/5] x86/hyperv: Add VTL specific structs and hypercalls
Date: Mon, 10 Apr 2023 17:06:35 +0000 [thread overview]
Message-ID: <PUZP153MB0749649140E44F374DD89F0EBE959@PUZP153MB0749.APCP153.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <20230408042802.GA14345@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net>
> -----Original Message-----
> From: Saurabh Singh Sengar <ssengar@linux.microsoft.com>
> Sent: Saturday, April 8, 2023 9:58 AM
> To: Stanislav Kinsburskii <skinsburskii@linux.microsoft.com>
> Cc: tglx@linutronix.de; mingo@redhat.com; bp@alien8.de;
> dave.hansen@linux.intel.com; x86@kernel.org; hpa@zytor.com; KY
> Srinivasan <kys@microsoft.com>; Haiyang Zhang
> <haiyangz@microsoft.com>; wei.liu@kernel.org; Dexuan Cui
> <decui@microsoft.com>; arnd@arndb.de; Tianyu Lan
> <Tianyu.Lan@microsoft.com>; Michael Kelley (LINUX)
> <mikelley@microsoft.com>; linux-kernel@vger.kernel.org; linux-
> hyperv@vger.kernel.org; linux-arch@vger.kernel.org; jgross@suse.com;
> mat.jonczyk@o2.pl
> Subject: [EXTERNAL] Re: [PATCH v4 2/5] x86/hyperv: Add VTL specific structs
> and hypercalls
>
> On Thu, Apr 06, 2023 at 06:51:13AM -0700, Stanislav Kinsburskii wrote:
> > On Tue, Apr 04, 2023 at 02:01:01AM -0700, Saurabh Sengar wrote:
> > > Add structs and hypercalls required to enable VTL support on x86.
> > >
> > > Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com>
> > > Reviewed-by: Michael Kelley <mikelley@microsoft.com>
> > > ---
> > > arch/x86/include/asm/hyperv-tlfs.h | 75
> > > ++++++++++++++++++++++++++++++ include/asm-generic/hyperv-tlfs.h |
> > > 4 ++
> > > 2 files changed, 79 insertions(+)
> > >
> > > diff --git a/arch/x86/include/asm/hyperv-tlfs.h
> > > b/arch/x86/include/asm/hyperv-tlfs.h
> > > index 0b73a809e9e1..0b0b4e9a4318 100644
> > > --- a/arch/x86/include/asm/hyperv-tlfs.h
> > > +++ b/arch/x86/include/asm/hyperv-tlfs.h
> > > @@ -713,6 +713,81 @@ union hv_msi_entry {
> > > } __packed;
> > > };
> > >
> > > +struct hv_x64_segment_register {
> > > + __u64 base;
> >
> > Ideally they arch-size types naming should be consistent: either with
> > underscores or without.
> > The majority of cases in this file are without underscores.
>
> Although I am fine either way, I think in a non-uapi file "without underscore"
> is prefered.
> I can change this in next version.
After reconsidering, I believe it would be wise to consult the "x86 maintainers" regarding this matter.
Hence, I intend to send the next version without this change.
- Saurabh
>
> Regards,
> Saurabh
>
>
> >
> > Reviewed-by: Stanislav Kinsburskii <stanislav.kinsburskii@gmail.com>
> >
> > > + __u32 limit;
> > > + __u16 selector;
> > > + union {
> > > + struct {
> > > + __u16 segment_type : 4;
> > > + __u16 non_system_segment : 1;
> > > + __u16 descriptor_privilege_level : 2;
> > > + __u16 present : 1;
> > > + __u16 reserved : 4;
> > > + __u16 available : 1;
> > > + __u16 _long : 1;
> > > + __u16 _default : 1;
> > > + __u16 granularity : 1;
> > > + } __packed;
> > > + __u16 attributes;
> > > + };
> > > +} __packed;
> > > +
> > > +struct hv_x64_table_register {
> > > + __u16 pad[3];
> > > + __u16 limit;
> > > + __u64 base;
> > > +} __packed;
> > > +
> > > +struct hv_init_vp_context {
> > > + u64 rip;
> > > + u64 rsp;
> > > + u64 rflags;
> > > +
> > > + struct hv_x64_segment_register cs;
> > > + struct hv_x64_segment_register ds;
> > > + struct hv_x64_segment_register es;
> > > + struct hv_x64_segment_register fs;
> > > + struct hv_x64_segment_register gs;
> > > + struct hv_x64_segment_register ss;
> > > + struct hv_x64_segment_register tr;
> > > + struct hv_x64_segment_register ldtr;
> > > +
> > > + struct hv_x64_table_register idtr;
> > > + struct hv_x64_table_register gdtr;
> > > +
> > > + u64 efer;
> > > + u64 cr0;
> > > + u64 cr3;
> > > + u64 cr4;
> > > + u64 msr_cr_pat;
> > > +} __packed;
> > > +
> > > +union hv_input_vtl {
> > > + u8 as_uint8;
> > > + struct {
> > > + u8 target_vtl: 4;
> > > + u8 use_target_vtl: 1;
> > > + u8 reserved_z: 3;
> > > + };
> > > +} __packed;
> > > +
> > > +struct hv_enable_vp_vtl {
> > > + u64 partition_id;
> > > + u32 vp_index;
> > > + union hv_input_vtl target_vtl;
> > > + u8 mbz0;
> > > + u16 mbz1;
> > > + struct hv_init_vp_context vp_context;
> > > +} __packed;
> > > +
> > > +struct hv_get_vp_from_apic_id_in {
> > > + u64 partition_id;
> > > + union hv_input_vtl target_vtl;
> > > + u8 res[7];
> > > + u32 apic_ids[];
> > > +} __packed;
> > > +
> > > #include <asm-generic/hyperv-tlfs.h>
> > >
> > > #endif
> > > diff --git a/include/asm-generic/hyperv-tlfs.h
> > > b/include/asm-generic/hyperv-tlfs.h
> > > index b870983596b9..87258341fd7c 100644
> > > --- a/include/asm-generic/hyperv-tlfs.h
> > > +++ b/include/asm-generic/hyperv-tlfs.h
> > > @@ -146,6 +146,7 @@ union hv_reference_tsc_msr {
> > > /* Declare the various hypercall operations. */
> > > #define HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE 0x0002
> > > #define HVCALL_FLUSH_VIRTUAL_ADDRESS_LIST 0x0003
> > > +#define HVCALL_ENABLE_VP_VTL 0x000f
> > > #define HVCALL_NOTIFY_LONG_SPIN_WAIT 0x0008
> > > #define HVCALL_SEND_IPI 0x000b
> > > #define HVCALL_FLUSH_VIRTUAL_ADDRESS_SPACE_EX 0x0013
> > > @@ -165,6 +166,8 @@ union hv_reference_tsc_msr {
> > > #define HVCALL_MAP_DEVICE_INTERRUPT 0x007c
> > > #define HVCALL_UNMAP_DEVICE_INTERRUPT 0x007d
> > > #define HVCALL_RETARGET_INTERRUPT 0x007e
> > > +#define HVCALL_START_VP 0x0099
> > > +#define HVCALL_GET_VP_ID_FROM_APIC_ID 0x009a
> > > #define HVCALL_FLUSH_GUEST_PHYSICAL_ADDRESS_SPACE 0x00af
> #define
> > > HVCALL_FLUSH_GUEST_PHYSICAL_ADDRESS_LIST 0x00b0 #define
> > > HVCALL_MODIFY_SPARSE_GPA_PAGE_HOST_VISIBILITY 0x00db @@ -
> 218,6
> > > +221,7 @@ enum HV_GENERIC_SET_FORMAT {
> > > #define HV_STATUS_INVALID_PORT_ID 17
> > > #define HV_STATUS_INVALID_CONNECTION_ID 18
> > > #define HV_STATUS_INSUFFICIENT_BUFFERS 19
> > > +#define HV_STATUS_VTL_ALREADY_ENABLED 134
> > >
> > > /*
> > > * The Hyper-V TimeRefCount register and the TSC
> > > --
> > > 2.34.1
next prev parent reply other threads:[~2023-04-10 17:06 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-04 9:00 [PATCH v4 0/5] Hyper-V VTL support Saurabh Sengar
2023-04-04 9:01 ` [PATCH v4 1/5] x86/init: Make get/set_rtc_noop() public Saurabh Sengar
2023-04-06 13:45 ` Stanislav Kinsburskii
2023-04-07 17:25 ` Wei Liu
2023-04-07 17:38 ` Michael Kelley (LINUX)
2023-04-04 9:01 ` [PATCH v4 2/5] x86/hyperv: Add VTL specific structs and hypercalls Saurabh Sengar
2023-04-06 13:51 ` Stanislav Kinsburskii
2023-04-08 4:28 ` Saurabh Singh Sengar
2023-04-10 17:06 ` Saurabh Singh Sengar [this message]
2023-04-04 9:01 ` [PATCH v4 3/5] x86/hyperv: Make hv_get_nmi_reason public Saurabh Sengar
2023-04-04 9:01 ` [PATCH v4 4/5] Drivers: hv: Kconfig: Add HYPERV_VTL_MODE Saurabh Sengar
2023-04-07 15:59 ` Michael Kelley (LINUX)
2023-04-04 9:01 ` [PATCH v4 5/5] x86/hyperv: VTL support for Hyper-V Saurabh Sengar
2023-04-06 14:07 ` Stanislav Kinsburskii
2023-04-07 20:56 ` Michael Kelley (LINUX)
2023-04-08 5:03 ` Saurabh Singh Sengar
2023-04-07 16:00 ` Michael Kelley (LINUX)
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=PUZP153MB0749649140E44F374DD89F0EBE959@PUZP153MB0749.APCP153.PROD.OUTLOOK.COM \
--to=ssengar@microsoft.com \
--cc=Tianyu.Lan@microsoft.com \
--cc=arnd@arndb.de \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=decui@microsoft.com \
--cc=haiyangz@microsoft.com \
--cc=hpa@zytor.com \
--cc=jgross@suse.com \
--cc=kys@microsoft.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mat.jonczyk@o2.pl \
--cc=mikelley@microsoft.com \
--cc=mingo@redhat.com \
--cc=skinsburskii@linux.microsoft.com \
--cc=ssengar@linux.microsoft.com \
--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®