From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 8F17E74003A for ; Wed, 5 Jun 2024 18:51:22 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=LdYW5WLFQM0/0zDhsCh+XfVoEYksm4mjcrhH+fh6idE=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:User-Agent:Subject:To:Cc:References:From:In-Reply-To:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20240206; t=1717613482; v=1; b=ktXDufS6TE8ZRwcOzNGCFGqL+l1Bejg/5tvRA+eBfw2GzwaVHRyfXlWg6grvVP8sj3igdXG9 xr9dAOV1k9m6XPkTpMgcuZfufCGyg9fknjlnDCA2UXJZyBjfOREml9BN7xF1KblbiXC1U7dOD+M ue7BZmVNsB5D+AzYQwklR9Wxs64GcbtKxdWbEsMdYDkcDhS4JuiV9SA3o3Pw5BOUwpPhP0NjHLG 965riVq3VlRKK7B29H2zk2Jz/d7xCEsa6H+Bhjo5JVGyEYrHmK5L5myUXk28nZkHMV/lqITmfcV xo3ujeG4UZ/oFTVXjQdcpIb1omCpvAht1QzR32MqiuSEw== X-Received: by 127.0.0.2 with SMTP id 3RxUYY7687511xYcrWSzBrra; Wed, 05 Jun 2024 11:51:21 -0700 X-Received: from NAM04-MW2-obe.outbound.protection.outlook.com (NAM04-MW2-obe.outbound.protection.outlook.com [40.107.101.69]) by mx.groups.io with SMTP id smtpd.web11.2193.1717613480645336786 for ; Wed, 05 Jun 2024 11:51:20 -0700 X-Received: from BL1PR12MB5732.namprd12.prod.outlook.com (2603:10b6:208:387::17) by DM6PR12MB4298.namprd12.prod.outlook.com (2603:10b6:5:21e::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.31; Wed, 5 Jun 2024 18:51:15 +0000 X-Received: from BL1PR12MB5732.namprd12.prod.outlook.com ([fe80::bf0:d462:345b:dc52]) by BL1PR12MB5732.namprd12.prod.outlook.com ([fe80::bf0:d462:345b:dc52%7]) with mapi id 15.20.7633.021; Wed, 5 Jun 2024 18:51:15 +0000 Message-ID: Date: Wed, 5 Jun 2024 13:51:13 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [edk2-devel] [PATCH ovmf v4 4/5] UefiCpuPkg: Add AMD SEV-ES features support To: Alexey Kardashevskiy , devel@edk2.groups.io Cc: Liming Gao , Michael D Kinney , Zhiguang Liu , Ard Biesheuvel , Erdem Aktas , Gerd Hoffmann , Jiewen Yao , Michael Roth , Min Xu , Jiaxin Wu , Rahul Kumar , Ray Ni References: <20240605020946.1224515-1-aik@amd.com> <20240605020946.1224515-5-aik@amd.com> From: "Lendacky, Thomas via groups.io" In-Reply-To: <20240605020946.1224515-5-aik@amd.com> X-ClientProxiedBy: SA9P221CA0012.NAMP221.PROD.OUTLOOK.COM (2603:10b6:806:25::17) To BL1PR12MB5732.namprd12.prod.outlook.com (2603:10b6:208:387::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL1PR12MB5732:EE_|DM6PR12MB4298:EE_ X-MS-Office365-Filtering-Correlation-Id: e0548a0c-7974-457f-758f-08dc85907a46 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: =?utf-8?B?dWlqWTVYQUpnMEppTm1PSkVRdW9FOVkxelRMcWdmWmN6U1gzZHVtaWFYazAw?= =?utf-8?B?Y0x3bUtjaDBWVVg4N2dBcUkxZ3ZKM1J4dUFGeThrVWdiQ2I2elNuZDIzMXor?= =?utf-8?B?M2VmVTgzWmRKd3E1ZVNOZHczUk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TZMNW5mYXpjS1NNSk1LMFlGazltMGZM?= =?utf-8?B?ZklDVTNYUjJGdUpYUnh0YXo3NkZBbVVoekp4ckZZUXFnVmsydGlNd2Q3bUor?= =?utf-8?B?NmdCd01GT2RXNE10MVc5YlQ5ancxQlRSenF6TFZheE1KcG5taWl1UE1VeG5Q?= =?utf-8?B?UENRUHUyK1hVT3R6Tmx2UUlWZk1jZWlqb0l0NFluTm5LcUZjeU9VMDJOSlBw?= =?utf-8?Q?wCxCrkXcf5//p2wdv8zsemDDN?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: e0548a0c-7974-457f-758f-08dc85907a46 X-MS-Exchange-CrossTenant-AuthSource: BL1PR12MB5732.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jun 2024 18:51:15.4662 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Gck9/cqEeFx7Agk2EfYukNy24H9RCWMX5wkEz/dLwZTXyisG1yHT3ca0iTsIAFg3EVC6AjmC4EOFTtLh/oQvmw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4298 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Wed, 05 Jun 2024 11:51:20 -0700 Resent-From: thomas.lendacky@amd.com Reply-To: devel@edk2.groups.io,thomas.lendacky@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 1pXtFlWrNaWlGUyq5OCOTklPx7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=ktXDufS6; dmarc=pass (policy=none) header.from=groups.io; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io On 6/4/24 21:09, Alexey Kardashevskiy wrote: > CONFIDENTIAL_COMPUTING_GUEST_ATTR is not a simple SEV level anymore > and includes a feature mask since the previous commit. >=20 > Fix AmdMemEncryptionAttrCheck to check the level and feature > correctly and add DebugVirtualization support. >=20 > Since the actual feature flag is not set yet, this should cause > no behavioural change. >=20 > Cc: Gerd Hoffmann > Cc: Jiaxin Wu > Cc: Rahul Kumar > Cc: Ray Ni > Cc: Tom Lendacky > Signed-off-by: Alexey Kardashevskiy Reviewed-by: Tom Lendacky > --- > UefiCpuPkg/Library/MpInitLib/MpLib.c | 12 +++++++++--- > 1 file changed, 9 insertions(+), 3 deletions(-) >=20 > diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/Mp= InitLib/MpLib.c > index f97298887f96..444df2abdc1d 100644 > --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c > +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c > @@ -3196,19 +3196,25 @@ AmdMemEncryptionAttrCheck ( > IN CONFIDENTIAL_COMPUTING_GUEST_ATTR Attr > ) > { > + UINT64 CurrentLevel; > + > + CurrentLevel =3D CurrentAttr & CCAttrTypeMask; > + > switch (Attr) { > case CCAttrAmdSev: > // > // SEV is automatically enabled if SEV-ES or SEV-SNP is active. > // > - return CurrentAttr >=3D CCAttrAmdSev; > + return CurrentLevel >=3D CCAttrAmdSev; > case CCAttrAmdSevEs: > // > // SEV-ES is automatically enabled if SEV-SNP is active. > // > - return CurrentAttr >=3D CCAttrAmdSevEs; > + return CurrentLevel >=3D CCAttrAmdSevEs; > case CCAttrAmdSevSnp: > - return CurrentAttr =3D=3D CCAttrAmdSevSnp; > + return CurrentLevel =3D=3D CCAttrAmdSevSnp; > + case CCAttrFeatureAmdSevEsDebugVirtualization: > + return !!(CurrentAttr & CCAttrFeatureAmdSevEsDebugVirtualization); > default: > return FALSE; > } -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#119483): https://edk2.groups.io/g/devel/message/119483 Mute This Topic: https://groups.io/mt/106496089/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-