public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Duran, Leo" <leo.duran@amd.com>
To: 'Laszlo Ersek' <lersek@redhat.com>,
	"edk2-devel@ml01.01.org" <edk2-devel@ml01.01.org>
Cc: Feng Tian <feng.tian@intel.com>,
	"Singh, Brijesh" <brijesh.singh@amd.com>,
	 Star Zeng <star.zeng@intel.com>
Subject: Re: [PATCH] MdeModulePkg: Add dynamic PCD PcdPteMemoryEncryptionAddressOrMask
Date: Wed, 8 Feb 2017 15:12:06 +0000	[thread overview]
Message-ID: <DM5PR12MB12432564C664A3CEE86663DEF9420@DM5PR12MB1243.namprd12.prod.outlook.com> (raw)
In-Reply-To: <95a53746-5847-27c8-b8a4-3e437982f7e9@redhat.com>

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 <leo.duran@amd.com>; edk2-devel@ml01.01.org
> Cc: Feng Tian <feng.tian@intel.com>; Singh, Brijesh
> <brijesh.singh@amd.com>; Star Zeng <star.zeng@intel.com>
> Subject: Re: [edk2] [PATCH] MdeModulePkg: Add dynamic PCD
> PcdPteMemoryEncryptionAddressOrMask
> 
> On 02/07/17 20:53, Leo Duran wrote:
> > From: Brijesh Singh <brijesh.singh@amd.com>
> >
> > 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 <feng.tian@intel.com>
> > Cc: Star Zeng <star.zeng@intel.com>
> > Cc: Laszlo Ersek <lersek@redhat.com>
> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: Leo Duran <leo.duran@amd.com>
> > ---
> >  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.<BR>  # Copyright (c) 2016, Linaro Ltd. All rights
> > reserved.<BR>  # (C) Copyright 2016 Hewlett Packard Enterprise
> > Development LP<BR>
> > +# Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR> #
> >  # 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
> >
> 
> 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?
> 
[Duran, Leo] 
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.
> 
> Thanks
> Laszlo


  reply	other threads:[~2017-02-08 15:12 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-07 19:53 [PATCH] MdeModulePkg: Add dynamic PCD Leo Duran
2017-02-07 19:53 ` [PATCH] MdeModulePkg: Add dynamic PCD PcdPteMemoryEncryptionAddressOrMask Leo Duran
2017-02-08  2:27   ` Zeng, Star
2017-02-08 16:59     ` Duran, Leo
2017-02-08 17:05       ` Yao, Jiewen
2017-02-08 17:10         ` Laszlo Ersek
2017-02-08 17:17           ` Yao, Jiewen
2017-02-08 17:27             ` Yao, Jiewen
2017-02-08 17:51               ` Laszlo Ersek
2017-02-08 18:20                 ` Yao, Jiewen
2017-02-08 19:47                   ` Laszlo Ersek
2017-02-09  5:12                     ` Zeng, Star
2017-02-09  5:22                       ` Yao, Jiewen
2017-02-09  5:56                         ` Zeng, Star
2017-02-09  9:10                           ` Laszlo Ersek
2017-02-09  9:18                             ` Zeng, Star
2017-02-09  5:26                       ` Zeng, Star
2017-02-09  9:13                         ` Laszlo Ersek
2017-02-09  9:17                           ` Zeng, Star
2017-02-09  9:46                             ` Laszlo Ersek
2017-02-08 17:55             ` Duran, Leo
2017-02-08 17:28           ` Duran, Leo
2017-02-08 17:56             ` Laszlo Ersek
2017-02-08 18:13               ` Yao, Jiewen
2017-02-08 18:36                 ` Laszlo Ersek
2017-02-08 17:52         ` Duran, Leo
2017-02-08  8:38   ` Laszlo Ersek
2017-02-08 15:12     ` Duran, Leo [this message]
2017-02-08 15:19   ` Gao, Liming
2017-02-08 17:11     ` Duran, Leo
2017-02-08 17:29       ` Yao, Jiewen
2017-02-08 18:30         ` Duran, Leo
2017-02-08 18:33           ` Yao, Jiewen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DM5PR12MB12432564C664A3CEE86663DEF9420@DM5PR12MB1243.namprd12.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox