Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp3207659pxb; Sun, 26 Sep 2021 08:15:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6lm/kSnV6ZFx3KzdlJDZTHonthQylK0Qbs0hsuF5jtJSgoS5i42KBaI4vIU5A466a8OrU X-Received: by 2002:a05:6402:cbb:: with SMTP id cn27mr18557923edb.5.1632669338557; Sun, 26 Sep 2021 08:15:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632669338; cv=none; d=google.com; s=arc-20160816; b=kKaVLwO489tO7jNYKufptYUU3gqIJBR3wxCHpOoSu+jPpVJNDDxI5BTzcVtcdaHnJy syGa6h+EiW/IrLzeXlCWKH1XCsHR5vKOm0ASSwL7x5HjnZ71zFkLqty2n3bUgXX+lSdW L9+xA1nJq4ez1vvzO2dBhqnnGp2FcgTMIkyE5TakcAU/2gTy8stuvUtzOYVVwpKzRaST 5gHeAU+7CsdQSLo3BUuVTgm6c3Fx4e9ckRxZGHs8iyweIkoNYiiME8MsC2EeeA8IGDcF X8cdjCNovWaPBxKHh6Jr2I7PSPk3hHukns+Dy6ck8B09VhF5LRno8Ne3S3nu/gHU/gCP WVrg== 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=xM1TAP6SyPkZxt3oLXVa7SXk4E9KPeiVLhno6SESzGQ=; b=dUK5a36dwJYcMauSX2iZrS7IVBEG+U0iTq5BNCMr+JK/dZlbn3PrWyOGf0sTvNV4Wr 7ekjtXtPdqliMCQqlLQVhfr+quc8lNWgw65JMAorsuq/KL0QXs2wxrh41pWeLwSif0Dk dIa8y/QmN7nAO7+UgtbprWO71YCnpNO23i+usfwE4/sh6syAALJIZgMd9iG2NJKrawCt L9nvpzn8d9Xwx38xIOeTU/wMvarVt+Cc/baG1bmeS4WBAdT0066kxmHXQ7wlJkWd/YVK wCWD39xXdbCRnT/eencyXDRfT7E6alPQWKmal4vjXkErNisiqS/MQ3L4Vau7oClkihi/ hevg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=pj10YR1r; 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 j17si15387535ejm.446.2021.09.26.08.15.14; Sun, 26 Sep 2021 08:15:38 -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=pj10YR1r; 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 S232266AbhIZPO2 (ORCPT + 99 others); Sun, 26 Sep 2021 11:14:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232142AbhIZPOI (ORCPT ); Sun, 26 Sep 2021 11:14:08 -0400 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3B90C061575 for ; Sun, 26 Sep 2021 08:12:31 -0700 (PDT) Received: by mail-pl1-x632.google.com with SMTP id t4so10045905plo.0 for ; Sun, 26 Sep 2021 08:12:31 -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=xM1TAP6SyPkZxt3oLXVa7SXk4E9KPeiVLhno6SESzGQ=; b=pj10YR1rWKjBsiBKbKtWBHD+JpivgWCgaBnTx8bicvg3J4n0aR9cprJJ+rEyACggi3 dw1AR5XOlZCobey6BtMtlrGICjw8CXuV0mAWg843w1mjfUMXJJvLbeM/p5fF2zjpsqV4 t1oqkF34rRT5PaF7YPh8Eqq0fVNbIl9voL6cyCuHLIcdpJ0vN143zGjAI6b0FeYcBCNA /UMkKXQeZ0u4yQ7Ztgke57GJaBB2I6EZd8gadxq2IrFq6fVd7ETQNCrM4QGaeP2x/RkM u3Tch4QtCwVx5Ya0sOmVFR52E/1KWTlaUrdpDGIpbzpITun/l+wosBndG4PBOT35+vuV xIPA== 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=xM1TAP6SyPkZxt3oLXVa7SXk4E9KPeiVLhno6SESzGQ=; b=VcnN8qQZtrqV7TT9r3aE+Lns4UbAOK1fT5OLEBUBb9lQeqHVdTNE6BXE/GZxc7oyeu PZK117+KtPSykVf7r6/gAeXbfr2Npg39s6NS8M37SpDm0x5I2mW6Y2pYoewxcQhLk+Lo 7W1fe4kn6vCbMaSFbZQWSzkc9753M4eNnFXoVCAFehQBC8YuC/+K9SKBn+FjE7NV5U2i kYyBvA9k+5ZvnSGzT04GWSRn5CraPla6AV0PufOgeDMWqdYivx3040oTy8LBHE7he11l opZH6lzYkc9TgyR3vPsC+6FoiZDubDAyJrYceWuW7z6OYPOEdYod8YKlVgiCR5my8vNy ebnQ== X-Gm-Message-State: AOAM533j+fbrEACWj2lagV0gLf82sWLkg3lN82oHsn69FsPLS9VSJ14x rieAflpfu7jA4h5GAHoQ0BHD/sonfwH2CQ== X-Received: by 2002:a17:902:d48e:b0:13a:60a5:f410 with SMTP id c14-20020a170902d48e00b0013a60a5f410mr18266310plg.64.1632669151266; Sun, 26 Sep 2021 08:12:31 -0700 (PDT) Received: from localhost ([47.88.60.64]) by smtp.gmail.com with ESMTPSA id a9sm11595278pfl.203.2021.09.26.08.12.30 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 26 Sep 2021 08:12:30 -0700 (PDT) From: Lai Jiangshan To: linux-kernel@vger.kernel.org Cc: Lai Jiangshan , Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , Juergen Gross , "Peter Zijlstra (Intel)" , Joerg Roedel , Mike Travis Subject: [PATCH V2 34/41] x86/doublefault: Use C entry code Date: Sun, 26 Sep 2021 23:08:31 +0800 Message-Id: <20210926150838.197719-35-jiangshanlai@gmail.com> X-Mailer: git-send-email 2.19.1.6.gb485710b In-Reply-To: <20210926150838.197719-1-jiangshanlai@gmail.com> References: <20210926150838.197719-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 Use DEFINE_IDTENTRY_IST_ETNRY_ERRORCODE to emit C entry function and use the function directly in entry_64.S. Signed-off-by: Lai Jiangshan --- arch/x86/entry/entry_64.S | 12 ++---------- arch/x86/include/asm/idtentry.h | 1 + 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/arch/x86/entry/entry_64.S b/arch/x86/entry/entry_64.S index 72a1610bb540..db108f8cd554 100644 --- a/arch/x86/entry/entry_64.S +++ b/arch/x86/entry/entry_64.S @@ -544,16 +544,8 @@ SYM_CODE_START(\asmsym) PUSH_AND_CLEAR_REGS ENCODE_FRAME_POINTER - /* paranoid_entry returns GS information for paranoid_exit in EBX. */ - call paranoid_entry - UNWIND_HINT_REGS - - movq %rsp, %rdi /* pt_regs pointer into first argument */ - movq ORIG_RAX(%rsp), %rsi /* get error code into 2nd argument*/ - movq $-1, ORIG_RAX(%rsp) /* no syscall to restart */ - call \cfunc - - call paranoid_exit + movq %rsp, %rdi /* pt_regs pointer */ + call ist_\cfunc jmp restore_regs_and_return_to_kernel _ASM_NOKPROBE(\asmsym) diff --git a/arch/x86/include/asm/idtentry.h b/arch/x86/include/asm/idtentry.h index 7935b0abc65d..99e1ae3f5c7d 100644 --- a/arch/x86/include/asm/idtentry.h +++ b/arch/x86/include/asm/idtentry.h @@ -401,6 +401,7 @@ __visible __entry_text void ist_##func(struct pt_regs *regs) \ * Maps to DEFINE_IDTENTRY_RAW_ERRORCODE */ #define DEFINE_IDTENTRY_DF(func) \ + DEFINE_IDTENTRY_IST_ETNRY_ERRORCODE(func) \ DEFINE_IDTENTRY_RAW_ERRORCODE(func) /** -- 2.19.1.6.gb485710b