Received: by 10.223.176.5 with SMTP id f5csp705645wra; Fri, 9 Feb 2018 06:00:54 -0800 (PST) X-Google-Smtp-Source: AH8x226XJ+pSS/2gnAeTCg2xu59vmgEFkFddGju5b7FL9xtDQvItT/MygfyPBn4xT9XJxjUD7a9z X-Received: by 2002:a17:902:3083:: with SMTP id v3-v6mr2721755plb.426.1518184854182; Fri, 09 Feb 2018 06:00:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518184854; cv=none; d=google.com; s=arc-20160816; b=q5A6K5/c6R0IUs44C7ei1UOz0zD2kfB9GBcl9LN5++y3czaBKoi/Inia9gFlKP1wqp kzbhOOLLtFt0NbEyu6/siC11ZPTD2REI7v67oBBBoRmcVhy7upP3hov7A9lXCJdTHLY+ u0yV8tzJUsCvWkF/srHXEe9omGQSGYCZkSLMu1n3IcF2pqEGec6oprOIwx88eMEec0v3 BnHHKFGQwt2UVAGr7/PPW0kw2+gvx3+tf1WOlOjcmonVtwDNN4jAJfrQttFJfqfATZm7 jAifCIvvmWkia7Klf1RVpR2bE4eDlfHEs5Ks0MCDX/8+EWMVoIzECLv7ff+vLAFEEfuO ZyEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=OOuQpYiwmjLKXOkzSpkwp4ASLqONuxvFU+I9PuFMYVA=; b=U0ADHom1ppkff/GI2YYQTLuWl7Zl7Vo5Q9ZqTcuQ8xlsKmL0h5RrZuVm0YRtSBiTMy 273cg3Qp19VKVJf5PdEcRf7mXvx01OVRQRDNGBkajSDwySQGukdWxeB+VxBR3Yp4OeOc LuC/9n7snVghPd70T+mlnjYanykhwbF06mB+mxcQz9y3tbSwV83cXHLD4/vh1K6Q0kBY fBnfKep9+GcwFg+OgaO5RFccS63GVcgjeqJ20VGJsb01Yv3Pq69Fjwadsuz8MMoxyVrr SVY5aWARceb+ce39yRiNE/9O4YPGwOftZhI7DH33pgVhmzclfAJ0/IEPQYaeBGpc51Op 1sxw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3-v6si1606763plt.307.2018.02.09.06.00.39; Fri, 09 Feb 2018 06:00:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753639AbeBIN70 (ORCPT + 99 others); Fri, 9 Feb 2018 08:59:26 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:51416 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753025AbeBINo1 (ORCPT ); Fri, 9 Feb 2018 08:44:27 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id C4EBB10BA; Fri, 9 Feb 2018 13:44:26 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Linus Torvalds , Kernel Hardening , David Woodhouse Subject: [PATCH 4.9 54/92] x86/entry/64: Push extra regs right away Date: Fri, 9 Feb 2018 14:39:23 +0100 Message-Id: <20180209133935.120035299@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180209133931.211869118@linuxfoundation.org> References: <20180209133931.211869118@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Andy Lutomirski (cherry picked from commit d1f7732009e0549eedf8ea1db948dc37be77fd46) With the fast path removed there is no point in splitting the push of the normal and the extra register set. Just push the extra regs right away. [ tglx: Split out from 'x86/entry/64: Remove the SYSCALL64 fast path' ] Signed-off-by: Andy Lutomirski Signed-off-by: Thomas Gleixner Acked-by: Ingo Molnar Cc: Borislav Petkov Cc: Linus Torvalds Cc: Kernel Hardening Link: https://lkml.kernel.org/r/462dff8d4d64dfbfc851fbf3130641809d980ecd.1517164461.git.luto@kernel.org Signed-off-by: David Woodhouse Signed-off-by: Greg Kroah-Hartman --- arch/x86/entry/entry_64.S | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) --- a/arch/x86/entry/entry_64.S +++ b/arch/x86/entry/entry_64.S @@ -177,10 +177,14 @@ GLOBAL(entry_SYSCALL_64_after_swapgs) pushq %r9 /* pt_regs->r9 */ pushq %r10 /* pt_regs->r10 */ pushq %r11 /* pt_regs->r11 */ - sub $(6*8), %rsp /* pt_regs->bp, bx, r12-15 not saved */ + pushq %rbx /* pt_regs->rbx */ + pushq %rbp /* pt_regs->rbp */ + pushq %r12 /* pt_regs->r12 */ + pushq %r13 /* pt_regs->r13 */ + pushq %r14 /* pt_regs->r14 */ + pushq %r15 /* pt_regs->r15 */ /* IRQs are off. */ - SAVE_EXTRA_REGS movq %rsp, %rdi call do_syscall_64 /* returns with IRQs disabled */