From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (NAM10-DM6-obe.outbound.protection.outlook.com [40.107.93.78]) by mx.groups.io with SMTP id smtpd.web10.1962.1576183692098694949 for ; Thu, 12 Dec 2019 12:48:12 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector2-amdcloud-onmicrosoft-com header.b=wjLQDQWT; spf=none, err=SPF record not found (domain: amd.com, ip: 40.107.93.78, mailfrom: thomas.lendacky@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oC9HBQBePUSIa/J5XijlvUbTONuAz9K8nkbXZTkRYbpPbe+MDZpdcQXsKgNdzGCkQDOMxOgOUBrNYPylkM+j2xaKeCBilpoQl9hpsey0gRcQQtgRQ7aj1XR+pAvvhV5wcjpPHexTR2rS75JZ4+KiSufJz4LLHaBwWVXStvg/36b0tNox82+II1k3uwC5ibzjMi/5FKBW3wXS9rVS8l87laTZoo+UMgUIcF7AaXQT86v+Dd6VvFFYG/SbZ4q8OE0lmUB3WZ4YmNFD1u928me/yFV6CePM9gSChkVmZDnowNLiKb4/4R0d6agjv9V7WG5AIs0EJpH9wH1NPrkvH9KGZw== 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=EYOme1V9DK6YUiEXYRsdKRVmfLgHP96SR2+QfEbmf7Q=; b=AkAKDFLleRLG4Z75TJCXkGxcRr++sFKjseyeMCHk8wDJHn9Apt8kCt8jL3ZK0zVYPV7xB/XY27WwQrY44xq88pAG+a6kV5gbS1GigEO+myPxzinlTGUz6y0QyezrSYu4Y6+2HIqdPpeO36O0JQh/CVmGC2EvqwvyR1fXIGpEGf/b3j/T/46iu5maYEEy6ouUpSpDNCJJrB9jJ8xk/3TTGeHDAjFxGvDpA6dZFW9XuqbRhKFDajSkgo54Z+yeYrH0+yNJ9DTWRwuWLhJqYGCW8pD1NPbsjljXbBsQH5Jd4TKpeAMDDXjIOXWoOmsgHgjpUXA01YRWKEL/3S0EITkKMw== 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=EYOme1V9DK6YUiEXYRsdKRVmfLgHP96SR2+QfEbmf7Q=; b=wjLQDQWTY9yqOXPHXU3I9Tka3oE3aK2lgrV322tk60k3dCNSNOxIkZHA3LHxy06X/7MYNJqbotInPjKDzKFD2FfL7dPnC+w9bAa1NSumym6Sre/7iUq6pnY27yXd38OfEcGoIuMh1c1kTqQsHyC7RJIsy4KKUvPQE35GXIhjs/Y= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Thomas.Lendacky@amd.com; Received: from DM6PR12MB3163.namprd12.prod.outlook.com (20.179.71.154) by DM6PR12MB3130.namprd12.prod.outlook.com (20.178.30.208) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.15; Thu, 12 Dec 2019 20:48:10 +0000 Received: from DM6PR12MB3163.namprd12.prod.outlook.com ([fe80::c16f:b437:4266:dbc1]) by DM6PR12MB3163.namprd12.prod.outlook.com ([fe80::c16f:b437:4266:dbc1%4]) with mapi id 15.20.2516.020; Thu, 12 Dec 2019 20:48:10 +0000 Subject: Re: [RFC PATCH v3 01/43] MdePkg: Create PCDs to be used in support of SEV-ES To: "Ni, Ray" , "devel@edk2.groups.io" Cc: "Justen, Jordan L" , Laszlo Ersek , Ard Biesheuvel , "Kinney, Michael D" , "Gao, Liming" , "Dong, Eric" , Brijesh Singh , "Wang, Jian J" , "Wu, Hao A" References: <734D49CCEBEEF84792F5B80ED585239D5C399A33@SHSMSX104.ccr.corp.intel.com> From: "Lendacky, Thomas" Message-ID: <3ab202b4-70dd-8006-f0b5-26d9e4fadf85@amd.com> Date: Thu, 12 Dec 2019 14:48:08 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 In-Reply-To: <734D49CCEBEEF84792F5B80ED585239D5C399A33@SHSMSX104.ccr.corp.intel.com> X-ClientProxiedBy: SN1PR12CA0100.namprd12.prod.outlook.com (2603:10b6:802:21::35) To DM6PR12MB3163.namprd12.prod.outlook.com (2603:10b6:5:15e::26) Return-Path: thomas.lendacky@amd.com MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: afb50323-2d68-4820-3c91-08d77f449944 X-MS-TrafficTypeDiagnostic: DM6PR12MB3130:|DM6PR12MB3130: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-Forefront-PRVS: 0249EFCB0B X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4636009)(346002)(376002)(366004)(396003)(39860400002)(136003)(13464003)(189003)(199004)(86362001)(316002)(6486002)(110136005)(4326008)(8676002)(478600001)(54906003)(52116002)(66946007)(31696002)(5660300002)(31686004)(966005)(2906002)(66476007)(66556008)(7416002)(6506007)(8936002)(26005)(2616005)(6512007)(36756003)(81166006)(81156014)(53546011)(186003)(45080400002);DIR:OUT;SFP:1101;SCL:1;SRVR:DM6PR12MB3130;H:DM6PR12MB3163.namprd12.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: OadncKuDSd2LPg5lQ0dvlBwDxTfIHlNcEjnvI9ssfir/MO6urbcRgZFCNZf+L8oDpvj537ADlZZaywamqiXP3KGUhSIxHaPTnz26DqgY83o51fnmI3cbdYSQpS1VC0IyU20lBvDczownfsXNR3/uJ9O6R1jGjKpjqXtOCV/0n3BXbpocXuwsFfxIEiyj+S8t3yNrhvnAPYKjjZ+Ov1okaPtXZy3v5x4lAGUm7sS0CpwFA6rCB6g+8JQjCS7NzhwH2D8mw71o5iqBrLFFlyWBSugbg4vSCIl9BT2HU0wFC0i3oY/U/4hUcjc0FFDB4+zWKACfRywJUGBOWBvSlGVAbTpEcFoCngpJJ8EKGFw20iOk2UilCLjKzdmqn2f0OKXtr8y9sQ9oWWOiHJQnhzSU2Zg/2z+yKDHlycADeNpD5v+Q+6a0QDEFoyjW4U3jlL4R3UCoLS7u3+o1IWXYxTEe0JqjdqpBgMBLxVAOZb0H9W7wJ1MiAYUH20LOGwhm8eb/ X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: afb50323-2d68-4820-3c91-08d77f449944 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2019 20:48:10.3463 (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: SvGmHvJ/PmSCZ1zQVaPDHlU+TM7IfjHXdZGxab4gPO0zRApP3jvxrDfUgOuqEOQe+4gkTBwTZRJqRS3VDbCypA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3130 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 12/12/19 12:53 AM, Ni, Ray wrote: > Do you really need to define the PCD in MdePkg? > General guide lines are: > 1. Avoid UefiCpuPkg depend on MdeModulePkg. > 2. Do not define platform level PCD in core pkgs (MdePkg, MdeModulePkg, UefiCpuPkg, etc) > > > PcdSevEsIsEnabled seems to be used in OVMF pkg only so how about define that in OvmfPkg.dec? PcdSevEsIsEnabled is used by the UefiCpuPkg in the MP library. I can move it from MdeModulePkg and into UefiCpuPkg if that's preferred? Thanks, Tom > > Thanks, > Ray > >> -----Original Message----- >> From: Tom Lendacky >> Sent: Thursday, November 21, 2019 4:06 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: [RFC PATCH v3 01/43] MdePkg: 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%7Cf366369db18d403f73f808d77ed01213%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637117304445443903&sdata=MlMdAafNmnwELGgm0I2qngT41Zr%2FuhjcUgYnOxfaMbY%3D&reserved=0 >> >> Two new fixed PCSs are needed to support SEV-ES under OVMF: >> - PcdSecGhcbBase UINT64 value that is the base address of the GHCB >> used during the SEC phase. >> - PcdSecGhcbSize UINT64 value that is the size, in bytes, of the GHCB >> area used during the SEC phase. >> >> Three new dynamic PCDs are needed to support SEV-ES under OVMF: >> - PcdSevEsIsEnabled: BOOLEAN value used to indicate if SEV-ES is enabled >> - 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 | 23 +++++++++++++++++++++++ >> 1 file changed, 23 insertions(+) >> >> diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec >> index 41b9e70a1ac8..c3bdfcc80971 100644 >> --- a/MdeModulePkg/MdeModulePkg.dec >> +++ b/MdeModulePkg/MdeModulePkg.dec >> @@ -1037,6 +1037,14 @@ [PcdsFixedAtBuild] >> # @Prompt Enable UEFI Stack Guard. >> gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard|FALSE|BOOLEAN|0x30001055 >> >> + ## The base address of the SEC GHCB page. >> + # @Prompt SEC GHCB Base Address >> + gEfiMdeModulePkgTokenSpaceGuid.PcdSecGhcbBase|0|UINT32|0x30001056 >> + >> + ## The total size of the SEC GHCB page. >> + # @Prompt SEC GHCB Size >> + gEfiMdeModulePkgTokenSpaceGuid.PcdSecGhcbSize|0|UINT32|0x30001057 >> + >> [PcdsFixedAtBuild, PcdsPatchableInModule] >> ## Dynamic type PCD can be registered callback function for Pcd setting action. >> # PcdMaxPeiPcdCallBackNumberPerPcdEntry indicates the maximum number of callback function >> @@ -2053,6 +2061,21 @@ [PcdsDynamic, PcdsDynamicEx] >> # @Prompt If there is any test key used by the platform. >> gEfiMdeModulePkgTokenSpaceGuid.PcdTestKeyUsed|FALSE|BOOLEAN|0x00030003 >> >> + ## This dynamic PCD indicates whether SEV-ES is enabled >> + # TRUE - SEV-ES is enabled >> + # FALSE - SEV-ES is not enabled >> + # @Prompt SEV-ES Status >> + gEfiMdeModulePkgTokenSpaceGuid.PcdSevEsIsEnabled|FALSE|BOOLEAN|0x00030007 >> + >> + ## This dynamic PCD holds the base address of the GHCB pool allocation. >> + # @Prompt GHCB Pool Base Address >> + gEfiMdeModulePkgTokenSpaceGuid.PcdGhcbBase|0|UINT64|0x00030008 >> + >> + ## 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|0x00030009 >> + >> [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. >> -- >> 2.17.1 >