Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754800AbbG0Wh5 (ORCPT ); Mon, 27 Jul 2015 18:37:57 -0400 Received: from mail-lb0-f173.google.com ([209.85.217.173]:35275 "EHLO mail-lb0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754546AbbG0Wh4 (ORCPT ); Mon, 27 Jul 2015 18:37:56 -0400 MIME-Version: 1.0 From: Andy Lutomirski Date: Mon, 27 Jul 2015 15:37:34 -0700 Message-ID: Subject: Re: [PATCH 3/5] x86/asm/entry/32: Jump from SYSENTER32 to SYSCALL32 code path To: Denys Vlasenko Cc: Ingo Molnar , Linus Torvalds , "Krzysztof A. Sobiecki" , Steven Rostedt , Borislav Petkov , "H. Peter Anvin" , Oleg Nesterov , Frederic Weisbecker , Alexei Starovoitov , Will Drewry , Kees Cook , X86 ML , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2441 Lines: 68 > Subject: [PATCH 3/5] x86/asm/entry/32: Jump from SYSENTER32 to SYSCALL32 code path Shouldn't that be /64, not /32, or maybe /64/compat? On Mon, Jul 27, 2015 at 1:33 PM, Denys Vlasenko wrote: > In 32-bit SYSENTER code, load arg6 into R9 instead of EBP. > Jump to SYSCALL code path after we finish setting up pt_regs > and clearing FLAGS_NT. > > This leaves most of SYSENTER32 code path inaccessible. > > Signed-off-by: Denys Vlasenko > CC: Ingo Molnar > CC: Linus Torvalds > CC: Krzysztof A. Sobiecki > CC: Steven Rostedt > CC: Borislav Petkov > CC: "H. Peter Anvin" > CC: Andy Lutomirski > CC: Oleg Nesterov > CC: Frederic Weisbecker > CC: Alexei Starovoitov > CC: Will Drewry > CC: Kees Cook > CC: x86@kernel.org > CC: linux-kernel@vger.kernel.org > --- > arch/x86/entry/entry_64_compat.S | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/arch/x86/entry/entry_64_compat.S b/arch/x86/entry/entry_64_compat.S > index df102e8..d74745a 100644 > --- a/arch/x86/entry/entry_64_compat.S > +++ b/arch/x86/entry/entry_64_compat.S > @@ -93,7 +93,7 @@ ENTRY(entry_SYSENTER_compat) > * 32-bit zero extended > */ > ASM_STAC > -1: movl (%rbp), %ebp > +1: movl (%rbp), %r9d You're sticking arg6 into r9d here, I think, and then: > > orl $TS_COMPAT, ASM_THREAD_INFO(TI_status, %rsp, SIZEOF_PTREGS) > testl $_TIF_WORK_SYSCALL_ENTRY, ASM_THREAD_INFO(TI_flags, %rsp, SIZEOF_PTREGS) > @@ -343,6 +344,7 @@ ENTRY(entry_SYSCALL_compat) > _ASM_EXTABLE(1b, ia32_badarg) > ASM_CLAC > > +sysenter_jumps_here: > orl $TS_COMPAT, ASM_THREAD_INFO(TI_status, %rsp, SIZEOF_PTREGS) > testl $_TIF_WORK_SYSCALL_ENTRY, ASM_THREAD_INFO(TI_flags, %rsp, SIZEOF_PTREGS) > jnz cstar_tracesys you land here, which eventually does: movl %ebp, %r9d /* arg6 */ What am I missing? --Andy -- 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/