Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2540630rwl; Mon, 27 Mar 2023 01:26:20 -0700 (PDT) X-Google-Smtp-Source: AK7set8ov0Swdroh6rxPKx6Im+Te7nKOyH70r8SYYZ4xtFrW85C63S2tjUEL3dF67ncQsWBfEgWE X-Received: by 2002:a05:6a20:3b93:b0:d9:5f89:46e with SMTP id b19-20020a056a203b9300b000d95f89046emr8948567pzh.15.1679905580147; Mon, 27 Mar 2023 01:26:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679905580; cv=none; d=google.com; s=arc-20160816; b=xvA4jb+GJzS3t7EaeOacjtINPpNdkAmiPxzOAkyzmhlQ/KeQFBLJ1hEm0CQCPxW4nL fpo/j+uuxfuxgvo+feJAb5YcNnR+/RRirg8EirocrNCsg2wWvYncsCUrkUyDLdPGeCnG V1W3OJpcnXPPcumPXkVA54SIlN9QKabd1U7B/lqBZr4bvpzKIcc4V3ZlRadOyO48g5qF 2mJAETR7wL5nWRSMmzaMVHjBMMeY6Ya4BbGZiLzYAUikwHrJiXrg7rPw8DJMlXtNM7qu noesAOMvNKf+B/V6ooYVhVTWFy/CgHqAClsFKH8UIGcXEQ37q/ie+mYiPA+zrr/O8rHU FSfg== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s132-20020a632c8a000000b00513162c223csi8926761pgs.470.2023.03.27.01.26.08; Mon, 27 Mar 2023 01:26:20 -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 S233255AbjC0IZh (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 Content-Transfer-Encoding: 8bit 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 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) -- 2.34.1