From: Keir Fraser Subject: Re: can dom0 modify Shadow PT of HVM domU? Date: Wed, 26 Aug 2009 13:58:38 +0100 Message-ID: References: <26241299.782791251282623958.JavaMail.coremail@bj163app31.163.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <26241299.782791251282623958.JavaMail.coremail@bj163app31.163.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: Wu Bingzheng , Tim Deegan Cc: xen-devel List-Id: xen-devel@lists.xenproject.org On 26/08/2009 11:30, "Wu Bingzheng" wrote: >> I see. That seems like a pretty convoluted way of doing it. Why don't >> you just inject #GP (or whatever) straight into the guest from your dom0 >> hypercall? > > I think vmx_inject_hw_exception() can't be called under dom0's context, > because it calls __vmread() to read VMCS. You can do vmx_vmcs_enter(v) at the very start of the function (before any vmread or vmwrite) and vmx_vmcs_exit(v) at the very end. If you make this change then it will be safe to call the function from dom0. -- Keir