From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: [PATCH 06/16] vmx: nest: handling VMX instruction exits Date: Wed, 15 Sep 2010 08:31:13 +0100 Message-ID: References: <1A42CE6F5F474C41B63392A5F80372B22A8C214A@shsmsx501.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1A42CE6F5F474C41B63392A5F80372B22A8C214A@shsmsx501.ccr.corp.intel.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "Dong, Eddie" , Tim Deegan , "He, Qing" Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On 15/09/2010 07:49, "Dong, Eddie" wrote: >> What is wrong with simply extending x86_emulate to handle these >> VMX-related instructions? We've dealt with emulators provided by >> Intel guys in the past and frankly they were full of holes. >> > Certainly fine to move those VMX instruction emulation to hvm/emulate.c as if > you don't think that is VMX specific :) It's the right place to put all instruction emulation, if at all possible. You will then presumably require at least one or two call-back hooks to caller context, at least to read/write VMCS, and that would be the place to determine whether these VMX instructions are executable. For example, SVM and PV emulation contexts would either leave the VMX callback hooks as NULL, and/or there will be checks for is-nested-VMX-guest in the VMX callback hooks, injecting #UD otherwise. The main trick with x86_emulate extensions is determining the correct neat small set of callback hooks to add, which is somewhat driven by deciding what should be emulated within x86_emulate and what should be left without for implementation in the caller's context. -- Keir