From patchwork Tue Dec 5 10:50:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Li, Xin3" X-Patchwork-Id: 173984 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp3359127vqy; Tue, 5 Dec 2023 03:22:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IFxBtYLgsVVn7IcKt1pXvJT2F3V7rb9grr6MRy0XOmfRZAsoWFszIScZFPFVNu5FW5gOHHO X-Received: by 2002:a17:902:f20b:b0:1d0:6ffe:9f7 with SMTP id m11-20020a170902f20b00b001d06ffe09f7mr4910133plc.85.1701775358611; Tue, 05 Dec 2023 03:22:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701775358; cv=none; d=google.com; s=arc-20160816; b=CGt3kCGnziP3VuNJ8S1KITMeLKUTqrKAA1o9PXSROcQPCBycTfuRGzEZDXrxLgGUfL WY9nxokUXCAyWbuXaIFYfyxoqaGIbFhZ6AMu72APOqv/ET4MScHxyc2KW3ZZHgdzSuvr WZon6agjyVdJj0gIb28GBqc3IT6ubUTSSmoSJz8QmX2r65sfmBsCWAAJYSBfR48D54P3 Mmqa2ZEoHSftG//DKm2RuyJW42zTsIKrs1J5uUBAwMe5jw/2gRdmCsGe6Os5r8G83AF1 BBG2fBCudk3EJyxfXT3vH2By9p8tBznPPYUeesvUJ3Wt1Ltj+lZWv/BWDxqnjT48ZEA0 TWXA== 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=BoolrdTo0WXkBw9+c7LF/Dim6mSwvl3dZbAuCDuPAP4=; fh=uCCWEUVpLc/xDP/D3WvGY/BxHU9d0NQYu/T71GEsNmA=; b=asJzuLjVvD2ESpqq2qkK03cIcPUoSN0pTAonte520Y7ndTpVhpQ+9bDa7eJaKX+nsJ NDPG+ntCzmCwhxiXXRFtBmnc2oiAfY4koxURP8sLa0Dfe5yWtgYXuH8wim9x2Ugdu3PC avN+e/Gki9Fiu2/9ap2i2J7qgicafh3DN1SFmKM2P1taRN3fqdXhTaQ+lTL/8Lj7E++A AH7n2a8cSyMFDpbzNv90s8tWovIGklofl9hlQllSbheakqPP2ScT1SHIbFpiW7I+JonC P32sO5SOolQb8049lAFb9+bVStcS5V9Z3Z6EFmHg+CeSIFZYXcRNYmPDnzHpvWKvja+3 vl1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=myRA8Ja+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id j3-20020a17090276c300b001cffcc110c4si9658469plt.54.2023.12.05.03.22.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 03:22:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=myRA8Ja+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 8902680F6B77; Tue, 5 Dec 2023 03:22:34 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442094AbjLELV4 (ORCPT + 99 others); Tue, 5 Dec 2023 06:21:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442076AbjLELVU (ORCPT ); Tue, 5 Dec 2023 06:21:20 -0500 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B9AE181; Tue, 5 Dec 2023 03:21:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701775286; x=1733311286; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1fzGqu48NP+nQ4Wei8H/FiUdtI6VnB83SN+47a+BzSw=; b=myRA8Ja+dUdub1a7KyjB7/p2MVH7fkCVHnvJVBUUwrWUUd539Q+xUF8W pIqj4d2dUztVL9o/aKLqd0p8+/2LrSVB3oSDDIuXAWDqPq7qc/dmjVZ9J Xpd9v2adglCfivUGblJNnIghjlMug/uJyFBEHS3vvIzsdNLlZq/hNFqTg ke3DGztD3ax3aOexd4KZprYE4yOMVU/t3QeEb+JuGhRsgA82Xdf1q5WYt BHWtlezpZOykIkBADbm/O7dgPS8Bg44+TNw2SSmRUfSVYkDpOthtG0nsB 2qhY8FP4h2eCMGyGoOvvVmYOsLfaVDI4/XNC3//qGPtCv4WtzynR+kVqb w==; X-IronPort-AV: E=McAfee;i="6600,9927,10914"; a="942449" X-IronPort-AV: E=Sophos;i="6.04,252,1695711600"; d="scan'208";a="942449" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Dec 2023 03:21:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10914"; a="1018192939" X-IronPort-AV: E=Sophos;i="6.04,252,1695711600"; d="scan'208";a="1018192939" Received: from unknown (HELO fred..) ([172.25.112.68]) by fmsmga006.fm.intel.com with ESMTP; 05 Dec 2023 03:21:19 -0800 From: Xin Li To: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-edac@vger.kernel.org, linux-hyperv@vger.kernel.org, kvm@vger.kernel.org, xen-devel@lists.xenproject.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, luto@kernel.org, pbonzini@redhat.com, seanjc@google.com, peterz@infradead.org, jgross@suse.com, ravi.v.shankar@intel.com, mhiramat@kernel.org, andrew.cooper3@citrix.com, jiangshanlai@gmail.com, nik.borisov@suse.com, shan.kang@intel.com Subject: [PATCH v13 12/35] x86/cpu: Add MSR numbers for FRED configuration Date: Tue, 5 Dec 2023 02:50:01 -0800 Message-ID: <20231205105030.8698-13-xin3.li@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231205105030.8698-1-xin3.li@intel.com> References: <20231205105030.8698-1-xin3.li@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Tue, 05 Dec 2023 03:22:34 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784440798651029528 X-GMAIL-MSGID: 1784440798651029528 From: "H. Peter Anvin (Intel)" Add MSR numbers for the FRED configuration registers per FRED spec 5.0. 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 737a52b89e64..d1d6b3c3e6bd 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 1d51e1850ed0..74f2c63ce717 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)