Xen 
 
Home About Xen.org Xen Xen Summit Wiki Mailing List Bug Tracker Xen Downloads
 
   
 

xen-devel

Re: [Xen-devel] PAE xen + linux kernel boots ...

To: Gerd Knorr <kraxel@xxxxxxxxxxx>
Subject: Re: [Xen-devel] PAE xen + linux kernel boots ...
From: Scott Parish <srparish@xxxxxxxxxx>
Date: Sat, 30 Apr 2005 09:51:24 +0000
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Sat, 30 Apr 2005 10:04:08 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20050430090117.GC16883@xxxxxxxxxx>
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20050425172624.GB22076@bytesex> <87ll74o29m.fsf@xxxxxxxxxxx> <20050430090117.GC16883@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: mutt-ng 1.5.9i (Linux)
On Sat, Apr 30, 2005 at 09:01:17AM +0000, Scott Parish wrote:

> On Wed, Apr 27, 2005 at 02:03:17PM +0200, Gerd Knorr wrote:
> 
> > Well, now it does, boots up to a login prompt ;)
> 
> pl1e would straddle a page boundary

I swear there is a muse associated with the send button on email
clients.

In this case the epiphany was the obvious--the problem was that we're
missing alignment. But why?

On the linux side of things we have the following in pgtable-3level.h:

   #if 1 /* writable pagetables */
   static inline void set_pte(pte_t *ptep, pte_t pte)
   {
            ptep->pte_high = pte.pte_high;
            smp_wmb();
            ptep->pte_low = pte.pte_low;
   }
   ...

Here's what (i'm thinking) is going on. We go to set the high bits
(first for atomicy: we don't set the active bit till last), but take
a page fault, on the high bits--a 4 byte offset.

Switch to xen, which is going to emulate some instructions and fake
the writing. We eventually end up in ptwr_emulated_update(), who among
other things, tries to copy the full l1_pgentry_t (64bits), but from
the 4 byte offset, that is the 4 high bytes and then 4 bytes of
undefined memory that may even be in another page.

sRp

-- 
Scott Parish

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