提交 2fd7476d 编写于 作者: L Linus Torvalds

Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 fixes from Ingo Molnar:
 "Misc smaller fixes that missed the v3.17 cycle"

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/build: Add arch/x86/purgatory/ make generated files to gitignore
  x86: Fix section conflict for numachip
  x86: Reject x32 executables if x32 ABI not supported
  x86_64, entry: Filter RFLAGS.NT on entry from userspace
  x86, boot, kaslr: Fix nuisance warning on 32-bit builds
boot/compressed/vmlinux boot/compressed/vmlinux
tools/test_get_len tools/test_get_len
tools/insn_sanity tools/insn_sanity
purgatory/kexec-purgatory.c
purgatory/purgatory.ro
...@@ -194,7 +194,7 @@ static bool mem_avoid_overlap(struct mem_vector *img) ...@@ -194,7 +194,7 @@ static bool mem_avoid_overlap(struct mem_vector *img)
while (ptr) { while (ptr) {
struct mem_vector avoid; struct mem_vector avoid;
avoid.start = (u64)ptr; avoid.start = (unsigned long)ptr;
avoid.size = sizeof(*ptr) + ptr->len; avoid.size = sizeof(*ptr) + ptr->len;
if (mem_overlaps(img, &avoid)) if (mem_overlaps(img, &avoid))
......
...@@ -151,6 +151,16 @@ ENTRY(ia32_sysenter_target) ...@@ -151,6 +151,16 @@ ENTRY(ia32_sysenter_target)
1: movl (%rbp),%ebp 1: movl (%rbp),%ebp
_ASM_EXTABLE(1b,ia32_badarg) _ASM_EXTABLE(1b,ia32_badarg)
ASM_CLAC ASM_CLAC
/*
* Sysenter doesn't filter flags, so we need to clear NT
* ourselves. To save a few cycles, we can check whether
* NT was set instead of doing an unconditional popfq.
*/
testl $X86_EFLAGS_NT,EFLAGS(%rsp) /* saved EFLAGS match cpu */
jnz sysenter_fix_flags
sysenter_flags_fixed:
orl $TS_COMPAT,TI_status+THREAD_INFO(%rsp,RIP-ARGOFFSET) orl $TS_COMPAT,TI_status+THREAD_INFO(%rsp,RIP-ARGOFFSET)
testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET) testl $_TIF_WORK_SYSCALL_ENTRY,TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET)
CFI_REMEMBER_STATE CFI_REMEMBER_STATE
...@@ -184,6 +194,8 @@ sysexit_from_sys_call: ...@@ -184,6 +194,8 @@ sysexit_from_sys_call:
TRACE_IRQS_ON TRACE_IRQS_ON
ENABLE_INTERRUPTS_SYSEXIT32 ENABLE_INTERRUPTS_SYSEXIT32
CFI_RESTORE_STATE
#ifdef CONFIG_AUDITSYSCALL #ifdef CONFIG_AUDITSYSCALL
.macro auditsys_entry_common .macro auditsys_entry_common
movl %esi,%r9d /* 6th arg: 4th syscall arg */ movl %esi,%r9d /* 6th arg: 4th syscall arg */
...@@ -226,7 +238,6 @@ sysexit_from_sys_call: ...@@ -226,7 +238,6 @@ sysexit_from_sys_call:
.endm .endm
sysenter_auditsys: sysenter_auditsys:
CFI_RESTORE_STATE
auditsys_entry_common auditsys_entry_common
movl %ebp,%r9d /* reload 6th syscall arg */ movl %ebp,%r9d /* reload 6th syscall arg */
jmp sysenter_dispatch jmp sysenter_dispatch
...@@ -235,6 +246,11 @@ sysexit_audit: ...@@ -235,6 +246,11 @@ sysexit_audit:
auditsys_exit sysexit_from_sys_call auditsys_exit sysexit_from_sys_call
#endif #endif
sysenter_fix_flags:
pushq_cfi $(X86_EFLAGS_IF|X86_EFLAGS_FIXED)
popfq_cfi
jmp sysenter_flags_fixed
sysenter_tracesys: sysenter_tracesys:
#ifdef CONFIG_AUDITSYSCALL #ifdef CONFIG_AUDITSYSCALL
testl $(_TIF_WORK_SYSCALL_ENTRY & ~_TIF_SYSCALL_AUDIT),TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET) testl $(_TIF_WORK_SYSCALL_ENTRY & ~_TIF_SYSCALL_AUDIT),TI_flags+THREAD_INFO(%rsp,RIP-ARGOFFSET)
......
...@@ -160,8 +160,9 @@ do { \ ...@@ -160,8 +160,9 @@ do { \
#define elf_check_arch(x) \ #define elf_check_arch(x) \
((x)->e_machine == EM_X86_64) ((x)->e_machine == EM_X86_64)
#define compat_elf_check_arch(x) \ #define compat_elf_check_arch(x) \
(elf_check_arch_ia32(x) || (x)->e_machine == EM_X86_64) (elf_check_arch_ia32(x) || \
(IS_ENABLED(CONFIG_X86_X32_ABI) && (x)->e_machine == EM_X86_64))
#if __USER32_DS != __USER_DS #if __USER32_DS != __USER_DS
# error "The following code assumes __USER32_DS == __USER_DS" # error "The following code assumes __USER32_DS == __USER_DS"
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
static int numachip_system __read_mostly; static int numachip_system __read_mostly;
static const struct apic apic_numachip __read_mostly; static const struct apic apic_numachip;
static unsigned int get_apic_id(unsigned long x) static unsigned int get_apic_id(unsigned long x)
{ {
......
...@@ -1184,7 +1184,7 @@ void syscall_init(void) ...@@ -1184,7 +1184,7 @@ void syscall_init(void)
/* Flags to clear on syscall */ /* Flags to clear on syscall */
wrmsrl(MSR_SYSCALL_MASK, wrmsrl(MSR_SYSCALL_MASK,
X86_EFLAGS_TF|X86_EFLAGS_DF|X86_EFLAGS_IF| X86_EFLAGS_TF|X86_EFLAGS_DF|X86_EFLAGS_IF|
X86_EFLAGS_IOPL|X86_EFLAGS_AC); X86_EFLAGS_IOPL|X86_EFLAGS_AC|X86_EFLAGS_NT);
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册