Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752595AbbLJFmJ (ORCPT ); Thu, 10 Dec 2015 00:42:09 -0500 Received: from mail-vk0-f52.google.com ([209.85.213.52]:33594 "EHLO mail-vk0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751223AbbLJFmH (ORCPT ); Thu, 10 Dec 2015 00:42:07 -0500 MIME-Version: 1.0 In-Reply-To: References: <1449666173-15366-1-git-send-email-brgerst@gmail.com> Date: Thu, 10 Dec 2015 00:42:06 -0500 Message-ID: Subject: Re: [PATCH] x86/entry/64: Remove duplicate syscall table for fast path From: Brian Gerst To: Andy Lutomirski Cc: Andy Lutomirski , "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: 1512 Lines: 41 On Wed, Dec 9, 2015 at 6:50 PM, Andy Lutomirski wrote: > On Wed, Dec 9, 2015 at 1:15 PM, Andy Lutomirski wrote: >> On Wed, Dec 9, 2015 at 1:08 PM, Brian Gerst wrote: >>> Simplified version: >>> ENTRY(stub_ptregs_64) >>> cmpl $fast_path_return, (%rsp) >> >> Does that instruction actually work the way you want it to? (Does it >> link?) I think you might need to use leaq the way I did in my patch. It should have been cmpq. leaq isn't necessary, since immediates are sign-extended to 64-bit. >>> jne 1f >>> SAVE_EXTRA_REGS offset=8 >>> call *%rax >>> RESTORE_EXTRA_REGS offset=8 >>> ret >>> 1: >>> jmp *%rax >>> END(stub_ptregs_64) >> >> This'll work, I think, but I still think I prefer keeping as much >> complexity as possible in the slow path. I could be convinced >> otherwise, though -- this variant is reasonably clean. > > On further reflection, there's at least one functional difference. > With my variant, modifying pt_regs from sys_foo/ptregs is safe. In > your variant, it's unsafe unless force_iret() is called. I don't know > whether we care. I can go either way at this point. My main concern was getting rid of the duplicate table. -- 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/