diff options
Diffstat (limited to 'arch/i386/kernel/sysenter.c')
| -rw-r--r-- | arch/i386/kernel/sysenter.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/arch/i386/kernel/sysenter.c b/arch/i386/kernel/sysenter.c index 960d8bd137d0..0bada1870bdf 100644 --- a/arch/i386/kernel/sysenter.c +++ b/arch/i386/kernel/sysenter.c | |||
| @@ -21,11 +21,16 @@ | |||
| 21 | 21 | ||
| 22 | extern asmlinkage void sysenter_entry(void); | 22 | extern asmlinkage void sysenter_entry(void); |
| 23 | 23 | ||
| 24 | void enable_sep_cpu(void *info) | 24 | void enable_sep_cpu(void) |
| 25 | { | 25 | { |
| 26 | int cpu = get_cpu(); | 26 | int cpu = get_cpu(); |
| 27 | struct tss_struct *tss = &per_cpu(init_tss, cpu); | 27 | struct tss_struct *tss = &per_cpu(init_tss, cpu); |
| 28 | 28 | ||
| 29 | if (!boot_cpu_has(X86_FEATURE_SEP)) { | ||
| 30 | put_cpu(); | ||
| 31 | return; | ||
| 32 | } | ||
| 33 | |||
| 29 | tss->ss1 = __KERNEL_CS; | 34 | tss->ss1 = __KERNEL_CS; |
| 30 | tss->esp1 = sizeof(struct tss_struct) + (unsigned long) tss; | 35 | tss->esp1 = sizeof(struct tss_struct) + (unsigned long) tss; |
| 31 | wrmsr(MSR_IA32_SYSENTER_CS, __KERNEL_CS, 0); | 36 | wrmsr(MSR_IA32_SYSENTER_CS, __KERNEL_CS, 0); |
| @@ -41,7 +46,7 @@ void enable_sep_cpu(void *info) | |||
| 41 | extern const char vsyscall_int80_start, vsyscall_int80_end; | 46 | extern const char vsyscall_int80_start, vsyscall_int80_end; |
| 42 | extern const char vsyscall_sysenter_start, vsyscall_sysenter_end; | 47 | extern const char vsyscall_sysenter_start, vsyscall_sysenter_end; |
| 43 | 48 | ||
| 44 | static int __init sysenter_setup(void) | 49 | int __init sysenter_setup(void) |
| 45 | { | 50 | { |
| 46 | void *page = (void *)get_zeroed_page(GFP_ATOMIC); | 51 | void *page = (void *)get_zeroed_page(GFP_ATOMIC); |
| 47 | 52 | ||
| @@ -58,8 +63,5 @@ static int __init sysenter_setup(void) | |||
| 58 | &vsyscall_sysenter_start, | 63 | &vsyscall_sysenter_start, |
| 59 | &vsyscall_sysenter_end - &vsyscall_sysenter_start); | 64 | &vsyscall_sysenter_end - &vsyscall_sysenter_start); |
| 60 | 65 | ||
| 61 | on_each_cpu(enable_sep_cpu, NULL, 1, 1); | ||
| 62 | return 0; | 66 | return 0; |
| 63 | } | 67 | } |
| 64 | |||
| 65 | __initcall(sysenter_setup); | ||
