From patchwork Fri Mar 10 16:02:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 13169493 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 084DFC64EC4 for ; Fri, 10 Mar 2023 16:03:15 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.508516.783222 (Exim 4.92) (envelope-from ) id 1pafCl-0000T0-EF; Fri, 10 Mar 2023 16:02:51 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 508516.783222; Fri, 10 Mar 2023 16:02:51 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pafCl-0000St-At; Fri, 10 Mar 2023 16:02:51 +0000 Received: by outflank-mailman (input) for mailman id 508516; Fri, 10 Mar 2023 16:02:49 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pafCj-0000Sh-Ll for xen-devel@lists.xenproject.org; Fri, 10 Mar 2023 16:02:49 +0000 Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com [216.71.145.142]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id fed5350f-bf5c-11ed-87f5-c1b5be75604c; Fri, 10 Mar 2023 17:02:47 +0100 (CET) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: fed5350f-bf5c-11ed-87f5-c1b5be75604c DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1678464167; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=t7ZnuhxowthQSOedJI0xzWN9tQ92btCp9YOyVVCtXMo=; b=fCtHkkmIhfJaSkZZQslE8GT3KQ6iVOXOddtP3kQkNm2SfTFJkh3UKpSP h+NfvvY7SdI3jRzIsnNm37vTvWZ1Us3Rmi8fdd5q2L1CgWPPKUP18J/z6 SfgH+upAKqdqWAb4hNvjZf9EdkDzN4/BQF7Q/ed0Wj8ROzC6zDfYY3Lq5 A=; Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 4.0 X-MesageID: 100753228 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.123 X-Policy: $RELAYED IronPort-Data: A9a23:8Shg0a+qJHBqtrwR2yzQDrUDln6TJUtcMsCJ2f8bNWPcYEJGY0x3n zEXXmiDOquPY2Twc4p0Ptu/oBxTvMLdz9VjGVFl/ig8E34SpcT7XtnIdU2Y0wF+jCHgZBk+s 5hBMImowOQcFCK0SsKFa+C5xZVE/fjUAOG6UKicYXoZqTZMEE8JkQhkl/MynrlmiN24BxLlk d7pqojUNUTNNwRcawr40Ire7kI/1BjOkGlA5AdmPqkT5AW2e0Q9V/rzG4ngdxMUfaEMdgKKb 76r5K20+Grf4yAsBruN+losWhRXKlJ6FVHmZkt+A8BOsDAbzsAB+v9T2M4nQVVWk120c+VZk 72hg3ASpTABZcUgkMxFO/VR/roX0aduoNcrKlDn2SCfItGvn9IBDJyCAWlvVbD09NqbDklc/ sI/ARQTNiygrMmInZuxTsRxwc0seZyD0IM34hmMzBncBPciB5vCX7/L9ZlT2zJYasJmRKiEI ZBDMHw2MUqGOkcUUrsUIMtWcOOAr3/zaTBH7nmSorI6+TP7xw1tyrn9dtHSf7RmQO0Mxh7H+ zmcpTSR7hcyDuyu5B/UqWuQidDItg35A9wYMb3l36s/6LGU7jNKU0BHPbehmtGmjmauVtQZL FYbkgI+oK53+EG1Q93VWxyjvGXCrhMaQ8BXEeAx9EeK0KW8yySzC3UATzVBQMc7r8JwTjsvv mJlhPuwW2Yp6ufMDyvAqPHN92ja1TUpwXEqdyQ6aiIh/YHfg6oYsE/mRNJODem8gYigcd3v+ AyioC87jrQVqMcE0aSn4FzK6w6RSoj1oh0dvVuOAD/8hu9tTMv8PtHztwCHhRpVBNzBJmRtq kTojCR3AAomKZiW3BKAT+wWdF1Cz6bUaWaM6bKD8nRIythMx5JBVdoNiN2dDB0zWirhRdMOS B67hO+pzMUPVEZGlIcuC25LN+wkzLL7CfPuXe3OY9xFb/BZLVHYrHo+Ox/IhD2yzCDAdJ3T3 r/BLK6R4YsyU/w7nFJauc9HuVPU+szO7TyKHs2qp/hW+bGfeGSUWd843KimN4gEAFe/iFyNq b53bpLaoyizpcWiOkE7B6ZPdwFVRZX6bLiqw/Fqmhmre1c3ST5/VqGOmtvMueVNxsxoqwsBx VnlMmcw9bY1rSGvxdmiApy7VI7SYA== IronPort-HdrOrdr: A9a23:GDCz464rF4P9ubDXZwPXwMbXdLJyesId70hD6qkRc3Bom6mj/P xG88516faZslgssRMb+exoSZPgfZq0z/cci+Qs1NyZLWrbUQWTXeRfxLqn7zr8GzDvss5xvJ 0QF5SW0eeAb2RHsQ== X-IronPort-AV: E=Sophos;i="5.98,250,1673931600"; d="scan'208";a="100753228" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Jan Beulich , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Wei Liu Subject: [PATCH 1/2] x86/spec-ctrl: Add BHI controls to userspace components Date: Fri, 10 Mar 2023 16:02:37 +0000 Message-ID: <20230310160238.1321765-2-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230310160238.1321765-1-andrew.cooper3@citrix.com> References: <20230310160238.1321765-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 This was an oversight when adding the Xen parts. Fixes: cea9ae062295 ("x86/spec-ctrl: Enumeration for new Intel BHI controls") Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- CC: Jan Beulich CC: Roger Pau Monné CC: Wei Liu --- tools/libs/light/libxl_cpuid.c | 3 +++ tools/misc/xen-cpuid.c | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c index 06b1227a2fd3..1d4e8a6b0067 100644 --- a/tools/libs/light/libxl_cpuid.c +++ b/tools/libs/light/libxl_cpuid.c @@ -240,6 +240,9 @@ int libxl_cpuid_parse_config(libxl_cpuid_policy_list *cpuid, const char* str) {"cet-sss", 0x00000007, 1, CPUID_REG_EDX, 18, 1}, {"intel-psfd", 0x00000007, 2, CPUID_REG_EDX, 0, 1}, + {"ipred-ctrl", 0x00000007, 2, CPUID_REG_EDX, 1, 1}, + {"rrsba-ctrl", 0x00000007, 2, CPUID_REG_EDX, 2, 1}, + {"bhi-ctrl", 0x00000007, 2, CPUID_REG_EDX, 4, 1}, {"mcdt-no", 0x00000007, 2, CPUID_REG_EDX, 5, 1}, {"lahfsahf", 0x80000001, NA, CPUID_REG_ECX, 0, 1}, diff --git a/tools/misc/xen-cpuid.c b/tools/misc/xen-cpuid.c index 3ab820571d8d..4f4261f4aa95 100644 --- a/tools/misc/xen-cpuid.c +++ b/tools/misc/xen-cpuid.c @@ -215,9 +215,9 @@ static const char *const str_7d1[32] = static const char *const str_7d2[32] = { - [ 0] = "intel-psfd", - - /* 4 */ [ 5] = "mcdt-no", + [ 0] = "intel-psfd", [ 1] = "ipred-ctrl", + [ 2] = "rrsba-ctrl", + [ 4] = "bhi-ctrl", [ 5] = "mcdt-no", }; static const struct { From patchwork Fri Mar 10 16:02:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 13169494 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CC349C6FA99 for ; Fri, 10 Mar 2023 16:03:16 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.508518.783242 (Exim 4.92) (envelope-from ) id 1pafCo-0000ws-1O; Fri, 10 Mar 2023 16:02:54 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 508518.783242; Fri, 10 Mar 2023 16:02:54 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pafCn-0000wh-UM; Fri, 10 Mar 2023 16:02:53 +0000 Received: by outflank-mailman (input) for mailman id 508518; Fri, 10 Mar 2023 16:02:52 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pafCm-0000Sh-E4 for xen-devel@lists.xenproject.org; Fri, 10 Mar 2023 16:02:52 +0000 Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com [216.71.145.153]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 016eb0d4-bf5d-11ed-87f5-c1b5be75604c; Fri, 10 Mar 2023 17:02:51 +0100 (CET) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 016eb0d4-bf5d-11ed-87f5-c1b5be75604c DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1678464171; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=hxDuuASBYhC3lgjPMhX5Vo2Fmk3Cotqg6TNgoc6+qJE=; b=hqj1VhyzMJNJnj2MiY+0/h2gELVNvZXxCVNt+ltukyPzYEcn50ADuNC7 HJTMHXToBN1o+MKIb6tu2x0fC80dRTn26Hs6Xc/MAZ1fXpFs2CTNbb3bz Xpd+ILgN3eHG8FkYiwHl4cVF/a3Ff4LMV1YyoEWHQzbiKkZVsB08mHNUM 0=; Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 4.0 X-MesageID: 100246595 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.156.123 X-Policy: $RELAYED IronPort-Data: A9a23:A/v9qKlc1A0J88r+9W3JEK3o5gyXJkRdPkR7XQ2eYbSJt1+Wr1Gzt xIbD2GOPqyMajCkL9ogaYTiphtS7Z7dmt41GQA5/CEzRSMWpZLJC+rCIxarNUt+DCFhoGFPt JxCN4aafKjYaleG+39B55C49SEUOZmgH+a6U6icfHgqH2eIcQ954Tp7gek1n4V0ttawBgKJq LvartbWfVSowFaYCEpNg064gE4p7aSaVA8w5ARkPqgQ5QeGzRH5MbpETU2PByqgKmVrNrbSq 9brlNmR4m7f9hExPdKp+p6TnpoiG+O60aCm0xK6aoD66vRwjnVaPpUTbZLwXXx/mTSR9+2d/ f0W3XCGpaXFCYWX8AgVe0Ew/yiTpsSq8pefSZS0mZT7I0Er7xIAahihZa07FdRwxwp5PY1B3 eQJd20KcA7Eu+2/3+qbZtYznpojIMa+aevzulk4pd3YJfMvQJSFSKTW/95Imjw3g6iiH96HO ZBfM2A2Kk2dPVsWYAx/5JEWxY9EglHWdTFCpU3Tjq0w+2XJlyR60aT3McqTcduPLSlQth/A/ jiaoTmoX3n2MvSOwjbY9yuLl9XhgH64W4IWH4fhz+Bl1Qj7Kms7V0RNCArTTeOColG6c8JSL QoT4CVGhbg/8gmnQ8fwWzW8oWWYpVgMVtxICeo45QqRjK3O7G6xJEIJUzpAY9wOr9ItSHoh0 Vrhoj/yLWUx6vvPEyvbr+rK62roYkD5MFPuewccXFRY5Mf95708hw2XbvpcT7brjtH6TGSYL y+xkAAygLAajMgu3qq9/Ezajz/EmqUlXjLZ9S2MADv7s1oRiJqNItXxtAOFtaoowJOxFAHpg ZQSpySJAAni57mpnTfFfugCFarBCx2tYGyF2g4H83XMGl2QF5+fkWJ4umwWyKRBaJxsldrVj Kj76GtsCGd7ZifCUEOOS9vZ5z4W5abhD8/5cfvfc8BDZJN8HCfeon4+Ph7Ojji2zRdw+U3aB Xt8WZzxZUv29Iw9lGbmLwvj+eVDKt8CKZP7GsmgkkXPPUu2b3+JU7YVWGZinchghJ5oVD79q o4FX+PTkkU3bQELSnWPmWLlBQxQfCdT6FGfg5A/S9Nv1SI/RTBwVKGMn+x6E2Gn9owM/tr1E riGchcw4DLCabfvc21mtlgLhGvTYKtC IronPort-HdrOrdr: A9a23:Gyi3hqN2wDsxecBcTs+jsMiBIKoaSvp037BL7SxMoHluGfBw+P rAoB1273HJYVQqOE3I6OrgBEDoexq1n/NICOIqTNSftWfdyQ6VBbAnwYz+wyDxXw3Sn9QtsZ uIqpIOauHNMQ== X-IronPort-AV: E=Sophos;i="5.98,250,1673931600"; d="scan'208";a="100246595" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Jan Beulich , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Wei Liu Subject: [PATCH 2/2] x86/spec-ctrl: Enumerations for DDP controls Date: Fri, 10 Mar 2023 16:02:38 +0000 Message-ID: <20230310160238.1321765-3-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230310160238.1321765-1-andrew.cooper3@citrix.com> References: <20230310160238.1321765-1-andrew.cooper3@citrix.com> MIME-Version: 1.0 https://www.intel.com/content/www/us/en/developer/articles/technical/software-security-guidance/technical-documentation/data-dependent-prefetcher.html Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich --- CC: Jan Beulich CC: Roger Pau Monné CC: Wei Liu --- tools/libs/light/libxl_cpuid.c | 1 + tools/misc/xen-cpuid.c | 2 +- xen/arch/x86/include/asm/msr-index.h | 1 + xen/include/public/arch-x86/cpufeatureset.h | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/libs/light/libxl_cpuid.c b/tools/libs/light/libxl_cpuid.c index 1d4e8a6b0067..968635981086 100644 --- a/tools/libs/light/libxl_cpuid.c +++ b/tools/libs/light/libxl_cpuid.c @@ -242,6 +242,7 @@ int libxl_cpuid_parse_config(libxl_cpuid_policy_list *cpuid, const char* str) {"intel-psfd", 0x00000007, 2, CPUID_REG_EDX, 0, 1}, {"ipred-ctrl", 0x00000007, 2, CPUID_REG_EDX, 1, 1}, {"rrsba-ctrl", 0x00000007, 2, CPUID_REG_EDX, 2, 1}, + {"ddp-ctrl", 0x00000007, 2, CPUID_REG_EDX, 3, 1}, {"bhi-ctrl", 0x00000007, 2, CPUID_REG_EDX, 4, 1}, {"mcdt-no", 0x00000007, 2, CPUID_REG_EDX, 5, 1}, diff --git a/tools/misc/xen-cpuid.c b/tools/misc/xen-cpuid.c index 4f4261f4aa95..868054ab96a6 100644 --- a/tools/misc/xen-cpuid.c +++ b/tools/misc/xen-cpuid.c @@ -216,7 +216,7 @@ static const char *const str_7d1[32] = static const char *const str_7d2[32] = { [ 0] = "intel-psfd", [ 1] = "ipred-ctrl", - [ 2] = "rrsba-ctrl", + [ 2] = "rrsba-ctrl", [ 3] = "ddp-ctrl", [ 4] = "bhi-ctrl", [ 5] = "mcdt-no", }; diff --git a/xen/arch/x86/include/asm/msr-index.h b/xen/arch/x86/include/asm/msr-index.h index 7615d8087f46..4e90b361eb08 100644 --- a/xen/arch/x86/include/asm/msr-index.h +++ b/xen/arch/x86/include/asm/msr-index.h @@ -41,6 +41,7 @@ #define SPEC_CTRL_RRSBA_DIS_U (_AC(1, ULL) << 5) #define SPEC_CTRL_RRSBA_DIS_S (_AC(1, ULL) << 6) #define SPEC_CTRL_PSFD (_AC(1, ULL) << 7) +#define SPEC_CTRL_DDPU_D (_AC(1, ULL) << 8) #define SPEC_CTRL_BHI_DIS_S (_AC(1, ULL) << 10) #define MSR_PRED_CMD 0x00000049 diff --git a/xen/include/public/arch-x86/cpufeatureset.h b/xen/include/public/arch-x86/cpufeatureset.h index 336744b47119..4976a27690af 100644 --- a/xen/include/public/arch-x86/cpufeatureset.h +++ b/xen/include/public/arch-x86/cpufeatureset.h @@ -295,6 +295,7 @@ XEN_CPUFEATURE(INTEL_PSFD, 13*32+ 0) /*A MSR_SPEC_CTRL.PSFD */ XEN_CPUFEATURE(IPRED_CTRL, 13*32+ 1) /* MSR_SPEC_CTRL.IPRED_DIS_* */ XEN_CPUFEATURE(RRSBA_CTRL, 13*32+ 2) /* MSR_SPEC_CTRL.RRSBA_DIS_* */ XEN_CPUFEATURE(BHI_CTRL, 13*32+ 4) /* MSR_SPEC_CTRL.BHI_DIS_S */ +XEN_CPUFEATURE(DDP_CTRL, 13*32+ 3) /* MSR_SPEC_CTRL.DDPU_U */ XEN_CPUFEATURE(MCDT_NO, 13*32+ 5) /*A MCDT_NO */ /* Intel-defined CPU features, CPUID level 0x00000007:1.ecx, word 14 */