From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: [PATCH v3] VMX: don't crash processing 'd' debug key Date: Mon, 11 Nov 2013 13:13:34 +0000 Message-ID: References: <5280E1C00200007800101D47@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VfrJP-0001Q8-Nq for xen-devel@lists.xenproject.org; Mon, 11 Nov 2013 13:13:51 +0000 Received: by mail-we0-f174.google.com with SMTP id p61so4517352wes.19 for ; Mon, 11 Nov 2013 05:13:50 -0800 (PST) In-Reply-To: <5280E1C00200007800101D47@nat28.tlf.novell.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: Jan Beulich , xen-devel Cc: Andrew Cooper , Eddie Dong , Jun Nakajima , Tim Deegan List-Id: xen-devel@lists.xenproject.org On 11/11/2013 12:55, "Jan Beulich" wrote: > There's a window during scheduling where "current" and the active VMCS > may disagree: The former gets set much earlier than the latter. Since > both vmx_vmcs_enter() and vmx_vmcs_exit() immediately return when the > subject vCPU is "current", accessing VMCS fields would, depending on > whether there is any currently active VMCS, either read wrong data, or > cause a crash. > > Going forward we might want to consider reducing the window during > which vmx_vmcs_enter() might fail (e.g. doing a plain __vmptrld() when > v->arch.hvm_vmx.vmcs != this_cpu(current_vmcs) but arch_vmx->active_cpu > == -1), but that would add complexities (acquiring and - more > importantly - properly dropping v->arch.hvm_vmx.vmcs_lock) that don't > look worthwhile adding right now. > > Signed-off-by: Jan Beulich > Reviewed-by: Andrew Cooper This is a little ugly but I can't think of a nicer way. Acked-by: Keir Fraser