From patchwork Thu Mar 2 05:24:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, Xin3" X-Patchwork-Id: 63227 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp4063582wrd; Wed, 1 Mar 2023 21:53:32 -0800 (PST) X-Google-Smtp-Source: AK7set+fpC5bJFYW1Zs7wo11GOGFGOFI01MEDDFeHqgPoP+fdbyQ+5vgBUqMCgzcst6GpLEqjEqm X-Received: by 2002:a50:ff07:0:b0:4af:601c:ea21 with SMTP id a7-20020a50ff07000000b004af601cea21mr8321721edu.38.1677736411930; Wed, 01 Mar 2023 21:53:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677736411; cv=none; d=google.com; s=arc-20160816; b=F24Ss9EzCUPMH2zHqjR9JINzTgF0WTt/y2rZ29rYk3JDXJcJXpZ20CICgRrepmPouR H387iTLvFOk/x/9FdA0OlPMR9rVTtIBxJTrqznWUuXwr5aDTP2PyWcja5lBbG7bUENXa LngA6j+TzycaZv9a8O/h1mQ4UWSJkVv9E3xRt/rwQGbbYewLLmApkMUwZ0ykrNR5NVF+ wJc/VEGJT3zdQtMemkNs+mfbeOYe0yYyO8NWiNYh51fno25MJHzzzcXa8g0JT1qyRPiS 9v3pEA0Y+TdZzlTb+KDt8xNaIMPPo+mM/fys9DacEZ3zhrvh51pDF4ssSzaPlbTN+JoA Xtuw== 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=VHkMyyU3HTkyeBGCsS/PdXW3i+nYIJWDtBukRe4hz1Y=; b=W8H1chzcsh2Vt2NJhYmjXTNHAp4hD+pZysbpjJrYJd7AD/DPenAtlg8MlxgiC7dPI2 84H8c/h8xUYsNQPYokMSZSXTgiChNx0HkiJtrzRmpZJXxcR5gSmox7S1M2BS80uzA1he XpMKbn2mDX4cEHxYz3b3OSSIgMhazNyqLlOjRI4DL3nV3NL2039nIBIpjbDwcsmM/yYL tQA1aZ3BnaC1F1mnVjMpf+nmBfgOwumRyhaX7F1z/auwUDB+FdTGw+jdONM/KLko5Gp8 S2kHs2inWVsSrT3h3S3UC5tNDH3ytwYTW94wSVmEAixQM+WJQric0pykUjSPMnGuPFFn T6jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=LRb87I6i; 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 qk17-20020a1709077f9100b008cd6f50c059si9160672ejc.669.2023.03.01.21.53.09; Wed, 01 Mar 2023 21:53:31 -0800 (PST) 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=LRb87I6i; 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 S230102AbjCBFwX (ORCPT + 99 others); Thu, 2 Mar 2023 00:52:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230015AbjCBFvq (ORCPT ); Thu, 2 Mar 2023 00:51:46 -0500 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 844464ECED; Wed, 1 Mar 2023 21:51:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677736265; x=1709272265; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Dhlfn7qvLhWN1c0RzKGaosBPQEjw24rUF7QUjxaHu4I=; b=LRb87I6iGWe0s4IDAGpRGOJtnLAw5iUVxtcQay2Dh+nKkcDp0vEOPZVy 0FXnqpsIiOdd6StrY4YuD8On/wLhiG5Okfdq1RmeCbbxHbpQImBjxdXkW h0ZYKZgR3+nVagI9kUCyDPyY5B9HCrcaNavKgPL7WsGY3nxDttyIiaU/k A3C1EzEmrWoIk6CS7NUC2DGcJ3s3DPRoEsLXUbGQ0bi5TbH8Y9RVy3YDF iJNwV/2T32S9IiAZONZ+h8CA8TDj6a6Iypuo9PP7p8C84P/KUslqXANvN ke2KTxJlZXBOwtzjZJeiw3AV8MH1uqvL+/6yydpvJrCSZpP5cTsjja9gP A==; X-IronPort-AV: E=McAfee;i="6500,9779,10636"; a="420887228" X-IronPort-AV: E=Sophos;i="5.98,226,1673942400"; d="scan'208";a="420887228" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2023 21:50:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10636"; a="920530907" X-IronPort-AV: E=Sophos;i="5.98,226,1673942400"; d="scan'208";a="920530907" Received: from unknown (HELO fred..) ([172.25.112.68]) by fmsmga006.fm.intel.com with ESMTP; 01 Mar 2023 21:50:47 -0800 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 Subject: [PATCH v4 12/34] x86/cpu: add MSR numbers for FRED configuration Date: Wed, 1 Mar 2023 21:24:49 -0800 Message-Id: <20230302052511.1918-13-xin3.li@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230302052511.1918-1-xin3.li@intel.com> References: <20230302052511.1918-1-xin3.li@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham 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?1759234135705978121?= X-GMAIL-MSGID: =?utf-8?q?1759234135705978121?= 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 37ff47552bcb..0ade66db3627 100644 --- a/tools/arch/x86/include/asm/msr-index.h +++ b/tools/arch/x86/include/asm/msr-index.h @@ -34,8 +34,19 @@ #define EFER_LMSLE (1<<_EFER_LMSLE) #define EFER_FFXSR (1<<_EFER_FFXSR) -/* 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)