All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Sergey Dyasli <sergey.dyasli@citrix.com>
Cc: Kevin Tian <kevin.tian@intel.com>, Wei Liu <wei.liu2@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <Andrew.Cooper3@citrix.com>,
	xen-devel@lists.xen.org, Jun Nakajima <jun.nakajima@intel.com>
Subject: Re: [PATCH v2 7/8] x86/vvmx: correctly report vvmcs size
Date: Fri, 9 Nov 2018 10:54:41 +0000	[thread overview]
Message-ID: <20181109105441.lfxtj4hlwmxf35sa@zion.uk.xensource.com> (raw)
In-Reply-To: <1de346a6-e378-f816-580a-ee04889d6ce8@citrix.com>

On Thu, Nov 08, 2018 at 10:28:24AM +0000, Sergey Dyasli wrote:
> On 07/11/2018 13:28, Wei Liu wrote:
> > On Tue, Nov 06, 2018 at 12:07:58PM +0000, Sergey Dyasli wrote:
> >> The size of Xen's virtual vmcs region is 4096 bytes (see comment about
> >> Virtual VMCS layout in include/asm-x86/hvm/vmx/vvmx.h). Correctly report
> >> it to the guest in case when VMCS shadowing is not available instead of
> >> providing H/W value (which is usually smaller).
> >>
> >> Signed-off-by: Sergey Dyasli <sergey.dyasli@citrix.com>
> >> ---
> >> v2:
> >> - slight commit message change
> >> ---
> >>  xen/arch/x86/hvm/vmx/vvmx.c | 8 ++++++++
> >>  1 file changed, 8 insertions(+)
> >>
> >> diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
> >> index 2f5370ceed..37d3cdd859 100644
> >> --- a/xen/arch/x86/hvm/vmx/vvmx.c
> >> +++ b/xen/arch/x86/hvm/vmx/vvmx.c
> >> @@ -2101,6 +2101,14 @@ int nvmx_msr_read_intercept(unsigned int msr, u64 *msr_content)
> >>          data = (host_data & (~0ul << 32)) |
> >>                 (vmcs->vmcs_revision_id & 0x7fffffff);
> >>          unmap_domain_page(vmcs);
> >> +
> >> +        if ( !cpu_has_vmx_vmcs_shadowing )
> >> +        {
> >> +            /* Report vmcs_region_size as 4096 */
> >> +            data &= ~VMX_BASIC_VMCS_SIZE_MASK;
> >> +            data |= 1ULL << 44;
> > 
> > Can you introduce a define for this to avoid using a magic number?
> 
> I don't see much point in making a define for several reasons:
> 
> 1. It's not going to be used anywhere else
> 
> 2. Intel SDM clearly states that VMCS size is "at most 4096 (bit 44
>    is set if and only if bits 43:32 are clear)"
> 
> 3. My VMX MSRs series will introduce a nice struct, after which this
>    assignment will look like "basic.vmcs_region_size = 4096;"
> 

Fair enough. I have no objection anymore.

Wei.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2018-11-09 10:54 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-06 12:07 [PATCH v2 0/8] x86/vvmx: various fixes Sergey Dyasli
2018-11-06 12:07 ` [PATCH v2 1/8] x86/vvmx: introduce nvmx_vcpu_preinit() Sergey Dyasli
2018-11-07 13:39   ` Andrew Cooper
2018-11-06 12:07 ` [PATCH v2 2/8] x86/nestedhvm: introduce vvmcx_valid() Sergey Dyasli
2018-11-06 14:58   ` Boris Ostrovsky
2018-11-07 13:28   ` Wei Liu
2018-11-14  3:11   ` Tian, Kevin
2018-11-06 12:07 ` [PATCH v2 3/8] x86/vvmx: add VMX_INSN_INVEPT_INVVPID_INVALID_OP errno Sergey Dyasli
2018-11-14  3:12   ` Tian, Kevin
2018-11-06 12:07 ` [PATCH v2 4/8] x86/vvmx: correct vmfail() usage for vmptrld and vmclear Sergey Dyasli
2018-11-14  3:13   ` Tian, Kevin
2018-11-06 12:07 ` [PATCH v2 5/8] x86/vvmx: add VMX_INSN_VMPTRLD_WITH_VMXON_PTR errno Sergey Dyasli
2018-11-06 12:07 ` [PATCH v2 6/8] x86/vvmx: refactor nvmx_handle_vmclear() Sergey Dyasli
2018-11-14  3:15   ` Tian, Kevin
2018-11-06 12:07 ` [PATCH v2 7/8] x86/vvmx: correctly report vvmcs size Sergey Dyasli
2018-11-07 13:28   ` Wei Liu
2018-11-08 10:28     ` Sergey Dyasli
2018-11-09 10:54       ` Wei Liu [this message]
2018-11-14  3:17   ` Tian, Kevin
2018-11-06 12:07 ` [PATCH v2 8/8] x86/vvmx: fix I/O and MSR bitmaps mapping Sergey Dyasli
2018-11-14  5:29   ` Tian, Kevin

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=20181109105441.lfxtj4hlwmxf35sa@zion.uk.xensource.com \
    --to=wei.liu2@citrix.com \
    --cc=Andrew.Cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=jun.nakajima@intel.com \
    --cc=kevin.tian@intel.com \
    --cc=sergey.dyasli@citrix.com \
    --cc=xen-devel@lists.xen.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.