All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergey Dyasli <sergey.dyasli@citrix.com>
To: "JBeulich@suse.com" <JBeulich@suse.com>
Cc: Sergey Dyasli <sergey.dyasli@citrix.com>,
	Kevin Tian <kevin.tian@intel.com>,
	Andrew Cooper <Andrew.Cooper3@citrix.com>,
	"jun.nakajima@intel.com" <jun.nakajima@intel.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH v1 1/2] x86/vvmx: check vmcs address in vmread/vmwrite
Date: Wed, 1 Mar 2017 15:23:21 +0000	[thread overview]
Message-ID: <1488381801.2934.5.camel@citrix.com> (raw)
In-Reply-To: <58B6E8B8020000780013EC7A@prv-mh.provo.novell.com>

On Wed, 2017-03-01 at 07:28 -0700, Jan Beulich wrote:
> > > > On 01.03.17 at 15:22, <sergey.dyasli@citrix.com> wrote:
> > 
> > On Wed, 2017-03-01 at 07:04 -0700, Jan Beulich wrote:
> > > > > > On 01.03.17 at 14:44, <sergey.dyasli@citrix.com> wrote:
> > > > 
> > > > Additionally, it would be painful to return the correct error value
> > > > all the way back to nvmx_handle_vmptrld().
> > > 
> > > Surely that's at best relevant in the other patch. Here you're in
> > > virtual_vmcs_vmwrite_safe(), which already knows how to
> > > communicate back an error indicator.
> > 
> > How checking the return value of virtual_vmcs_enter() is different
> > from checking nv_vvmcxaddr?
> 
> Checking the address is just one step. As the other patch shows,
> checking the ID is necessary too. Over time more such checks may
> be found necessary. Checking what hardware hands us is a single
> check, and is always going to be sufficient no matter what new
> features get added to hardware.

Conceptually, the result of __vmptrld() is irrelevant to a guest
during nested vmread/vmwrite emulation.  The fact that Xen is doing
__vmptrld() is a side effect of nested VMX.

All necessary checks may be found in Intel SDM.  And it states that
there can be only 1 VMfail if VMCS pointer is not valid: VMfailInvalid.
vmptrld can end up in 3 different VMfails and returning them to the
guest as a result of vmread/vmwrite emulation is wrong.

(Even though each of them will end up being VMfailInvalid in current
implementation)

I think that Xen's goal in nested VMX is emulating H/W as close as
possible.

-- 
Thanks,
Sergey
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2017-03-01 15:23 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-01  9:13 [PATCH v1 0/2] x86/vvmx: a couple of fixes (vmptrld + vmread/vmwrite) Sergey Dyasli
2017-03-01  9:13 ` [PATCH v1 1/2] x86/vvmx: check vmcs address in vmread/vmwrite Sergey Dyasli
2017-03-01 10:58   ` Andrew Cooper
2017-03-01 12:55   ` Jan Beulich
2017-03-01 13:22     ` Andrew Cooper
2017-03-01 13:40       ` Jan Beulich
2017-03-01 13:44     ` Sergey Dyasli
2017-03-01 14:04       ` Jan Beulich
2017-03-01 14:22         ` Sergey Dyasli
2017-03-01 14:28           ` Jan Beulich
2017-03-01 15:23             ` Sergey Dyasli [this message]
2017-03-01 15:39               ` Jan Beulich
2017-03-03  8:21                 ` Tian, Kevin
2017-03-01  9:13 ` [PATCH v1 2/2] x86/vvmx: add vmcs id check into vmptrld emulation Sergey Dyasli
2017-03-01 11:01   ` Andrew Cooper
2017-03-03 10:54     ` Jan Beulich
2017-03-03  8:21   ` 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=1488381801.2934.5.camel@citrix.com \
    --to=sergey.dyasli@citrix.com \
    --cc=Andrew.Cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=jun.nakajima@intel.com \
    --cc=kevin.tian@intel.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.