Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1583633pxb; Tue, 26 Oct 2021 11:41:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRBHuLTiFbRCwUNC48oTfPD5cKYyhSpbgkpr/lZSljGEqDzeBO8omtkuQ9AIEEHwXFxuSz X-Received: by 2002:a17:90a:dc0c:: with SMTP id i12mr525853pjv.60.1635273717383; Tue, 26 Oct 2021 11:41:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635273717; cv=none; d=google.com; s=arc-20160816; b=auHiKtjTwgTdpr3CustJL/aJrpuqAnbNy8mDRbxSf+HhZiOPow1J4gtM6Rjtmq8t7a 8+L4T3uQiv5KIzjZTjUoKGvb25rMPvp/Cx0+MwYmx1zfqoYKbhdFZwTj/6/LI/8aeAan NRGSjfWAg8AsjG8oGNxNsbzSd4s3u/0UwF7i9Dx1TuWUu2ybLEwSgqp0xCKLV1JURGGW AQYtX9UVOeSwb5Qvfpo7qMWftt7mqxF72x5XeEZAXFo3G0ok+WPa0b/ZgKYG616JcGOx 3NPO9koWKnN7XHGMk+vPrS7X36FsHPWdQYKNuKfRDhAs4mD81qTLQLsUeqzrGxkRDzy0 EdOQ== 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=X1SrmVsVj/8riq8Zu11HU29nfsCt2CipbOtY3TsCm9Y=; b=fvj0W9cwxtrCVwnUeZ08Q4M0AchQG29rWCKLcGAmVfDbplvpuzJjzcpcQocStmIHya V8JybkS654xIe3jdZFREKujjR58wAlIZj9N1h9YiH7ntp7Ij5OpeM4ffUGQEUEg05ATy OXDRWeWJQVsDkJ2QgIg7K9CZOclK/nL0a/4rW98pGKza2x3UR8fAetV9Pxe05OzXhezX YESlju01OrEIhPPp8WgDtSl0dBUldkyQR/0RinTJuMBmexmymUGEa+Wx0fL846ZNSDas kQPgOolCNG0RLi1vCorOuZeMNGfuYkyJer+j6qOVOjEoudJN5PLCYF1eFLo+rf23clE6 x2iA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=FfyS8Ucs; 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 w132si29386489pff.154.2021.10.26.11.41.44; Tue, 26 Oct 2021 11:41:57 -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=FfyS8Ucs; 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 S236823AbhJZOis (ORCPT + 99 others); Tue, 26 Oct 2021 10:38:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236736AbhJZOii (ORCPT ); Tue, 26 Oct 2021 10:38:38 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FA54C061767 for ; Tue, 26 Oct 2021 07:36:14 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id r5so5889343pls.1 for ; Tue, 26 Oct 2021 07:36:14 -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=X1SrmVsVj/8riq8Zu11HU29nfsCt2CipbOtY3TsCm9Y=; b=FfyS8Ucs3QccfDKAHEcbld4gwnfXPKb4ahTobsIckda69/Z9xwaS3DcpgBU3xfk//Y FM3Lbhy5zmjYy5nCN/Qkxs2ScRYsVFk/gsrlFIS7KGbd7tEYQzPTksltUg4fth9q+Maz 55Jq36PN6A3ZoAnuoaV988UIx419fNOigdzdMWx6odChtqoe0W5PyfSjfT+CLoEAiZiS jSSMt+zDeuo0A7JVsGX013FrKynBe4onuC8vNeGvBgcnc/TLeGGGeeSLoxvEC+Du6W1j 2K0PT2euLiTBdenHCKTGkJEfUfRBekiaaIoEK0eLAYvY1l0/VtHSHhv4oClw19MILmDR LlSQ== 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=X1SrmVsVj/8riq8Zu11HU29nfsCt2CipbOtY3TsCm9Y=; b=sJ0S624vZAubN/KDcv9vX2I60UQDkCqSrAssrnUbC4MCpmPOvIp8p2NNLi7BV1GgPu pDfVJ/oU8riRLXaSkF+134KT6Jb6pj7Ho2xl7QJqntQnOIK9KjeKPthqhOOpvTFroJH5 0iwOtAaDNIl/1XdxYwSLyHd1wdnEgnpPXgWV1YM2DjQGNPv/iKX9OpTF4g8Q81ibXkI+ /B8LNhSN9ripCXL9l1e457sdfAbEoYOd1lnQ9qjDZCC2wxBoFEbobupU6BImKfEma0Fl zqX5Y6qdCR8RaeU6iHyWZHtguo9kRmjSCdamK59KFt46tz4U7mxkqEFbEQVs9/UVdnvi l/0g== X-Gm-Message-State: AOAM531qGHhJwSCmRKbpMa88QXUnBQkcFB7bZ2uyC56iVwDkjKhz0myj 8hwLHVDvDUt7kTeY/c2ChTe39HXPtYA= X-Received: by 2002:a17:90a:ca90:: with SMTP id y16mr26807263pjt.222.1635258973736; Tue, 26 Oct 2021 07:36:13 -0700 (PDT) Received: from localhost ([47.88.5.130]) by smtp.gmail.com with ESMTPSA id g7sm18740883pgp.17.2021.10.26.07.36.12 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Oct 2021 07:36:13 -0700 (PDT) From: Lai Jiangshan To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, Lai Jiangshan , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Juergen Gross , "Peter Zijlstra (Intel)" , Joerg Roedel Subject: [PATCH V4 38/50] x86/entry: Add a C macro to define the function body for IST in .entry.text Date: Tue, 26 Oct 2021 22:34:24 +0800 Message-Id: <20211026143436.19071-13-jiangshanlai@gmail.com> X-Mailer: git-send-email 2.19.1.6.gb485710b In-Reply-To: <20211026141420.17138-1-jiangshanlai@gmail.com> References: <20211026141420.17138-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 Add DEFINE_IDTENTRY_IST_ETNRY() macro to define C code to implement the ASM code which calls paranoid_entry(), cfunc(), paranoid_exit() in series for IST exceptions without error code. Not functional difference intended. Signed-off-by: Lai Jiangshan --- arch/x86/include/asm/idtentry.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/arch/x86/include/asm/idtentry.h b/arch/x86/include/asm/idtentry.h index cf41901227ed..0f615943a460 100644 --- a/arch/x86/include/asm/idtentry.h +++ b/arch/x86/include/asm/idtentry.h @@ -337,6 +337,20 @@ void ist_paranoid_exit(unsigned long cr3, unsigned long gsbase); __visible noinstr void kernel_##func(struct pt_regs *regs, unsigned long error_code); \ __visible noinstr void user_##func(struct pt_regs *regs, unsigned long error_code) +/** + * DEFINE_IDTENTRY_IST_ENTRY - Emit __entry_text code for IST entry points + * @func: Function name of the entry point + */ +#define DEFINE_IDTENTRY_IST_ETNRY(func) \ +__visible __entry_text void ist_##func(struct pt_regs *regs) \ +{ \ + unsigned long cr3, gsbase; \ + \ + ist_paranoid_entry(&cr3, &gsbase); \ + func(regs); \ + ist_paranoid_exit(cr3, gsbase); \ +} + /** * DEFINE_IDTENTRY_IST - Emit code for IST entry points * @func: Function name of the entry point -- 2.19.1.6.gb485710b