~ubuntu-branches/ubuntu/quantal/linux-lowlatency/quantal

« back to all changes in this revision

Viewing changes to arch/x86/mm/setup_nx.c

  • Committer: Package Import Robot
  • Author(s): Alessio Igor Bogani
  • Date: 2011-10-26 11:13:05 UTC
  • Revision ID: package-import@ubuntu.com-20111026111305-04kado7d1u2er2rl
Tags: 3.2.0-16.25
Add new lowlatency kernel flavour

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <linux/sched.h>
1
2
#include <linux/spinlock.h>
2
3
#include <linux/errno.h>
3
4
#include <linux/init.h>
5
6
#include <asm/pgtable.h>
6
7
#include <asm/proto.h>
7
8
 
8
 
static int disable_nx __cpuinitdata;
 
9
int disable_nx __cpuinitdata;
9
10
 
10
11
/*
11
12
 * noexec = on|off
39
40
 
40
41
void __init x86_report_nx(void)
41
42
{
 
43
        int nx_emulation = 0;
 
44
 
42
45
        if (!cpu_has_nx) {
43
46
                printk(KERN_NOTICE "Notice: NX (Execute Disable) protection "
44
47
                       "missing in CPU!\n");
 
48
                nx_emulation = 1;
45
49
        } else {
46
50
#if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE)
47
51
                if (disable_nx) {
54
58
#else
55
59
                /* 32bit non-PAE kernel, NX cannot be used */
56
60
                printk(KERN_NOTICE "Notice: NX (Execute Disable) protection "
57
 
                       "cannot be enabled: non-PAE kernel!\n");
 
61
                       "cannot be enabled in hardware: non-PAE kernel!\n");
 
62
                nx_emulation = 1;
 
63
#endif
 
64
        }
 
65
 
 
66
        if (nx_emulation) {
 
67
#ifdef CONFIG_X86_32
 
68
                if (!disable_nx)
 
69
                        printk(KERN_INFO "NX (Execute Disable) protection: "
 
70
                               "approximated by x86 segment limits\n");
 
71
                else
 
72
                        printk(KERN_INFO "NX (Execute Disable) protection: "
 
73
                               "approximation disabled by kernel command "
 
74
                               "line option\n");
58
75
#endif
59
76
        }
60
77
}