From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.93; helo=mga11.intel.com; envelope-from=jian.j.wang@intel.com; receiver=edk2-devel@lists.01.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (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 932E9211B85F8 for ; Thu, 17 Jan 2019 23:06:27 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jan 2019 23:06:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,489,1539673200"; d="scan'208";a="127016417" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga002.jf.intel.com with ESMTP; 17 Jan 2019 23:06:23 -0800 Received: from fmsmsx154.amr.corp.intel.com (10.18.116.70) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 17 Jan 2019 23:06:22 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX154.amr.corp.intel.com (10.18.116.70) with Microsoft SMTP Server (TLS) id 14.3.408.0; Thu, 17 Jan 2019 23:06:21 -0800 Received: from shsmsx107.ccr.corp.intel.com ([169.254.9.239]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.150]) with mapi id 14.03.0415.000; Fri, 18 Jan 2019 15:06:19 +0800 From: "Wang, Jian J" To: Ard Biesheuvel , "edk2-devel@lists.01.org" CC: "Kinney, Michael D" , "Gao, Liming" , "Ye, Ting" , "Wei, Gang" , "Zhang, Chao B" , "Yao, Jiewen" , "Wu, Hao A" , "Zeng, Star" , Achin Gupta , Jagadeesh Ujja Thread-Topic: [PATCH 2/4] SecurityPkg/PlatformSecureLibNull: permit use by MM_STANDALONE modules Thread-Index: AQHUreGc2ArqAo8RDU6fI0AShH51YKW0nNNg Date: Fri, 18 Jan 2019 07:06:19 +0000 Message-ID: References: <20190116212221.7460-1-ard.biesheuvel@linaro.org> <20190116212221.7460-3-ard.biesheuvel@linaro.org> In-Reply-To: <20190116212221.7460-3-ard.biesheuvel@linaro.org> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYjVkMjVmYWEtNjQwMy00OTRjLWExM2YtMGRjMTliM2NhNDZmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoianlwRlNlcFE0UHdaZzd6QVJHaGRKUk9NOWVWbnVIT0VGem9sMHNTTnNjc0xhaEFXazZtbENab3lGMDVueDhGSSJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH 2/4] SecurityPkg/PlatformSecureLibNull: permit use by MM_STANDALONE modules 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: Fri, 18 Jan 2019 07:06:27 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jian J Wang > -----Original Message----- > From: Ard Biesheuvel [mailto:ard.biesheuvel@linaro.org] > Sent: Thursday, January 17, 2019 5:22 AM > To: edk2-devel@lists.01.org > Cc: Ard Biesheuvel ; Kinney, Michael D > ; Gao, Liming ; Ye, Tin= g > ; Wei, Gang ; Wang, Jian J > ; Zhang, Chao B ; Yao, > Jiewen ; Wu, Hao A ; Zeng, Star > ; Achin Gupta ; Jagadeesh Ujja > > Subject: [PATCH 2/4] SecurityPkg/PlatformSecureLibNull: permit use by > MM_STANDALONE modules >=20 > Add MM_STANDALONE to the list of module types that are permitted to > link to this library. Also, since the constructor prototype is > different between MM_STANDALONE and DXE_DRIVER type libraries, > convert the library into BASE type. >=20 > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Ard Biesheuvel > --- > SecurityPkg/Library/PlatformSecureLibNull/PlatformSecureLibNull.c | 9 = +++++- > --- > SecurityPkg/Library/PlatformSecureLibNull/PlatformSecureLibNull.inf | 4 = ++-- > 2 files changed, 7 insertions(+), 6 deletions(-) >=20 > diff --git a/SecurityPkg/Library/PlatformSecureLibNull/PlatformSecureLibN= ull.c > b/SecurityPkg/Library/PlatformSecureLibNull/PlatformSecureLibNull.c > index 0c6ded22f3e6..b2493a029393 100644 > --- a/SecurityPkg/Library/PlatformSecureLibNull/PlatformSecureLibNull.c > +++ b/SecurityPkg/Library/PlatformSecureLibNull/PlatformSecureLibNull.c > @@ -15,6 +15,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY > KIND, EITHER EXPRESS OR IMPLIED. >=20 > **/ >=20 > +#include > + > BOOLEAN mUserPhysicalPresence =3D FALSE; >=20 > /** > @@ -53,15 +55,14 @@ UserPhysicalPresent ( > @retval EFI_SUCCESS PcdUserPhysicalPresence is got successfu= lly. >=20 > **/ > -EFI_STATUS > +RETURN_STATUS > EFIAPI > PlatformSecureLibNullConstructor ( > - IN EFI_HANDLE ImageHandle, > - IN EFI_SYSTEM_TABLE *SystemTable > + VOID > ) > { >=20 > mUserPhysicalPresence =3D PcdGetBool(PcdUserPhysicalPresence); >=20 > - return EFI_SUCCESS; > + return RETURN_SUCCESS; > } > diff --git a/SecurityPkg/Library/PlatformSecureLibNull/PlatformSecureLibN= ull.inf > b/SecurityPkg/Library/PlatformSecureLibNull/PlatformSecureLibNull.inf > index 979a33705de0..70051a27a0a9 100644 > --- a/SecurityPkg/Library/PlatformSecureLibNull/PlatformSecureLibNull.inf > +++ b/SecurityPkg/Library/PlatformSecureLibNull/PlatformSecureLibNull.inf > @@ -21,9 +21,9 @@ [Defines] > BASE_NAME =3D PlatformSecureLibNull > MODULE_UNI_FILE =3D PlatformSecureLibNull.uni > FILE_GUID =3D 7FA68D82-10A4-4e71-9524-D3D9500D3CD= F > - MODULE_TYPE =3D DXE_DRIVER > + MODULE_TYPE =3D BASE > VERSION_STRING =3D 1.0 > - LIBRARY_CLASS =3D PlatformSecureLib|DXE_RUNTIME_DRIVE= R > DXE_SMM_DRIVER DXE_DRIVER > + LIBRARY_CLASS =3D PlatformSecureLib|DXE_RUNTIME_DRIVE= R > DXE_SMM_DRIVER DXE_DRIVER MM_STANDALONE > CONSTRUCTOR =3D PlatformSecureLibNullConstructor >=20 > # > -- > 2.17.1