From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeremy Fitzhardinge Subject: Re: 2.6.28 64-bit domU not booting Date: Fri, 27 Mar 2009 11:34:17 -0700 Message-ID: <49CD1C29.9060103@goop.org> References: <4961FABF.1020304@dataproof.fi> <49CCAC82.2010204@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <49CCAC82.2010204@redhat.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: Chris Lalancette Cc: xen-devel@lists.xensource.com, Valtteri Kiviniemi , Ian Campbell List-Id: xen-devel@lists.xenproject.org Chris Lalancette wrote: > Just to dig up this old thread: we've been seeing the same thing. I *think* it > comes down to the NX bit (or the lack thereof); on machines without NX, the > early pagetable setup is trying to use the NX bit in the PTE flags, and the > hypervisor is telling it to go away. The Red Hat bugzilla entry that I've filed > has more analysis: > > https://bugzilla.redhat.com/show_bug.cgi?id=492523 > > Valtteri, can you give the output of "cat /proc/cpuinfo | grep flags", so we can > confirm that it's probably the same issue? > > And it looks like Ian Campbell actually posted a patch upstream > (http://lkml.indiana.edu/hypermail/linux/kernel/0901.3/02668.html) that should > fix this, but I don't see it in any of the upstream trees. Ian, Jeremy, do you > guys know what the status is there? It would be good to get into 2.6.30, and > probably backport to the stable trees as well. > Hm, yes, it does seem to have got lost. But I wonder if a simpler fix isn't just test for NX early and set __supported_pte_mask accordingly. Does this work? J From: Jeremy Fitzhardinge Date: Fri, 27 Mar 2009 11:29:02 -0700 Subject: [PATCH] xen: set _PAGE_NX in __supported_pte_mask before pagetable construction Many 32-bit and some 64-bit machines don't support the NX flag in ptes. Check for NX before constructing the kernel pagetables. Signed-off-by: Jeremy Fitzhardinge diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index 992be7f..f8c9e49 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -1003,6 +1004,13 @@ asmlinkage void __init xen_start_kernel(void) __supported_pte_mask |= _PAGE_IOMAP; + /* Work out if we support NX */ +#ifdef CONFIG_X86_64 + check_efer(); +#else + set_nx(); +#endif + /* Don't do the full vcpu_info placement stuff until we have a possible map and a non-dummy shared_info. */ per_cpu(xen_vcpu, 0) = &HYPERVISOR_shared_info->vcpu_info[0];