The problem is in arch/x86/include/asm/pgtable_types.h:
#if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE)
#define _PAGE_NX (_AT(pteval_t, 1) << _PAGE_BIT_NX)
#else
#define _PAGE_NX (_AT(pteval_t, 0))
#endif
which means on 32bit non-pae _NX_PAGE is 0 and so nx_enable gets incorrectly set to 1. This in turn causes code to be executed on resume which runs under the wrong assumptions.
To fix this, the code has either to verify that _PAGE_NX is not 0 or #ifdef the line for CONFIG_X86_64 only and leave the value of nx_enabled alone otherwise.
The change related to this bug causes a regression on suspend/resume at least on my T42p. We tracked the reason down to this line:
@@ -77,6 +77,7 @@ static void __init set_nx(void) pte_mask & _PAGE_NX) == _PAGE_NX );
#else
static inline void set_nx(void)
{
+ nx_enabled = ( (__supported_
}
#endif
The problem is in arch/x86/ include/ asm/pgtable_ types.h: CONFIG_ X86_64) || defined( CONFIG_ X86_PAE)
#if defined(
#define _PAGE_NX (_AT(pteval_t, 1) << _PAGE_BIT_NX)
#else
#define _PAGE_NX (_AT(pteval_t, 0))
#endif
which means on 32bit non-pae _NX_PAGE is 0 and so nx_enable gets incorrectly set to 1. This in turn causes code to be executed on resume which runs under the wrong assumptions.
To fix this, the code has either to verify that _PAGE_NX is not 0 or #ifdef the line for CONFIG_X86_64 only and leave the value of nx_enabled alone otherwise.