* [PATCH 1/2] x86-64: Directly access per-cpu IST @ 2010-07-31 16:48 Brian Gerst 2010-07-31 16:48 ` [PATCH 2/2] x86-32: Directly access per-cpu GDT Brian Gerst 2010-08-02 15:15 ` [tip:x86/asm] x86-64, asm: Directly access per-cpu IST tip-bot for Brian Gerst 0 siblings, 2 replies; 4+ messages in thread From: Brian Gerst @ 2010-07-31 16:48 UTC (permalink / raw) To: hpa; +Cc: x86, linux-kernel Use a direct per-cpu reference for the IST instead of using a scratch register. Signed-off-by: Brian Gerst <brgerst@gmail.com> --- arch/x86/kernel/entry_64.S | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S index 4db7c4d..59af275 100644 --- a/arch/x86/kernel/entry_64.S +++ b/arch/x86/kernel/entry_64.S @@ -1065,6 +1065,7 @@ ENTRY(\sym) END(\sym) .endm +#define INIT_TSS_IST(x) PER_CPU_VAR(init_tss) + (TSS_ist + ((x) - 1) * 8) .macro paranoidzeroentry_ist sym do_sym ist ENTRY(\sym) INTR_FRAME @@ -1076,10 +1077,9 @@ ENTRY(\sym) TRACE_IRQS_OFF movq %rsp,%rdi /* pt_regs pointer */ xorl %esi,%esi /* no error code */ - PER_CPU(init_tss, %r12) - subq $EXCEPTION_STKSZ, TSS_ist + (\ist - 1) * 8(%r12) + subq $EXCEPTION_STKSZ, INIT_TSS_IST(\ist) call \do_sym - addq $EXCEPTION_STKSZ, TSS_ist + (\ist - 1) * 8(%r12) + addq $EXCEPTION_STKSZ, INIT_TSS_IST(\ist) jmp paranoid_exit /* %ebx: no swapgs flag */ CFI_ENDPROC END(\sym) -- 1.7.2 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] x86-32: Directly access per-cpu GDT 2010-07-31 16:48 [PATCH 1/2] x86-64: Directly access per-cpu IST Brian Gerst @ 2010-07-31 16:48 ` Brian Gerst 2010-08-02 15:16 ` [tip:x86/asm] x86-32, asm: " tip-bot for Brian Gerst 2010-08-02 15:15 ` [tip:x86/asm] x86-64, asm: Directly access per-cpu IST tip-bot for Brian Gerst 1 sibling, 1 reply; 4+ messages in thread From: Brian Gerst @ 2010-07-31 16:48 UTC (permalink / raw) To: hpa; +Cc: x86, linux-kernel Use a direct per-cpu reference for the GDT instead of using a scratch register. Signed-off-by: Brian Gerst <brgerst@gmail.com> --- arch/x86/kernel/entry_32.S | 11 +++++------ 1 files changed, 5 insertions(+), 6 deletions(-) diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S index cd49141..233c582 100644 --- a/arch/x86/kernel/entry_32.S +++ b/arch/x86/kernel/entry_32.S @@ -611,14 +611,14 @@ ldt_ss: * compensating for the offset by changing to the ESPFIX segment with * a base address that matches for the difference. */ +#define GDT_ESPFIX_SS PER_CPU_VAR(gdt_page) + (GDT_ENTRY_ESPFIX_SS * 8) mov %esp, %edx /* load kernel esp */ mov PT_OLDESP(%esp), %eax /* load userspace esp */ mov %dx, %ax /* eax: new kernel esp */ sub %eax, %edx /* offset (low word is 0) */ - PER_CPU(gdt_page, %ebx) shr $16, %edx - mov %dl, GDT_ENTRY_ESPFIX_SS * 8 + 4(%ebx) /* bits 16..23 */ - mov %dh, GDT_ENTRY_ESPFIX_SS * 8 + 7(%ebx) /* bits 24..31 */ + mov %dl, GDT_ESPFIX_SS + 4 /* bits 16..23 */ + mov %dh, GDT_ESPFIX_SS + 7 /* bits 24..31 */ pushl $__ESPFIX_SS CFI_ADJUST_CFA_OFFSET 4 push %eax /* new kernel esp */ @@ -791,9 +791,8 @@ ptregs_clone: * normal stack and adjusts ESP with the matching offset. */ /* fixup the stack */ - PER_CPU(gdt_page, %ebx) - mov GDT_ENTRY_ESPFIX_SS * 8 + 4(%ebx), %al /* bits 16..23 */ - mov GDT_ENTRY_ESPFIX_SS * 8 + 7(%ebx), %ah /* bits 24..31 */ + mov GDT_ESPFIX_SS + 4, %al /* bits 16..23 */ + mov GDT_ESPFIX_SS + 7, %ah /* bits 24..31 */ shl $16, %eax addl %esp, %eax /* the adjusted stack pointer */ pushl $__KERNEL_DS -- 1.7.2 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [tip:x86/asm] x86-32, asm: Directly access per-cpu GDT 2010-07-31 16:48 ` [PATCH 2/2] x86-32: Directly access per-cpu GDT Brian Gerst @ 2010-08-02 15:16 ` tip-bot for Brian Gerst 0 siblings, 0 replies; 4+ messages in thread From: tip-bot for Brian Gerst @ 2010-08-02 15:16 UTC (permalink / raw) To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, brgerst, tglx Commit-ID: 72c511dd596cff88d6523f231a0fbb8f73006d51 Gitweb: http://git.kernel.org/tip/72c511dd596cff88d6523f231a0fbb8f73006d51 Author: Brian Gerst <brgerst@gmail.com> AuthorDate: Sat, 31 Jul 2010 12:48:23 -0400 Committer: H. Peter Anvin <hpa@zytor.com> CommitDate: Sun, 1 Aug 2010 16:05:23 -0700 x86-32, asm: Directly access per-cpu GDT Use a direct per-cpu reference for the GDT instead of using a scratch register. Signed-off-by: Brian Gerst <brgerst@gmail.com> LKML-Reference: <1280594903-6341-2-git-send-email-brgerst@gmail.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com> --- arch/x86/kernel/entry_32.S | 11 +++++------ 1 files changed, 5 insertions(+), 6 deletions(-) diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S index cd49141..233c582 100644 --- a/arch/x86/kernel/entry_32.S +++ b/arch/x86/kernel/entry_32.S @@ -611,14 +611,14 @@ ldt_ss: * compensating for the offset by changing to the ESPFIX segment with * a base address that matches for the difference. */ +#define GDT_ESPFIX_SS PER_CPU_VAR(gdt_page) + (GDT_ENTRY_ESPFIX_SS * 8) mov %esp, %edx /* load kernel esp */ mov PT_OLDESP(%esp), %eax /* load userspace esp */ mov %dx, %ax /* eax: new kernel esp */ sub %eax, %edx /* offset (low word is 0) */ - PER_CPU(gdt_page, %ebx) shr $16, %edx - mov %dl, GDT_ENTRY_ESPFIX_SS * 8 + 4(%ebx) /* bits 16..23 */ - mov %dh, GDT_ENTRY_ESPFIX_SS * 8 + 7(%ebx) /* bits 24..31 */ + mov %dl, GDT_ESPFIX_SS + 4 /* bits 16..23 */ + mov %dh, GDT_ESPFIX_SS + 7 /* bits 24..31 */ pushl $__ESPFIX_SS CFI_ADJUST_CFA_OFFSET 4 push %eax /* new kernel esp */ @@ -791,9 +791,8 @@ ptregs_clone: * normal stack and adjusts ESP with the matching offset. */ /* fixup the stack */ - PER_CPU(gdt_page, %ebx) - mov GDT_ENTRY_ESPFIX_SS * 8 + 4(%ebx), %al /* bits 16..23 */ - mov GDT_ENTRY_ESPFIX_SS * 8 + 7(%ebx), %ah /* bits 24..31 */ + mov GDT_ESPFIX_SS + 4, %al /* bits 16..23 */ + mov GDT_ESPFIX_SS + 7, %ah /* bits 24..31 */ shl $16, %eax addl %esp, %eax /* the adjusted stack pointer */ pushl $__KERNEL_DS ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [tip:x86/asm] x86-64, asm: Directly access per-cpu IST 2010-07-31 16:48 [PATCH 1/2] x86-64: Directly access per-cpu IST Brian Gerst 2010-07-31 16:48 ` [PATCH 2/2] x86-32: Directly access per-cpu GDT Brian Gerst @ 2010-08-02 15:15 ` tip-bot for Brian Gerst 1 sibling, 0 replies; 4+ messages in thread From: tip-bot for Brian Gerst @ 2010-08-02 15:15 UTC (permalink / raw) To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, brgerst, tglx Commit-ID: c15a5958a0b6dbf06b3c05972694f04a0c50a4cf Gitweb: http://git.kernel.org/tip/c15a5958a0b6dbf06b3c05972694f04a0c50a4cf Author: Brian Gerst <brgerst@gmail.com> AuthorDate: Sat, 31 Jul 2010 12:48:22 -0400 Committer: H. Peter Anvin <hpa@zytor.com> CommitDate: Sun, 1 Aug 2010 16:05:17 -0700 x86-64, asm: Directly access per-cpu IST Use a direct per-cpu reference for the IST instead of using a scratch register. Signed-off-by: Brian Gerst <brgerst@gmail.com> LKML-Reference: <1280594903-6341-1-git-send-email-brgerst@gmail.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com> --- arch/x86/kernel/entry_64.S | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S index 4db7c4d..59af275 100644 --- a/arch/x86/kernel/entry_64.S +++ b/arch/x86/kernel/entry_64.S @@ -1065,6 +1065,7 @@ ENTRY(\sym) END(\sym) .endm +#define INIT_TSS_IST(x) PER_CPU_VAR(init_tss) + (TSS_ist + ((x) - 1) * 8) .macro paranoidzeroentry_ist sym do_sym ist ENTRY(\sym) INTR_FRAME @@ -1076,10 +1077,9 @@ ENTRY(\sym) TRACE_IRQS_OFF movq %rsp,%rdi /* pt_regs pointer */ xorl %esi,%esi /* no error code */ - PER_CPU(init_tss, %r12) - subq $EXCEPTION_STKSZ, TSS_ist + (\ist - 1) * 8(%r12) + subq $EXCEPTION_STKSZ, INIT_TSS_IST(\ist) call \do_sym - addq $EXCEPTION_STKSZ, TSS_ist + (\ist - 1) * 8(%r12) + addq $EXCEPTION_STKSZ, INIT_TSS_IST(\ist) jmp paranoid_exit /* %ebx: no swapgs flag */ CFI_ENDPROC END(\sym) ^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-08-02 15:16 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-07-31 16:48 [PATCH 1/2] x86-64: Directly access per-cpu IST Brian Gerst 2010-07-31 16:48 ` [PATCH 2/2] x86-32: Directly access per-cpu GDT Brian Gerst 2010-08-02 15:16 ` [tip:x86/asm] x86-32, asm: " tip-bot for Brian Gerst 2010-08-02 15:15 ` [tip:x86/asm] x86-64, asm: Directly access per-cpu IST tip-bot for Brian Gerst
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.