From: Tim Deegan Subject: Re: can dom0 modify Shadow PT of HVM domU? Date: Wed, 26 Aug 2009 10:00:16 +0100 Message-ID: <20090826090016.GT5235@york.uk.xensource.com> References: <33221896.741851251275735463.JavaMail.coremail@bj163app34.163.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Return-path: Content-Disposition: inline In-Reply-To: <33221896.741851251275735463.JavaMail.coremail@bj163app34.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 Cc: xen-devel List-Id: xen-devel@lists.xenproject.org Hi, At 09:35 +0100 on 26 Aug (1251279335), Wu Bingzheng wrote: > Can Xen hypervisor modify HVM domU's Shadow page table, under the > dom0's context, like trapped from dom0's hypercall? Yes, and it sometimes does (e.g. dom0 hypercalls that change domU's p2m tables cause changes indirectly in the shadows). > I think it have to call 2 functions at least: guest_walk_tables() and > flush_tlb_all(). Can these 2 functions called in dom0's context? Yes, but they're not nearly enough to safely modify the shadow pagetables. There's a lot of reference-counting and concurrency code in there. The paging_* function calls are really the only sensible way to interact with the shadow pagetables code. > In my test, if hypervisor tries to modify HVM's shadow page table, it > will bring down the whole system. I am not sure what's the reason. Why do you want to modify the shadow pagetables from dom0? They're probably the wrong place to be trying to do things since (a) they don't exist on EPT/NPT-capable hardware, and (b) they can get discarded and rebuilt by Xen at any time. Cheers, Tim. -- Tim Deegan Principal Software Engineer, Citrix Systems (R&D) Ltd. [Company #02300071, SL9 0DZ, UK.]