From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ed White Subject: Re: [PATCH v2 06/12] VMX: add VMFUNC leaf 0 (EPTP switching) to emulator. Date: Wed, 24 Jun 2015 13:29:34 -0700 Message-ID: <558B132E.4020701@intel.com> References: <1434999372-3688-1-git-send-email-edmund.h.white@intel.com> <1434999372-3688-7-git-send-email-edmund.h.white@intel.com> <558AA6EB.4060900@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <558AA6EB.4060900@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper , xen-devel@lists.xen.org Cc: Ravi Sahita , Wei Liu , Ian Jackson , Tim Deegan , Jan Beulich , tlengyel@novetta.com, Daniel De Graaf List-Id: xen-devel@lists.xenproject.org On 06/24/2015 05:47 AM, Andrew Cooper wrote: >> + case EXIT_REASON_VMFUNC: >> + if ( vmx_vmfunc_intercept(regs) == X86EMUL_OKAY ) > > This is currently an unconditional failure, and I don't see subsequent > patches which alter vmx_vmfunc_intercept(). Shouldn't > vmx_vmfunc_intercept() switch on eax and optionally call > p2m_switch_vcpu_altp2m_by_id()? If the VMFUNC instruction was valid, the hardware would have executed it. The only time a VMFUNC exit occurs is if the hardware supports VMFUNC and the hypervisor has enabled it, but the VMFUNC instruction is invalid in some way and can't be executed (because EAX != 0, for example). There are only two choices: crash the domain or inject #UD (which is the closest analogue to what happens in the absence of a hypervisor and will probably crash the OS in the domain). I chose the latter in the code I originally wrote; Ravi chose the former in his patch. I don't have a strong opinion either way, but I think these are the only two choices. I hope this answers Jan's question in another email on the same subject. Ed