From patchwork Fri Sep 30 15:14:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Lendacky X-Patchwork-Id: 12995629 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 93591C433FE for ; Fri, 30 Sep 2022 15:15:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231441AbiI3PPC (ORCPT ); Fri, 30 Sep 2022 11:15:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231320AbiI3PPA (ORCPT ); Fri, 30 Sep 2022 11:15:00 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2043.outbound.protection.outlook.com [40.107.92.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 221CE3ECDB for ; Fri, 30 Sep 2022 08:14:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EgzLG5n5+O8vHgLpBUPf63jDwWCq61JVP3gZcHf/VWkX1RjuoQWkEuQAfuM+DO6dWS3QAxko5Y01KiobyzhpJuIJKjSlKucq/87E/YFXh7NifSxS6hjP+O9Sshmi+FcnzCdZh1mlGlfJlhX7jnTJKCfaYOast2W4PE2vC5RBn7LeYMXd3wB/1fPjRjUPAwcOrykrAz9vbj6mHWtOFfo9jCdw7Vb0HBDQg5g9X/laaQ42F+Qiy0tjeqFR/BCG4jpF5zOk30qAQwlfWdjjs1PxUnwU76AMsZXf7FBMzwO7GrfzyxFVqzjMYuUM2xmG3thFwpt71pUsJop/3GsyzEfY3w== 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=Ob/NQf5+m8reU3ape58u0Hb3iCVgbA1GXB2+QQJ/DJI=; b=ebmuXtabKIaW2ckEqKjWbRzLXXZ2b6yR7i1O5nJ8Krr53mXCOKHQDg1V/Bv9iGc1oVItMxOnwFcyLW01AVz0QjpXpNpZJSTvvBrR+htSaCs2iiiaYTG7gRUE4mA4kFhZ7bAo4yA8jvUtUVA390emUBOYbFMN4t+DxttphNxShnDjs5Z9ehtmFQ6irlChAIHRDjEfDHqvVGZYLIVIZNPpXPazp8uZ3DY3K/1ER2q+00bpCXc6ENcxXVnVG0eRu1B4IR245YSG2Sni3WUDAHvACxXgxQ0M3CfTXW6w5Ah3Ow+jbPMst43Dda8DN3BkgDewqV+tvkkw7Ae5YEoDB7gjCg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=nongnu.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ob/NQf5+m8reU3ape58u0Hb3iCVgbA1GXB2+QQJ/DJI=; b=0Z8HnISkUiOyrwsob4ZLAGwKpc2lN2/VZdYYH9TOQeGaCJaAEa6MPWj5Z/Bm7f/xckf3T8akKId5LI/5AXVGGzpy/SwOCtiFLvx0wAHJQgRIF/JE+zTpEe4tJXqd6IpJ8ojCgBfTE+lmCSUoUZ1Cl9QZ+vTh2C2tPvjNegY9ZCM= Received: from DM6PR13CA0017.namprd13.prod.outlook.com (2603:10b6:5:bc::30) by PH8PR12MB6962.namprd12.prod.outlook.com (2603:10b6:510:1bd::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.23; Fri, 30 Sep 2022 15:14:52 +0000 Received: from DM6NAM11FT071.eop-nam11.prod.protection.outlook.com (2603:10b6:5:bc:cafe::f4) by DM6PR13CA0017.outlook.office365.com (2603:10b6:5:bc::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.23 via Frontend Transport; Fri, 30 Sep 2022 15:14:52 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT071.mail.protection.outlook.com (10.13.173.48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5676.17 via Frontend Transport; Fri, 30 Sep 2022 15:14:52 +0000 Received: from tlendack-t1.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Fri, 30 Sep 2022 10:14:51 -0500 From: Tom Lendacky To: , CC: Eric Blake , Markus Armbruster , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , Marcelo Tosatti , Michael Roth Subject: [PATCH 1/4] qapi, i386/sev: Change the reduced-phys-bits value from 5 to 1 Date: Fri, 30 Sep 2022 10:14:27 -0500 Message-ID: X-Mailer: git-send-email 2.37.3 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT071:EE_|PH8PR12MB6962:EE_ X-MS-Office365-Filtering-Correlation-Id: 653afce4-19aa-4afd-9fa2-08daa2f6861b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kv/qhqGNg05tL7Tg+xzc5IEpYXI5oM3d7gcyyhoZYrBKxaktIVf28FXOtczivBctWf8B/FspM+kcix0odpyNLgpC9Q4qV9D7DCCJ7xOSoJ57ZoQyPX/440ZAjtFubdesw8zAYEhV/YGqUBIQ5Rhz7LkS1imqFC6Hb78TmamV8F5mXpLL37NP/6uI+KE3gZuNZqI9N5ldr4zErgKHI68NwviurUPWTMAvyyWvpyPkFUCPEVJQw6sWExFcK/hhyCVOpq7GdjpFYs2Srl0eS43rvQkARBDnxYp/i97K++WWsYoDCsvS09AqNUwbaKbG3kjnnuI3kemF1IRDy81/T4tZ1SV8IXm5An/ruPiX/cQF6hI+Arvd4Z/ugdzU1zAQINlVCAzs6TZnTr15LvTW8qHpt0FrJ8wWT8XBHD38n9GsJWgMs7f3720MKbBj08s3ZtKWifopkErWKSWuPUbr21UeaFddqarbk9NrqzylCPvSsGhQa2LribPQVBOB9BrYwITd2oq57EmA/r7bBK3Ypxo4Zg3AIiGb4UsR5dXfTwROJDfBWQVmJleNZ/WxvLDAAoKm7CxjTeQ8WV9CuBCm065yVI40La/ZUBypKUkA9qwng6l5sLNRHiOWuQcbj194N56DCz6ZDaWyhaVGn42De0un+3rINmCpzbzTnJ4TAuCGf23LI+tSg061E7cBmre3emlqKdMUSdZkyl0VhzdOy94CiySaQbfFGo4uaYaijb7ZlvdbadkSzNaWUE5Vie9kIqYsIWZnq0ySxTEn7enw/aLQbCvaR62jPOCDMWvk4TMn4+vgRJz+OghOBLibUzgZ4erF X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(39860400002)(396003)(346002)(376002)(136003)(451199015)(36840700001)(40470700004)(46966006)(81166007)(2616005)(356005)(82310400005)(2906002)(110136005)(54906003)(478600001)(316002)(5660300002)(40480700001)(336012)(86362001)(8936002)(26005)(40460700003)(47076005)(7696005)(4744005)(6666004)(83380400001)(186003)(82740400003)(41300700001)(16526019)(36756003)(36860700001)(70586007)(70206006)(8676002)(426003)(4326008)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2022 15:14:52.0864 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 653afce4-19aa-4afd-9fa2-08daa2f6861b X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT071.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB6962 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org A guest only ever experiences, at most, 1 bit of reduced physical addressing. Change the query-sev-capabilities json comment to use 1. Fixes: 31dd67f684 ("sev/i386: qmp: add query-sev-capabilities command") Signed-off-by: Tom Lendacky Reviewed-by: Dr. David Alan Gilbert --- qapi/misc-target.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qapi/misc-target.json b/qapi/misc-target.json index 4944c0528f..398fd09f25 100644 --- a/qapi/misc-target.json +++ b/qapi/misc-target.json @@ -172,7 +172,7 @@ # -> { "execute": "query-sev-capabilities" } # <- { "return": { "pdh": "8CCDD8DDD", "cert-chain": "888CCCDDDEE", # "cpu0-id": "2lvmGwo+...61iEinw==", -# "cbitpos": 47, "reduced-phys-bits": 5}} +# "cbitpos": 47, "reduced-phys-bits": 1}} # ## { 'command': 'query-sev-capabilities', 'returns': 'SevCapability', From patchwork Fri Sep 30 15:14:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Lendacky X-Patchwork-Id: 12995630 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4AB3C433FE for ; Fri, 30 Sep 2022 15:15:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231686AbiI3PPL (ORCPT ); Fri, 30 Sep 2022 11:15:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231643AbiI3PPJ (ORCPT ); Fri, 30 Sep 2022 11:15:09 -0400 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2081.outbound.protection.outlook.com [40.107.101.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0327A5C36D for ; Fri, 30 Sep 2022 08:15:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dyiNds36iSOtTTLRKZiXhTdhSUUroXL1nDvX/YR9NWiyNOjyUHGGcqrlWU6+tb1hT0npl1QwUcUixh9jLvGmuyLTcjH5PotOi5mFaLaU+SQTyuQ9I0NF8sl/6KIwYfN1lLSqxrrH6KPrQkqx+wWaI97HefzCO8/amb9HH87yiDgMgA3xb51z69RMMVCDYvB2RzNmgtyp1QiNbEcprDSa1+dm9FioYAXkmxguGgUJuJs/cYNQ4qSQyrfOdPPq3oS37JojGRpDB96rMDHRaQCfvqfv3sLifLMcxLMVjxe/mnzAy0MeGY2vZQnYK9jVEqyd9sYQNFhxov1DgBG3fQ/qBQ== 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=+2ayFyr87PrDNTyBkodhT+gEwPtKngFt2QVuiwrZwyw=; b=QdD0makXqIhr1YuJruL3sn7viAS7AxuESn1DmbLKGLxQSU8WgxJSzt4HBkGqFxw17DL1A2JbtgF3BNzom0EI/K1FKKQ8bzmzEhjAUPsCbXnoBR+iVmXlGHVW/y8cjGZofU4OlXiNAUGaq057VHwpBhXqB3MrfCZA5UBbmLzsH9p1Hx45s/wNOlvqAfdGeWpoNHkldfyYa7KcsWGxYF/7N2BdLiEHPwM9VNeUfDwik/kRpE/Q5UkMss4XLjHO+5+KLIqmTcalb0557gc+pwrdfTQqsQAyL27t5b14qHVD2WdHjt4HNSqSjXhjkCy3rDZdrlp8zXIPXfebkKL8vi5Xzw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=nongnu.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+2ayFyr87PrDNTyBkodhT+gEwPtKngFt2QVuiwrZwyw=; b=MsK6zS5Gdu1dKzhKUKXbVV3pimec4gW/kKDMScT/0OQC9FG7ANfz8iUwGfGK47H9zjzEKbUMweMul4dYN0PR1jz5DL17L7Rfe4kkuOQXxXguPXgeOj9f+3QcpI8bkiSXCcJq8iJx3i3/i8EGgD8XDjl1WBzTaP2tGI2dePBh+v8= Received: from DS7PR03CA0325.namprd03.prod.outlook.com (2603:10b6:8:2b::34) by SJ0PR12MB5453.namprd12.prod.outlook.com (2603:10b6:a03:37f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.23; Fri, 30 Sep 2022 15:14:59 +0000 Received: from DM6NAM11FT055.eop-nam11.prod.protection.outlook.com (2603:10b6:8:2b:cafe::b4) by DS7PR03CA0325.outlook.office365.com (2603:10b6:8:2b::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.20 via Frontend Transport; Fri, 30 Sep 2022 15:14:59 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT055.mail.protection.outlook.com (10.13.173.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5676.17 via Frontend Transport; Fri, 30 Sep 2022 15:14:59 +0000 Received: from tlendack-t1.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Fri, 30 Sep 2022 10:14:58 -0500 From: Tom Lendacky To: , CC: Eric Blake , Markus Armbruster , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , Marcelo Tosatti , Michael Roth Subject: [PATCH 2/4] qemu-options.hx: Update the reduced-phys-bits documentation Date: Fri, 30 Sep 2022 10:14:28 -0500 Message-ID: <13a62ced1808546c1d398e2025cf85f4c94ae123.1664550870.git.thomas.lendacky@amd.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT055:EE_|SJ0PR12MB5453:EE_ X-MS-Office365-Filtering-Correlation-Id: 1fe45696-0517-4ae4-5e76-08daa2f68a5e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mTtPJMU+ErVL7AthKFsPoBYOkMCmpNXx6mqpteN3DGRWLDLwEfHRm7VvQzt1/BXY7ebrVLYFmmGcdkVqnTsPOxBxdOR32rXza9+cNRiN0eWILg0SoF3fea2LPyRWVw14uvkmKthdqeH2DQHSJJz2fkXQqCC2T/Nix2x5hsOnJJpPWN1faWMpFCvhNK/2/fLBUTwnCQfMHviiTV71Um46C98UOCMXjdPNkGLZBFAQamqazAoVkJyBbeTnUcL0RrZWlJyE9NiVUXwTJ3ysUBln2v8iZ5w08wvdiB0dfumNC3A3EQE7fGbERmy+GaIkAB3MSnyIg77eCFSTs3llEENPX3dxeqBeq+Qdr5kJi2b6xmTvD+bDL319fS8ML9MbNKOiIvyNTpbY82BnIpt32phrgfrsfnFZNw57JeJZ8NTwHKzZt6zm3fmgeEzNnPX0wLgY4LJCx5Kpt0Fsj5/5jQt0nMrNf0HTdup98hXY1DiqnHwJYkDN1cY8mH9j2+Mo6iauUtzw/upImNlO5Usi3pl1F8I0J7KGNWLOsBcFZf43xMAuKGaVaXOG6SDcIaXKKvIW+qSW2tn/06qIlb2TADSKuSovlGCoVd7QAJ3tA2WqyI4bo9Pp1xkJ4X13SXVmX4RrvNWWtWynrwbzDT4lAdFgo77nRhoBEQpokXHBmg2n+OBGqqKmYMe8anh4V0KCh7g6GcvvOxr+TKH7xhNwtyciSZssEle31KLjsN/sy72Jq8EMaEEEf3i6v9H5AY62HtdqSvhlYr7uPMLwyK91ocTQgTi0A+Gx97+AxgmYNqaE5Nt3WislozuZehamufaPQQq6 X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(136003)(346002)(376002)(39860400002)(396003)(451199015)(46966006)(36840700001)(40470700004)(36756003)(54906003)(110136005)(86362001)(36860700001)(356005)(2616005)(426003)(47076005)(16526019)(186003)(81166007)(82740400003)(83380400001)(336012)(15650500001)(478600001)(26005)(6666004)(8936002)(70586007)(70206006)(8676002)(4326008)(7696005)(82310400005)(2906002)(5660300002)(41300700001)(40460700003)(316002)(40480700001)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2022 15:14:59.2347 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1fe45696-0517-4ae4-5e76-08daa2f68a5e X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT055.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB5453 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org A guest only ever experiences, at most, 1 bit of reduced physical addressing. Update the documentation to reflect this as well as change the example value on the reduced-phys-bits option. Fixes: a9b4942f48 ("target/i386: add Secure Encrypted Virtualization (SEV) object") Signed-off-by: Tom Lendacky Reviewed-by: Dr. David Alan Gilbert --- qemu-options.hx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qemu-options.hx b/qemu-options.hx index 913c71e38f..3396085cf0 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -5391,7 +5391,7 @@ SRST physical address space. The ``reduced-phys-bits`` is used to provide the number of bits we loose in physical address space. Similar to C-bit, the value is Host family dependent. On EPYC, - the value should be 5. + a guest will lose a maximum of 1 bit, so the value should be 1. The ``sev-device`` provides the device file to use for communicating with the SEV firmware running inside AMD Secure @@ -5426,7 +5426,7 @@ SRST # |qemu_system_x86| \\ ...... \\ - -object sev-guest,id=sev0,cbitpos=47,reduced-phys-bits=5 \\ + -object sev-guest,id=sev0,cbitpos=47,reduced-phys-bits=1 \\ -machine ...,memory-encryption=sev0 \\ ..... From patchwork Fri Sep 30 15:14:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Lendacky X-Patchwork-Id: 12995631 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DA86BC4332F for ; Fri, 30 Sep 2022 15:15:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231821AbiI3PPU (ORCPT ); Fri, 30 Sep 2022 11:15:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231643AbiI3PPO (ORCPT ); Fri, 30 Sep 2022 11:15:14 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2058.outbound.protection.outlook.com [40.107.220.58]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E7665A3C0 for ; Fri, 30 Sep 2022 08:15:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nO+myY2/uWiikVN+ARTXnKPDCsVErp1Exo9Ne0PdVXJFJvK6ULjeROdIXmHJ4YeA4daI8N+8esBvsz586Vqpm+NeuEeIz7/au/CEW9j/fL7B+29Rqi8JkGmtWatQCs12/DslYgNbEa+dQraVgOjTrlwyN3QhdozWKgOp+uhi4U+BuVlIXTXbEpi0GxdQvmAo+qrL+c1c21hi7+awMNXbqa4BmSlh80JJ6sY1kl+VNCPJusoQEfB2fhf0CeZkwFckMUeEnlTcgXc1cfZDWyDItGqJHDW7ii3q8PTYccID87NpvgSk0UvmuMcUASdDTXtmU5eYn1azYIZmQrvaMDvKsA== 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=vCsVCwffb2vojkLdLT9BTCms2huNYqdI8+2y//lbwbY=; b=moZX2V69RL2qD2t1deYryBr9etkEOJcOywi8ydWb15WaVYFeTzq5uErnlyhBCiosR59j6f1Uk9H8P9c2F0uVHOQnsZBrALQ4RWcyvDraZpiqgIzm1JdmNDGa4EPb0Z8MfL/OTVsDA8gi2eIgWk050BFiyh4tJouSFM2V8U64oC3eh6q79rFBysT5Hafi7cuOy2IK3ZljyW7F1saDlLTj3Jgouq0quEpC4Jukxn8rs1jTJu9So70vR5TDw3bQNezheRs3/qOrmpFSePVhA0EDie182XSNUyoWXpx4hpu/S9gIYP/+9ELIoqQYocoHbm99WKtok0LkHVyUdiMvfARj7w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=nongnu.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vCsVCwffb2vojkLdLT9BTCms2huNYqdI8+2y//lbwbY=; b=t98K73bFqzIZUNC2cQpuAYdJwv52uR07Colt21IVStujgjm1cGm8yiEbqAiv6nkfGEIB0ymY/im/nXnt860pekR+YSsUw/Yx/hzKJsKt5DTUxzPvjwQM9t77+Zw4CfQKmHWkUGOh2ndUrhm/pDLtF+ZVQcBXILUZ+GHBXuMP2xU= Received: from DS7PR07CA0021.namprd07.prod.outlook.com (2603:10b6:5:3af::23) by SN7PR12MB7203.namprd12.prod.outlook.com (2603:10b6:806:2aa::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.18; Fri, 30 Sep 2022 15:15:07 +0000 Received: from DM6NAM11FT070.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3af:cafe::97) by DS7PR07CA0021.outlook.office365.com (2603:10b6:5:3af::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.23 via Frontend Transport; Fri, 30 Sep 2022 15:15:07 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT070.mail.protection.outlook.com (10.13.173.51) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5676.17 via Frontend Transport; Fri, 30 Sep 2022 15:15:06 +0000 Received: from tlendack-t1.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Fri, 30 Sep 2022 10:15:05 -0500 From: Tom Lendacky To: , CC: Eric Blake , Markus Armbruster , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , Marcelo Tosatti , Michael Roth Subject: [PATCH 3/4] i386/sev: Update checks and information related to reduced-phys-bits Date: Fri, 30 Sep 2022 10:14:29 -0500 Message-ID: X-Mailer: git-send-email 2.37.3 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT070:EE_|SN7PR12MB7203:EE_ X-MS-Office365-Filtering-Correlation-Id: a7000f2a-de05-4b0e-7302-08daa2f68ed9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: kGRQe1oqaVmbcKrAbMDeh/iPvhuOp3wqCNFISjk9GRvLn1TkaKKHlTu89mg3sjPocLtImP5wGSAVf7vS4oGB/sT0pmdjSXiatFozFB49cCdjpjm530vkaKSLOV4JlnZHBj6YLAQsT/cyZ6yraMtws1/vNhTVRswa4dneJPmnIFLP0/640AC+Fe5lV7Uvij35JSunHUd1z2nYxl63Kqn0INEeyNuhLGUteGzVD6pB6a4ULGdvw6GfmUc2j8g971G1aC2uiz4v2LZLp7HV+rP/A8r+Yd14mqdhj3o9WZner3VKLta7Hho9zjc+lvl3n1tCSRhx4aeQIoH+CJf118DGwqZqFmhqwM6muMjqbT9WLGXVXdbSMrLbjo9z26b+72d//nNNiPXdibXSsJmD33GBKLnXRawIvLKSqV690C31i0fLnhF81EO6bETbBshfm5RzuNusvn17Sq00vAfM/ubSrRLjdL1K8lys3ZOTDM5LJKtgGVdakbmrp6YwcHeo3Z3zaSkE5jGLlWKwFraREY8CfxczDzxsrThhDqUXRbO7tExDx7hYUxSN2R8msuUzCFov4vj1VQRUqIKcgwf3zTUSdbELNwB1dRL1sxrutDo/jbPFWySBffBJkoq4CSq1cpozkmbA/Y7MSKvRCBbZyoR93LUQWjMM53cqRL2RF/4Yu/ow+u2E6Ju6sUVU+526D+1hNTOj/G45N2UK3+rxOIQUtyxzK1TwwnA52YIynzzsuUuJwz/AsXft//Z4vtV0l/s2ai4IzOl+/Rk8KIKoumI3QTpuWE8RilHjtktngFGJY1XNJ8CoontIcHe9R/9xnHMe X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(346002)(376002)(396003)(136003)(39860400002)(451199015)(40470700004)(46966006)(36840700001)(86362001)(81166007)(82740400003)(356005)(36756003)(426003)(8676002)(2616005)(26005)(36860700001)(40460700003)(47076005)(2906002)(8936002)(15650500001)(16526019)(83380400001)(41300700001)(186003)(4326008)(5660300002)(6666004)(70206006)(478600001)(70586007)(7696005)(82310400005)(336012)(316002)(110136005)(40480700001)(54906003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2022 15:15:06.7522 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a7000f2a-de05-4b0e-7302-08daa2f68ed9 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT070.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7203 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org The value of the reduced-phys-bits parameter is propogated to the CPUID information exposed to the guest. Update the current validation check to account for the size of the CPUID field (6-bits), ensuring the value is in the range of 1 to 63. Maintain backward compatibility, to an extent, by allowing a value greater than 1 (so that the previously documented value of 5 still works), but not allowing anything over 63. Fixes: d8575c6c02 ("sev/i386: add command to initialize the memory encryption context") Signed-off-by: Tom Lendacky Reviewed-by: Dr. David Alan Gilbert --- target/i386/sev.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/target/i386/sev.c b/target/i386/sev.c index 32f7dbac4e..78c2d37eba 100644 --- a/target/i386/sev.c +++ b/target/i386/sev.c @@ -932,15 +932,26 @@ int sev_kvm_init(ConfidentialGuestSupport *cgs, Error **errp) host_cpuid(0x8000001F, 0, NULL, &ebx, NULL, NULL); host_cbitpos = ebx & 0x3f; + /* + * The cbitpos value will be placed in bit positions 5:0 of the EBX + * register of CPUID 0x8000001F. No need to verify the range as the + * comparison against the host value accomplishes that. + */ if (host_cbitpos != sev->cbitpos) { error_setg(errp, "%s: cbitpos check failed, host '%d' requested '%d'", __func__, host_cbitpos, sev->cbitpos); goto err; } - if (sev->reduced_phys_bits < 1) { - error_setg(errp, "%s: reduced_phys_bits check failed, it should be >=1," - " requested '%d'", __func__, sev->reduced_phys_bits); + /* + * The reduced-phys-bits value will be placed in bit positions 11:6 of + * the EBX register of CPUID 0x8000001F, so verify the supplied value + * is in the range of 1 to 63. + */ + if (sev->reduced_phys_bits < 1 || sev->reduced_phys_bits > 63) { + error_setg(errp, "%s: reduced_phys_bits check failed," + " it should be in the range of 1 to 63, requested '%d'", + __func__, sev->reduced_phys_bits); goto err; } From patchwork Fri Sep 30 15:14:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Lendacky X-Patchwork-Id: 12995632 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE9CCC433FE for ; Fri, 30 Sep 2022 15:15:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231646AbiI3PPZ (ORCPT ); Fri, 30 Sep 2022 11:15:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231760AbiI3PPU (ORCPT ); Fri, 30 Sep 2022 11:15:20 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2053.outbound.protection.outlook.com [40.107.92.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0138C76474 for ; Fri, 30 Sep 2022 08:15:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Zc7WjGcOMfyaNByg2obUBAjNHrVClZeNoqh8rjq7BUPUkpP2+mtq9d4+9cvm/os/sPbwGUc1it38zCJHoENNKjWDdwak/VVyTaN/RxcZaLm3J35Kw62gYu1rmxXUxW9KgbgsE6MresXVsGh8voyEGVIZzBZ5GoeeKtGJOzuJf8cGNo9DIEL6aKZkbvW4n3UKZJFZJn9vQ7eC2Yvk/N9jT8XJL7T6uCZzJaIMVvK+C5fWWFy+9+ovX59xabZyPtp1/5nqdGlO5cVDHA8YlbR8HX1z08rCM1jXXjALvwa/Rt/gvO3bNbzxry0BNs843pQx0a1O2Nxp0C6AXvV36YVjQw== 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=l8p4b1w4rnquY8PiNlpi7Ul8PChbGJzBJX7pWBqONVE=; b=WlCBnU/w5lPNraDXh1YxyYQWaIePvGov1TYyCn2LUwDy7UgiPHKUuL4gzc45VTEMHd2ifBMqfQZIL7mWE78Lcx8dl46OAx0ZM0NTGLMkWU0/13p4WEniiCsCVsjGYvg712hbsIv7M0aKgm5Jij78BRPOVkZmQt+VNE0KsRKsRNA6Yd2av9xqe7fV0XlgcxOkbWEpb1fVC+ZvUUk1iaXH3ONBp6puxd0aG+2BWJoBdpyyNTnqGtgSOEHbGV0r12awX8F+eutqqaiiMAErNzy/ud128tlul++ZRbqjXdd8N1wl6RryhKhpy26lvXjIXDdY9uEqeQVQAoUkLhBW2Ag0gA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=nongnu.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=l8p4b1w4rnquY8PiNlpi7Ul8PChbGJzBJX7pWBqONVE=; b=Q1iD/FmP5PayyJ0l2tsU8nR+fAilaxQCAGfa9msjbPgrvbOlf6jnSUpKQs8V8Poc9SgkNIZGaYWA9stckk3W0XCVOtZP3XkYLvQ/PORdpPM3bQcfQ5ZhIpGPzVbYWnUqsenFiuIwNbbqqmEB39tLPIcjo2NFB8XmP9KQZFdlwWk= Received: from DM5PR08CA0043.namprd08.prod.outlook.com (2603:10b6:4:60::32) by SA0PR12MB4558.namprd12.prod.outlook.com (2603:10b6:806:72::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.23; Fri, 30 Sep 2022 15:15:14 +0000 Received: from DM6NAM11FT057.eop-nam11.prod.protection.outlook.com (2603:10b6:4:60:cafe::45) by DM5PR08CA0043.outlook.office365.com (2603:10b6:4:60::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.26 via Frontend Transport; Fri, 30 Sep 2022 15:15:14 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT057.mail.protection.outlook.com (10.13.172.252) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5676.17 via Frontend Transport; Fri, 30 Sep 2022 15:15:14 +0000 Received: from tlendack-t1.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Fri, 30 Sep 2022 10:15:13 -0500 From: Tom Lendacky To: , CC: Eric Blake , Markus Armbruster , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , Marcelo Tosatti , Michael Roth Subject: [PATCH 4/4] i386/cpu: Update how the EBX register of CPUID 0x8000001F is set Date: Fri, 30 Sep 2022 10:14:30 -0500 Message-ID: <5822fd7d02b575121380e1f493a8f6d9eba2b11a.1664550870.git.thomas.lendacky@amd.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT057:EE_|SA0PR12MB4558:EE_ X-MS-Office365-Filtering-Correlation-Id: a28f63b2-5b04-4a93-b9c9-08daa2f6933a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ijz+ph1hsWbs5zaLzVzC5mEfHaEb2J/MQu6fw43EhjK93pOIW3OOT3BVgi0Gi9vAt6HDOHfXbAlyN4jcHKYzxV8vl0UsToxt8Pz6Fq4RRYZ9WE8EGiegB1S+gxwaC7sngDY8N4XdfAKA9XFqwORha1z8sTd4e7DiGYzx2IskFWe7kHIklCzgvq5sOnJpfbLNfnIMO/DaWY5373VjEdTx34ib0AdUH9QVdIVjsyP2LyFrKevuEascVv5RbN+Kb+hpkMx0qMCiiqZNIfOkgTEhWdE6qhCkQpvTYAWBHtAArELnqNAq8pdNekzC12zKqzvcMOjrQ8mAbc1iNrFvHPk+l7LWAkSCFnBtyhP8LMoWrIzSp1oB25cKDizTeLT//1rivbvrpNiYArInF7R0sbQSciZksQq309mLTR5GVOOAuKt8LwT3eQDwowuYS2fVkhLDcWMy2vS8YDnFEyXNRca2IFpR5+Ct1aGEICeDToGZV6+yyT9B4avzostB3HPEvKai+4mgs5CstOfrJhocxRjqoeqPHA3KzIL4HNtCGnjM6GhIBs8sDQVvVNvRoVbY44tCAJ2pcMfCKaU2iSQA3FYosT5QJ17aiwipT27majVQQ2ly3NxfFL5FDPe9ejFSWcPWMuvYBVN0QjlHF1ckoBg8GfWyXNkFbhn6C7jX/Pw3bYtOKpS2s9lEstZ86Qgz+txumcuwr2O9DG/SN+xXMiGEaxSBNOMhVHuEDC0iC9NE9oYQC9nt7Oo5ZYuuPjw8iiSub++rAVP+ZGv+egZoBcZyv2/7sx13sEx0Jn2XvFFg09uWPsJPzNgbSiI6rTVqgFoj X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230022)(4636009)(39860400002)(376002)(346002)(396003)(136003)(451199015)(40470700004)(46966006)(36840700001)(426003)(86362001)(47076005)(83380400001)(336012)(82740400003)(82310400005)(41300700001)(81166007)(110136005)(36756003)(54906003)(478600001)(316002)(6666004)(40460700003)(70586007)(4326008)(70206006)(186003)(16526019)(2616005)(7696005)(26005)(8676002)(40480700001)(4744005)(15650500001)(356005)(36860700001)(5660300002)(2906002)(8936002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2022 15:15:14.0850 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a28f63b2-5b04-4a93-b9c9-08daa2f6933a X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT057.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4558 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Update the setting of CPUID 0x8000001F EBX to clearly document the ranges associated with fields being set. Fixes: 6cb8f2a663 ("cpu/i386: populate CPUID 0x8000_001F when SEV is active") Signed-off-by: Tom Lendacky Reviewed-by: Dr. David Alan Gilbert --- target/i386/cpu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 1db1278a59..d4b806cfec 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -5853,8 +5853,8 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count, if (sev_enabled()) { *eax = 0x2; *eax |= sev_es_enabled() ? 0x8 : 0; - *ebx = sev_get_cbit_position(); - *ebx |= sev_get_reduced_phys_bits() << 6; + *ebx = sev_get_cbit_position() & 0x3f; /* EBX[5:0] */ + *ebx |= (sev_get_reduced_phys_bits() & 0x3f) << 6; /* EBX[11:6] */ } break; default: