From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (NAM11-CO1-obe.outbound.protection.outlook.com [40.107.220.69]) by mx.groups.io with SMTP id smtpd.web12.6170.1588599292748798878 for ; Mon, 04 May 2020 06:34:53 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector2-amdcloud-onmicrosoft-com header.b=3UlwrB+q; spf=none, err=SPF record not found (domain: amd.com, ip: 40.107.220.69, mailfrom: thomas.lendacky@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d/DdZZ72g4A3i89IXNF8h9JGd3UJP3kf+ncSgcdPtt1BS2ig+F0xf+iqIyv4RDLB0naN/zdzufLJ7G8I6l0DzrchJmCvCxJtUNCXY6kkH3fRJR/5uErtRnBQc5OB8FyRkPDW5fUjFSYTgHLZSdWVFpQP4ANuRtxd/juRp6aSPqxPxicvgGmF6M/UFNsnpxlHx1x0MWPf8jflUgXHkgVbEcYMmI9zMIyxJpIRfF6S17l9eZk6LnVgS2AOH5/NitbSk44oEh5/rKjwwdJx9tRbMC3jRTeWPkmBhv1qFyjJD4rqBnJ9BkpdAMxE+0/M8XXOiuWxhIRyhWbaFHKmqvemrA== 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-SenderADCheck; bh=foIY6X6q8jfv1IiNKF8JWTtGCjnSR18Nco01Ckn1HG4=; b=AAG5dZPzKe/8jxrFznE4qCfE80MVpUgxaYHcAGpIbisPkUK4g50x3Wi9uZFTSs0FVGscTqOenoSAxDJKMkkUbe/Fe8G5z6Ch64WGRZQlAT5eTQ2/QVKRD2PPCV9qahEHnz/cRbMg+kbN12wIrRTpKElgYHiQT+mHGuXQx9pvY6GbIJY0nmi8hAOCEmZhOquZagtRnBCbH7W4Isku6rJ4oUZc7mxUKhZHLDL/jUiTHeSWDvCmhhK5IioQKVXZOtplP7czDNdyz3ZZ0hyToyv2wvbSOy/cSOz0IH74teS4EJNm2spWZLBzt7Zr6Xgm/e9+V5RKQvklv3NK2/5hq0BUPA== 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=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=foIY6X6q8jfv1IiNKF8JWTtGCjnSR18Nco01Ckn1HG4=; b=3UlwrB+qVzd4GlL4yQsh9hFByLhR1c36qxGpeaE2hzI74bfq2DhTFr73uD8LqSbqYr9aguC6v5TEwGQjnPMmQj4N5HWJNerDhXry+cNA3U19Qj8WR2Hjg0xnzxH/CJg3fpWpXV6i7hIatkRs/JvlwSPD8c6lj0/scpSeK2TaJjc= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=amd.com; Received: from DM5PR12MB1355.namprd12.prod.outlook.com (2603:10b6:3:6e::7) by DM5PR12MB1435.namprd12.prod.outlook.com (2603:10b6:3:7a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.27; Mon, 4 May 2020 13:34:51 +0000 Received: from DM5PR12MB1355.namprd12.prod.outlook.com ([fe80::4ce1:9947:9681:c8b1]) by DM5PR12MB1355.namprd12.prod.outlook.com ([fe80::4ce1:9947:9681:c8b1%10]) with mapi id 15.20.2958.029; Mon, 4 May 2020 13:34:51 +0000 Subject: Re: [edk2-devel] [PATCH v7 01/43] MdeModulePkg: Create PCDs to be used in support of SEV-ES To: "Dong, Eric" , "devel@edk2.groups.io" Cc: "Justen, Jordan L" , Laszlo Ersek , Ard Biesheuvel , "Kinney, Michael D" , "Gao, Liming" , "Ni, Ray" , Brijesh Singh , "Wang, Jian J" , "Wu, Hao A" References: From: "Lendacky, Thomas" Message-ID: <3af2e4a8-fa4d-bb29-a282-c406ada7cf06@amd.com> Date: Mon, 4 May 2020 08:34:48 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 In-Reply-To: X-ClientProxiedBy: SN6PR04CA0079.namprd04.prod.outlook.com (2603:10b6:805:f2::20) To DM5PR12MB1355.namprd12.prod.outlook.com (2603:10b6:3:6e::7) Return-Path: thomas.lendacky@amd.com MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from office-linux.texastahm.com (67.79.209.213) by SN6PR04CA0079.namprd04.prod.outlook.com (2603:10b6:805:f2::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.19 via Frontend Transport; Mon, 4 May 2020 13:34:50 +0000 X-Originating-IP: [67.79.209.213] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 26e060db-3cbe-4e35-e3db-08d7f02febfc X-MS-TrafficTypeDiagnostic: DM5PR12MB1435:|DM5PR12MB1435: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:216; X-Forefront-PRVS: 03932714EB X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wjrllQfWDcv8d+6jQBdBwovWvDkWx4qCEF7a01AVJLiTvuOb170WcKxcCdD/N2OHP9kqt0BFr0RUXBiu4au8WArIb/yx46Hodsfbm86h6umKSFhaqv7oLv+o18cVJcIsH9TrjVgHbshGFzF5YEDrzpF/tVUTRjPqgpnNwrikgFzVZvIX05RZEslnSKuMEDD1piqSa1t6bFIjvj6ue2PqEIftltHBZk4aYg2Gobkfjzhx7seSTbmOKkjeXnpx1mQF9JXhvb9pzouRTtrJPE5ZI7CoKgJErCwUcA04BD9uqY2bEeWEEy8E+FVGq8GduiM+YlIS8CHHmjelWNExJPl777p4Gahgw06wtDSMYLUg6vCylOl0EJIxsxfwFpJL+NFX6rwUKMSUowThYs4+KCGbvdcLKV8yzxFZhuVHVaFnALECf2FgPV7NzkVe/45IpZBqlroz9dr1cMKAOe1upAL8z1KoHLKgnsQIZsG5r0RM6wzegdy+XuQRdrXwo57rVC0SJEYZAsw7+EoWj5ec+8UzMDqF2ALKDy16fj9IWsBxkbrPc12JjzBcDctFJQNwonro X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM5PR12MB1355.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(4636009)(39860400002)(346002)(136003)(396003)(366004)(376002)(8676002)(6512007)(86362001)(8936002)(54906003)(478600001)(110136005)(52116002)(5660300002)(31696002)(2906002)(45080400002)(966005)(956004)(31686004)(16526019)(186003)(66946007)(4326008)(26005)(2616005)(53546011)(6486002)(36756003)(6506007)(7416002)(316002)(66476007)(66556008)(460985005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: g6bFK5/hKH985RWjaI6FgrkPiJpEf2NqLsommU/h8loOW9TfbGY9lC+8+/c8UUxtrOWYuRQd/BG0fbtk6hknrwFBxA9MIryEf0NH1KL7jR0ObaviOkJhJs44iaWUB+pGO1nZ+lZDDRPKqjuJ/FTH56eg3aIdSzmGa1xe8W1wO/i+bnX60JyhK6dgWjxU473MU45WbHADJanCcRhxFeNnesXIMcV73jBjXY+GBc9uQiHkU4fK3W09GLpjTng0EE5cuAiz0cDAmiA1LXdYcxYKurAU4Dro8/FIUVzecj3sMyKX5TIoABoMG6XsUC9sFpseClpRP7dKWOassCqMr91o9Zo43ryVxDRKaJcAIF9PqAI6iWoVK80+Zut2xegnEYYyUPfeVAlxAmIG+TUuX1VxVGJAB8opw3nxEfAZoXCWFJtUmvhJwV9UrqdY9D06ab3XsFU0zirwlpIiU+33nHSasTraRFElaGGiPDLcJ2Gtmofx3/6dgo7CjF9wUaaldrvOVo2u+Rds6QOeU6j/U+HSckUJQHaNaaFrirt1E28aImcF9GvMBfcdy54wTX3s5V0aVAs2jckqam+0L0AMM3yKhhf1yATx+MtFxxYULScGun6YbZlEgiovq/4ZoMTYEqzmLilh3FRmbj2qNxBQyeM/OVjHpndbelYlCUON/OP98/s8D1j6YMe9Le06NXuNz9/HsYn7iUzGk2qJXQt6BZVrrUcHrQ4ZM0u5KThJY+bH0aGeBZZh/3w4vsCXM5vYDjVzVgPv0U6WICWqeq291QSGtpS+osXSLirx2pAAVwhzdOY= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 26e060db-3cbe-4e35-e3db-08d7f02febfc X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2020 13:34:51.2591 (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: Y1B9+SJcfF0CzAiAKPFS3fRjPP5pxgt8+GRT6FjXchDKgxj18v8AGAK6c4MQ2qsUzMVgWV3gWn4DkQzNC57YIw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1435 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit On 5/2/20 3:19 AM, Dong, Eric wrote: > Hi Tom, Hi Eric, > > Can you describe what tests have you done for this patch serial? I've built the OVMF package in 32, 32/64 and 64-bit configurations on Linux using GCC as the compiler. These warnings were not emitted in those configurations. I'll look into seeing if there is a compiler setting that will provide these conversion warnings. I don't have Visual Studio and so cannot test that. I can, however, fix these warnings. Are these the only warnings you have seen? Thanks, Tom > > I just build the UefiCpupkg. Dsc with VS2015x86 and met below errors: > g:\edk2-open-source\edk2\UefiCpuPkg\Library\CpuExceptionHandlerLib\X64\ArchAMDSevVcHandler.c(730): warning C4245: 'function': conversion from 'int' to 'UINT64', signed/unsigned mismatch > g:\edk2-open-source\edk2\UefiCpuPkg\Library\CpuExceptionHandlerLib\X64\ArchAMDSevVcHandler.c(745): warning C4244: '=': conversion from 'UINTN' to 'UINT8', possible loss of data > g:\edk2-open-source\edk2\UefiCpuPkg\Library\CpuExceptionHandlerLib\X64\ArchAMDSevVcHandler.c(753): warning C4245: 'function': conversion from 'int' to 'UINT64', signed/unsigned mismatch > Trim --asm-file -o g:\edk2-open-source\edk2\Build\UefiCpu\DEBUG_VS2015x86\X64\UefiCpuPkg\Library\SmmCpuFeaturesLib\SmmCpuFeaturesLibStm\OUTPUT\X64\SmiEntry.i -i g:\edk2-open-source\edk2\Build\UefiCpu\DEBUG_VS2015x86\X64\UefiCpuPkg\Library\SmmCpuFeaturesLib\SmmCpuFeaturesLibStm\OUTPUT\inc.lst g:\edk2-open-source\edk2\UefiCpuPkg\Library\SmmCpuFeaturesLib\X64\SmiEntry.nasm > PeiDxeSmmCpuException.c > g:\edk2-open-source\edk2\UefiCpuPkg\Library\CpuExceptionHandlerLib\X64\ArchAMDSevVcHandler.c(778): warning C4245: 'function': conversion from 'int' to 'UINT64', signed/unsigned mismatch > "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Vc\bin\x86_amd64\lib.exe" /NOLOGO /LTCG /OUT:g:\edk2-open-source\edk2\Build\UefiCpu\DEBUG_VS2015x86\X64\MdeModulePkg\Library\TpmMeasurementLibNull\TpmMeasurementLibNull\OUTPUT\TpmMeasurementLibNull.lib @g:\edk2-open-source\edk2\Build\UefiCpu\DEBUG_VS2015x86\X64\MdeModulePkg\Library\TpmMeasurementLibNull\TpmMeasurementLibNull\OUTPUT\object_files.lst > Building ... g:\edk2-open-source\edk2\UefiCpuPkg\Library\CpuTimerLib\BaseCpuTimerLib.inf [X64] > g:\edk2-open-source\edk2\UefiCpuPkg\Library\CpuExceptionHandlerLib\X64\ArchAMDSevVcHandler.c(801): warning C4245: 'function': conversion from 'int' to 'UINT64', signed/unsigned mismatch > CheckSum.c > g:\edk2-open-source\edk2\UefiCpuPkg\Library\CpuExceptionHandlerLib\X64\ArchAMDSevVcHandler.c(821): warning C4245: 'function': conversion from 'int' to 'UINT64', signed/unsigned mismatch > g:\edk2-open-source\edk2\UefiCpuPkg\Library\CpuExceptionHandlerLib\X64\ArchAMDSevVcHandler.c(837): warning C4244: 'function': conversion from 'UINTN' to 'UINT8', possible loss of data > > Thanks, > Eric > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Lendacky, Thomas > Sent: Thursday, April 23, 2020 1:41 AM > To: devel@edk2.groups.io > Cc: Justen, Jordan L ; Laszlo Ersek ; Ard Biesheuvel ; Kinney, Michael D ; Gao, Liming ; Dong, Eric ; Ni, Ray ; Brijesh Singh ; Wang, Jian J ; Wu, Hao A > Subject: [edk2-devel] [PATCH v7 01/43] MdeModulePkg: Create PCDs to be used in support of SEV-ES > > BZ: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugzilla.tianocore.org%2Fshow_bug.cgi%3Fid%3D2198&data=02%7C01%7Cthomas.lendacky%40amd.com%7Cfbe4f561e0234d8450fe08d7ee7186e2%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637240043676140655&sdata=xdnfAfSLtPi3FE5olqjU7%2B4OHJBxgOTRAFR0%2BMkECLc%3D&reserved=0 > > Two new dynamic MdeModulePkg PCDs are needed to support SEV-ES under OVMF: > - PcdGhcbBase: UINT64 value that is the base address of the GHCB > allocation. > - PcdGhcbSize: UINT64 value that is the size, in bytes, of the > GHCB allocation (size is dependent on the number of > APs). > > Cc: Jian J Wang > Cc: Hao A Wu > Signed-off-by: Tom Lendacky > --- > MdeModulePkg/MdeModulePkg.dec | 9 +++++++++ MdeModulePkg/MdeModulePkg.uni | 8 ++++++++ > 2 files changed, 17 insertions(+) > > diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index 42ad21cf244d..642a4791d83c 100644 > --- a/MdeModulePkg/MdeModulePkg.dec > +++ b/MdeModulePkg/MdeModulePkg.dec > @@ -2048,6 +2048,15 @@ [PcdsDynamic, PcdsDynamicEx] > # @Prompt If there is any test key used by the platform. > gEfiMdeModulePkgTokenSpaceGuid.PcdTestKeyUsed|FALSE|BOOLEAN|0x00030003 > > + ## This dynamic PCD holds the base address of the GHCB pool allocation. > + # @Prompt GHCB Pool Base Address > + gEfiMdeModulePkgTokenSpaceGuid.PcdGhcbBase|0|UINT64|0x00030007 > + > + ## This dynamic PCD holds the total size of the GHCB pool allocation. > + # The amount of memory allocated for GHCBs is dependent on the number of APs. > + # @Prompt GHCB Pool Size > + gEfiMdeModulePkgTokenSpaceGuid.PcdGhcbSize|0|UINT64|0x00030008 > + > [PcdsDynamicEx] > ## This dynamic PCD enables the default variable setting. > # Its value is the default store ID value. The default value is zero as Standard default. > diff --git a/MdeModulePkg/MdeModulePkg.uni b/MdeModulePkg/MdeModulePkg.uni index 2007e0596c4f..2f8cca03e527 100644 > --- a/MdeModulePkg/MdeModulePkg.uni > +++ b/MdeModulePkg/MdeModulePkg.uni > @@ -1297,3 +1297,11 @@ > #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdTcgPfpMeasurementRevision_PROMPT #language en-US "TCG Platform Firmware Profile revision" > > #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdTcgPfpMeasurementRevision_HELP #language en-US "Indicates which TCG Platform Firmware Profile revision the EDKII firmware follows." > + > +#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdGhcbBase_PROMPT #language en-US "GHCB Pool Base Address" > + > +#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdGhcbBase_HELP #language en-US "Used with SEV-ES support to identify an address range that is not to be encrypted." > + > +#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdGhcbSize_PROMPT #language en-US "GHCB Pool Base Size" > + > +#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdGhcbSize_HELP #language en-US "Used with SEV-ES support to identify the size of the address range that is not to be encrypted." > -- > 2.17.1 > > > >