All of lore.kernel.org
 help / color / mirror / Atom feed
From: Saurabh Singh Sengar <ssengar@linux.microsoft.com>
To: Anirudh Rayabharam <anrayabh@linux.microsoft.com>
Cc: ssengar@microsoft.com, kys@microsoft.com, haiyangz@microsoft.com,
	wei.liu@kernel.org, decui@microsoft.com,
	linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org,
	mikelley@microsoft.com, tglx@linutronix.de, bp@alien8.de,
	dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com
Subject: Re: [PATCH] x86/Hyper-V: Expand definition of struct hv_vp_assist_page
Date: Fri, 4 Nov 2022 00:51:42 -0700	[thread overview]
Message-ID: <20221104075142.GA6146@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> (raw)
In-Reply-To: <Y2S8aT7ltuqcHGVN@anrayabh-desk>

On Fri, Nov 04, 2022 at 12:46:57PM +0530, Anirudh Rayabharam wrote:
> On Thu, Nov 03, 2022 at 09:56:54PM -0700, Saurabh Sengar wrote:
> > The struct hv_vp_assist_page has 24 bytes which is defined as u64[3],
> > expand that to expose vtl_entry_reason, vtl_ret_x64rax and vtl_ret_x64rcx
> > field. vtl_entry_reason is updated by hypervisor for the entry reason as
> > to why the VTL was entered on the virtual processor.
> > Guest updates the vtl_ret_* fields to provide the register values to
> > restore on VTL return. The specific register values that are restored
> > which will be updated on vtl_ret_x64rax and vtl_ret_x64rcx.
> > Also added the missing fields for synthetic_time_unhalted_timer_expired,
> > virtualization_fault_information and intercept_message.
> > 
> > Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com>
> > ---
> >  arch/x86/include/asm/hyperv-tlfs.h | 11 ++++++++++-
> >  1 file changed, 10 insertions(+), 1 deletion(-)
> > 
> > diff --git a/arch/x86/include/asm/hyperv-tlfs.h b/arch/x86/include/asm/hyperv-tlfs.h
> > index f769b9db4630..b3d0f42853d2 100644
> > --- a/arch/x86/include/asm/hyperv-tlfs.h
> > +++ b/arch/x86/include/asm/hyperv-tlfs.h
> > @@ -377,11 +377,20 @@ struct hv_nested_enlightenments_control {
> >  struct hv_vp_assist_page {
> >  	__u32 apic_assist;
> >  	__u32 reserved1;
> > -	__u64 vtl_control[3];
> > +	__u8  vtl_entry_reason;
> 
> This is defined as an enum in the TLFS [1]. We should do the same.
> And since the TLFS defines it as an enum it is a 32 bit value and
> not a u8.

I think we can do that. Let me check this and update on v2.

> 
> > +	__u8  vtl_reserved[7];
> > +	__u64 vtl_ret_x64rax;
> > +	__u64 vtl_ret_x64rcx;
> 
> The TLFS groups the above VTL related fields into a struct
> HV_VP_VTL_CONTROL. Any reason to not do the same?

No particular reason, but this change is simple and sufficient.
We can expand in future as the need arises.

> 
> [1] https://learn.microsoft.com/en-us/virtualization/hyper-v-on-windows/tlfs/datatypes/hv_vp_vtl_control
> 
> Thanks,
> Anirudh.
> 
> >  	struct hv_nested_enlightenments_control nested_control;
> >  	__u8 enlighten_vmentry;
> >  	__u8 reserved2[7];
> >  	__u64 current_nested_vmcs;
> > +	__u8 synthetic_time_unhalted_timer_expired;
> > +	__u8 reserved3[7];
> > +	__u8 virtualization_fault_information[40];
> > +	__u8 reserved4[8];
> > +	__u8 intercept_message[256];
> > +	__u8 vtl_ret_actions[256];
> >  } __packed;
> >  
> >  struct hv_enlightened_vmcs {
> > -- 
> > 2.34.1

  reply	other threads:[~2022-11-04  7:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-04  4:56 [PATCH] x86/Hyper-V: Expand definition of struct hv_vp_assist_page Saurabh Sengar
2022-11-04  7:16 ` Anirudh Rayabharam
2022-11-04  7:51   ` Saurabh Singh Sengar [this message]
2022-11-04 15:52   ` 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=20221104075142.GA6146@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net \
    --to=ssengar@linux.microsoft.com \
    --cc=anrayabh@linux.microsoft.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=decui@microsoft.com \
    --cc=haiyangz@microsoft.com \
    --cc=hpa@zytor.com \
    --cc=kys@microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikelley@microsoft.com \
    --cc=ssengar@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 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.