From: Tim Deegan Subject: Re: [PATCH 15 of 20] Switch shadow/virtual VMCS between n1/n2 guests Date: Thu, 2 Jun 2011 15:58:07 +0100 Message-ID: <20110602145807.GM5098@whitby.uk.xensource.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Eddie Dong Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Hi, > +asmlinkage void nvmx_switch_guest(void) > +{ > + struct vcpu *v = current; > + struct nestedvcpu *nvcpu = &vcpu_nestedhvm(v); > + struct cpu_user_regs *regs = guest_cpu_user_regs(); > + > + /* > + * a softirq may interrupt us between a virtual vmentry is > + * just handled and the true vmentry. If during this window, > + * a L1 virtual interrupt causes another virtual vmexit, we > + * cannot let that happen or VM_ENTRY_INTR_INFO will be lost. > + */ > + if ( unlikely(nvcpu->nv_vmswitch_in_progress) ) > + return; > + > + if ( nestedhvm_vcpu_in_guestmode(v) && nvcpu->nv_vmexit_pending ) > + { > + local_irq_enable(); Why? Is this function every called with interrupts disabled? And if so, will its caller deal with having them enabled when it exits? > + virtual_vmexit(regs); > + } > + else if ( !nestedhvm_vcpu_in_guestmode(v) && nvcpu->nv_vmentry_pending ) > + { > + local_irq_enable(); ditto. Tim. -- Tim Deegan Principal Software Engineer, Xen Platform Team Citrix Systems UK Ltd. (Company #02937203, SL9 0BG)