[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] Re: Oops when loading xen_platform_pci module in HVM domain on CS 11429



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
because
> > 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
at
> > the moment.   I'll keep poking around.  thought I'd share my findings
so
> > far.
>
> Page directory entries use permissions _PAGE_TABLE, which does not
include
> _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
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.