Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932307AbbLHAvF (ORCPT ); Mon, 7 Dec 2015 19:51:05 -0500 Received: from mail-vk0-f52.google.com ([209.85.213.52]:36025 "EHLO mail-vk0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932072AbbLHAuz (ORCPT ); Mon, 7 Dec 2015 19:50:55 -0500 MIME-Version: 1.0 In-Reply-To: <2ff015fa6989c6a8907c73636f5f5cb99402f6c3.1449522077.git.luto@kernel.org> References: <2ff015fa6989c6a8907c73636f5f5cb99402f6c3.1449522077.git.luto@kernel.org> Date: Mon, 7 Dec 2015 19:50:55 -0500 Message-ID: Subject: Re: [PATCH 07/12] x86/entry/64: Always run ptregs-using syscalls on the slow path From: Brian Gerst To: Andy Lutomirski Cc: "the arch/x86 maintainers" , Linux Kernel Mailing List , Borislav Petkov , =?UTF-8?B?RnLDqWTDqXJpYyBXZWlzYmVja2Vy?= , Denys Vlasenko , Linus Torvalds 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: 1362 Lines: 42 On Mon, Dec 7, 2015 at 4:51 PM, Andy Lutomirski wrote: > 64-bit syscalls currently have an optimization in which they are > called with partial pt_regs. A small handful require full pt_regs. > > In the 32-bit and compat cases, I cleaned this up by forcing full > pt_regs for all syscalls. The performance hit doesn't really matter. > > I want to clean up the 64-bit case as well, but I don't want to hurt > fast path performance. To do that, I want to force the syscalls > that use pt_regs onto the slow path. This will enable us to make > slow path syscalls be real ABI-compliant C functions. > > Use the new syscall entry qualification machinery for this. > stub_clone is now stub_clone/ptregs. > > The next patch will eliminate the stubs, and we'll just have > sys_clone/ptregs. I've got an idea on how to do this without the duplicate syscall table. ptregs_foo: leaq sys_foo(%rip), %rax jmp stub_ptregs_64 stub_ptregs_64: testl $TS_EXTRAREGS, ti_status> jnz 1f SAVE_EXTRA_REGS call *%rax RESTORE_EXTRA_REGS ret 1: call *%rax -- Brian Gerst -- 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/