Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4297779pxj; Wed, 12 May 2021 02:25:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKiuNGX/3LVmaiZouaI/OhkSPbGUHbaH1MBA2e6oWLfu261TVAqj6dVwubOesyMQ/bpixF X-Received: by 2002:a05:6e02:118b:: with SMTP id y11mr30082351ili.163.1620811543208; Wed, 12 May 2021 02:25:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620811543; cv=none; d=google.com; s=arc-20160816; b=vG+1cYxbT/S/SXAV5PG5GdROrPPtRWxsKBjQaJ+/xNrlrD8Q+2zPa6ilp6zeDPMl/b 9nfJnvLTXOtRhuS99wQtpnkDh5rJkBk8BW32Vesmy3USt8TssCOI9WOW8dAQUXzBvyZ7 c64NwY4G/sAfZv28g+rtq3Kg07N40HnWpsfayAHSJmnoVXVXW+qOpJ+0sXixB6L9mLUG fgxbwm4I0g7pDqyWl25i07YJvIaOwCYEWcXU8oVkNxnnJ7S3VvyKkhI5Qa6f5xZs1w7K ux6rYfLeZn5jlT/QE8+9uQEnMy/stoINy6u069JiNrfi/aInJurbhLyPD3/xt2haNa3t cakQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=KfVAuSOhyD+3RHq++pgOxElnVlkBerZacpttXIHit6Y=; b=Suj2tB9OVPc0Q3pA2i+AfUDTxU3F+3iR5aVfKSp5zIsqXL4Qb5ZYCl6j175QJQf8za xuLYucm+PHbbURgvoDDNzREJURwRy5sw0rukWqTIdotsUDZjjwTrOzM2T6gWMIqlgbz+ 1GzTP/niyr0OIglRs5Jpc289Fkc5e+xgYnfIlHaeGCOW/nJ6XaoNs/7P+8EewuPrKHC0 Nns2jNLDs7HuTqaNkohXL4ibw1nG3MLRBb1oYr7Qz+MsE+nRtS6Shfr46x9fY4Lsn5Cb d6DoSDaVVnNCiPk3jc/MTouRpOuxnHQNdAr8Ls4MG0DZn3pg/gmdknbIiptnNzP6tOTb 2DKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="bxeR/6dK"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=T2tyRIAi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c2si21616222ilr.77.2021.05.12.02.25.31; Wed, 12 May 2021 02:25:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="bxeR/6dK"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=T2tyRIAi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230265AbhELJYq (ORCPT + 99 others); Wed, 12 May 2021 05:24:46 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:49934 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230181AbhELJYl (ORCPT ); Wed, 12 May 2021 05:24:41 -0400 Date: Wed, 12 May 2021 09:23:32 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1620811412; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KfVAuSOhyD+3RHq++pgOxElnVlkBerZacpttXIHit6Y=; b=bxeR/6dK3CGc60tFLCazWkQ5uYdAtGPQzqU8z/05IfIYPY51obVGxGVjIy2xoNne/mZfUI KWcWTOMOLN2gjG6fVJJv6QdhNPtOwdbL6BblVn3AhTCvGjie2rSC6I7Uq8yGBQHHUbX2Dh 4Ot0PfjPKrhVzkDIOv/bsbKJM4RsEGjnAHZpDcCAzXookwb0DCiZgIi8pfsbwW+9razP4t BiAPsWnT8ODk3Uv/9KCAH4s8hHU7+fBGDKNXFgUtaAhBmK8cDcnN0NU6EZVVcaUK45VDZ1 5tzlTiROUgqlP3faVgltvuk1mrKfVKFMmtsXf1E+poIGnA5pca6n72FaPiIZZQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1620811412; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KfVAuSOhyD+3RHq++pgOxElnVlkBerZacpttXIHit6Y=; b=T2tyRIAiF+180TidV9Oj45du5x0UYUYhiNlblDUJWmq7Om3GGtO9R1seuku4a9TBol+AJQ ol5If6i9bn1McnDQ== From: "tip-bot2 for H. Peter Anvin (Intel)" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/asm] x86/entry: Split PUSH_AND_CLEAR_REGS into two submacros Cc: "H. Peter Anvin (Intel)" , Ingo Molnar , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20210510185316.3307264-6-hpa@zytor.com> References: <20210510185316.3307264-6-hpa@zytor.com> MIME-Version: 1.0 Message-ID: <162081141225.29796.14095021239413369152.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the x86/asm branch of tip: Commit-ID: 29e9758966f47004bd7245e6adadcb708386f36a Gitweb: https://git.kernel.org/tip/29e9758966f47004bd7245e6adadcb708386f36a Author: H. Peter Anvin (Intel) AuthorDate: Mon, 10 May 2021 11:53:14 -07:00 Committer: Ingo Molnar CommitterDate: Wed, 12 May 2021 10:49:15 +02:00 x86/entry: Split PUSH_AND_CLEAR_REGS into two submacros PUSH_AND_CLEAR_REGS, as the name implies, performs two functions: pushing registers and clearing registers. They don't necessarily have to be performed in immediate sequence, although all current users do. Split it into two macros for the case where that isn't desired; the FRED enabling patchset will eventually make use of this. Signed-off-by: H. Peter Anvin (Intel) Signed-off-by: Ingo Molnar Link: https://lore.kernel.org/r/20210510185316.3307264-6-hpa@zytor.com --- arch/x86/entry/calling.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/arch/x86/entry/calling.h b/arch/x86/entry/calling.h index 7436d4a..a4c061f 100644 --- a/arch/x86/entry/calling.h +++ b/arch/x86/entry/calling.h @@ -63,7 +63,7 @@ For 32-bit we have the following conventions - kernel is built with * for assembly code: */ -.macro PUSH_AND_CLEAR_REGS rdx=%rdx rax=%rax save_ret=0 +.macro PUSH_REGS rdx=%rdx rax=%rax save_ret=0 .if \save_ret pushq %rsi /* pt_regs->si */ movq 8(%rsp), %rsi /* temporarily store the return address in %rsi */ @@ -90,7 +90,9 @@ For 32-bit we have the following conventions - kernel is built with .if \save_ret pushq %rsi /* return address on top of stack */ .endif +.endm +.macro CLEAR_REGS /* * Sanitize registers of values that a speculation attack might * otherwise want to exploit. The lower registers are likely clobbered @@ -112,6 +114,11 @@ For 32-bit we have the following conventions - kernel is built with .endm +.macro PUSH_AND_CLEAR_REGS rdx=%rdx rax=%rax save_ret=0 + PUSH_REGS rdx=\rdx, rax=\rax, save_ret=\save_ret + CLEAR_REGS +.endm + .macro POP_REGS pop_rdi=1 skip_r11rcx=0 popq %r15 popq %r14