From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B868E81F5C for ; Wed, 8 Feb 2017 00:38:42 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx16.intmail.prod.int.phx2.redhat.com [10.5.11.28]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4B0E661E4D; Wed, 8 Feb 2017 08:38:43 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-31.phx2.redhat.com [10.3.116.31]) by smtp.corp.redhat.com (Postfix) with ESMTP id 02D9097CAA; Wed, 8 Feb 2017 08:38:41 +0000 (UTC) To: Leo Duran , edk2-devel@ml01.01.org References: <1486497223-22694-1-git-send-email-leo.duran@amd.com> <1486497223-22694-2-git-send-email-leo.duran@amd.com> Cc: Feng Tian , Brijesh Singh , Star Zeng From: Laszlo Ersek Message-ID: <95a53746-5847-27c8-b8a4-3e437982f7e9@redhat.com> Date: Wed, 8 Feb 2017 09:38:39 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <1486497223-22694-2-git-send-email-leo.duran@amd.com> X-Scanned-By: MIMEDefang 2.74 on 10.5.11.28 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 08 Feb 2017 08:38:43 +0000 (UTC) Subject: Re: [PATCH] MdeModulePkg: Add dynamic PCD PcdPteMemoryEncryptionAddressOrMask X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2017 08:38:42 -0000 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit On 02/07/17 20:53, Leo Duran wrote: > From: Brijesh Singh > > This dynamic PCD holds the address mask for page table entries when memory > encryption is enabled on AMD processors supporting the Secure Encrypted > Virtualization (SEV) feature. > > Cc: Feng Tian > Cc: Star Zeng > Cc: Laszlo Ersek > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Leo Duran > --- > MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf | 5 ++++- > MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c | 18 ++++++++++-------- > MdeModulePkg/MdeModulePkg.dec | 8 ++++++++ > 3 files changed, 22 insertions(+), 9 deletions(-) [snip] > diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec > index 273cd7e..207384f 100644 > --- a/MdeModulePkg/MdeModulePkg.dec > +++ b/MdeModulePkg/MdeModulePkg.dec > @@ -6,6 +6,8 @@ > # Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.
> # Copyright (c) 2016, Linaro Ltd. All rights reserved.
> # (C) Copyright 2016 Hewlett Packard Enterprise Development LP
> +# Copyright (c) 2017, AMD Incorporated. All rights reserved.
> +# > # This program and the accompanying materials are licensed and made available under > # the terms and conditions of the BSD License that accompanies this distribution. > # The full text of the license may be found at > @@ -1738,5 +1740,11 @@ [PcdsDynamic, PcdsDynamicEx] > # @Prompt If there is any test key used by the platform. > gEfiMdeModulePkgTokenSpaceGuid.PcdTestKeyUsed|FALSE|BOOLEAN|0x00030003 > > + ## This dynamic PCD holds the address mask for page table entries when memory encryption is > + # enabled on AMD processors supporting the Secure Encrypted Virtualization (SEV) feature. > + # This mask should be applied when creating 1:1 virtual to physical mapping tables. > + # > + gEfiMdeModulePkgTokenSpaceGuid.PcdPteMemoryEncryptionAddressOrMask|0x0|UINT64|0x00030004 > + > [UserExtensions.TianoCore."ExtraFiles"] > MdeModulePkgExtra.uni > I think this PCD should be added to the following section of the DEC file: [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx] Although OVMF will use the PCD as a dynamic one, I see no reason why the DEC file should prohibit setting the PCD as a fixed one. Looking at other PCDs in the [PcdsDynamic, PcdsDynamicEx] section, most of those seem to stand for data that are impossible to determine at build time. Is the new PCD impossible to determine at build time, for any platform at all? ... Of course, if it can be proved that any given platform will either (a) set this new PCD dynamically, or (b) not even *include* the PCD -- with a dynamic default value -- in its platform DSC file, then this patch can work too. Thanks Laszlo