--- arch/ia64/include/asm/page.h.orig 2012-02-01 08:19:59.000000000 +0100 +++ arch/ia64/include/asm/page.h 2012-02-01 08:21:00.000000000 +0100 @@ -55,6 +55,12 @@ # define HAVE_ARCH_HUGETLB_UNMAPPED_AREA #endif /* CONFIG_HUGETLB_PAGE */ +#ifdef CONFIG_PAX_KERNEXEC +#define ktla_ktva(addr) (addr) +#define ktva_ktla(addr) (addr) +#endif + #ifdef __ASSEMBLY__ # define __pa(x) ((x) - PAGE_OFFSET) # define __va(x) ((x) + PAGE_OFFSET) --- arch/ia64/kernel/module.c.orig 2012-02-01 09:14:44.000000000 +0100 +++ arch/ia64/kernel/module.c 2012-02-01 12:45:42.000000000 +0100 @@ -304,14 +304,27 @@ #endif /* !USE_BRL */ -void * -module_alloc (unsigned long size) +#ifdef CONFIG_PAX_KERNEXEC +void *module_alloc(unsigned long size) { - if (!size) + if (size == 0) return NULL; + return vmalloc(size); } +void *module_alloc_exec(unsigned long size) +#else +void *module_alloc(unsigned long size) +#endif + +{ + if (size == 0) + return NULL; + + return vmalloc_exec(size); +} + void module_free (struct module *mod, void *module_region) { @@ -322,6 +335,13 @@ vfree(module_region); } +#ifdef CONFIG_PAX_KERNEXEC +void module_free_exec(struct module *mod, void *module_region) +{ + module_free(mod, module_region); +} +#endif + /* Have we already seen one of these relocations? */ /* FIXME: we could look in other sections, too --RR */ static int