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

* 'x86-asm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  x86-64, asm: If the assembler supports fxsave64, use it
  i386: Make kernel_execve() suitable for stack unwinding
This commit is contained in:
Linus Torvalds 2010-10-21 13:06:00 -07:00
Родитель 2f0384e5fc d7acb92fea
Коммит e990c77d06
3 изменённых файлов: 9 добавлений и 5 удалений

Просмотреть файл

@ -96,8 +96,12 @@ cfi := $(call as-instr,.cfi_startproc\n.cfi_rel_offset $(sp-y)$(comma)0\n.cfi_en
# is .cfi_signal_frame supported too? # is .cfi_signal_frame supported too?
cfi-sigframe := $(call as-instr,.cfi_startproc\n.cfi_signal_frame\n.cfi_endproc,-DCONFIG_AS_CFI_SIGNAL_FRAME=1) cfi-sigframe := $(call as-instr,.cfi_startproc\n.cfi_signal_frame\n.cfi_endproc,-DCONFIG_AS_CFI_SIGNAL_FRAME=1)
cfi-sections := $(call as-instr,.cfi_sections .debug_frame,-DCONFIG_AS_CFI_SECTIONS=1) cfi-sections := $(call as-instr,.cfi_sections .debug_frame,-DCONFIG_AS_CFI_SECTIONS=1)
KBUILD_AFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections)
KBUILD_CFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections) # does binutils support specific instructions?
asinstr := $(call as-instr,fxsaveq (%rax),-DCONFIG_AS_FXSAVEQ=1)
KBUILD_AFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections) $(asinstr)
KBUILD_CFLAGS += $(cfi) $(cfi-sigframe) $(cfi-sections) $(asinstr)
LDFLAGS := -m elf_$(UTS_MACHINE) LDFLAGS := -m elf_$(UTS_MACHINE)

Просмотреть файл

@ -175,7 +175,7 @@ static inline void fpu_fxsave(struct fpu *fpu)
uses any extended registers for addressing, a second REX prefix uses any extended registers for addressing, a second REX prefix
will be generated (to the assembler, rex64 followed by semicolon will be generated (to the assembler, rex64 followed by semicolon
is a separate instruction), and hence the 64-bitness is lost. */ is a separate instruction), and hence the 64-bitness is lost. */
#if 0 #ifdef CONFIG_AS_FXSAVEQ
/* Using "fxsaveq %0" would be the ideal choice, but is only supported /* Using "fxsaveq %0" would be the ideal choice, but is only supported
starting with gas 2.16. */ starting with gas 2.16. */
__asm__ __volatile__("fxsaveq %0" __asm__ __volatile__("fxsaveq %0"

Просмотреть файл

@ -33,8 +33,8 @@ int kernel_execve(const char *filename,
const char *const envp[]) const char *const envp[])
{ {
long __res; long __res;
asm volatile ("push %%ebx ; movl %2,%%ebx ; int $0x80 ; pop %%ebx" asm volatile ("int $0x80"
: "=a" (__res) : "=a" (__res)
: "0" (__NR_execve), "ri" (filename), "c" (argv), "d" (envp) : "memory"); : "0" (__NR_execve), "b" (filename), "c" (argv), "d" (envp) : "memory");
return __res; return __res;
} }