From patchwork Sat Sep 23 09:41: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: 144025 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp439295vqu; Sat, 23 Sep 2023 18:05:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFRQ5dX2jk+a01L5kgSycNRMSu4LIkAYEvaVBhn+48z6CdZRsv69YGw/UpxAKG8Ca/vsEC0 X-Received: by 2002:a05:6a20:4292:b0:14c:d494:77c5 with SMTP id o18-20020a056a20429200b0014cd49477c5mr4660368pzj.13.1695517538038; Sat, 23 Sep 2023 18:05:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695517538; cv=none; d=google.com; s=arc-20160816; b=C/ATMhKg6/I2YfsMwEd7lokWkzqYciVmNQAgL8K+hIQ44/naT4SOgEcXWZsxnu5l7d BJJzmvUDDoz9pLyuoP/ViR+rg77jhp2hjmExlMEOY6KXXgzcwR6zbx3+Jb6XrjO/Wsdu qRbLN7OemE2Lx7gXEAoq1Dm8x7jm7LQytnlVjpxm4vZXF547qOgupixtdC0m/7ojX+c5 c6cuVmeJ9gGqz5rYbzWB5kVc7z28xYc74KNLjE8kG+PMdBmqeAlw/f/jkyk4L17yyMF4 6iIkEJiWtf85ZED1Oisg3F1jBXXg13OekVPNyl6YwUzpRo2Y+NlVTiedNTRxTNBMrTQ5 Zx1Q== 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=a2d/ubhPBmd/aLgESTEXr+wGS7Ce+IWvfuiLIqp29nM=; fh=Tb1p8S3iOxe/kX/WSNC3xEJzSVgGJ5DaxSrKb+pzH+4=; b=AtK1DfG7525KqVBTdTHlHNLRDuPzxkCq6eOz7KQp1Jr7zpfMajf9GMLGHPAPMD2qIb +E2z1pGD3HDpPhKt60hl/XwT82XhurvS+NoBFu+CyVEfFbXw7yV7L9sQ7WlqVT2SX61S G4MQx72Z/cOZcY2W37WYl+RDolxUaIaPHRqsLEDjE1fRIHBDYB6GWTWhDPteX3e/6uz4 isSlm6womI1Ze2O+HfKXmMN3H/cSaJCnBpGlWHMEYt5fahBQjs+pmsHIIK8gZE9Foy4p dXw5lCHye7gwK1aU1kzyBozOMoHwsDkbyyvcr1YotRxzR4EfCG1o+CH1Xd0AMpWORetu exdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=aiHp3F93; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id bu6-20020a056a00410600b00691018750casi6815987pfb.276.2023.09.23.18.05.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Sep 2023 18:05:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=aiHp3F93; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id 40D5A83513AE; Sat, 23 Sep 2023 03:14:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231605AbjIWKNU (ORCPT + 29 others); Sat, 23 Sep 2023 06:13:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231377AbjIWKLu (ORCPT ); Sat, 23 Sep 2023 06:11:50 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 686391A7; Sat, 23 Sep 2023 03:11:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695463904; x=1726999904; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=szPt1r95a6G9RGqQRcu9cfSwmWMFMGoo6TuZWPez9pk=; b=aiHp3F93ZLAAx68RVNAF9kDM48Xa4MHBEVCM0o7rJH0sKCBEdKCIyB1x Ip7LpJojTmQfHM9DuxeA6AeyAyukQImVfp8Nid6IXm3jmoPgaiGMbjtSH 8obi3zGXrgb7JsG7WXXxo9Cbt8Cb3hLmADuIgIjxBKsHJ+oSjaFnJuf8B 6p5IpWXil2gARsKf9soNV8ts4mXAHTjBDM67MlzR0CzL9r7JIb9NQgSGH 1tRJz0pbjlykJ3aNi1ZiTGqTBXRmMDWnpe8zmWja1nMxanmShFGTSmFDs Kmv6lGFcahhw5t/RWJ1qo8iuDhsrE0L/qzvzzmD/BNrfm0REJU1ui78gx Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10841"; a="447492240" X-IronPort-AV: E=Sophos;i="6.03,171,1694761200"; d="scan'208";a="447492240" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2023 03:11:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10841"; a="813388148" X-IronPort-AV: E=Sophos;i="6.03,171,1694761200"; d="scan'208";a="813388148" Received: from unknown (HELO fred..) ([172.25.112.68]) by fmsmga008.fm.intel.com with ESMTP; 23 Sep 2023 03:11:42 -0700 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 Subject: [PATCH v11 14/37] x86/cpu: Add MSR numbers for FRED configuration Date: Sat, 23 Sep 2023 02:41:49 -0700 Message-Id: <20230923094212.26520-15-xin3.li@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230923094212.26520-1-xin3.li@intel.com> References: <20230923094212.26520-1-xin3.li@intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=2.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Sat, 23 Sep 2023 03:14:49 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777878997738695163 X-GMAIL-MSGID: 1777878997738695163 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 6a6b0f763f67..200d7715696d 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 a00a53e15ab7..fc75e3ca47d9 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)