From patchwork Mon Mar 27 07:58:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, Xin3" X-Patchwork-Id: 75289 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1358647vqo; Mon, 27 Mar 2023 01:41:31 -0700 (PDT) X-Google-Smtp-Source: AKy350bhIh3PrlCdJi80D7HLpcxoznuyhgPT8vyhzVTXnKtytG2GWSd2V1VDEtrVabZajwwY3cn2 X-Received: by 2002:a62:7988:0:b0:625:e8ec:4f5b with SMTP id u130-20020a627988000000b00625e8ec4f5bmr10848222pfc.6.1679906491560; Mon, 27 Mar 2023 01:41:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679906491; cv=none; d=google.com; s=arc-20160816; b=jyKNpxQkTezMTzszv43In4IA2SPwDoRGNPXo0VRIg920FTvgv0me3XzGvyWnL3lkOY 8Tr8mXUEgMNu07PZSrxg4SZ6A9KfS5nnDDvkdsX6CVtdqf+UnjCl4H8f4O2OilUOOWEs pNct7oOo3RU7b/mfre7JE7Is3ju9LDGJbDbDlXRAwfUSKwGqETV+OEUbxXPumSnA5BlI meDho4sns90ltiboDWLw66JZw0hYINZzeMOYq6xImwJ/YWdTLDNnHMutMOAT6FGKHSWN uiWKbL4uQtJdBpHliDAC+hF/e/8+4kfUXVteyDACrXGePkOzomNR3t2yqyuYGU91w1a/ 5gSA== 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=bxlRTsP9VdEoqzfLEjO6uA1EB+3I6TDY2eyMrxjMlAY=; b=j0P36ni6LHoP9ksEe7gQ7G7TS6EvQGuLFbPAByd/2Cign5QLmw91pGf5MvReKVZ8v7 lt/JyE8ZabgGZMAIfZOotdZq+NAjbI0ABKpPyf4hMv59DMcDZ9MHQzNM55ikmgFpgk92 i9bW0grLR0sTmvxBvlIItGdpJwN5vTNhH4URVaOYQa4ujezyg9smnnxsC6fxdFcf6yhr ZLqbci3iVOxkjSIvV4rQ2Pu9wndx4NVIMLn+kbt7ArtJ8OLW/Ocve2ckWFulz1wVHuNh yw83bQF0ZWtjE1+xTo5IP7Ni3vKaaXLZaNS065aidqzk2TROoKIBCL58EdF2Z/BbUU4B be9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=AVk5Dy2u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y29-20020aa78f3d000000b005d8fd3b36ecsi26736169pfr.228.2023.03.27.01.41.19; Mon, 27 Mar 2023 01:41:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=AVk5Dy2u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232990AbjC0IZh (ORCPT + 99 others); Mon, 27 Mar 2023 04:25:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233037AbjC0IYg (ORCPT ); Mon, 27 Mar 2023 04:24:36 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74E723C3A; Mon, 27 Mar 2023 01:24:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679905475; x=1711441475; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=9ZDzco+F9bEe6GLOCDycLaH8JYPs/ssjd/Vxju2hLBE=; b=AVk5Dy2u7kc49KCx4b8CP5X9BoJtIvNjGqyHtXVnquufi3mPEpwfSCEQ c0E7d2MkRgByVwTrW3sheewgjIoFO7uCPmqEiwVq0KP4UW8MuWWQdS9Fp 57DUyvtiAYCd+yNrktt1E5u1FE8DeOPmk6Zp7MtJYBlFohmkoHjzVpIg3 +XNjRwoxlpbEKO+xyUNyxWnlLJmNaRBlqOn9wAERVauVUTH24D999Upl8 zlQFTFmobdVj1Hz9dfc633qgJer1g6W6gcbbMP5c76lEnKe+Kgupw8XiS UKpt4LROeEwcjJOkCm4lPgdzI1x4BUM3PnhZtFoSuA38jPGCGxLjni8tY Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10661"; a="338930206" X-IronPort-AV: E=Sophos;i="5.98,294,1673942400"; d="scan'208";a="338930206" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2023 01:24:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10661"; a="713787071" X-IronPort-AV: E=Sophos;i="5.98,294,1673942400"; d="scan'208";a="713787071" Received: from unknown (HELO fred..) ([172.25.112.68]) by orsmga008.jf.intel.com with ESMTP; 27 Mar 2023 01:24:33 -0700 From: Xin Li To: linux-kernel@vger.kernel.org, x86@kernel.org, kvm@vger.kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, peterz@infradead.org, andrew.cooper3@citrix.com, seanjc@google.com, pbonzini@redhat.com, ravi.v.shankar@intel.com, jiangshanlai@gmail.com, shan.kang@intel.com Subject: [PATCH v6 12/33] x86/cpu: add MSR numbers for FRED configuration Date: Mon, 27 Mar 2023 00:58:17 -0700 Message-Id: <20230327075838.5403-13-xin3.li@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230327075838.5403-1-xin3.li@intel.com> References: <20230327075838.5403-1-xin3.li@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761509629292747111?= X-GMAIL-MSGID: =?utf-8?q?1761509629292747111?= From: "H. Peter Anvin (Intel)" Add MSR numbers for the FRED configuration registers. Originally-by: Megha Dey Signed-off-by: H. Peter Anvin (Intel) Tested-by: Shan Kang Signed-off-by: Xin Li --- arch/x86/include/asm/msr-index.h | 13 ++++++++++++- tools/arch/x86/include/asm/msr-index.h | 13 ++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/msr-index.h b/arch/x86/include/asm/msr-index.h index ad35355ee43e..87db728f8bbc 100644 --- a/arch/x86/include/asm/msr-index.h +++ b/arch/x86/include/asm/msr-index.h @@ -36,8 +36,19 @@ #define EFER_FFXSR (1<<_EFER_FFXSR) #define EFER_AUTOIBRS (1<<_EFER_AUTOIBRS) -/* Intel MSRs. Some also available on other CPUs */ +/* FRED MSRs */ +#define MSR_IA32_FRED_RSP0 0x1cc /* Level 0 stack pointer */ +#define MSR_IA32_FRED_RSP1 0x1cd /* Level 1 stack pointer */ +#define MSR_IA32_FRED_RSP2 0x1ce /* Level 2 stack pointer */ +#define MSR_IA32_FRED_RSP3 0x1cf /* Level 3 stack pointer */ +#define MSR_IA32_FRED_STKLVLS 0x1d0 /* Exception stack levels */ +#define MSR_IA32_FRED_SSP0 MSR_IA32_PL0_SSP /* Level 0 shadow stack pointer */ +#define MSR_IA32_FRED_SSP1 0x1d1 /* Level 1 shadow stack pointer */ +#define MSR_IA32_FRED_SSP2 0x1d2 /* Level 2 shadow stack pointer */ +#define MSR_IA32_FRED_SSP3 0x1d3 /* Level 3 shadow stack pointer */ +#define MSR_IA32_FRED_CONFIG 0x1d4 /* Entrypoint and interrupt stack level */ +/* Intel MSRs. Some also available on other CPUs */ #define MSR_TEST_CTRL 0x00000033 #define MSR_TEST_CTRL_SPLIT_LOCK_DETECT_BIT 29 #define MSR_TEST_CTRL_SPLIT_LOCK_DETECT BIT(MSR_TEST_CTRL_SPLIT_LOCK_DETECT_BIT) diff --git a/tools/arch/x86/include/asm/msr-index.h b/tools/arch/x86/include/asm/msr-index.h index ad35355ee43e..87db728f8bbc 100644 --- a/tools/arch/x86/include/asm/msr-index.h +++ b/tools/arch/x86/include/asm/msr-index.h @@ -36,8 +36,19 @@ #define EFER_FFXSR (1<<_EFER_FFXSR) #define EFER_AUTOIBRS (1<<_EFER_AUTOIBRS) -/* Intel MSRs. Some also available on other CPUs */ +/* FRED MSRs */ +#define MSR_IA32_FRED_RSP0 0x1cc /* Level 0 stack pointer */ +#define MSR_IA32_FRED_RSP1 0x1cd /* Level 1 stack pointer */ +#define MSR_IA32_FRED_RSP2 0x1ce /* Level 2 stack pointer */ +#define MSR_IA32_FRED_RSP3 0x1cf /* Level 3 stack pointer */ +#define MSR_IA32_FRED_STKLVLS 0x1d0 /* Exception stack levels */ +#define MSR_IA32_FRED_SSP0 MSR_IA32_PL0_SSP /* Level 0 shadow stack pointer */ +#define MSR_IA32_FRED_SSP1 0x1d1 /* Level 1 shadow stack pointer */ +#define MSR_IA32_FRED_SSP2 0x1d2 /* Level 2 shadow stack pointer */ +#define MSR_IA32_FRED_SSP3 0x1d3 /* Level 3 shadow stack pointer */ +#define MSR_IA32_FRED_CONFIG 0x1d4 /* Entrypoint and interrupt stack level */ +/* Intel MSRs. Some also available on other CPUs */ #define MSR_TEST_CTRL 0x00000033 #define MSR_TEST_CTRL_SPLIT_LOCK_DETECT_BIT 29 #define MSR_TEST_CTRL_SPLIT_LOCK_DETECT BIT(MSR_TEST_CTRL_SPLIT_LOCK_DETECT_BIT)