From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (NAM12-DM6-obe.outbound.protection.outlook.com [40.107.243.65]) by mx.groups.io with SMTP id smtpd.web12.14894.1636720420308901493 for ; Fri, 12 Nov 2021 04:33:40 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amd.com header.s=selector1 header.b=XgJStG8e; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: amd.com, ip: 40.107.243.65, mailfrom: brijesh.singh@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N54P3w/0DHFnf9EawjH9WA4gROwThKvqE1fBdu2He6/8pslJozz+jKe9e+EViEorD8lrdBR9caiZ6GS8SX9NOebOQhPngLsQ8R7x8YFZvCnRI60gq/TlN76Qn6ixy4UrlLg0DRUCnevs4MGL4xV/AKKMS/3BwLacIokdmumjQxMegppf+fY+3x8CcP93jtp71z5TPV1e8Kfrgpy+W/FP/RQh3IukuCpd3thAqsYlk7Dag6Zf8LG/jpQsbwa+To03oC8DhDkhOQR89dE/KehpwnFakkBcPUeek5TW4yHja/Mn38EbwuTTWm72K6xpqc4QOVOpi0u9VELC0vNCt9dJIQ== 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=yZMCRwMIuzmneSYpJceIXSVZci26YrzxnOyeS7J64S0=; b=adZQEbsmfut6G/g5X00RO6PpkPo44LyADzWdpU9hjv/I1GeknQ7v47ic6Zl2UszmGbAshQbeSXYlUVKnqEhaK70PQYKfA+hNmyeFbxCXwRjvmAxylqvLmPHcKi1yoyxpXYyfIsAufycV/ua8EV0nrEjh5YDsoVWFaxhYRvJWqmuqRIXArWushuM/B1N0CTsRoq8rZy9VTYuKmc9Y4ppCFRvp5RYrMgs5eS+zD2K9DN/8yAtL1cctBFU9kB4DyYe5b6SPrpVwUINQALFvnbtuxBieKDK/8w2yf/aBcVP8u942fGSxaFz6PaQLIVCmvZ+EYNd00ca/O6ZA6HqgV3bEeg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; 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=yZMCRwMIuzmneSYpJceIXSVZci26YrzxnOyeS7J64S0=; b=XgJStG8e2en7urFv3fBfY6ow348GLZgswP+Dh14/oqZWwWHETkvcm1ZfHoPIjnDCWn+CgTFG6Fdiw00sZQKaWbIN+jF9gHw2NL0QGcHfgZD87r/pqUQE7aCBjU+g4KZWYr9SyjfN/FFotql7TIuSwWK8G29uRduzV93Rpg20or0= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=amd.com; Received: from SN6PR12MB2718.namprd12.prod.outlook.com (2603:10b6:805:6f::22) by SN1PR12MB2367.namprd12.prod.outlook.com (2603:10b6:802:26::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.13; Fri, 12 Nov 2021 12:33:37 +0000 Received: from SN6PR12MB2718.namprd12.prod.outlook.com ([fe80::e4da:b3ea:a3ec:761c]) by SN6PR12MB2718.namprd12.prod.outlook.com ([fe80::e4da:b3ea:a3ec:761c%7]) with mapi id 15.20.4669.020; Fri, 12 Nov 2021 12:33:36 +0000 Message-ID: <17867ae9-7c5a-830e-945a-8c30556734b7@amd.com> Date: Fri, 12 Nov 2021 06:33:34 -0600 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.2.1 Cc: brijesh.singh@amd.com, James Bottomley , "Xu, Min M" , "Yao, Jiewen" , Tom Lendacky , "Justen, Jordan L" , Ard Biesheuvel , Erdem Aktas , Michael Roth , Gerd Hoffmann , "Kinney, Michael D" , Liming Gao , "Liu, Zhiguang" , "Kumar, Rahul1" , "Dong, Eric" Subject: Re: [PATCH v12 22/32] UefiCpuPkg/MpInitLib: use PcdConfidentialComputingAttr to check SEV status To: "Ni, Ray" , "devel@edk2.groups.io" References: <20211110221457.2397234-1-brijesh.singh@amd.com> <20211110221457.2397234-23-brijesh.singh@amd.com> From: "Brijesh Singh" In-Reply-To: X-ClientProxiedBy: SA9PR13CA0049.namprd13.prod.outlook.com (2603:10b6:806:22::24) To SN6PR12MB2718.namprd12.prod.outlook.com (2603:10b6:805:6f::22) Return-Path: brijesh.singh@amd.com MIME-Version: 1.0 Received: from [10.0.0.5] (70.112.153.56) by SA9PR13CA0049.namprd13.prod.outlook.com (2603:10b6:806:22::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.5 via Frontend Transport; Fri, 12 Nov 2021 12:33:35 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 94c54207-d47f-4662-e98d-08d9a5d8a602 X-MS-TrafficTypeDiagnostic: SN1PR12MB2367: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iZuq3PQKz20j7rHkipWzGJSGHItIstYBw+R8HSxal2UDbeML71xh3J3dOt+gjgIqUgLz3NEHcHCsGTINTS45mOp2afnM7sOB+OTM42/n4AVokkxqO0QdwcLBjvnX8d1qWfuTc99iZNoIrFdDJvLkInaQBNvyGSaCZG5CJOn3EhRSvhHkRN9dJFKAOU1nzFBqcprl0J2qHFzRhdcOImemMFIeP7hbZ6pYDZKoXjDeTmULh6SXhHXmkZF/Fko04rwqiej5/H0reNG2ijRe9GoxZtKajN24tBWPyhxppuDts6J48uDQj4o8GsdP6eQCiSrvc4WJ4UMN89FwODaBDMbf+MUtCHLdFINboeaMJ3e2ijP49hMyAge4yUxg35IKsaVzO2ATlmIlkrEQomyIAitVZw7eFqyaEnWgM/zjwQZ2IqQ6fn/3GJdn2umcISZdLXEQtT5VUTHme2PT7ptk25BVgi0Pj612BR/ceTelCDygiv478smaRcne0dr137TRnaDaMvQt8lSXqNH9Il5YepeIg1fp4yPOTL64s3yzAmMGssYzmGuI615V00gfX3/S7qUOqkb3LDDo6VZV0Yi1HVZqZKClmpOiiSDyBGgkhr+CCXXG8Xjh3W4bgK44uXCQTEfwnHdXabu6SVHXMlar9/iCfF0iv8kLdsNomtLEbFdHY6mTBzI5/0cB4GSFzW/NkcNX3TCy/DooiTPgr84JgdfjoPuguXfmJlSWY4xa1GiOpLA= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR12MB2718.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(6029001)(4636009)(366004)(956004)(5660300002)(86362001)(6486002)(2616005)(36756003)(26005)(53546011)(66556008)(4744005)(31696002)(44832011)(54906003)(8936002)(66476007)(186003)(31686004)(38100700002)(508600001)(8676002)(110136005)(2906002)(66946007)(316002)(4326008)(7416002)(16576012)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?TzBWTGloaWFOTTJMRWcvSldyMnVvSGJhbFFqWVhxRCtQSmlMVVNNT0lJbTZM?= =?utf-8?B?YUFuQUZadU1SRTltNExuS3h3TUZnUGp3QktIYldjSUw5aGhxYkNaTjg5cEVq?= =?utf-8?B?NXR5K0JidmRBTmFRL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jSEk0Qkd4Y01t?= =?utf-8?B?VHpaK1lSd3RkclAwY2RLcmloKzByTzhrcWNVZzB2TjZEckRjTVVNU2U4TFJI?= =?utf-8?B?U1FEQWx4bWd5OXN3U1ZMN0tZZ0ZMVGxjaHJtelhTU0l0K2lySE1jSDlEUm9h?= =?utf-8?B?dUVOZTNXbnFuRW9NR0NFdDNZNUdubVp3djQvMHN5RUg5ZXBDbGhhdHpoOGpt?= =?utf-8?B?MnIrbmRac3BGMnJwMlVKdFZmeUJPRzRQempFZTlmUGZWaWp6Y1RycGdONlRu?= =?utf-8?Q?dTyl6pgfB3MCIO6ly6c5YGY=3D?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 94c54207-d47f-4662-e98d-08d9a5d8a602 X-MS-Exchange-CrossTenant-AuthSource: SN6PR12MB2718.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Nov 2021 12:33:36.7732 (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: iqX7hL5Mx3j37X2itzJutZikeqsnVpStcjlVKtGb7pZloxUkroXetLindvo/B6Gm0T0uJPrNYoBCaJTX3RLdZw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB2367 Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 11/11/21 7:27 PM, Ni, Ray wrote: > 2 minor comments. > >> + switch (Attr) { >> + case CCAttrAmdSev: >> + return CurrentAttr >= CCAttrAmdSev; >> + case CCAttrAmdSevEs: >> + return CurrentAttr >= CCAttrAmdSevEs; >> + case CCAttrAmdSevSnp: >> + return CurrentAttr == CCAttrAmdSevSnp; > 1. Can you put comments to explain that the relationship between the three features? > That can explain why ">=" is used here. > You may use ">=" for SEV-SNP as well, in case AMD invents a more advanced SEV.:) Sure, I can add a comment. > >> + >> + return (CurrentAttr == Attr); > 2. I guess a "BOOLEAN" type cast is needed. > I can cast it but CI didn't complain about it.