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/
Home Products Support Community News


Re: [Xen-devel] Re: Oops when loading xen_platform_pci module in HVM dom

To: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Subject: Re: [Xen-devel] Re: Oops when loading xen_platform_pci module in HVM domain on CS 11429
From: Steve Dobbelstein <steved@xxxxxxxxxx>
Date: Thu, 7 Sep 2006 19:41:47 -0500
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Thu, 07 Sep 2006 17:42:24 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <C1264999.1069%Keir.Fraser@xxxxxxxxxxxx>
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Keir Fraser <Keir.Fraser@xxxxxxxxxxxx> wrote on 09/07/2006 04:11:37 PM:

> On 7/9/06 21:04, "Steve Dobbelstein" <steved@xxxxxxxxxx> wrote:
> > I tried hacking some code to turn off the NX bit in the PTE for the
> > hypercall stubs page, but I still get the oops.  I'm thinking it's
> > the NX bit is set in the PMD.
> >
> > I'm quite new to the paging mechanism, so I'm not sure how to fix this
> > the moment.   I'll keep poking around.  thought I'd share my findings
> > far.
> Page directory entries use permissions _PAGE_TABLE, which does not
> _PAGE_NX. So clearing _PAGE_NX from the PTEs, using
> change_page_attr(PAGE_KERNEL_EXEC), should suffice.
>  -- Keir

Yes, it should suffice, but it doesn't.  What happens is that the PV driver
calls __get_free_page() and gets a page -- a large page, i.e. the _PAGE_PSE
bit is set in the PTE.  change_page_attr() sees that the pgprot is being
change for only one 4KB page and splits the page.  It creates a PMD for the
4KB pages that made up the large page.  The PMD is given the pgprot of the
original large page, which in this case includes the _PAGE_NX bit.  So
while the new PTE for the 4KB page for the hypercall stubs has the _PAGE_NX
bit turned off, the PMD over the PTE has the _PAGE_NX bit on which
effectively sets it for all the PTEs pointed to by the PMD. :(

Thanks for any tips.

Steve D.

Xen-devel mailing list