From patchwork Wed Jan 16 21:22:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 155771 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp1152746jaa; Wed, 16 Jan 2019 13:22:34 -0800 (PST) X-Google-Smtp-Source: ALg8bN7PciS0dIn5PiT56FHNGuxIJhcuWq9N8dSNoXqBPk3lERKfFj7TirEEsLjEMNIf9llVW5Qp X-Received: by 2002:a63:374e:: with SMTP id g14mr10991822pgn.59.1547673753995; Wed, 16 Jan 2019 13:22:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547673753; cv=none; d=google.com; s=arc-20160816; b=daaLM3RQ36IY3DLekTu1ylyTg0lispZZRWrpRrEVcSwRviDr5NFKlX8quzzjGLN7qq TTdXtpIIpc2z/ZhCFirRuG66Gnaj1okB5MrdHhEHmkjTUfiHn8AJdz0ugJLbS5iiC5I9 okO36xmE2m8BgjwilcghekfdXHE80o56WtHIA1TAUVIwP9j9zmoEFQjZjW5tNQx6sjEY RleNRTZjvr4UCGvduBwSGyVN3q6II757RS5VbQiPI6PF5jmzuvwBmCgBXS13uevRTtdj AkW4a/ACtztnttb/Zcc/7o90nxle6K/zcGPEHw4cZ5JtcWJbN9/Uo0rrCp6b3mST7UmJ cxrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to; bh=iVIcoS8YJwj0mVv6Z7RxLo/beGYN9FeFFx3jlV/jAb0=; b=RAtx6Q58/HMnRCHnJ+I0vy129n+0+qGd5eS/lxRsg3LG6jEHNi74JKVGJ7KLySq4rY bIiSUWcnviU9/VEb173bWYapDaZPFDSP8U8tH01vroOPk/AT+0G1uQMASZNK6RbYfOJ1 3suFyh57nvi6eZXe3FDu4ky7ilDfz5FudCyCpd8xjNB09C/H/Weme3YXV0flNR7htXbF pNlst3dVjjq1bFX/aPfkiqHzY4RCrU3RX/cEjkp0yzFid23DcagX321wMSiEUoD/N03m owO2RWMlYV3XZn/+mXuunBP5pYvzq8/vZJXogQpAQiQ9ImUlP6LlIBq1S7s1DeBreKWV Mfpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=QS0GiAli; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id d4si348985plj.334.2019.01.16.13.22.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Jan 2019 13:22:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=QS0GiAli; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 96311211B81A8; Wed, 16 Jan 2019 13:22:32 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:4864:20::341; helo=mail-wm1-x341.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) (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 15789211B81A2 for ; Wed, 16 Jan 2019 13:22:31 -0800 (PST) Received: by mail-wm1-x341.google.com with SMTP id f188so3575938wmf.5 for ; Wed, 16 Jan 2019 13:22:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=G7N5j6m5QWjSCvmOT+nhf+0fvV9t4sCwCr0ar+pxWxc=; b=QS0GiAli/A5uuKlsA+y2ElNEbk68IeWFxNhQD+80syONFZ4OuQEO66pdzTR20cr2iw oR9btvuXkGl34evuF0LiI6GuDluoe7o6ztNU05QcVyj4+w2mK5V7XSRX4mjzacPW9DOm DET87iMSy4oU/v4T8gGfH/6FoPagX2Jbjvr0Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=G7N5j6m5QWjSCvmOT+nhf+0fvV9t4sCwCr0ar+pxWxc=; b=UKFkw2gPko9+zIaKehqKT77beP9k7wpDd1qTIysXoteTS/6oTr+es+Z+KshchAHXLx lJ6inbKuhmQNfhz4Fwn8PtJM5ZbPY214/mx6FFTJKvAAf7Ry0iuImWp+xBx7YkNwh9ls 3svrwwzs7UHhqCF1VsAL8rIr782qDG6+0mUYISKJ/mHFD0RmluohuvPKZODmJI41S1oY qpIZUSZdSnp2T0jzGOOs6MaifHQ1IxFeZnvO8PDxHyk7DsEtC0LDpeh2krJKzzelWnWi TzGOltb+LhWnIWF6wsaA/1YDJTAY3fhxM6jWXIxIv1Hx4KeKbsxBFMFESk0/QxIxP1GF R4lA== X-Gm-Message-State: AJcUukfmU49xSB0wqVL3MgCUE8yqkkprdAzy5FYyq7Eg05AR1Nm8ubIQ 0ZMuRHEhkEAbWxxHGzLg9pU2OgbbvhK4Fg== X-Received: by 2002:a1c:1d81:: with SMTP id d123mr8871093wmd.112.1547673749249; Wed, 16 Jan 2019 13:22:29 -0800 (PST) Received: from dogfood.home ([2a01:cb1d:112:6f00:28df:207d:542c:1451]) by smtp.gmail.com with ESMTPSA id l14sm162789095wrp.55.2019.01.16.13.22.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Jan 2019 13:22:28 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Wed, 16 Jan 2019 22:22:19 +0100 Message-Id: <20190116212221.7460-3-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190116212221.7460-1-ard.biesheuvel@linaro.org> References: <20190116212221.7460-1-ard.biesheuvel@linaro.org> Subject: [edk2] [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: , Cc: Ting Ye , Liming Gao , Hao Wu , Jiewen Yao , Star Zeng , Michael D Kinney , Chao Zhang MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" 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. 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(-) -- 2.17.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Jian J Wang Reviewed-by: Jiewen.yao@intel.com diff --git a/SecurityPkg/Library/PlatformSecureLibNull/PlatformSecureLibNull.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. **/ +#include + BOOLEAN mUserPhysicalPresence = FALSE; /** @@ -53,15 +55,14 @@ UserPhysicalPresent ( @retval EFI_SUCCESS PcdUserPhysicalPresence is got successfully. **/ -EFI_STATUS +RETURN_STATUS EFIAPI PlatformSecureLibNullConstructor ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable + VOID ) { mUserPhysicalPresence = PcdGetBool(PcdUserPhysicalPresence); - return EFI_SUCCESS; + return RETURN_SUCCESS; } diff --git a/SecurityPkg/Library/PlatformSecureLibNull/PlatformSecureLibNull.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 = PlatformSecureLibNull MODULE_UNI_FILE = PlatformSecureLibNull.uni FILE_GUID = 7FA68D82-10A4-4e71-9524-D3D9500D3CDF - MODULE_TYPE = DXE_DRIVER + MODULE_TYPE = BASE VERSION_STRING = 1.0 - LIBRARY_CLASS = PlatformSecureLib|DXE_RUNTIME_DRIVER DXE_SMM_DRIVER DXE_DRIVER + LIBRARY_CLASS = PlatformSecureLib|DXE_RUNTIME_DRIVER DXE_SMM_DRIVER DXE_DRIVER MM_STANDALONE CONSTRUCTOR = PlatformSecureLibNullConstructor #