Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4086171pxb; Wed, 13 Oct 2021 20:37:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwuuybzlAWy+AIFBN1uPAkHFu8L0bzdTgoGbwhh1QgAkyfs2EeAl3Eg4G34NamGDpO0TzxB X-Received: by 2002:a17:90b:1c8e:: with SMTP id oo14mr17827899pjb.224.1634182676029; Wed, 13 Oct 2021 20:37:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634182676; cv=none; d=google.com; s=arc-20160816; b=N1GJ7DiCS4J0uvjwjXzp36DUyVIsf7wX82GWDoIdQsRh/kKAaJYUM0U1F3pTiQliKO hA+jUXpDzW/w/1neD2nx4DAyoQvDUXXWVOnfeOk7IY24iM8A/gBZv76U64njsXjWoSBi TM7QxQ3sken/p2bBBsjfnralurIrM7a/Tq/7F3Is4s/qlLzPLbeI53bSnvgbXfpXy6ve UbvxS+qYY+RubBLHKJZcnP6uS5ZINeebQwRiiOrY6YilL/F43IBZ+hNjIXQmPeLrEfn8 Pb6OlQpu1rKef9TAQ4kJOK4EPWzb+k1e05HplAsig+hOL1KsZqDdyoI342G2B18ZnOjV zBFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=+qdPX6leSrxZFRthtIVsp8vJTUvVJ0ZjU2fXlZEYPiA=; b=Bpv1KFDQEjKULkqJr9CLc4XgbXCqdx9OxoyhptzqtddqHSv6FYTgR2tw2i4TJMMDcQ GrY8aJymJmsXCy3PXPZqtXm6xE3zKzPveeBuIE/Oka7mHbrF2uCE5wnutckv9BozWfNT EIxx9QadNc6Y/D1nWRlyGbfNAfBNjhzR16tyofriL4Nbm+ThcUz3ewnJhsghtcXRbM4J qpj1yJe3VLJN2RRg+2suRlksX0Ond+pm1ojXHdFE/nPl+lIbgzEtL0qojkWH22fp7Hr+ in+i3sLTkBE/GjkGI5H5eaorOwi6HDp4I5uv+t4p02aZ+2KlX8XRgRzBZdNHBgcx7wFn yE8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=BiWvxTQj; 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=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d18si6140384pjs.100.2021.10.13.20.37.43; Wed, 13 Oct 2021 20:37:56 -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=@gmail.com header.s=20210112 header.b=BiWvxTQj; 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=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230299AbhJNDiQ (ORCPT + 99 others); Wed, 13 Oct 2021 23:38:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230324AbhJNDiJ (ORCPT ); Wed, 13 Oct 2021 23:38:09 -0400 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00388C06174E for ; Wed, 13 Oct 2021 20:36:04 -0700 (PDT) Received: by mail-pj1-x102e.google.com with SMTP id k23so3806941pji.0 for ; Wed, 13 Oct 2021 20:36:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+qdPX6leSrxZFRthtIVsp8vJTUvVJ0ZjU2fXlZEYPiA=; b=BiWvxTQjs4ZIO9YAKSkRdOArPks/CujmsJ2NRgRAJykNjbSynP4367pQkVcN7Z1Y21 w4WQVqSNFERwdlPWhqpnFcyVaA1XLm8arGKnRtQCfjJVczEURjLkqwwI8f/KNID0QxGa ZOsMEAYKpnSUq4pq4PX1XJYZY8VYY65P1xNT56UNjA13XJDWB7mq06DzJtW9ghaMJU4q SPWgkn2+jbQYwTAggIO6zTkVRkjhOMBs52zPFvyfpkEHBnYEzL7goOvJLfMyRECMaumm 7SAXGJ7V5svgJ8IZISDPqR3RDw+BEH+yDPQX49LzJWPpmT1TIJ52AH/NpPa7helpyM/0 7kgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+qdPX6leSrxZFRthtIVsp8vJTUvVJ0ZjU2fXlZEYPiA=; b=4v68Db0N6da/cw9ZUg7ZvT/OSbI63At17kXNFNLyNanMU3Zdyq8H+P3sP5MYoh0PYf QCLWvS3EMesqsYp3iq+BTVOhxmvWBKWSQRbedZYMRqI6TGGTl4w2tucTdAap//hMpfYn RWMrwjeT1J8NM6jzA8N6cnMMst21dlOGzsgyq/XLQDPYa1wLIrGcOCMW8IRSBnQkEObQ uOeigiLhQQFzZZuFQbWdMMYOv/+kt6emXr4tMCiDmho7a3GMqjc0HQRNIpsnSnh71xj9 pQS9LT+eFvNhEUpzEnWpd4G4r7RRJb1ABZR9xy5HVfBKBbMGcpy9zg6LJ9iNrcOyM328 oDxw== X-Gm-Message-State: AOAM530u2JNL08iS0LthaOwhA3WLhaMRD2M/1mKS1fsBu2yyM8agiIE7 pTNQHJgMDHGqFmhfW8E5JX+h2QEsDH4= X-Received: by 2002:a17:90b:1283:: with SMTP id fw3mr935041pjb.99.1634182564399; Wed, 13 Oct 2021 20:36:04 -0700 (PDT) Received: from localhost ([198.11.178.15]) by smtp.gmail.com with ESMTPSA id i18sm837448pfq.198.2021.10.13.20.36.03 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Oct 2021 20:36:04 -0700 (PDT) From: Lai Jiangshan To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, Lai Jiangshan , Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" Subject: [PATCH V3 21/49] x86/entry: Move cld to the start of idtentry Date: Thu, 14 Oct 2021 11:33:44 +0800 Message-Id: <20211014033414.16321-16-jiangshanlai@gmail.com> X-Mailer: git-send-email 2.19.1.6.gb485710b In-Reply-To: <20211014031413.14471-1-jiangshanlai@gmail.com> References: <20211014031413.14471-1-jiangshanlai@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lai Jiangshan Make it next to CLAC Suggested-by: Peter Zijlstra Signed-off-by: Lai Jiangshan --- arch/x86/entry/entry_64.S | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S index 1ec87d9e685d..52a08c4a0171 100644 --- a/arch/x86/entry/entry_64.S +++ b/arch/x86/entry/entry_64.S @@ -357,6 +357,7 @@ SYM_CODE_END(ret_from_fork) SYM_CODE_START(\asmsym) UNWIND_HINT_IRET_REGS offset=\has_error_code*8 ASM_CLAC + cld .if \has_error_code == 0 pushq $-1 /* ORIG_RAX: no syscall to restart */ @@ -424,6 +425,7 @@ SYM_CODE_END(\asmsym) SYM_CODE_START(\asmsym) UNWIND_HINT_IRET_REGS ASM_CLAC + cld pushq $-1 /* ORIG_RAX: no syscall to restart */ @@ -479,6 +481,7 @@ SYM_CODE_END(\asmsym) SYM_CODE_START(\asmsym) UNWIND_HINT_IRET_REGS ASM_CLAC + cld /* * If the entry is from userspace, switch stacks and treat it as @@ -540,6 +543,7 @@ SYM_CODE_END(\asmsym) SYM_CODE_START(\asmsym) UNWIND_HINT_IRET_REGS offset=8 ASM_CLAC + cld /* paranoid_entry returns GS information for paranoid_exit in EBX. */ call paranoid_entry @@ -852,7 +856,6 @@ SYM_CODE_END(xen_failsafe_callback) */ SYM_CODE_START_LOCAL(paranoid_entry) UNWIND_HINT_FUNC - cld PUSH_AND_CLEAR_REGS save_ret=1 ENCODE_FRAME_POINTER 8 @@ -977,7 +980,6 @@ SYM_CODE_END(paranoid_exit) */ SYM_CODE_START_LOCAL(error_entry) UNWIND_HINT_FUNC - cld testb $3, CS+8(%rsp) jz .Lerror_kernelspace @@ -1112,6 +1114,7 @@ SYM_CODE_START(asm_exc_nmi) */ ASM_CLAC + cld /* Use %rdx as our temp variable throughout */ pushq %rdx @@ -1131,7 +1134,6 @@ SYM_CODE_START(asm_exc_nmi) */ swapgs - cld FENCE_SWAPGS_USER_ENTRY SWITCH_TO_KERNEL_CR3 scratch_reg=%rdx movq %rsp, %rdx -- 2.19.1.6.gb485710b