From patchwork Fri Nov 4 14:22:34 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: 13032070 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 55AECC4332F for ; Fri, 4 Nov 2022 14:23:32 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.437603.692039 (Exim 4.92) (envelope-from ) id 1oqxbJ-0003se-6o; Fri, 04 Nov 2022 14:23:17 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 437603.692039; Fri, 04 Nov 2022 14:23:17 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oqxbJ-0003sX-3g; Fri, 04 Nov 2022 14:23:17 +0000 Received: by outflank-mailman (input) for mailman id 437603; Fri, 04 Nov 2022 14:23:15 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1oqxbH-0003sR-MS for xen-devel@lists.xenproject.org; Fri, 04 Nov 2022 14:23:15 +0000 Received: from esa3.hc3370-68.iphmx.com (esa3.hc3370-68.iphmx.com [216.71.145.155]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 363ca381-5c4c-11ed-8fd1-01056ac49cbb; Fri, 04 Nov 2022 15:23:13 +0100 (CET) Received: from mail-mw2nam12lp2040.outbound.protection.outlook.com (HELO NAM12-MW2-obe.outbound.protection.outlook.com) ([104.47.66.40]) by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 04 Nov 2022 10:23:10 -0400 Received: from SJ0PR03MB6360.namprd03.prod.outlook.com (2603:10b6:a03:395::11) by SA1PR03MB6515.namprd03.prod.outlook.com (2603:10b6:806:1c6::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.22; Fri, 4 Nov 2022 14:23:08 +0000 Received: from SJ0PR03MB6360.namprd03.prod.outlook.com ([fe80::d197:992c:4dca:3c4c]) by SJ0PR03MB6360.namprd03.prod.outlook.com ([fe80::d197:992c:4dca:3c4c%6]) with mapi id 15.20.5791.022; Fri, 4 Nov 2022 14:23:08 +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: 363ca381-5c4c-11ed-8fd1-01056ac49cbb DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1667571793; h=from:to:cc:subject:date:message-id:in-reply-to: references:content-transfer-encoding:mime-version; bh=jm+WktHEAe9juee6Ae1iGK2iCs5BKtmxCfe43jNjjjk=; b=UQcerZNo6WY0+B9bsfwmSybO7QmU84vNPmAeNE+kEJ61n89NneMyHWnw oAwxUkMKVvmTgYUXXcLFdQm4V8FwuNTKLTxJqLddwi0tLu9Gq4YHoRYjf ysTquQIO58K2bOO34Ji5tMHWHwh3F6RmaO/NPN6O4cFLhr/0ICqjKIMh2 I=; X-IronPort-RemoteIP: 104.47.66.40 X-IronPort-MID: 84179917 X-IronPort-Reputation: None X-IronPort-Listener: OutboundMail X-IronPort-SenderGroup: RELAY_O365 X-IronPort-MailFlowPolicy: $RELAYED IronPort-Data: A9a23:RTebxKqioU2uG/e2fNBGV52O0iVeBmLeZBIvgKrLsJaIsI4StFCzt garIBnVPveNajamf9h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dHRYo5CSHkDvtsdfBYlCl9yZbdwkK7aYp8G DDnQC8zqK/s8ujwhuZ82PI9ZxZlPbo19MGLs2Rjco+LCnql2+TFc1ccozHmApwjPCk6V4snt WJixA8P/5r43eURW2xqQuF4XiU7B8er1vZjXOIi3rqpsL0ABggDdBauI5fehzFr2I9odBVys twri6knqsSKSmFsDX25tDOWR0vvFGzu2AenekaiGEaeZcCaYVWsZcU8CpuYdo99RrBmc4a+d RVfYDhDK48SyLbU5mZhBgk/DWUZAV9Iv/cKXJy+fB80FBt7QJEJgUjtY4id0w7heIAoql/lp r525tT5cBzp7ctHMRA7cc6ML+K4z/2MGXxGVPXB2jbP4c6HF+Ig6LLwdwOlZKXkdozvdAPpK g= X-IronPort-AV: E=Sophos;i="5.96,137,1665460800"; d="scan'208";a="84179917" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Cv/VklMqqYlPnlXnYlapC0c6Rb29DQltCHqSyCvklvOdd2FCpUgOyg6NrUff4MMBTTjD27O/q9+L9MkXNd5fewFnNKYZWFZ1ICSulA2jlTggSGzTLB1C+1IaPisQDTwam+4VswxThfwff2bbIftIbbdkg3eHx5W4F1RUX2ZsIeX4i+lbTwWiY9EZjDXGQTQXT8bYG/EBmeE8a3W1vsyjMhLzuGCC80fKc6ydPjpQScSIqTjT80keESsBhyWL2rCJDzzx4EO5axcoekKvJz3yI91TRI+vSC+QODVShfoTgk5eNDWQ30hLzBlOcTEVWroF/TEq6pnZupAb/hP4MK1gKQ== 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=5+aUh139xPDENw+O/ZnONlv8URjchfq7wyKCH+pV9NQ=; b=REZX6Luv5sNr9HiUUvOto8ffkmCCNSOuv15OI+5KSbhjRhVoPeci4UZkMRdxm1qiWyKj2KIv90Cy/JcpXmDZR2qnHxyxoJBXaKbNOYYHCCjjjPZUYWGoVoB3k8YTnhGiNYVwh7g7PlBJOKhtVME+lmu0tU/EQ7BtA0xgX8E3yT1UjwtFrS0fIU9p7lgKzqJOwD2FBeXYn/WDMQDroJFNPUvtDHSneQKsgDk+vV+t98TP7I89uIJk5KdCxQZ4+Hq9R2uKRgYehL+4UZ5fgThgJiDft861FGw+q5WsMSiF0cPk6yC23ZJB3mOquqT0+XWmT/e5qK2pNiZDYZa34Z0CvA== 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=5+aUh139xPDENw+O/ZnONlv8URjchfq7wyKCH+pV9NQ=; b=SxAWIWRFBxLHn/hMfwwrifzAueEAhcdhIhlqwgcBpW1BxaiUyCI8Uqe1wYHJ3mxEYYH7RpyenJx0qXboJ5r4N0QHnfGv8y4ilSPuwpgMf/91gaumbpim7jOPsyHdv5fRBaF0ehAc2OmpyUxU9QsF+5u1FiUj1kV9UVed3VZy24Q= 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 , Paul Durrant , Wei Liu , Jan Beulich , Andrew Cooper Subject: [PATCH for-4.17 1/2] viridian: suggest MSR APIC accesses if MSR accesses are accelerated Date: Fri, 4 Nov 2022 15:22:34 +0100 Message-Id: <20221104142235.36556-2-roger.pau@citrix.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221104142235.36556-1-roger.pau@citrix.com> References: <20221104142235.36556-1-roger.pau@citrix.com> X-ClientProxiedBy: LO2P265CA0391.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:f::19) To SJ0PR03MB6360.namprd03.prod.outlook.com (2603:10b6:a03:395::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR03MB6360:EE_|SA1PR03MB6515:EE_ X-MS-Office365-Filtering-Correlation-Id: 1588a87b-915b-4e25-1e52-08dabe70187a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AVy9LN+tpdd7yVe7pwZzWUQzuh/H2ZbpXbgKDJeYkhbnranbLJ2R0fMjkV4yOQu38Z3wZ+iYShlIsQ186vhE91cLXRxCDN2VzgDqCjNnuTARY6FbMK0jE6kiYmU8TK50VdE+Q5ver1zdkn1V550j/069OmeIqUtyCd/1SioV7ZJtjUxifsIcycCHULJ2Jj93MdgR5nKhCw5TZXRqKWasYBCkUD0GVhRfH1/dJ8Yrx77RQssrG9S7MtGPS7a/l5O24krghE3DJmig7hq6oXh2GvfBnxTYqL8tpWFOBzT1MRwgGiHdEm0ztrSP/A+/w0IBgIXWIbBW1fxqPndh3N6EgjG81GhEDoMicZCsFRrZBPHHkNDhEH00ZtJEOs894Z3xjGXzsLeWOKJbeWx2ynef2Mutp8h+Lwe9ZrZOO7N7lFWiBY/cXQgJAxsb6YbsSk3CfXctsOKRbbdkPsQN3++j9+FDdoLJJrFIIhysTwjB723RN9Jh/MH1eG7WCVAoU6IOVGnIxT3v8LyBMdEIDNJjgvCZgk57xaCyxKEKO4r2+fD3strKMTEqOx2wV/NI7zelw4AsiMjOEd2+7AHxlz2FdJKqVOYt5SL+r86/mEK3OiX9wG15LSaggS6UKLS+uYMpHL/fUd6CPXzBFdJi25xXRRGf0aQBDWbcHVtPOMiRfHvP42kObVPOx2gkOfdEnP1gql8CTu3ilX36r4rgZ4kz/g== 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)(39860400002)(346002)(376002)(396003)(136003)(366004)(451199015)(5660300002)(82960400001)(38100700002)(66476007)(66556008)(66946007)(4326008)(316002)(8676002)(8936002)(54906003)(6916009)(41300700001)(36756003)(2906002)(6506007)(26005)(6512007)(6666004)(186003)(107886003)(478600001)(6486002)(2616005)(83380400001)(1076003)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?BRd2398ByVs7KsfOD1BBKprUXeFa?= =?utf-8?q?3/fLanq6RvW/pE6bZQbKublJXebOinK9skWDhDVWM8OyUg2RYnT9muRkhjbA19lai?= =?utf-8?q?iMIyvRtYcxTLITzJFx3vdOO6DPo9BgRND/lhJLRDcBaWV7lmh4FG6r7rtK2mwrFRI?= =?utf-8?q?MZWW92tTRSQzVaPD5pYzs2bm2qA4vCQjh5ReRNQ2tKaqEbh6oaFCSnb6lpHlw+ZKL?= =?utf-8?q?h0Ze/sqkO+JfnHSZQwPNpGCG7DTfAVkGDIh4UsPnMLG8z7k7sb9ME6zRxYRfj56tX?= =?utf-8?q?zZ4J+mbg8UyHvpF5YH9PXLPjK+pHIA+OIA7TsssP4oxNT/EsqbIbRNPyQ80dFVhIR?= =?utf-8?q?p5q5upB1sTkfigs9rxrr7RPiithrdKHAR6xfbXOwoDAoi/amWkeyOCrnslhX4OFRq?= =?utf-8?q?jdlzqzDLoNxM6UawnX8cwJTztubWksNlBfnzr+KmXhdA0bKpQwrO1dAplAk1YGjNF?= =?utf-8?q?cTtXKIA7F2ANFuMfb2iXIFDUaAQSzJefdNC5sqr2QOCUF6WLzBO/lOQBOkkTvBTAh?= =?utf-8?q?1fKy6nYeRKvAz/dQVUrrlu2sS7zszQ4Ks6GBhmRiE86BTr/AdJ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E7R20k2lf9cfao9buylDR1ifEZw?= =?utf-8?q?IkyjtFAuK83bXYGYID27KKILuvbWG+9OKzwU1dJuujxPnEgbn6t+GfJZ2iOheJljf?= =?utf-8?q?w1iSU6K9xZMk?= X-OriginatorOrg: citrix.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1588a87b-915b-4e25-1e52-08dabe70187a X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6360.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Nov 2022 14:23:08.5117 (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: o2VKVCJuZD6aol+imHZt1vcZtKfz/3DPLKPRYuRHN0jrlQCa9U3Ic2AT5ATNlumsIdoKkN372eEr2U01wqcu5A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR03MB6515 The "APIC register virtualization" Intel hardware feature applies to both MMIO or MSR APIC accesses depending on whether "virtualize x2APIC mode" is also available. As such also suggest MSR APIC accesses if both "APIC register virtualization" and "virtualize x2APIC mode" features are available. Fixes: 7f2e992b82 ('VMX/Viridian: suppress MSR-based APIC suggestion when having APIC-V') Signed-off-by: Roger Pau Monné --- xen/arch/x86/hvm/viridian/viridian.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/hvm/viridian/viridian.c b/xen/arch/x86/hvm/viridian/viridian.c index 25dca93e8b..c4fa0a8b32 100644 --- a/xen/arch/x86/hvm/viridian/viridian.c +++ b/xen/arch/x86/hvm/viridian/viridian.c @@ -197,7 +197,11 @@ void cpuid_viridian_leaves(const struct vcpu *v, uint32_t leaf, res->a = CPUID4A_RELAX_TIMER_INT; if ( viridian_feature_mask(d) & HVMPV_hcall_remote_tlb_flush ) res->a |= CPUID4A_HCALL_REMOTE_TLB_FLUSH; - if ( !cpu_has_vmx_apic_reg_virt ) + /* + * Suggest x2APIC mode by default, unless xAPIC registers are hardware + * virtualized and x2APIC ones aren't. + */ + if ( !cpu_has_vmx_apic_reg_virt || cpu_has_vmx_virtualize_x2apic_mode ) res->a |= CPUID4A_MSR_BASED_APIC; if ( viridian_feature_mask(d) & HVMPV_hcall_ipi ) res->a |= CPUID4A_SYNTHETIC_CLUSTER_IPI;