From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4864:20::d43; helo=mail-io1-xd43.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-io1-xd43.google.com (mail-io1-xd43.google.com [IPv6:2607:f8b0:4864:20::d43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B179321A09130 for ; Tue, 5 Mar 2019 08:16:57 -0800 (PST) Received: by mail-io1-xd43.google.com with SMTP id e1so7531699iok.1 for ; Tue, 05 Mar 2019 08:16:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=Fj9yAWWVW2In1KexAb2GlKQmFGuhEgv8DH5WbwhecKk=; b=dnqGdLKjktRKIN9DaLO/OfGNIBVljIGN4z5NQVTQYKls0W7q1nOliHzlT3i77x9tZV W8G3pmhdPXuzP1ZKmciD3ogYuHwdptG5i3o8MIQ7VoC10RYqGP4vrD0znXxUCCTuuTgz JtI+ViFyVe5FS688Hb+VyWmVNNwemmi4rGb+r2hQ3atDq/r0PygcWdsnlJ6P70gr5PpY 7gfnzoZaD4/lXiER8qerxqYeLQa9nWaIbRvaZK6rRBi93GmJEleKKi0kQAtYDZVCbJA8 n+e28Md3OUlTgtX5Ek3z1PwywBZvE0NgzzgsA56CCb4oQcF97FpvT0k1tueuW9OknE7f cYzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=Fj9yAWWVW2In1KexAb2GlKQmFGuhEgv8DH5WbwhecKk=; b=uhbo3Fqs7ElPDVfi+0yEG1VvaglUv3vph63Lvq34dlEV7JrukXCMwdekDpU6MylmsC NLJbVF3sKmuthgX2x7XMkKR805+Ek0BOTf7mtic6mM99LShAbxOtrpO5zjnt/RioGGZx r4BOwylxQZGvPfHMK/ovw9GzWVlxgkTBn6MLQ965GAA/iJdcRYNHzUzKRBWiqAWB3ufb Znhx/ycb+mxjU3vV4XjYxajSCi1N4bVE53h0NcF+x3mn9jd5WqR7e0xrCorKn+IMSf7u OKMhjmMAYLvOY8FN1J9N+ZoI/4DwtezI1jRAn42GhvS+4/DK+eyEf57C79aM3pIigCZN YwAw== X-Gm-Message-State: APjAAAXHdn9MUYCNoqRxEs5Pj+mTSRV5Ie0J4KSOo4hmT12nEw5LIv/M +RPcAAF/A02MwMJdJjhdd1tqGhK2twPUmqQipoGHXA== X-Google-Smtp-Source: APXvYqxDr0/tscBqd7xR7UPWrtWLh08L2HzASsRlkUTNXn/ViRI/CbRLduioH/KWrG+qK7RGrfoYm7HHFKbDUPgx5Bg= X-Received: by 2002:a6b:6511:: with SMTP id z17mr499444iob.173.1551802616474; Tue, 05 Mar 2019 08:16:56 -0800 (PST) MIME-Version: 1.0 References: <1551689639-21446-1-git-send-email-jagadeesh.ujja@arm.com> <74D8A39837DF1E4DA445A8C0B3885C503F54FA39@shsmsx102.ccr.corp.intel.com> In-Reply-To: <74D8A39837DF1E4DA445A8C0B3885C503F54FA39@shsmsx102.ccr.corp.intel.com> From: Ard Biesheuvel Date: Tue, 5 Mar 2019 17:16:41 +0100 Message-ID: To: "Yao, Jiewen" Cc: Jagadeesh Ujja , Achin Gupta , "Gao, Liming" , "edk2-devel@lists.01.org" , "Zhang, Chao B" , "Kinney, Michael D" , "Zeng, Star" Subject: Re: [PATCH v3] StandaloneMmPkg/Library: Install Variable Arch Protocol X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Mar 2019 16:16:58 -0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 5 Mar 2019 at 17:15, Yao, Jiewen wrote: > > I look at the patch. I don=E2=80=99t have concern. > > Please go ahead. > Thank you Jiewen, I will take that as a reviewed-by and proceed with merging the patch once the hard freeze is over. > > -----Original Message----- > > From: Jagadeesh Ujja [mailto:jagadeesh.ujja@arm.com] > > Sent: Tuesday, March 5, 2019 6:09 AM > > To: Ard Biesheuvel > > Cc: Achin Gupta ; Yao, Jiewen > > ; Gao, Liming ; > > edk2-devel@lists.01.org; Zhang, Chao B ; Kinney= , > > Michael D ; Zeng, Star > > Subject: Re: [edk2] [PATCH v3] StandaloneMmPkg/Library: Install Variabl= e > > Arch Protocol > > > > hi Jiewen, Achin > > > > On Mon, Mar 4, 2019 at 4:16 PM Ard Biesheuvel > > wrote: > > > > > > (add StandaloneMmPkg maintainers) > > > > > Please let me know if you have any comments on this patch > > > > > On Mon, 4 Mar 2019 at 09:54, Jagadeesh Ujja > > wrote: > > > > > > > > In a system implementing the variable store in MM, there are no var= iable > > > > arch protocol and variable write arch protocol installed into the > > > > DXE_SMM protocol database. On such systems, it is not required to > > > > locate these protocols by the DXE runtime variable drivers because > > > > it can be assumed that these protocols are already installed in the > > > > MM context. But then such an implementation will deviate from the > > > > existing traditional MM based variable driver implementation. > > > > > > > > So in order to maintain consistency with the traditional MM variabl= e > > > > driver implementation, allow platforms to install these protocols i= nto > > > > the DXE protocol database but these protocol will not be consumed > > > > by non-secure variable service runtime driver. > > > > > > > > The Platform which uses StandaloneMM based secure variable storage > > > > have to include this library > > > > > > > > Example > > > > In edk2-platforms/Platform/ARM/SgiPkg/SgiPlatform.dsc > > > > > > > > ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.inf { > > > > > > > > > > NULL|StandaloneMmPkg/Library/VariableMmDependency/VariableMmDep > > endency.inf > > > > } > > > > > > > > Contributed-under: TianoCore Contribution Agreement 1.1 > > > > Signed-off-by: Jagadeesh Ujja > > > > > > Reviewed-by: Ard Biesheuvel > > > > > > > --- > > > > Changes since v2: > > > > - Addressed the comments from Ard Biesheuvel and Zeng Star > > > > > > > > Changes since v1: > > > > - This is a next version of patch > > > > =E2=80=9CMdeModulePkg/VariableSmmRuntimeDxe: Refactor locating > > Variable Arch Protocol=E2=80=9D. > > > > > > [https://lists.01.org/pipermail/edk2-devel/2019-February/036885.html] > > > > - Addressed the comments from Ard Biesheuvel and Zeng Star > > > > - Can this library be placed in MdePkg rather then the StandaloneMm= Pkg? > > > > > > > > > > StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependenc > > y.c | 54 ++++++++++++++++++++ > > > > > > StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependenc > > y.inf | 46 +++++++++++++++++ > > > > 2 files changed, 100 insertions(+) > > > > > > > > diff --git > > a/StandaloneMmPkg/Library/VariableMmDependency/VariableMmDepende > > ncy.c > > b/StandaloneMmPkg/Library/VariableMmDependency/VariableMmDepende > > ncy.c > > > > new file mode 100644 > > > > index 0000000..7e0f31b > > > > --- /dev/null > > > > +++ > > b/StandaloneMmPkg/Library/VariableMmDependency/VariableMmDepende > > ncy.c > > > > @@ -0,0 +1,54 @@ > > > > +/** @file > > > > + Runtime DXE part corresponding to StanaloneMM variable module. > > > > + > > > > +This module installs variable arch protocol and variable write arc= h > > protocol > > > > +to StandaloneMM runtime variable service. > > > > + > > > > +Copyright (c) 2019, ARM Ltd. All rights reserved. > > > > + > > > > +This program and the accompanying materials > > > > +are licensed and made available under the terms and conditions of = the > > BSD License > > > > +which accompanies this distribution. The full text of the license= may > > be found at > > > > +http://opensource.org/licenses/bsd-license.php. > > > > + > > > > +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" > > BASIS, > > > > +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER > > EXPRESS OR IMPLIED. > > > > + > > > > +**/ > > > > + > > > > +#include > > > > +#include > > > > + > > > > +/** > > > > + The constructor function installs variable arch protocol and var= iable > > > > + write arch protocol to StandaloneMM runtime variable service > > > > + > > > > + @param ImageHandle The firmware allocated handle for the EFI > > image. > > > > + @param SystemTable A pointer to the Management mode > > System Table. > > > > + > > > > + @retval EFI_SUCCESS The constructor always returns > > EFI_SUCCESS. > > > > + > > > > +**/ > > > > +EFI_STATUS > > > > +EFIAPI > > > > +VariableMmDependencyLibConstructor ( > > > > + IN EFI_HANDLE ImageHandle, > > > > + IN EFI_SYSTEM_TABLE *SystemTable > > > > + ) > > > > +{ > > > > + EFI_STATUS Status; > > > > + EFI_HANDLE Handle; > > > > + > > > > + Handle =3D NULL; > > > > + Status =3D gBS->InstallMultipleProtocolInterfaces ( > > > > + &Handle, > > > > + &gEfiSmmVariableProtocolGuid, > > > > + NULL, > > > > + &gSmmVariableWriteGuid, > > > > + NULL, > > > > + NULL > > > > + ); > > > > + ASSERT_EFI_ERROR (Status); > > > > + return EFI_SUCCESS; > > > > +} > > > > + > > > > diff --git > > a/StandaloneMmPkg/Library/VariableMmDependency/VariableMmDepende > > ncy.inf > > b/StandaloneMmPkg/Library/VariableMmDependency/VariableMmDepende > > ncy.inf > > > > new file mode 100644 > > > > index 0000000..e71c44d > > > > --- /dev/null > > > > +++ > > b/StandaloneMmPkg/Library/VariableMmDependency/VariableMmDepende > > ncy.inf > > > > @@ -0,0 +1,46 @@ > > > > +## @file > > > > +# Runtime DXE part corresponding to StanaloneMM variable module. > > > > +# > > > > +# This module installs variable arch protocol and variable write = arch > > protocol > > > > +# to StandaloneMM runtime variable service. > > > > +# > > > > +# Copyright (c) 2019, ARM Ltd. All rights reserved. > > > > +# This program and the accompanying materials > > > > +# are licensed and made available under the terms and conditions o= f the > > BSD License > > > > +# which accompanies this distribution. The full text of the licens= e may > > be found at > > > > +# http://opensource.org/licenses/bsd-license.php > > > > +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS > > IS" BASIS, > > > > +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER > > EXPRESS OR IMPLIED. > > > > +# > > > > +## > > > > + > > > > +[Defines] > > > > + INF_VERSION =3D 0x0001001A > > > > + BASE_NAME =3D VariableMmDependency > > > > + FILE_GUID =3D > > 64BC4129-778E-4867-BA07-13999A4DEC3F > > > > + MODULE_TYPE =3D DXE_DRIVER > > > > + LIBRARY_CLASS =3D NULL > > > > + CONSTRUCTOR =3D > > VariableMmDependencyLibConstructor > > > > + > > > > +# > > > > +# The following information is for reference only and not required= by > > the build tools. > > > > +# > > > > +# VALID_ARCHITECTURES =3D AARCH64 > > > > +# > > > > +# > > > > + > > > > +[Sources] > > > > + VariableMmDependency.c > > > > + > > > > +[Packages] > > > > + MdePkg/MdePkg.dec > > > > + MdeModulePkg/MdeModulePkg.dec > > > > + > > > > +[Protocols] > > > > + gEfiSmmVariableProtocolGuid ## PRODUCES > > > > + > > > > +[Guids] > > > > + gSmmVariableWriteGuid ## PRODUCES > > ## GUID # Install protocol > > > > + > > > > +[Depex] > > > > + TRUE > > > > -- > > > > 2.7.4 > > > > > > > _______________________________________________ > > > edk2-devel mailing list > > > edk2-devel@lists.01.org > > > https://lists.01.org/mailman/listinfo/edk2-devel