From: "Jan Beulich" Subject: Re: [PATCH v3 07/13] VMX: add VMFUNC leaf 0 (EPTP switching) to emulator. Date: Tue, 07 Jul 2015 08:31:41 +0100 Message-ID: <559B9C7D020000780008D256@mail.emea.novell.com> References: <1435774177-6345-1-git-send-email-edmund.h.white@intel.com> <1435774177-6345-8-git-send-email-edmund.h.white@intel.com> <5596BAE8.9020104@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ravi Sahita Cc: Tim Deegan , Wei Liu , George Dunlap , Andrew Cooper , Ian Jackson , Edmund H White , "xen-devel@lists.xen.org" , "tlengyel@novetta.com" , Daniel De Graaf List-Id: xen-devel@lists.xenproject.org >>> On 06.07.15 at 21:56, wrote: > From: Andrew Cooper [mailto:andrew.cooper3@citrix.com] > Sent: Friday, July 03, 2015 9:40 AM >> On 01/07/15 19:09, Ed White wrote: >> @@ -1830,6 +1831,20 @@ static void vmx_vcpu_update_vmfunc_ve(struct vcpu *v) >> vmx_vmcs_exit(v); >> } >> >> +static int vmx_vcpu_emulate_vmfunc(struct cpu_user_regs *regs) { >> + int rc = X86EMUL_EXCEPTION; >> + struct vcpu *v = current; >> + >> + if ( !cpu_has_vmx_vmfunc && altp2m_active(v->domain) && >> + regs->eax == 0 && >> + p2m_switch_vcpu_altp2m_by_id(v, (uint16_t)regs->ecx) ) >> + { >> + rc = X86EMUL_OKAY; >> + } > > You need a #UD injection at this point. > > Ravi> I will keep this function unchanged i.e. returns X86EMUL_EXCEPTION on > error, which will cause the initiating hvmemul_vmfunc to stage a #UD (this > staging was in fact missing, and is now fixed - thanks). > Ravi> The #UD is actually injected by the top level routine > vmx_vmexit_ud_intercept. May I please ask you to adjust your reply style to one similar to what everyone else uses? The Ravi> prefixes aren't indicating a reply at a first, cursory look, especially since they only precede paragraph (or sentence?) starts, i.e. aren't replicated on each line... Jan