Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1219646 > unrolled thread
| Started by | Nikolay Borisov <nikolay.b.borisov@gmail.com> |
|---|---|
| First post | 2015-09-05 23:00 +0200 |
| Last post | 2015-09-06 08:10 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH v2] x86/asm/entry/64: Minor cleanup of conditional compilation Nikolay Borisov <nikolay.b.borisov@gmail.com> - 2015-09-05 23:00 +0200
Re: [PATCH v2] x86/asm/entry/64: Minor cleanup of conditional compilation "H. Peter Anvin" <hpa@zytor.com> - 2015-09-06 08:10 +0200
| From | Nikolay Borisov <nikolay.b.borisov@gmail.com> |
|---|---|
| Date | 2015-09-05 23:00 +0200 |
| Subject | [PATCH v2] x86/asm/entry/64: Minor cleanup of conditional compilation |
| Message-ID | <q5sJ3-39f-13@gated-at.bofh.it> |
The entry_SYSCALL_64_fastpath was checking the value of __SYSCALL_MASK, which in turn was being set in arch/x86/include/asm/unistd.h depending on whether CONFIG_X86_X32_ABI was set or not. This made the intention a bit cryptic. Juggle the code around so that the conditional compilation depends on the value of CONFIG_X86_X32_ABI Signed-off-by: Nikolay Borisov <nikolay.b.borisov@gmail.com> --- Sending v2 as I had forgotten to add my signed-off-by line. arch/x86/entry/entry_64.S | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S index 8cb3e43..b0177f9 100644 --- a/arch/x86/entry/entry_64.S +++ b/arch/x86/entry/entry_64.S @@ -175,11 +175,11 @@ GLOBAL(entry_SYSCALL_64_after_swapgs) testl $_TIF_WORK_SYSCALL_ENTRY, ASM_THREAD_INFO(TI_flags, %rsp, SIZEOF_PTREGS) jnz tracesys entry_SYSCALL_64_fastpath: -#if __SYSCALL_MASK == ~0 - cmpq $__NR_syscall_max, %rax -#else +#ifdef CONFIG_X86_X32_ABI andl $__SYSCALL_MASK, %eax cmpl $__NR_syscall_max, %eax +#else + cmpq $__NR_syscall_max, %rax #endif ja 1f /* return -ENOSYS (already in pt_regs->ax) */ movq %r10, %rcx -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | "H. Peter Anvin" <hpa@zytor.com> |
|---|---|
| Date | 2015-09-06 08:10 +0200 |
| Subject | Re: [PATCH v2] x86/asm/entry/64: Minor cleanup of conditional compilation |
| Message-ID | <q5Bjk-79Y-17@gated-at.bofh.it> |
| In reply to | #1219646 |
On 09/05/15 13:53, Nikolay Borisov wrote: > The entry_SYSCALL_64_fastpath was checking the value of __SYSCALL_MASK, > which in turn was being set in arch/x86/include/asm/unistd.h depending on > whether CONFIG_X86_X32_ABI was set or not. This made the intention a bit > cryptic. On the contrary: that instruction can be omitted if and only if the value of the mask is all 1's; it doesn't matter how the mask is set. So you just turned a local constraint into a global constraint. This is both unnecessarily confusing and opens the risk for bugs later. If you feel the need, you could submit a patch to add a comment, but this version is: Nacked-by: H. Peter Anvin <hpa@zytor.com> -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web