WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: about fixup_page_fault

To: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Subject: [Xen-devel] Re: about fixup_page_fault
From: Tim Deegan <Tim.Deegan@xxxxxxxxxx>
Date: Wed, 17 Dec 2008 10:53:45 +0000
Cc: "Tian, Kevin" <kevin.tian@xxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, "Yang, Xiaowei" <xiaowei.yang@xxxxxxxxx>, Gianluca Guida <gianluca.guida@xxxxxxxxxxxxx>
Delivery-date: Wed, 17 Dec 2008 02:54:10 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <C56E7104.204C3%keir.fraser@xxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <0A882F4D99BBF6449D58E61AAFD7EDD603BB497F@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <C56E7104.204C3%keir.fraser@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.17 (2007-11-01)
At 09:04 +0000 on 17 Dec (1229504644), Keir Fraser wrote:
> A Xen fault shouldn't cause a lookup in guest tables for HVM guests.

Looks like it does, though. :(  The check in fixup_page_fault should
probably be more like:

if ( (paging_mode_external(d) && guest_mode(regs))
     || (paging_mode_enabled(d) && !paging_mode_external(d)) )

That is, unconditionally call paging_fault() for PV guests (who
shouldn't be allowed map the 0 page, right?), and call for HVM guests
only if the guest caused the fault. 

Potentially it can all be tidied up a bit by moving the other
HVM-specific call out of the if (IN_HYPERVISOR_RANGE) block at the top.
 
> I think the issue here is actually that shadow code places some mapping of
> its own at address 0. We've had this issue before, where it stops NULL
> dereferences from crashing...

Yep; that was different, in that there was no page fault at all. 
But of course Xen has no bugs so the code was like that for years
before anyone noticed. :)

Cheers,

Tim

-- 
Tim Deegan <Tim.Deegan@xxxxxxxxxx>
Principal Software Engineer, Citrix Systems (R&D) Ltd.
[Company #02300071, SL9 0DZ, UK.]

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel