From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0602.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe42::602]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id CBC2F81F1C for ; Wed, 8 Feb 2017 07:12:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=kaocRbp34XSts3NgvxeYhEfsPXRfH2RyJQhiWzfME0E=; b=nDOvM7tUlA8IJ1dBF1JdZxjiiG2XxOvtHwNH8FBvemRyptR3VT7Rh8aZ+ZoaHKMOgINO4jS0fYGxQ8Wn4bZ0bvbriSHwDWRj6bXXPStMfS5eINJvln/zMvUIDR7bjTVCVUPxFjd0Yv/Lcwgr/uQjhx6Lbz3rKJkzyicIoIHuhR0= Received: from DM5PR12MB1243.namprd12.prod.outlook.com (10.168.237.22) by DM5PR12MB1610.namprd12.prod.outlook.com (10.172.40.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.16; Wed, 8 Feb 2017 15:12:07 +0000 Received: from DM5PR12MB1243.namprd12.prod.outlook.com ([10.168.237.22]) by DM5PR12MB1243.namprd12.prod.outlook.com ([10.168.237.22]) with mapi id 15.01.0888.026; Wed, 8 Feb 2017 15:12:06 +0000 From: "Duran, Leo" To: 'Laszlo Ersek' , "edk2-devel@ml01.01.org" CC: Feng Tian , "Singh, Brijesh" , Star Zeng Thread-Topic: [edk2] [PATCH] MdeModulePkg: Add dynamic PCD PcdPteMemoryEncryptionAddressOrMask Thread-Index: AQHSgXvpPu5JgE3+Q0eFw1PUQsHrO6FeyoWAgABsL5A= Date: Wed, 8 Feb 2017 15:12:06 +0000 Message-ID: References: <1486497223-22694-1-git-send-email-leo.duran@amd.com> <1486497223-22694-2-git-send-email-leo.duran@amd.com> <95a53746-5847-27c8-b8a4-3e437982f7e9@redhat.com> In-Reply-To: <95a53746-5847-27c8-b8a4-3e437982f7e9@redhat.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=leo.duran@amd.com; x-originating-ip: [165.204.77.1] x-microsoft-exchange-diagnostics: 1; DM5PR12MB1610; 7:qPt8yimGL8K/QEB+Y2Bm2xe9HYc2GiVVHmrYFxirSGCAITHmok84/kR5eo72m1mBsTtqWSfkgxwpbRgGfDllINUzCFT4N5XhGQlB7Fd2qsnsMRTsXDrXmfTP2/RiIyorpC6w0uDvup6NxOrg0TPzi1h2kGFk5ASf2wtz/gDj0IOg/DUclN24P6DW2jiVVAgqxXknAzGekjdCIFWz2hleJYapW6TTbcFxmqWBx5V8YpNt6/IdrEUmBgJIDjAJBFlyrNvjv+I5+DzEakq1adGFqgSQkbGgSEqYh7YhkcRaNMFCT0W5bBskMKlJ7Zrz8HkUxp8WlqMDztL0AELObTMkCIFPjk/H5pM/lkYuXPiKm+TuNnFtvnmscqOQHM2Be3s/DTrmDY1ddqYrF7DMXdaghBujF9O7L6aSnqMFq/YVzTTHGq9Z7+mMnlaCQzb4UgvnXWersPsHjuSNPhVdmn173lq7e50zKFP94E1Ln3uAc1Q6V2k/eyMJyQGDUn7Q6IV/w5nkiyPZvcMCL6PiLK0qQA==; 20:GPQX2WrxCzRZJC4t5A9fuB/7Vs5dKz8aCPEi1fNsgiF+1B6JrPYI61UrdooiL5TMFeXvbmNQzrfx8LSUTPtr9exjgBRmblO9QMr/TbpIxwfiMgAj14kQ6hnUhDCZWPBXON/9pHnqhXDV39VcPfmL7l3/Z0Jpg/lnqG+oXTWbmHz17iJ2ExRjhkTi7EkzSaBs0UOWzBThCsJBc0rXV8e2LSy06qDj/Do9yroWeFJLRPMmfaRyzhlfBTplAuXk9pNy x-forefront-antispam-report: SFV:SKI; SCL:-1SFV:NSPM; SFS:(10009020)(6009001)(6029001)(7916002)(39450400003)(39410400002)(39860400002)(39840400002)(39850400002)(13464003)(189002)(377454003)(199003)(24454002)(101416001)(38730400002)(53546003)(74316002)(6246003)(66066001)(5660300001)(305945005)(97736004)(2950100002)(2900100001)(54356999)(7736002)(68736007)(50986999)(102836003)(6116002)(3846002)(86362001)(76176999)(106116001)(122556002)(105586002)(92566002)(106356001)(7696004)(8676002)(2501003)(25786008)(55016002)(3280700002)(99286003)(229853002)(8936002)(81156014)(81166006)(9686003)(189998001)(2906002)(33656002)(6506006)(54906002)(4326007)(77096006)(3660700001)(6436002)(53936002)(213903007)(19627235001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR12MB1610; H:DM5PR12MB1243.namprd12.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; x-ms-office365-filtering-correlation-id: 0341170b-b4aa-4a05-b4f8-08d45034d899 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081); SRVR:DM5PR12MB1610; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(767451399110)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(2017020702029)(20170203043)(10201501046)(3002001)(6055026)(6041248)(20161123560025)(20161123558025)(20161123564025)(20161123562025)(20161123555025)(6072148); SRVR:DM5PR12MB1610; BCL:0; PCL:0; RULEID:; SRVR:DM5PR12MB1610; x-forefront-prvs: 0212BDE3BE received-spf: None (protection.outlook.com: amd.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Feb 2017 15:12:06.7515 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1610 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 15:12:11 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Lazlo, et al, Please reply below. Leo. > -----Original Message----- > From: Laszlo Ersek [mailto:lersek@redhat.com] > Sent: Wednesday, February 08, 2017 2:39 AM > To: Duran, Leo ; edk2-devel@ml01.01.org > Cc: Feng Tian ; Singh, Brijesh > ; Star Zeng > Subject: Re: [edk2] [PATCH] MdeModulePkg: Add dynamic PCD > PcdPteMemoryEncryptionAddressOrMask >=20 > 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(-) >=20 > [snip] >=20 > > 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|0x0 > 0030003 > > > > + ## 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.PcdPteMemoryEncryptionAddressOrM > ask|0 > > + x0|UINT64|0x00030004 > > + > > [UserExtensions.TianoCore."ExtraFiles"] > > MdeModulePkgExtra.uni > > >=20 > I think this PCD should be added to the following section of the DEC file= : >=20 > [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx] >=20 > 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. >=20 > Looking at other PCDs in the >=20 > [PcdsDynamic, PcdsDynamicEx] >=20 > 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? >=20 [Duran, Leo]=20 The PCD should be determined at runtime using CPUID. However, I suppose you may 'know' about your platform at build time. So to your point, I think it's reasonable to allow fixed, etc. > ... 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. >=20 > Thanks > Laszlo