From patchwork Tue Oct 11 16:02:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 13004132 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 C9616C4332F for ; Tue, 11 Oct 2022 16:04:42 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.420396.665217 (Exim 4.92) (envelope-from ) id 1oiHk2-0000eg-Pm; Tue, 11 Oct 2022 16:04:26 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 420396.665217; Tue, 11 Oct 2022 16:04:26 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oiHk2-0000eZ-Mo; Tue, 11 Oct 2022 16:04:26 +0000 Received: by outflank-mailman (input) for mailman id 420396; Tue, 11 Oct 2022 16:04:25 +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 1oiHk1-0000OR-AA for xen-devel@lists.xenproject.org; Tue, 11 Oct 2022 16:04:25 +0000 Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com [216.71.145.155]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 5f97b421-497e-11ed-91b4-6bf2151ebd3b; Tue, 11 Oct 2022 18:04:24 +0200 (CEST) Received: from mail-mw2nam12lp2047.outbound.protection.outlook.com (HELO NAM12-MW2-obe.outbound.protection.outlook.com) ([104.47.66.47]) by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 11 Oct 2022 12:04:19 -0400 Received: from SJ0PR03MB6360.namprd03.prod.outlook.com (2603:10b6:a03:395::11) by SA2PR03MB5769.namprd03.prod.outlook.com (2603:10b6:806:11b::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5709.21; Tue, 11 Oct 2022 16:04:17 +0000 Received: from SJ0PR03MB6360.namprd03.prod.outlook.com ([fe80::861e:b46c:1acc:c576]) by SJ0PR03MB6360.namprd03.prod.outlook.com ([fe80::861e:b46c:1acc:c576%6]) with mapi id 15.20.5709.015; Tue, 11 Oct 2022 16:04:17 +0000 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: 5f97b421-497e-11ed-91b4-6bf2151ebd3b DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1665504263; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=YWW/0Xrlj8OlYzjx1jxvYy8p0hZwDkcqnamKCBlqojA=; b=DtHcXWp9qbJ4i8VWcpWbuhJ3CkpiVC6cEy0IND0Lks9C74wvKT46KOnI +eSehz1U9UNETdGktCPoZlXPbkDyQjD4KYJvKE6JmaRQrAn9aKV6bqURp 24CVLavBQr3KpWlsBEAixoJA9yc6NdzzjaxlJFDVTYwu1XfvB56RyS+2Q 8=; X-IronPort-RemoteIP: 104.47.66.47 X-IronPort-MID: 82474351 X-IronPort-Reputation: None X-IronPort-Listener: OutboundMail X-IronPort-SenderGroup: RELAY_O365 X-IronPort-MailFlowPolicy: $RELAYED IronPort-Data: A9a23:7yxDPq8h2ZPxOQNCn9ltDrUDXH+TJUtcMsCJ2f8bNWPcYEJGY0x3z WsZDz/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AKP+tOKL Osou584xawc3Ueacq2QlEDQuj4vtXO0LbrewQPCRIL4BSHyWrA0s+zLzGomjMlFx9fy7Yr9m bI1yT/+6WYqvm+jjvRzXXa4Zh6kMbojvFDGMuPoM4ILSiEsHfgWK1RH5m5+BwlquCm71gn1P HKvhcbJsx2r0jce2mkyCGdrjXI4XIL0TvP2FWYiXzsrYjSXzQhEfdMgopfb1/w91cglMsU6t MG40up875sST/QliX04NbFEztwkFCvnHYkmekPy1RCTIolbqNLp4B3xjIZLH45JlO11GkbKp guMCmFj8wmMW9yLkqp9FWH+ebcEUjaRXy9Mws/Us/86UkloJk29Tpb+CUlpAZxyHsMceg72w 36CNUYqFg3dL5xUUtcPpZ0fSLlMB27fTv8dESvHH/AKIYrf1rwlr+f2sRH2AjtQu1C8KcP X-IronPort-AV: E=Sophos;i="5.95,176,1661832000"; d="scan'208";a="82474351" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TeDUgGnB8XTBbP69vb3BIC1dzbzDYtxHgoL4S1mN9UlGc/lEnzAtn4doGh6VC2Lnal4P2h6J2M6PAuRXAu1LP/R9TZzInqDMTN9GExJbKx2k/VXXR3R8UEUCY75kAecHXB2SQsYec90WOcdyYthHR+9oQVa0AHcfagFjMuxPi1n976Yj/aOmg/pbiUDZ2utZs8ZK1thj++tRrzqLfCVimzsEZaAxtXez2M4rTASGfTK4WkxMi7/yuPJ680dn+UySvEfeitUcYEeWn/iQ1mPyeFdm8hRlUEgU94LbTgV4fny5LFq+5zC2TwSl/0uEGxkcGqhvj6A+qEGSKSWgDdoRDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=GhLgI3FpRIlKsmCjqXjQcTnIcwm7M2jzmcvE579jJOA=; b=EtFVO7BguQJ3On4g4QpF6cHrAO+tRZ9hsG75hL2sKggdOSy6w6LoBr6WrkL4Im0DcDdPDX3eVEbj06HoXXiz9YAx55ki/ej4Syc1DvebwwtO9twLYQOQ+AMARsPcGOo9Qvv8L6WmKd56iDiw+/AbnpyL17350w+uaxCznIZMObqcx1iF81qYGJCYAHq7V2ng734IayrQrH02aHB+sRNixUijbI0eMEPDx+6eIQ+tR0WwOl3kbqGW6B+OFN7ktZI3zFLbX4D8jkFKX/9O8Peh4tppYCpV/+9trGOfr4uqHdm8TlUc1EtEmKCFp/nRZzevNAKU4SxETlMlnt5Arjb84A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GhLgI3FpRIlKsmCjqXjQcTnIcwm7M2jzmcvE579jJOA=; b=vDhqzRF+ptG8yU2KHVU4JtLIat+gkDN1pnuD1w29iqT4ryh+oIIZ7XQxFQ8bGTZf7UL93QGhgeO3hpXFcSJdpny4lh2TllP+xueolY50EhyPWnk8NHgPHND0oTDBXU1ZtwbaDYzb1lCxO2wjnIlW0Lz4lsv1bkeHpAo7sSx1rQE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com; From: Roger Pau Monne To: xen-devel@lists.xenproject.org Cc: Henry.Wang@arm.com, Roger Pau Monne , Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu Subject: [PATCH for-4.17 3/4] amd/ssbd: remove hypervisor SSBD selection Date: Tue, 11 Oct 2022 18:02:44 +0200 Message-Id: <20221011160245.56735-4-roger.pau@citrix.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221011160245.56735-1-roger.pau@citrix.com> References: <20221011160245.56735-1-roger.pau@citrix.com> X-ClientProxiedBy: LO4P265CA0261.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:37c::14) To SJ0PR03MB6360.namprd03.prod.outlook.com (2603:10b6:a03:395::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR03MB6360:EE_|SA2PR03MB5769:EE_ X-MS-Office365-Filtering-Correlation-Id: 00d5132a-58c0-4eff-dc80-08daaba23ffd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4aGoRbXIkMB6zPLVpCjkgMacndO6pA1BaopHEgxfGeTz2s0i4Ikkh+ott9OHrlMG1V7EQM+vYM8juHsSZSmeQjGq3zHfDgeCX2ZZVm8alg2dbLMRanJLQHhYO8fX3+s6PyKkxg3weuNzHC2gUp6TG46kc6uDZvshEv7VZl9+JqpF0rHJGL/QnJKjLclDTAAmhPM088o6qT7bVLjIerlJxYm880uTtCmSdU02tj9fxpdbJTJOm9C/Gd3n8g/OKt/vdDpRsap16WjvZk9tDpcAx/2A8oHJL1ifMlY7BwlkOUUdcHytbG7vFN/csX5vwBb1NU8rPJc5WnjSyFOL0CITElDJKByBqAdXm8Jl4zIgAQmSAtxZ7AKxKKs7FGOzQD4ZCdLOQObAzCGslJiYPjXQmzZigAkE8C9zL1uCk+ZrvIF6Jmcis/8yNFhs7EVgzk1mKiFBclf4HiTAi9WtFxpdZEpQAUsGPUNIYwtXQCURjhueT3QfxWwgfDJ4yPflPHt4k+9mCl5UtMM1HvxoH+1QpZFpLKq/sumaAqHH68plMKIB4SnOY3LmEF78q9LMzpQoxVmUFyiOeDg3j1vIh6tCAHnUHsx003FVhRxYMwPWEloKIAa4PDSswdrOZft1jgB4/oPmx7UkZUYFTa9NHrcUfRujVYFHcOeEj5nzwJvRib/SjpaUE+GGKHGG40X2wNqWc4VWZPeiGIwy8tvKKO4ZPg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6360.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(346002)(136003)(376002)(396003)(366004)(39860400002)(451199015)(36756003)(86362001)(83380400001)(5660300002)(38100700002)(82960400001)(2616005)(186003)(1076003)(6512007)(6506007)(6486002)(6666004)(26005)(478600001)(54906003)(6916009)(8676002)(66946007)(66556008)(66476007)(316002)(8936002)(41300700001)(2906002)(4326008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?kwVo+gaDC9KmBXq+WuLmZ6FxBQac?= =?utf-8?q?TzZzqnz2fCAwnvB/80fFM8NlEW2uCkm/yh2WYg6QtiTO6zrKmGQNjMoqZKQ5YbaRE?= =?utf-8?q?eD8G1qGkAq024tyepy92ONrETb5UdTX0xrHLnsxx3b6J+v6aJfWMVZTL0PHNidEq5?= =?utf-8?q?nZ2RcAlAtXfjxDi2Py6v2WQvJjiQ/THMRVzCjKl/wAdwMXynEgd7yLnVtlh7xb/lE?= =?utf-8?q?SNYbP+Q5s1tJpDudxsx+1fZMhuETVgl7+WfEwSZVt1hKteGEFoNrB0YKh5GK2nD8q?= =?utf-8?q?vwh95xuGhV1iAyQU4uEj/pBBzTH39kSVBdOvYp5zpfr4NPpnEB1BsWID3jTonXcGG?= =?utf-8?q?g/dWJbz113O9mDHcTxnk30vKRvhu/uilCzDu1/zi5oIozqvgwIkRF/4AFndbJzZ+m?= =?utf-8?q?vxUE8ehVhdybY22tLJ3E+6zEURZuObJsJdv9wEljORMaZ6LxCMvLWqOSLVY+d5M9t?= =?utf-8?q?IHKcIN7dRusNRkG9tON5Wf3ZbglcIxBUwRMxtjfh97mV8wD/3m3jhxaC+uPOZe/bY?= =?utf-8?q?ZRY60z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XvMF+IwO9m0gSnUYfGUcnkHCyXnzMEz8t5cVOu?= =?utf-8?q?8ydhDrqb2HQi7WP2qUYD3FEGgOBDTcYZTH+lTilseUzyZwWWXxwC571BS+vz7+ncQ?= =?utf-8?q?N8EIpHNIxbSy?= X-OriginatorOrg: citrix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 00d5132a-58c0-4eff-dc80-08daaba23ffd X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6360.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2022 16:04:17.6139 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: vUN3AgUwxdSS3W0vPZJeByMrSGUqtdg7JMAdV5iqcdhYMFE7sxveIANUqKswa8kkbkbdZ6Fn5q7dF7Nd4gc34g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR03MB5769 Like on Intel AMD guests are now capable of setting SSBD on their own, either from SPEC_CTRL or from VIRT_SPEC_CTRL. As a result the unconditional setting of SSBD from Xen in order to cope with the bit not being exposed to guests is no longer needed. Remove the Xen command line `spec-ctrl=ssbd` option and related settings. Signed-off-by: Roger Pau Monné --- docs/misc/xen-command-line.pandoc | 8 +------- xen/arch/x86/cpu/amd.c | 11 ++++------- xen/arch/x86/include/asm/spec_ctrl.h | 1 - xen/arch/x86/spec_ctrl.c | 19 +------------------ 4 files changed, 6 insertions(+), 33 deletions(-) diff --git a/docs/misc/xen-command-line.pandoc b/docs/misc/xen-command-line.pandoc index 68389843b2..f2666b881a 100644 --- a/docs/misc/xen-command-line.pandoc +++ b/docs/misc/xen-command-line.pandoc @@ -2297,7 +2297,7 @@ By default SSBD will be mitigated at runtime (i.e `ssbd=runtime`). ### spec-ctrl (x86) > `= List of [ , xen=, {pv,hvm}=, > {msr-sc,rsb,md-clear,ibpb-entry}=|{pv,hvm}=, -> bti-thunk=retpoline|lfence|jmp, {ibrs,ibpb,ssbd,psfd, +> bti-thunk=retpoline|lfence|jmp, {ibrs,ibpb,psfd, > eager-fpu,l1d-flush,branch-harden,srb-lock, > unpriv-mmio}= ]` @@ -2365,12 +2365,6 @@ On hardware supporting STIBP (Single Thread Indirect Branch Predictors), the By default, Xen will use STIBP when IBRS is in use (IBRS implies STIBP), and when hardware hints recommend using it as a blanket setting. -On hardware supporting SSBD (Speculative Store Bypass Disable), the `ssbd=` -option can be used to force or prevent Xen using the feature itself. On AMD -hardware, this is a global option applied at boot, and not virtualised for -guest use. On Intel hardware, the feature is virtualised for guests, -independently of Xen's choice of setting. - On hardware supporting PSFD (Predictive Store Forwarding Disable), the `psfd=` option can be used to force or prevent Xen using the feature itself. By default, Xen will not use PSFD. PSFD is implied by SSBD, and SSBD is off by diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c index c28f2d5220..cfeb8d1daf 100644 --- a/xen/arch/x86/cpu/amd.c +++ b/xen/arch/x86/cpu/amd.c @@ -730,11 +730,12 @@ void amd_init_ssbd(const struct cpuinfo_x86 *c) } if (cpu_has_virt_ssbd) { - wrmsrl(MSR_VIRT_SPEC_CTRL, opt_ssbd ? SPEC_CTRL_SSBD : 0); + /* Handled by context switch logic. */ return; } - if (!set_legacy_ssbd(c, opt_ssbd)) { + /* Test whether legacy SSBD is available. */ + if (!set_legacy_ssbd(c, 0)) { printk_once(XENLOG_ERR "No SSBD controls available\n"); if (amd_legacy_ssbd) panic("CPU feature mismatch: no legacy SSBD\n"); @@ -777,12 +778,8 @@ bool __init amd_setup_legacy_ssbd(void) if (!ssbd_ls_cfg) return false; - for (i = 0; i < ssbd_max_cores * AMD_FAM17H_MAX_SOCKETS; i++) { - /* Set initial state, applies to any (hotplug) CPU. */ - ssbd_ls_cfg[i].count = opt_ssbd ? boot_cpu_data.x86_num_siblings - : 0; + for (i = 0; i < ssbd_max_cores * AMD_FAM17H_MAX_SOCKETS; i++) spin_lock_init(&ssbd_ls_cfg[i].lock); - } return true; } diff --git a/xen/arch/x86/include/asm/spec_ctrl.h b/xen/arch/x86/include/asm/spec_ctrl.h index 9403b81dc7..ee5c7b8d54 100644 --- a/xen/arch/x86/include/asm/spec_ctrl.h +++ b/xen/arch/x86/include/asm/spec_ctrl.h @@ -66,7 +66,6 @@ void init_speculation_mitigations(void); void spec_ctrl_init_domain(struct domain *d); extern int8_t opt_ibpb_ctxt_switch; -extern bool opt_ssbd; extern int8_t opt_eager_fpu; extern int8_t opt_l1d_flush; diff --git a/xen/arch/x86/spec_ctrl.c b/xen/arch/x86/spec_ctrl.c index 0b94af6b86..dcee9795a5 100644 --- a/xen/arch/x86/spec_ctrl.c +++ b/xen/arch/x86/spec_ctrl.c @@ -56,7 +56,6 @@ static enum ind_thunk { static int8_t __initdata opt_ibrs = -1; int8_t __initdata opt_stibp = -1; -bool __ro_after_init opt_ssbd; int8_t __initdata opt_psfd = -1; int8_t __ro_after_init opt_ibpb_ctxt_switch = -1; @@ -126,7 +125,6 @@ static int __init cf_check parse_spec_ctrl(const char *s) opt_thunk = THUNK_JMP; opt_ibrs = 0; opt_ibpb_ctxt_switch = false; - opt_ssbd = false; opt_l1d_flush = 0; opt_branch_harden = false; opt_srb_lock = 0; @@ -263,8 +261,6 @@ static int __init cf_check parse_spec_ctrl(const char *s) opt_ibrs = val; else if ( (val = parse_boolean("stibp", s, ss)) >= 0 ) opt_stibp = val; - else if ( (val = parse_boolean("ssbd", s, ss)) >= 0 ) - opt_ssbd = val; else if ( (val = parse_boolean("psfd", s, ss)) >= 0 ) opt_psfd = val; @@ -471,7 +467,7 @@ static void __init print_details(enum ind_thunk thunk, uint64_t caps) "\n"); /* Settings for Xen's protection, irrespective of guests. */ - printk(" Xen settings: BTI-Thunk %s, SPEC_CTRL: %s%s%s%s%s, Other:%s%s%s%s%s\n", + printk(" Xen settings: BTI-Thunk %s, SPEC_CTRL: %s%s%s%s, Other:%s%s%s%s%s\n", thunk == THUNK_NONE ? "N/A" : thunk == THUNK_RETPOLINE ? "RETPOLINE" : thunk == THUNK_LFENCE ? "LFENCE" : @@ -482,9 +478,6 @@ static void __init print_details(enum ind_thunk thunk, uint64_t caps) (!boot_cpu_has(X86_FEATURE_STIBP) && !boot_cpu_has(X86_FEATURE_AMD_STIBP)) ? "" : (default_xen_spec_ctrl & SPEC_CTRL_STIBP) ? " STIBP+" : " STIBP-", - (!boot_cpu_has(X86_FEATURE_SSBD) && - !boot_cpu_has(X86_FEATURE_AMD_SSBD)) ? "" : - (default_xen_spec_ctrl & SPEC_CTRL_SSBD) ? " SSBD+" : " SSBD-", (!boot_cpu_has(X86_FEATURE_PSFD) && !boot_cpu_has(X86_FEATURE_INTEL_PSFD)) ? "" : (default_xen_spec_ctrl & SPEC_CTRL_PSFD) ? " PSFD+" : " PSFD-", @@ -1274,16 +1267,6 @@ void __init init_speculation_mitigations(void) boot_cpu_has(X86_FEATURE_AMD_STIBP)) ) default_xen_spec_ctrl |= SPEC_CTRL_STIBP; - if ( opt_ssbd && (boot_cpu_has(X86_FEATURE_SSBD) || - boot_cpu_has(X86_FEATURE_AMD_SSBD)) ) - { - /* SSBD implies PSFD */ - if ( opt_psfd == -1 ) - opt_psfd = 1; - - default_xen_spec_ctrl |= SPEC_CTRL_SSBD; - } - /* * Don't use PSFD by default. AMD designed the predictor to * auto-clear on privilege change. PSFD is implied by SSBD, which is