From patchwork Mon Jan 14 13:27:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 155487 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3658400jaa; Mon, 14 Jan 2019 05:28:18 -0800 (PST) X-Google-Smtp-Source: ALg8bN49ZWsxcFcrUEuSzwgJRLXksjr6/olx1HYsoHgn1A2gKsmT2iw//GPMyctqc7GTpJ5ZIyVA X-Received: by 2002:a17:902:7296:: with SMTP id d22mr25995080pll.265.1547472498178; Mon, 14 Jan 2019 05:28:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547472498; cv=none; d=google.com; s=arc-20160816; b=fS/T5QRMxk9O79+0pJzZvbcQmVNMxzrkTTLn3afRSWA9YbaxTIxSj5OkSizi7l8QJP 9jmbXx7/ZcmigGasUckiYZ7Ju9XvFgWjcCIPhPNzaYqqg0sByU6hz5fGHeY+nieZF7ZV IqfQtzzXMui03SbJa0/zp07X6MXPNWnVGNgAYhfIUOxceFabrBy5x9+tOmJ8vbqpxxYZ bb1kzOkAawH3EFQuBkQqu04M3n4m68d1yNUBjmmjPtRaT5ETNi3Xwyt4DMKZXy9H2P6e 4/zpVNFCC9a9otZs0ihYfyF2mRjOBbH23XA0NNq8XXr9LXx4SBB+ThkxF1FEZHuGORjO 6Oeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=4p8PzmEag2bYFuOV7eJPH8dF/TbB8GLWcyjPfIj5Q1s=; b=gsWMO0Z8xxjwXS4eZM5ewLrZzdl/D22xFiXVstC0gWhFILHZY7KTK3COs32qDijoP0 EhiQq0yOpQsUIFQPprfqozMiMwLTm1CncrgZbKBMrcT/VLYUMu20wO/BD8KNiyswMcyR R6jYDqWcU2tvEOfn7ilVl1Xg0e98/cYIIl0CkIuE0oOT13QpKH4UlWFxZBc8uLuZOoGJ ZPdRkRcHXdwH4pEm5vv1/UmVS4Zf0rDFYK1MPN+11pP8M6A7qodDaTJ4o1b1JBkvyqrh bzPwxW4XORzF1bdatUlbYBnVEOBpwcxKE9wJ5zGLLFMpNf8XQMd+UEpluW86t3FJzRUh 1mVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=YZNM0Vkh; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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. [198.145.21.10]) by mx.google.com with ESMTPS id b5si333627plr.355.2019.01.14.05.28.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 05:28:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=YZNM0Vkh; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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 263A1211B6C0F; Mon, 14 Jan 2019 05:28:16 -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::442; helo=mail-wr1-x442.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) (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 C8FDB21197374 for ; Mon, 14 Jan 2019 05:28:14 -0800 (PST) Received: by mail-wr1-x442.google.com with SMTP id p4so22841866wrt.7 for ; Mon, 14 Jan 2019 05:28:14 -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 :mime-version:content-transfer-encoding; bh=4fr/f7IiPdsB4UQjqmEN9qWFg2bENF8bLpmSTCLMNKo=; b=YZNM0VkhQwQbNqtD701/Vibi7Wu9469dtgU1nJYCp28WLC95+cJJVS3zdQQwuoLWJ7 x+g9Aa3YGa0SzOxJqReKDws4KwU+w/R5P+gPjbzk53YuFh4hE0u+yUqLKiJ4EZYxOodK DcZKa3T4Z6X/A2MKtUFmAbBezTHx1gazXRUg8= 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:mime-version:content-transfer-encoding; bh=4fr/f7IiPdsB4UQjqmEN9qWFg2bENF8bLpmSTCLMNKo=; b=ukE+FZp7Uc59DL3czgEI5vRC6UHvRMTmZ0JJ+QC8ZyBJ8tJWTfXT8v1zplZbwN3zMR p0TNfHexhiUGbBHmpeI0Z30SJohPZAqiYZllPL8d8PAcrNT5vxaV81sCqw/wl4mi3DKU 9lRi20O6v1LUdmpnHbcXo6m8a6NR8P7pgrwRBNwt2b12d6dcFGKTNaTOcIk74NyN8TaW gNDQ1vKw7uRfDeiSs5sqxdL6XB9Sq4v+3iRR9IuiVJWaAmNX5Iiu2fScqWZeOq1+WxpX sK7X0tibz/sHHI+FO3UOfQIP4GbHS28+h9Zp7wZfdfS8BXFM9h7tUrhTO4DKRSoilbw2 YNqw== X-Gm-Message-State: AJcUukcj4+gue9XkYvqZy9CfmUIRJg9raoUzwgQ0xZ0++f0900jleRmR t6C26wgRmMtp0bDIwL/QNigjDTy88UM= X-Received: by 2002:adf:eec9:: with SMTP id a9mr23689004wrp.242.1547472492956; Mon, 14 Jan 2019 05:28:12 -0800 (PST) Received: from localhost.localdomain (aputeaux-684-1-19-62.w90-86.abo.wanadoo.fr. [90.86.222.62]) by smtp.gmail.com with ESMTPSA id 202sm33446560wmt.8.2019.01.14.05.28.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 05:28:11 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Mon, 14 Jan 2019 14:27:42 +0100 Message-Id: <20190114132758.24054-2-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190114132758.24054-1-ard.biesheuvel@linaro.org> References: <20190114132758.24054-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Subject: [edk2] [PATCH v2 01/17] MdeModulePkg/MdeModulePkg.dsc: add MmServicesTableLib resolution 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: Hao Wu , Liming Gao , Michael D Kinney , Laszlo Ersek , Star Zeng Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" The SMM based FTW and variable drivers are going to depend on MmServicesTableLib after a subsequent patch, so add a resolution for it to MdeModulePkg.dsc. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- MdeModulePkg/MdeModulePkg.dsc | 1 + 1 file changed, 1 insertion(+) -- 2.20.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Star Zeng diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc index 5d042be3a862..967fe082aaae 100644 --- a/MdeModulePkg/MdeModulePkg.dsc +++ b/MdeModulePkg/MdeModulePkg.dsc @@ -152,6 +152,7 @@ [LibraryClasses.common.DXE_SMM_DRIVER] HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf DebugLib|MdePkg/Library/UefiDebugLibConOut/UefiDebugLibConOut.inf MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAllocationLib.inf + MmServicesTableLib|MdePkg/Library/MmServicesTableLib/MmServicesTableLib.inf SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.inf LockBoxLib|MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxSmmLib.inf SmmMemLib|MdePkg/Library/SmmMemLib/SmmMemLib.inf From patchwork Mon Jan 14 13:27:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 155488 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3658449jaa; Mon, 14 Jan 2019 05:28:21 -0800 (PST) X-Google-Smtp-Source: ALg8bN4AZd+hDLYU3NQVoiN6PvgXkCM605SnC748nN56ZhuX0DhcHjwqlkUUIj3GXrMCNsnkh+5N X-Received: by 2002:a17:902:bd0b:: with SMTP id p11mr25620217pls.259.1547472501017; Mon, 14 Jan 2019 05:28:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547472501; cv=none; d=google.com; s=arc-20160816; b=i/+bGtcyYgKD0K8ccW1eD++OaSZteK4S2EtnIwCURS7TB4kUehtlTKcJgqZXn8rGqd pa2ei2/J2PuP1iqETIVWyyqbW310zeBaLXW5DL6n7bn6Tn/2fbWG1lSPMbT3lAl87TCb joofkQtDslGXmLE1UE7MSt4pl2CZVx6W0X0qNlfkuoblhQBmhIe434GqwCt3OO/hs2QE +BD7Ynl1Jey8llPG32Pnaau72pew0+bTOGrRteqAEcxgQXGJs7EOFvYz8Ayjfk2AwqR8 oVcb0bEI21ASZOSjL/+O4ffEq5FOv0HOrQ/nQjdU6eHQamj1ZOedeFyx/XBdWmdkvWiI DU3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=uRRQzLvrTQzHHVB5gLHviFb52NiCMPF99NS5vGZ5lFw=; b=a8waAq8ZWDF77dEq2uM/T3zhy/Cn8Zyah3MjCGHtbG76vvCNaLhQP+fGgFn08VJ4Lp kW2O9lhmQ2rAWg3Mmeu/iI232PgDa021b1ryjBEZeICErMyRAjmWPkeNIMKyi+oeAeVb 4TJV/ycWRkM0yJGEEdVnYsZAOeapdEKLReLXc6qeZIeWt/djWTivEtT4c+J/pXukMwH2 /H61EF/SuDJMfCbqLkYDnodkxoPodmpJb6/4+ruP03XjLUWSDEiT8w4aFMUgXPvfKc86 d8knw6zGhQFys+8A3QRvb+9WJtTohyx/LQt1w/NsrM2TO6P7KIXsWO5m9yvJ/9cNaRG6 Q3uQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="UB/reuYB"; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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. [198.145.21.10]) by mx.google.com with ESMTPS id k134si329450pga.401.2019.01.14.05.28.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 05:28:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="UB/reuYB"; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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 55926211B7375; Mon, 14 Jan 2019 05:28:17 -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::441; helo=mail-wr1-x441.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) (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 51FEE2194D3B3 for ; Mon, 14 Jan 2019 05:28:16 -0800 (PST) Received: by mail-wr1-x441.google.com with SMTP id v13so22839092wrw.5 for ; Mon, 14 Jan 2019 05:28:16 -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 :mime-version:content-transfer-encoding; bh=wHKZ20DXbevtTh+liGD4t/qhF91ozzHg2Gtr7yQdWpE=; b=UB/reuYB5zhbIhN4+7f/Qg5HLE50Bn3kRZ+7Vs5P4M+um+Gp0Le7JZvVPwjCteuIj+ VYHMPF9CC7QxlKElTK+PodXqSycL1h/hxc/iUvmFWjIdlmqUKWAITxogKMD3tQ8+gKYD Fe64sIcqOs4LJ4xWXn0avais7AfZ9Y2mzS7WQ= 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:mime-version:content-transfer-encoding; bh=wHKZ20DXbevtTh+liGD4t/qhF91ozzHg2Gtr7yQdWpE=; b=qqUgfDbCtUbHby/xhqkwOkIXP9Oxc9EOMlgihTl9drYsqCDKOzEp3OSTJOdRzT++Vy 4bO0p84MzY3ywkFxnxUq91CkBXye81RNd5m5S1JCRpPhjM76LHBrYMSKU9Fnxp3Zed8F yI3sAbqTrEZkh181t0JSkmacd56H4hpZSB/RsTQJSB7YaxL8Jigdhha5ActG4lL/o+aZ PrTnd9d8q/PrOJEoSoJuPrNcFJgVBWB4+MXQuDABa/G5tPMiGIg0R1+Tb9Mou6oeeCFg GWkr5aNxACagGAF/UEHSm+k3y7IUH4eAJ8V7b5zSm95VHlCqn3toTo163c3fW+sK42ef iUHQ== X-Gm-Message-State: AJcUukco/umsdzaEiSt98z5ADdJFNfpQ5/bOsT+BF4SKxoHH0r+eFzVe /xpKa3YtjxLLCUS32RrqoJmvUyflE5U= X-Received: by 2002:a05:6000:51:: with SMTP id k17mr23115649wrx.259.1547472494478; Mon, 14 Jan 2019 05:28:14 -0800 (PST) Received: from localhost.localdomain (aputeaux-684-1-19-62.w90-86.abo.wanadoo.fr. [90.86.222.62]) by smtp.gmail.com with ESMTPSA id 202sm33446560wmt.8.2019.01.14.05.28.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 05:28:13 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Mon, 14 Jan 2019 14:27:43 +0100 Message-Id: <20190114132758.24054-3-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190114132758.24054-1-ard.biesheuvel@linaro.org> References: <20190114132758.24054-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Subject: [edk2] [PATCH v2 02/17] OvmfPkg: add MmServicesTableLib resolution 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: Hao Wu , Liming Gao , Michael D Kinney , Laszlo Ersek , Star Zeng Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" The SMM based FTW and variable drivers are going to depend on MmServicesTableLib after a subsequent patch, so add a resolution for it to various OvmfPkg .dsc files. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- OvmfPkg/OvmfPkgIa32.dsc | 1 + OvmfPkg/OvmfPkgIa32X64.dsc | 1 + OvmfPkg/OvmfPkgX64.dsc | 1 + 3 files changed, 3 insertions(+) -- 2.20.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Laszlo Ersek diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc index 3f3533e5c163..aee19b75d7ae 100644 --- a/OvmfPkg/OvmfPkgIa32.dsc +++ b/OvmfPkg/OvmfPkgIa32.dsc @@ -385,6 +385,7 @@ [LibraryClasses.common.DXE_SMM_DRIVER] ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf SmmMemLib|MdePkg/Library/SmmMemLib/SmmMemLib.inf + MmServicesTableLib|MdePkg/Library/MmServicesTableLib/MmServicesTableLib.inf SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.inf !ifdef $(DEBUG_ON_SERIAL_PORT) DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc index 6c08b2728d63..90cbd8e34158 100644 --- a/OvmfPkg/OvmfPkgIa32X64.dsc +++ b/OvmfPkg/OvmfPkgIa32X64.dsc @@ -390,6 +390,7 @@ [LibraryClasses.common.DXE_SMM_DRIVER] ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf SmmMemLib|MdePkg/Library/SmmMemLib/SmmMemLib.inf + MmServicesTableLib|MdePkg/Library/MmServicesTableLib/MmServicesTableLib.inf SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.inf !ifdef $(DEBUG_ON_SERIAL_PORT) DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index 4072c839d73f..83d16eb00b82 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -390,6 +390,7 @@ [LibraryClasses.common.DXE_SMM_DRIVER] ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf SmmMemLib|MdePkg/Library/SmmMemLib/SmmMemLib.inf + MmServicesTableLib|MdePkg/Library/MmServicesTableLib/MmServicesTableLib.inf SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.inf !ifdef $(DEBUG_ON_SERIAL_PORT) DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf From patchwork Mon Jan 14 13:27:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 155489 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3658501jaa; Mon, 14 Jan 2019 05:28:24 -0800 (PST) X-Google-Smtp-Source: ALg8bN4lzpdyxNrrBulIV4xct0tFmcP70NBHmKGzDaV/V7mkpO/PJ2n2niyy0PIQVlgNwA7vrevC X-Received: by 2002:a63:1e56:: with SMTP id p22mr22725596pgm.126.1547472504135; Mon, 14 Jan 2019 05:28:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547472504; cv=none; d=google.com; s=arc-20160816; b=zI6oeXWF7D0xCs5Dvi2IIx+zqIy8fm+Fk6JZXBf3NzFLz1c+AsycnzmN34BkyK3uM5 g8Ux/h5Mkzz6AUi3N3jgNmCo+0oqs+Qq9ZtNyl/Y7EvfyNOomnNUgcUol+3Zj0R4vilw 1tnNHsj30oPC8xCORogfNcbNA+/Yz+5/VnCjIGQfRJoEKcbzf6arppbEuCDmh6HrfK2t amBmHs1dy/LmkaVtIItRz6bmrkzjYg6dGlWhVsZrqCbJMlL5JRPZKeIOUdk6+5Ev98Ji fj8EVJKOk7JnEt9D4sasCbixs898IKRpUm9KjRzAetW3OeuoIWv5/7aYOdEZ5fmppRHb J/DA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=6w6vR1mxd2+q4lmk0EkZVM1GG1UaZ0/bGAnNhKafccc=; b=AJJHP9c8AawZ3Gi9LL8Uh0kJ+bYrsQtWgO40jYn/O+lty1ABBuqg1uvawcwRXzIC8Z p29wJ61Oj5Hqz6j1D4AH2VSyMwrVDsbyrkFE5wdpFxIviUXFmhBTeYA6J9T2Evrj/xOp FiTrHJRqhAuUhhe42JyfrTZKlCUCUXiQr2VWzR0nJ0mvR0hf4TlwjsINrAulD+5i+R+x XvnHhJX7Vmh7bhAcmf4iAzI7T6Z8Ss9uKSPUk3Mz0/5VFqX17zGUFKFrOjPhZp3K3szE 6TtZmuOq9V5sf6yWYRnJKtci0CiTayH3QkGCLIENG1tdkFWjDtboMzISrFQzCkaP9aFp 5lNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=echcENjO; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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. [198.145.21.10]) by mx.google.com with ESMTPS id y12si328909plk.174.2019.01.14.05.28.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 05:28:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=echcENjO; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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 879B1211B76A9; Mon, 14 Jan 2019 05:28:19 -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::444; helo=mail-wr1-x444.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) (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 3A206211B5082 for ; Mon, 14 Jan 2019 05:28:18 -0800 (PST) Received: by mail-wr1-x444.google.com with SMTP id x10so22803969wrs.8 for ; Mon, 14 Jan 2019 05:28:18 -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 :mime-version:content-transfer-encoding; bh=pJam5DxSbUJRBurxGouukeax/deugnF9Oh7Os20CAOE=; b=echcENjO8TCg82U5CbuI402vczk+7rMtao2lG+j+8ZKWMEuGj/TKEUoOjtTdYFghY/ 9KNhUJdRKD4SYOWmUn2MpYYknQyhmYFuyLyUZpgRq4QbWeeeRexldPFFWgzf5DeaRoj5 8DuVOBJz7kbLCQfTf/edvY+Y/Ye7jOOFcipv4= 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:mime-version:content-transfer-encoding; bh=pJam5DxSbUJRBurxGouukeax/deugnF9Oh7Os20CAOE=; b=QSlTrA2xTX/5lGfzq2tU4Cc8p+X/+BMMz7r6/1ofCboIMF6rm6ac4IRg5YOy33WiTA CKhI/CMYB7Y0NI6Nk1fPPcyuy1Wi1/n43X7GKPYY26de96XYrL9rI+bx59RlzYMaOCHL 58EVCtZndXcGxjfY2DkfFp78+WWIhlzUeqOWlvBhdh2PY+8tgN2+2tAZV0cOSkAJiXyl 3J7EubHYnhSlZ9jWXye7/K30OfqI/2D+FYtDjqQUg/z3o9ndFMTOOpH6NUEIKL34V268 WZN905VPxNNmfJpotMzrfJr06C21YX29iEcdCefw3gucTQdbysZOEwuEQO/nbleSQ+M6 mmIw== X-Gm-Message-State: AJcUukdRypn8aPhewy2l3WpGN+lL8qCvFHtApJY5eHTLcr20WXjjuy/8 Xth5r4gnYh28b1qglIU6a306FcZlvWw= X-Received: by 2002:adf:a743:: with SMTP id e3mr23360208wrd.56.1547472496477; Mon, 14 Jan 2019 05:28:16 -0800 (PST) Received: from localhost.localdomain (aputeaux-684-1-19-62.w90-86.abo.wanadoo.fr. [90.86.222.62]) by smtp.gmail.com with ESMTPSA id 202sm33446560wmt.8.2019.01.14.05.28.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 05:28:15 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Mon, 14 Jan 2019 14:27:44 +0100 Message-Id: <20190114132758.24054-4-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190114132758.24054-1-ard.biesheuvel@linaro.org> References: <20190114132758.24054-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Subject: [edk2] [PATCH v2 03/17] QuarkPlatformPkg: add MmServicesTableLib resolution 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: Hao Wu , Liming Gao , Michael D Kinney , Laszlo Ersek , Star Zeng Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" The SMM based FTW and variable drivers are going to depend on MmServicesTableLib after a subsequent patch, so add a resolution for it to various QuarkPlatformPkg .dsc files. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- QuarkPlatformPkg/Quark.dsc | 1 + QuarkPlatformPkg/QuarkMin.dsc | 1 + 2 files changed, 2 insertions(+) -- 2.20.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Liming Gao diff --git a/QuarkPlatformPkg/Quark.dsc b/QuarkPlatformPkg/Quark.dsc index 96ae404f476c..0e69b3c51f97 100644 --- a/QuarkPlatformPkg/Quark.dsc +++ b/QuarkPlatformPkg/Quark.dsc @@ -282,6 +282,7 @@ [LibraryClasses.IA32.DXE_CORE] !endif [LibraryClasses.IA32.DXE_SMM_DRIVER] + MmServicesTableLib|MdePkg/Library/MmServicesTableLib/MmServicesTableLib.inf SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.inf ReportStatusCodeLib|MdeModulePkg/Library/SmmReportStatusCodeLib/SmmReportStatusCodeLib.inf MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAllocationLib.inf diff --git a/QuarkPlatformPkg/QuarkMin.dsc b/QuarkPlatformPkg/QuarkMin.dsc index d7a25686a30b..0f6da821cb82 100644 --- a/QuarkPlatformPkg/QuarkMin.dsc +++ b/QuarkPlatformPkg/QuarkMin.dsc @@ -242,6 +242,7 @@ [LibraryClasses.IA32.DXE_CORE] !endif [LibraryClasses.IA32.DXE_SMM_DRIVER] + MmServicesTableLib|MdePkg/Library/MmServicesTableLib/MmServicesTableLib.inf SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.inf ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull.inf MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAllocationLib.inf From patchwork Mon Jan 14 13:27:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 155490 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3658589jaa; Mon, 14 Jan 2019 05:28:28 -0800 (PST) X-Google-Smtp-Source: ALg8bN5kuWD/ZTnMkVkaytVHdzKjLY1r02JNV5fjpBFenkODJCe2a+5mD1+DAkd1TU/M1SX0GU9h X-Received: by 2002:a62:55c4:: with SMTP id j187mr25319786pfb.129.1547472508133; Mon, 14 Jan 2019 05:28:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547472508; cv=none; d=google.com; s=arc-20160816; b=C9jG98YdykbyQ6fcNSJQkFODE3d8k44VFG/Vbnl3RdR7gFBfoXH3EoZXs34TJealX9 mHuMc5irYSXvOfWs8Jnyf79V2g3r+gSK2z79+ISOhQ4S/skHKJdu6+w5guTehPcboLmX M/3ZTywAelaRvQEeTI/DPu2EK+VMuUbSdn6uXixqpdsj4gZhbN2og6ISgvVOyLJtKNC2 eEtsh1pjogvo/JsJtnhgGraN6itEZYFQ2iTrzzaMdN4QMHWoHO6OuTDbBSycN4qqCS5x 6CMBY+fYPavVApGSc59et7loSLlwtZS9DRXLYHGs+qnhtYZXhm3HrsrKpR73qJHwhaeQ OaRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=rkdxV1FbKc/+T2oYeymeLHeNyu1AlZ+xi3NFwOxT++s=; b=ahd/Dty3Vad6pdblxyoqhfO7FwtgwIGcq756QZhNRpclF55x33fs1PdhYKHiI+LDm4 LBthfv26fbu/5vy4hP86jLmBB4hFAnNdv0xSclZtKZGcyYM4M0VPufe/aX+yhEirboz8 AkOYaa6YbuLFVcPGYQWqqS5dYjLeoznI5x+UdcVHPh/w/ID3fxVE5Fferuq8MzQz/ITh rkRgV1WnJKibHSL2RkYy8AepwDiRvdN7XW7hdvK/Yp6JZmIyLPs1GB+9VZFAYXEFwDxH UjSwIP97leb1zHwvk5B7Ouk5bzu+EBAEcbXcuPpYtdUz0MIXcNpIhVw1EIlPPn9gpmWY HFeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=JFy5vpJh; 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 o33si362796pld.121.2019.01.14.05.28.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 05:28:28 -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=JFy5vpJh; 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 B611C211B736F; Mon, 14 Jan 2019 05:28:20 -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::444; helo=mail-wr1-x444.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) (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 6F064211B738E for ; Mon, 14 Jan 2019 05:28:19 -0800 (PST) Received: by mail-wr1-x444.google.com with SMTP id t27so22837274wra.6 for ; Mon, 14 Jan 2019 05:28:19 -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 :mime-version:content-transfer-encoding; bh=2I1ajjaBppEFXp9AjJBUjf5RT2qHfVKEzLwEPvRzgLU=; b=JFy5vpJhB1NTMB1/tKoBpjmGRV1kYs6MuYgYvHNrm+drfJmccUYi/Wh7iedMnNtitp C30OXkdi5Ynpi7Hpx37e19dZROmYhiR5fmJe5Zx0YfHPDFAcLO4taQcdr7/sgxxO7dMD Pm9qVNMX4l5BPvOFxZ5BoSd0CPUuizSn7cVrg= 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:mime-version:content-transfer-encoding; bh=2I1ajjaBppEFXp9AjJBUjf5RT2qHfVKEzLwEPvRzgLU=; b=mG+dlegGrYR7uNQ+9dKh3rILTOKGy/qWz+H2G3Ixa9eNYs45zU11d9X1DwTYSrU4gG TsvGYyZGYSMaSvB+15imduPTDViwm69BP8RUDjUcLD8eDaF90F9SkXT52xqmFAFASv/c YG2z4vDl3v9wW8UXcmytCqggW4CS80msmc4uNEKAh0MGUsqgY04QulJJwu8ubD+ixzCj sbxwc57wtNhxtmAHn9ilQrVWGxNPprGV08sYz8B5lU1xKqle71x637MmdtX4pJVPNCYY FapOMgMGOwXXXVIr6VtcI11H67hLCkOmYYkR4skl1bc/EP7lmB8Y0tPK+LKtvvLtMYQg 9SIg== X-Gm-Message-State: AJcUukfvvqqqeMYA/aIsZL+C9sV/hFUBUEXLWX52D3s/EwA29ekl/735 FuzbRQbbsUBZRVZTzOf2xA7lvY7XM9w= X-Received: by 2002:a5d:64c7:: with SMTP id y7mr23775917wrv.207.1547472497831; Mon, 14 Jan 2019 05:28:17 -0800 (PST) Received: from localhost.localdomain (aputeaux-684-1-19-62.w90-86.abo.wanadoo.fr. [90.86.222.62]) by smtp.gmail.com with ESMTPSA id 202sm33446560wmt.8.2019.01.14.05.28.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 05:28:17 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Mon, 14 Jan 2019 14:27:45 +0100 Message-Id: <20190114132758.24054-5-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190114132758.24054-1-ard.biesheuvel@linaro.org> References: <20190114132758.24054-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Subject: [edk2] [PATCH v2 04/17] Vlv2TbltDevicePkg: add MmServicesTableLib resolution 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: Hao Wu , Liming Gao , Michael D Kinney , Laszlo Ersek , Star Zeng Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" The SMM based FTW and variable drivers are going to depend on MmServicesTableLib after a subsequent patch, so add a resolution for it to various Vlv2TbltDevicePkg .dsc files. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc | 1 + Vlv2TbltDevicePkg/PlatformPkgIA32.dsc | 1 + Vlv2TbltDevicePkg/PlatformPkgX64.dsc | 1 + 3 files changed, 3 insertions(+) -- 2.20.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Michael D Kinney Reviewed-by: Qian Yi diff --git a/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc b/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc index d43611550285..eb7c205a10a6 100644 --- a/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc +++ b/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc @@ -406,6 +406,7 @@ [LibraryClasses.X64.DXE_CORE] !endif [LibraryClasses.X64.DXE_SMM_DRIVER] + MmServicesTableLib|MdePkg/Library/MmServicesTableLib/MmServicesTableLib.inf SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.inf ReportStatusCodeLib|MdeModulePkg/Library/SmmReportStatusCodeLib/SmmReportStatusCodeLib.inf MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAllocationLib.inf diff --git a/Vlv2TbltDevicePkg/PlatformPkgIA32.dsc b/Vlv2TbltDevicePkg/PlatformPkgIA32.dsc index a33816c4d18b..b2f0d73f6d05 100644 --- a/Vlv2TbltDevicePkg/PlatformPkgIA32.dsc +++ b/Vlv2TbltDevicePkg/PlatformPkgIA32.dsc @@ -406,6 +406,7 @@ [LibraryClasses.IA32.DXE_CORE] !endif [LibraryClasses.IA32.DXE_SMM_DRIVER] + MmServicesTableLib|MdePkg/Library/MmServicesTableLib/MmServicesTableLib.inf SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.inf ReportStatusCodeLib|MdeModulePkg/Library/SmmReportStatusCodeLib/SmmReportStatusCodeLib.inf MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAllocationLib.inf diff --git a/Vlv2TbltDevicePkg/PlatformPkgX64.dsc b/Vlv2TbltDevicePkg/PlatformPkgX64.dsc index 1da1442c64c6..aa62c07f177b 100644 --- a/Vlv2TbltDevicePkg/PlatformPkgX64.dsc +++ b/Vlv2TbltDevicePkg/PlatformPkgX64.dsc @@ -408,6 +408,7 @@ [LibraryClasses.X64.DXE_CORE] !endif [LibraryClasses.X64.DXE_SMM_DRIVER] + MmServicesTableLib|MdePkg/Library/MmServicesTableLib/MmServicesTableLib.inf SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.inf ReportStatusCodeLib|MdeModulePkg/Library/SmmReportStatusCodeLib/SmmReportStatusCodeLib.inf MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAllocationLib.inf From patchwork Mon Jan 14 13:27:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 155491 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3658646jaa; Mon, 14 Jan 2019 05:28:32 -0800 (PST) X-Google-Smtp-Source: ALg8bN6bRakCnHGalqCOicFh9ttjq8S+pIUBCTpML8AJ45puZB5H6iyh3qnjP+Jbq4FdkpMd4k3I X-Received: by 2002:a65:6094:: with SMTP id t20mr22627602pgu.285.1547472512042; Mon, 14 Jan 2019 05:28:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547472512; cv=none; d=google.com; s=arc-20160816; b=gBIZwbmnv0b9vWQwsTKvefR2mbpkwMH8L4uJ1ZZyRZ3mHxd5HpJHu2ClbUqOG/n+8V 3pS+4JWlii80myPS/WCKdkoRdFGYkUugVEP28Tbf2SKGcn9+a3FM4wjX+Fe4XVqDx/ym UKW7K7GJRr+PJuRMz2S2+/YdZ1eJDRp9r0dG/0It6I1fjlDvn1+8bZornRjYnkSxBTVS Az81tDxIhSqT0TqONZLy+/Ff3kdIZ1d0+3Q4clYc4eZ4R6+DEBSgf7pier/A/FHrFnS1 /3L3/caXR9vQnYtBC0wO8d74rwGOXmTAEBEnh3h7LVfuRGUR4epBiZ0IIFZfdlD4rTlk AcqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=LAT70rYWm1R3RIZ1zpz0KRjrcqPFkdD6Gip6eXMzLZY=; b=gsOyIT7qlBpPIlU+Bx6pnqmHk8/0JGxUD9Vw8J2Vxwef92NwnuzGvzZ3AZinpApgKb O7YpVr0oHdDc69NucYV1lpHjmM0N18HA7lNcIU41NI1NzoPywWbVdptL7GCl69loj0wk f4o/y32zs3bueBw7rhn6LNPWZgmRVd9kQtsnxwNlRRdm7r9qCmr/f3E7qEZRlxM/Zsok w9SRSKre5Bam9jcl0XIN+7lOjzGJfg+Y9Mm44lu0mK7f/+XZEydOVAUy891mQ1Z/TPK9 6CPS8bRY57y+2GvJyjzy/7rFmvkyw9y//cbl/aJY3BnbygUmSOlO7bSwf+nKLdI0inMR AAcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=C5PVl1mQ; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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. [198.145.21.10]) by mx.google.com with ESMTPS id z13si310872pgi.438.2019.01.14.05.28.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 05:28:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=C5PVl1mQ; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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 E08C8211B76C8; Mon, 14 Jan 2019 05:28:22 -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 75F692119FF5E for ; Mon, 14 Jan 2019 05:28:21 -0800 (PST) Received: by mail-wm1-x341.google.com with SMTP id y8so8811670wmi.4 for ; Mon, 14 Jan 2019 05:28:21 -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 :mime-version:content-transfer-encoding; bh=PQ5NW2PxKX/8EmucU1Y5DHn/Yf+BIm5rcdfU9FcM6Os=; b=C5PVl1mQkaN8BO6+ocAUA+nt4ynbuiMAvkGawiwa5CaP+qFO9PK71q21K5nlZaCQWF +J0SBPMy15QJXLwDI0TvGjSUgT1OyNIdeSF58Ru0oLdoYuO8bLVCH/HjjM98RZ/5skk9 R/wQAAnpy9rtGC3mymqGDYOzjnQ6aQajXWffM= 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:mime-version:content-transfer-encoding; bh=PQ5NW2PxKX/8EmucU1Y5DHn/Yf+BIm5rcdfU9FcM6Os=; b=r/VeYI8VKLzKigjlkX5BDM9O3P2PN5fpfgMFG8DLRWkwB00seSW+FB/rxXcGy4tTOk bJiuNHGI5+bHKD98pxAmcjKupuSmKeKIljQah6rDxwlZ7IXJRiieb1gZhrgnyRpxxhGr TYVLbDuuqJD1SxtymnRpmx/f/fNViC+s0HJ9liscDDFXB2s38PtA6dsYFs8hqZn4/lq+ UhW5Tb0UrnVJH3pF6E0L5EaO1YFhKimYZAuZQXVPcYgYgJCAUbdkSB1S+seUxPJjgklw mzowg6eMhtlXTRys9ONk1nO3Xn0OvR7U+PDlQ/TRZUKBgMW4fVkAjwRhAQYUsUjgFCvM QDnw== X-Gm-Message-State: AJcUukcADwQ3z0nl6HLsrMJ0zxmy28iZnjaxp5tsEOllesZ8Qo1oH0YJ dveIV2nhUkY6K2zDVnMnxpI02gK22M4= X-Received: by 2002:a1c:8148:: with SMTP id c69mr11667210wmd.126.1547472499317; Mon, 14 Jan 2019 05:28:19 -0800 (PST) Received: from localhost.localdomain (aputeaux-684-1-19-62.w90-86.abo.wanadoo.fr. [90.86.222.62]) by smtp.gmail.com with ESMTPSA id 202sm33446560wmt.8.2019.01.14.05.28.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 05:28:18 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Mon, 14 Jan 2019 14:27:46 +0100 Message-Id: <20190114132758.24054-6-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190114132758.24054-1-ard.biesheuvel@linaro.org> References: <20190114132758.24054-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Subject: [edk2] [PATCH v2 05/17] MdeModulePkg/FaultTolerantWriteDxe: factor out boot service accesses 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: Hao Wu , Liming Gao , Michael D Kinney , Laszlo Ersek , Star Zeng Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" In preparation of providing a standalone MM based FTW driver, move the existing SMM driver to the new MM services table, and factor out some pieces that are specific to the traditional driver, mainly related to the use of UEFI boot services, which are not accessible to standalone MM drivers. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel Reviewed-by: Jian J Wang Regression-tested-by: Laszlo Ersek --- MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.inf | 5 +- MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWrite.h | 23 ++++- MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmmCommon.h | 34 +++++++ MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.c | 31 ++++++ MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.c | 53 ++++------ MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteTraditionalMm.c | 106 ++++++++++++++++++++ MdeModulePkg/Universal/FaultTolerantWriteDxe/UpdateWorkingBlock.c | 10 +- 7 files changed, 219 insertions(+), 43 deletions(-) -- 2.20.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.inf b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.inf index 606cc2266bda..1653365bc247 100644 --- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.inf +++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.inf @@ -37,6 +37,7 @@ [Sources] FtwMisc.c UpdateWorkingBlock.c FaultTolerantWrite.c + FaultTolerantWriteTraditionalMm.c FaultTolerantWriteSmm.c FaultTolerantWrite.h FaultTolerantWriteSmmCommon.h @@ -46,7 +47,7 @@ [Packages] MdeModulePkg/MdeModulePkg.dec [LibraryClasses] - SmmServicesTableLib + MmServicesTableLib MemoryAllocationLib BaseMemoryLib UefiDriverEntryPoint @@ -73,7 +74,7 @@ [Protocols] ## PRODUCES ## UNDEFINED # SmiHandlerRegister gEfiSmmFaultTolerantWriteProtocolGuid - gEfiSmmEndOfDxeProtocolGuid ## CONSUMES + gEfiMmEndOfDxeProtocolGuid ## CONSUMES [FeaturePcd] gEfiMdeModulePkgTokenSpaceGuid.PcdFullFtwServiceEnable ## CONSUMES diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWrite.h b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWrite.h index 844cf3bee04d..a23cb620e2f2 100644 --- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWrite.h +++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWrite.h @@ -31,7 +31,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include #include -#include #include // @@ -766,4 +765,26 @@ WriteWorkSpaceData ( IN UINT8 *Buffer ); +/** + Internal implementation of CRC32. Depending on the execution context + (traditional SMM or DXE vs standalone MM), this function is implemented + via a call to the CalculateCrc32 () boot service, or via a library + call. + + If Buffer is NULL, then ASSERT(). + If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). + + @param[in] Buffer A pointer to the buffer on which the 32-bit CRC is + to be computed. + @param[in] Length The number of bytes in the buffer Data. + + @retval Crc32 The 32-bit CRC was computed for the data buffer. + +**/ +UINT32 +FtwCalculateCrc32 ( + IN VOID *Buffer, + IN UINTN Length + ); + #endif diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmmCommon.h b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmmCommon.h index 8ad0015f3c9e..23d9a49e8bcf 100644 --- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmmCommon.h +++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmmCommon.h @@ -77,4 +77,38 @@ typedef struct { UINT8 Data[1]; } SMM_FTW_GET_LAST_WRITE_HEADER; +/** + Entry point of the module +**/ +EFI_STATUS +MmFaultTolerantWriteInitialize ( + VOID + ); + +/** + This function checks if the buffer is valid per processor architecture and + does not overlap with SMRAM. + + @param Buffer The buffer start address to be checked. + @param Length The buffer length to be checked. + + @retval TRUE This buffer is valid per processor architecture and does not + overlap with SMRAM. + @retval FALSE This buffer is not valid per processor architecture or overlaps + with SMRAM. +**/ +BOOLEAN +FtwSmmIsBufferOutsideSmmValid ( + IN EFI_PHYSICAL_ADDRESS Buffer, + IN UINT64 Length + ); + +/** + Notify the system that the SMM FTW driver is ready +**/ +VOID +FtwNotifySmmReady ( + VOID + ); + #endif diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.c b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.c index 094e40f9d86c..24e507104bbe 100644 --- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.c +++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.c @@ -51,6 +51,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ +#include #include "FaultTolerantWrite.h" EFI_EVENT mFvbRegistration = NULL; @@ -250,3 +251,33 @@ FaultTolerantWriteInitialize ( return EFI_SUCCESS; } + +/** + Internal implementation of CRC32. Depending on the execution context + (traditional SMM or DXE vs standalone MM), this function is implemented + via a call to the CalculateCrc32 () boot service, or via a library + call. + + If Buffer is NULL, then ASSERT(). + If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). + + @param[in] Buffer A pointer to the buffer on which the 32-bit CRC is to be computed. + @param[in] Length The number of bytes in the buffer Data. + + @retval Crc32 The 32-bit CRC was computed for the data buffer. + +**/ +UINT32 +FtwCalculateCrc32 ( + IN VOID *Buffer, + IN UINTN Length + ) +{ + EFI_STATUS Status; + UINT32 ReturnValue; + + Status = gBS->CalculateCrc32 (Buffer, Length, &ReturnValue); + ASSERT_EFI_ERROR (Status); + + return ReturnValue; +} diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.c b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.c index 481fea3f1fdf..148eedc71a0c 100644 --- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.c +++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.c @@ -54,14 +54,13 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ -#include -#include -#include +#include +#include #include #include #include "FaultTolerantWrite.h" #include "FaultTolerantWriteSmmCommon.h" -#include +#include EFI_EVENT mFvbRegistration = NULL; EFI_FTW_DEVICE *mFtwDevice = NULL; @@ -92,7 +91,7 @@ FtwGetFvbByHandle ( // // To get the SMM FVB protocol interface on the handle // - return gSmst->SmmHandleProtocol ( + return gMmst->MmHandleProtocol ( FvBlockHandle, &gEfiSmmFirmwareVolumeBlockProtocolGuid, (VOID **) FvBlock @@ -119,7 +118,7 @@ FtwGetSarProtocol ( // // Locate Smm Swap Address Range protocol // - Status = gSmst->SmmLocateProtocol ( + Status = gMmst->MmLocateProtocol ( &gEfiSmmSwapAddressRangeProtocolGuid, NULL, SarProtocol @@ -158,7 +157,7 @@ GetFvbCountAndBuffer ( BufferSize = 0; *NumberHandles = 0; *Buffer = NULL; - Status = gSmst->SmmLocateHandle ( + Status = gMmst->MmLocateHandle ( ByProtocol, &gEfiSmmFirmwareVolumeBlockProtocolGuid, NULL, @@ -174,7 +173,7 @@ GetFvbCountAndBuffer ( return EFI_OUT_OF_RESOURCES; } - Status = gSmst->SmmLocateHandle ( + Status = gMmst->MmLocateHandle ( ByProtocol, &gEfiSmmFirmwareVolumeBlockProtocolGuid, NULL, @@ -336,7 +335,7 @@ SmmFaultTolerantWriteHandler ( } CommBufferPayloadSize = TempCommBufferSize - SMM_FTW_COMMUNICATE_HEADER_SIZE; - if (!SmmIsBufferOutsideSmmValid ((UINTN)CommBuffer, TempCommBufferSize)) { + if (!FtwSmmIsBufferOutsideSmmValid ((UINTN)CommBuffer, TempCommBufferSize)) { DEBUG ((EFI_D_ERROR, "SmmFtwHandler: SMM communication buffer in SMRAM or overflow!\n")); return EFI_SUCCESS; } @@ -525,13 +524,12 @@ FvbNotificationEvent ( EFI_STATUS Status; EFI_SMM_FAULT_TOLERANT_WRITE_PROTOCOL *FtwProtocol; EFI_HANDLE SmmFtwHandle; - EFI_HANDLE FtwHandle; // // Just return to avoid install SMM FaultTolerantWriteProtocol again // if SMM Fault Tolerant Write protocol had been installed. // - Status = gSmst->SmmLocateProtocol ( + Status = gMmst->MmLocateProtocol ( &gEfiSmmFaultTolerantWriteProtocolGuid, NULL, (VOID **) &FtwProtocol @@ -551,7 +549,7 @@ FvbNotificationEvent ( // // Install protocol interface // - Status = gSmst->SmmInstallProtocolInterface ( + Status = gMmst->MmInstallProtocolInterface ( &mFtwDevice->Handle, &gEfiSmmFaultTolerantWriteProtocolGuid, EFI_NATIVE_INTERFACE, @@ -562,20 +560,13 @@ FvbNotificationEvent ( /// /// Register SMM FTW SMI handler /// - Status = gSmst->SmiHandlerRegister (SmmFaultTolerantWriteHandler, &gEfiSmmFaultTolerantWriteProtocolGuid, &SmmFtwHandle); + Status = gMmst->MmiHandlerRegister (SmmFaultTolerantWriteHandler, &gEfiSmmFaultTolerantWriteProtocolGuid, &SmmFtwHandle); ASSERT_EFI_ERROR (Status); // // Notify the Ftw wrapper driver SMM Ftw is ready // - FtwHandle = NULL; - Status = gBS->InstallProtocolInterface ( - &FtwHandle, - &gEfiSmmFaultTolerantWriteProtocolGuid, - EFI_NATIVE_INTERFACE, - NULL - ); - ASSERT_EFI_ERROR (Status); + FtwNotifySmmReady (); return EFI_SUCCESS; } @@ -592,7 +583,7 @@ FvbNotificationEvent ( **/ EFI_STATUS EFIAPI -SmmEndOfDxeCallback ( +MmEndOfDxeCallback ( IN CONST EFI_GUID *Protocol, IN VOID *Interface, IN EFI_HANDLE Handle @@ -614,14 +605,12 @@ SmmEndOfDxeCallback ( **/ EFI_STATUS -EFIAPI -SmmFaultTolerantWriteInitialize ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable +MmFaultTolerantWriteInitialize ( + VOID ) { EFI_STATUS Status; - VOID *SmmEndOfDxeRegistration; + VOID *MmEndOfDxeRegistration; // // Allocate private data structure for SMM FTW protocol and do some initialization @@ -634,17 +623,17 @@ SmmFaultTolerantWriteInitialize ( // // Register EFI_SMM_END_OF_DXE_PROTOCOL_GUID notify function. // - Status = gSmst->SmmRegisterProtocolNotify ( - &gEfiSmmEndOfDxeProtocolGuid, - SmmEndOfDxeCallback, - &SmmEndOfDxeRegistration + Status = gMmst->MmRegisterProtocolNotify ( + &gEfiMmEndOfDxeProtocolGuid, + MmEndOfDxeCallback, + &MmEndOfDxeRegistration ); ASSERT_EFI_ERROR (Status); // // Register FvbNotificationEvent () notify function. // - Status = gSmst->SmmRegisterProtocolNotify ( + Status = gMmst->MmRegisterProtocolNotify ( &gEfiSmmFirmwareVolumeBlockProtocolGuid, FvbNotificationEvent, &mFvbRegistration diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteTraditionalMm.c b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteTraditionalMm.c new file mode 100644 index 000000000000..78351199d3f1 --- /dev/null +++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteTraditionalMm.c @@ -0,0 +1,106 @@ +/** @file + + Parts of the SMM/MM implementation that are specific to traditional MM + +Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2018, Linaro, 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 +#include "FaultTolerantWrite.h" +#include "FaultTolerantWriteSmmCommon.h" + +/** + This function checks if the buffer is valid per processor architecture and + does not overlap with SMRAM. + + @param Buffer The buffer start address to be checked. + @param Length The buffer length to be checked. + + @retval TRUE This buffer is valid per processor architecture and does not + overlap with SMRAM. + @retval FALSE This buffer is not valid per processor architecture or overlaps + with SMRAM. +**/ +BOOLEAN +FtwSmmIsBufferOutsideSmmValid ( + IN EFI_PHYSICAL_ADDRESS Buffer, + IN UINT64 Length + ) +{ + return SmmIsBufferOutsideSmmValid (Buffer, Length); +} + +/** + Internal implementation of CRC32. Depending on the execution context + (traditional SMM or DXE vs standalone MM), this function is implemented + via a call to the CalculateCrc32 () boot service, or via a library + call. + + If Buffer is NULL, then ASSERT(). + If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). + + @param[in] Buffer A pointer to the buffer on which the 32-bit CRC is + to be computed. + @param[in] Length The number of bytes in the buffer Data. + + @retval Crc32 The 32-bit CRC was computed for the data buffer. + +**/ +UINT32 +FtwCalculateCrc32 ( + IN VOID *Buffer, + IN UINTN Length + ) +{ + EFI_STATUS Status; + UINT32 ReturnValue; + + Status = gBS->CalculateCrc32 (Buffer, Length, &ReturnValue); + ASSERT_EFI_ERROR (Status); + + return ReturnValue; +} + +/** + Notify the system that the SMM FTW driver is ready +**/ +VOID +FtwNotifySmmReady ( + VOID + ) +{ + EFI_HANDLE FtwHandle; + EFI_STATUS Status; + + FtwHandle = NULL; + Status = gBS->InstallProtocolInterface ( + &FtwHandle, + &gEfiSmmFaultTolerantWriteProtocolGuid, + EFI_NATIVE_INTERFACE, + NULL + ); + ASSERT_EFI_ERROR (Status); +} + +/** + Entry point of the module +**/ +EFI_STATUS +EFIAPI +SmmFaultTolerantWriteInitialize ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + return MmFaultTolerantWriteInitialize (); +} diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/UpdateWorkingBlock.c b/MdeModulePkg/Universal/FaultTolerantWriteDxe/UpdateWorkingBlock.c index 50d3421b88bb..d09e9719cf05 100644 --- a/MdeModulePkg/Universal/FaultTolerantWriteDxe/UpdateWorkingBlock.c +++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/UpdateWorkingBlock.c @@ -29,8 +29,6 @@ InitializeLocalWorkSpaceHeader ( VOID ) { - EFI_STATUS Status; - // // Check signature with gEdkiiWorkingBlockSignatureGuid. // @@ -64,12 +62,8 @@ InitializeLocalWorkSpaceHeader ( // // Calculate the Crc of woking block header // - Status = gBS->CalculateCrc32 ( - &mWorkingBlockHeader, - sizeof (EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER), - &mWorkingBlockHeader.Crc - ); - ASSERT_EFI_ERROR (Status); + mWorkingBlockHeader.Crc = FtwCalculateCrc32 (&mWorkingBlockHeader, + sizeof (EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER)); mWorkingBlockHeader.WorkingBlockValid = FTW_VALID_STATE; mWorkingBlockHeader.WorkingBlockInvalid = FTW_INVALID_STATE; From patchwork Mon Jan 14 13:27:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 155492 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3658727jaa; Mon, 14 Jan 2019 05:28:38 -0800 (PST) X-Google-Smtp-Source: ALg8bN41hxYNFexMIY9upznWbYbECDDzRxyUzGifsjUnaRfk4a6kt8OVikAhl+6g0TOU18At29LN X-Received: by 2002:a62:6e07:: with SMTP id j7mr26078506pfc.135.1547472518517; Mon, 14 Jan 2019 05:28:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547472518; cv=none; d=google.com; s=arc-20160816; b=yp1etG9GhalPWXogs6GhCuYJkiNkoiI4AK0tSERHCEi9l0GzHViBGUvBnaNfPwlwsw aPbSyqyzarqOZ5mPtsOyjWif2qWGWwb4mlhPmQRbfWRzCEyQcin4KSIt0IsKdGKmKCLi Jk4MlJ7zrEpJQpnMbKEEAg3cDD3Au/59YcteXWDLGz847BqU3uj09YyneqDKGFsvL5cd B+UCDEpaT11ctv+sQdyF87RxKnE3QYmASKqD0R7Itf1G0ZrELjOsNRtn7Zg41yIsp7X2 MsjMaiYQls3Mi1ZqgkkU3hDtA5raM7DukC3xJN1GOwjYaaTV02G7RXN8UOc3L6MN1dkt iMVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=9YFqYELuICpFZ60KUt6+ntHvZkVAPksWShIZskH63rs=; b=naytetBrHg5tekxIaqx8xKShj46j1+xVzuY/1wSlJzr/Ejk46MwvVANNyPRurwfjAv /z8eLl03FrjgwQ4du62Sna6tnFfRBbydgkiR9XtBuZSbLRHX17o1+mX9Y24lqBF3nfG8 jVIf5nchqz1YOD7JGD8eyqsbNXPTiFeydv3TjqqP74VLjO3ipac/fwRNj2zg06UxtLp9 uFbrqRWRh0VfroJptu6FrWpzKqN2f76r0aqXt98aZZr3A0NMe4gm9AiMAErOIGJ+GQma 1Neu/QxvTE8AcIlrlXTGYIFOad6XB26sMdg3mZ2kMpp6j52AmH2+gMD/r63ANe0OzTmp 9wqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=G9OGHWqq; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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. [198.145.21.10]) by mx.google.com with ESMTPS id u25si344094pgm.532.2019.01.14.05.28.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 05:28:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=G9OGHWqq; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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 30625211B76C3; Mon, 14 Jan 2019 05:28:24 -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::444; helo=mail-wr1-x444.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) (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 9541D211B739D for ; Mon, 14 Jan 2019 05:28:22 -0800 (PST) Received: by mail-wr1-x444.google.com with SMTP id j2so22926632wrw.1 for ; Mon, 14 Jan 2019 05:28:22 -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 :mime-version:content-transfer-encoding; bh=sPvgL9rPfGGBUF7lXXzmGQjdT3XcD246PvswS/wpSDo=; b=G9OGHWqqN0ugI4/Gm7BOmXALW5B4n3ssD5h4XlcaaKcL2MRiXO5lJyVpw5/dD9AU2m cJP4J1RqssittdUlTh3nzdxfTkpjG/RE7SZZT0PX6d58KmOhLH0ZJd7VUkxFe8t835b0 9uNBT2RFQkVObf0304uAck80F9RyEhk0fLb7c= 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:mime-version:content-transfer-encoding; bh=sPvgL9rPfGGBUF7lXXzmGQjdT3XcD246PvswS/wpSDo=; b=BI9O8DrGQ0cqXyvHHpn3W+VnIh2vh/0car2RYxgXqTqjECEn6McXnKbR5cxinRZxoJ a9YA4HYFco39ExOdG+E5fNSKYKIokNrkjB3aLtUOGSOFvTAtcvCauAHmiCsOF+LIw5Zv UpnVL/bXXo9QNYRO28Wc2ALSqeuCmeDtisYsmxIsgUD15BnXLu3eO6rv83qpi/uvDUSl hjRkR9VW8VDWenOXcGzV725B5RlmE9/a1Bv1DpCGSxleiBV8qmMMA2SN5EpgSdeS5Z73 0VAa15lnR5QWkdGyX5C1BHvzX5A2g0p59IH4LvsLYVVTtVaowrSqI6o5y5kb8VKrDNwb Jc4g== X-Gm-Message-State: AJcUukcoMblbmEg/AEVWnt46us/KA+XbdC4C3Gxw3KKF9e8uQdlMRMcH hO4XALH3Zxcq3It0BRYCKsX7aL6ofE8= X-Received: by 2002:adf:8323:: with SMTP id 32mr23476975wrd.176.1547472500914; Mon, 14 Jan 2019 05:28:20 -0800 (PST) Received: from localhost.localdomain (aputeaux-684-1-19-62.w90-86.abo.wanadoo.fr. [90.86.222.62]) by smtp.gmail.com with ESMTPSA id 202sm33446560wmt.8.2019.01.14.05.28.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 05:28:19 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Mon, 14 Jan 2019 14:27:47 +0100 Message-Id: <20190114132758.24054-7-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190114132758.24054-1-ard.biesheuvel@linaro.org> References: <20190114132758.24054-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Subject: [edk2] [PATCH v2 06/17] MdeModulePkg/FaultTolerantWriteDxe: implement standalone MM version 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: Hao Wu , Liming Gao , Michael D Kinney , Laszlo Ersek , Star Zeng Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Implement a new version of the fault tolerant write driver that can be used in the context of a standalone MM implementation. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel Reviewed-by: Jian J Wang --- MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteStandaloneMm.inf | 90 ++++++++++++++++++++ MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteStandaloneMm.c | 88 +++++++++++++++++++ 2 files changed, 178 insertions(+) -- 2.20.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteStandaloneMm.inf b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteStandaloneMm.inf new file mode 100644 index 000000000000..c667d4c19bfa --- /dev/null +++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteStandaloneMm.inf @@ -0,0 +1,90 @@ + ## @file +# Fault Tolerant Write Smm Driver. +# +# This driver installs SMM Fault Tolerant Write (FTW) protocol, which provides fault +# tolerant write capability in SMM environment for block devices. Its implementation +# depends on the full functionality SMM FVB protocol that support read, write/erase +# flash access. +# +# Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
+# Copyright (c) 2018, Linaro, 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. +# +## + +[Defines] + INF_VERSION = 0x0001001B + BASE_NAME = FaultTolerantWriteStandaloneMm + FILE_GUID = 3aade4ec-63cc-4a48-a928-5a374dd463eb + MODULE_TYPE = MM_STANDALONE + VERSION_STRING = 1.0 + PI_SPECIFICATION_VERSION = 0x00010032 + ENTRY_POINT = StandaloneMmFaultTolerantWriteInitialize + +# +# The following information is for reference only and not required by the build tools. +# +# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64 +# + +[Sources] + FtwMisc.c + UpdateWorkingBlock.c + FaultTolerantWrite.c + FaultTolerantWriteStandaloneMm.c + FaultTolerantWriteSmm.c + FaultTolerantWrite.h + FaultTolerantWriteSmmCommon.h + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + StandaloneMmPkg/StandaloneMmPkg.dec + +[LibraryClasses] + BaseLib + BaseMemoryLib + DebugLib + MemoryAllocationLib + MmServicesTableLib + PcdLib + ReportStatusCodeLib + StandaloneMmDriverEntryPoint + +[Guids] + # + # Signature in EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER + # + ## CONSUMES ## GUID + ## PRODUCES ## GUID + gEdkiiWorkingBlockSignatureGuid + +[Protocols] + gEfiSmmSwapAddressRangeProtocolGuid | gEfiMdeModulePkgTokenSpaceGuid.PcdFullFtwServiceEnable ## SOMETIMES_CONSUMES + ## NOTIFY + ## CONSUMES + gEfiSmmFirmwareVolumeBlockProtocolGuid + ## PRODUCES + ## UNDEFINED # SmiHandlerRegister + gEfiSmmFaultTolerantWriteProtocolGuid + gEfiMmEndOfDxeProtocolGuid ## CONSUMES + +[FeaturePcd] + gEfiMdeModulePkgTokenSpaceGuid.PcdFullFtwServiceEnable ## CONSUMES + +[Pcd] + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase ## SOMETIMES_CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64 ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase ## SOMETIMES_CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64 ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize ## CONSUMES + +[Depex] + TRUE diff --git a/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteStandaloneMm.c b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteStandaloneMm.c new file mode 100644 index 000000000000..95effd6d75fa --- /dev/null +++ b/MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteStandaloneMm.c @@ -0,0 +1,88 @@ +/** @file + + Parts of the SMM/MM implementation that are specific to standalone MM + +Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2018, Linaro, 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 +#include "FaultTolerantWrite.h" +#include "FaultTolerantWriteSmmCommon.h" + +/** + This function checks if the buffer is valid per processor architecture and + does not overlap with SMRAM. + + @param Buffer The buffer start address to be checked. + @param Length The buffer length to be checked. + + @retval TRUE This buffer is valid per processor architecture and does not + overlap with SMRAM. + @retval FALSE This buffer is not valid per processor architecture or overlaps + with SMRAM. +**/ +BOOLEAN +FtwSmmIsBufferOutsideSmmValid ( + IN EFI_PHYSICAL_ADDRESS Buffer, + IN UINT64 Length + ) +{ + return TRUE; +} + +/** + Internal implementation of CRC32. Depending on the execution context + (standalone SMM or DXE vs standalone MM), this function is implemented + via a call to the CalculateCrc32 () boot service, or via a library + call. + + If Buffer is NULL, then ASSERT(). + If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). + + @param[in] Buffer A pointer to the buffer on which the 32-bit CRC is to be computed. + @param[in] Length The number of bytes in the buffer Data. + + @retval Crc32 The 32-bit CRC was computed for the data buffer. + +**/ +UINT32 +FtwCalculateCrc32 ( + IN VOID *Buffer, + IN UINTN Length + ) +{ + return CalculateCrc32 (Buffer, Length); +} + +/** + Notify the system that the SMM FTW driver is ready +**/ +VOID +FtwNotifySmmReady ( + VOID + ) +{ +} + +/** + Entry point of the module +**/ +EFI_STATUS +EFIAPI +StandaloneMmFaultTolerantWriteInitialize ( + IN EFI_HANDLE ImageHandle, + IN EFI_MM_SYSTEM_TABLE *MmSystemTable + ) +{ + return MmFaultTolerantWriteInitialize (); +} From patchwork Mon Jan 14 13:27:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 155493 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3658803jaa; Mon, 14 Jan 2019 05:28:42 -0800 (PST) X-Google-Smtp-Source: ALg8bN7iB2b45wHFyv4YKRbLYCt753LqHa/bcsRNwexP5ZzFo2okqDz/TL+epJh6ZhZCYNkrj7F3 X-Received: by 2002:a62:7a8b:: with SMTP id v133mr25863572pfc.159.1547472522743; Mon, 14 Jan 2019 05:28:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547472522; cv=none; d=google.com; s=arc-20160816; b=Eg4Yw6oS6iM0KpJjdtp4btGhkmW1+ZXfWDekOPDm+5bVQRaZK3PFVpKcQgBb8qZ0g3 sUU0o3BzMNph98fM2IpgmuVPVqfI9nkqxeBIAPItQEVJC5xrvGVwfL31LCe+OsQxnR5b 7UvmiDOROHGgLWc/o3oxisuLDxxUuOAJb6mROxCY9/324nFK2NYYOcH6ww7mNt6iQAuY FmE8y5o1YOpMgBWIJGU+wWfrMYadDXSq4rlTgCxHP7jiklKLC9z8kRJqnx966svJi7Kb n6IKt6AQdnn4l9ISCHsMeWxNlH/8GsKJA3yu2p4PD9O+NTgPNkTGY3tDfoxfxZvJ3P57 rnFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=Dv3b76GBSm46bklkFIhqcdeVz0+OYZDMoiPdWq2Cq6o=; b=INgB35vgE60UvCcVGm3QUk/wp6fJ5sI9gLL6GE546TFJz/IzcludEOyt6oNy3BBmXW SqrGVbZ0THsCcsDJvw4+FPEzBgTcrMfcCVQkkcQsfzbO590k6DYYb9Ut1XwMYir9Rlt3 HFi4tYDTc+K9l9kJDo+1xmTK/aHWfGmFTNIVVQZUYS5a6tvkfJGpX7E4EyWwYBGRlqys CWJuLQ77RNgRABqlUPuUsfI250uA+zS8+uDI9m6ZoFZEdd3akofKWPmbIweI3ns5xDIF m6gfsNQnd0nEhHrl8JBhWubX9m6PD+/MKyQ2WTn4ug/ASeVlu/nzccQQA4llPyFxRiC9 7nlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=XuGiBhoZ; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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. [198.145.21.10]) by mx.google.com with ESMTPS id b3si346114pld.282.2019.01.14.05.28.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 05:28:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=XuGiBhoZ; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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 5B84C211B76CE; Mon, 14 Jan 2019 05:28:25 -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::343; helo=mail-wm1-x343.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) (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 83EEE211B5082 for ; Mon, 14 Jan 2019 05:28:24 -0800 (PST) Received: by mail-wm1-x343.google.com with SMTP id m22so8877303wml.3 for ; Mon, 14 Jan 2019 05:28:24 -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 :mime-version:content-transfer-encoding; bh=U3GmeKOEaQXpxQUs4zAPLHwHPVtyCLWudbjl/mWE2uA=; b=XuGiBhoZlA6x2+CT5TtadBdBNYFTdop5yXWYeUeH5vlPI2cCxPggAWl40mtiMuzuf3 7LBefGknO+lS7aBUC1LYizoCtDB+/QqwpjhRti6US5TNp/3oD9ync3YobzgWgdXeQ2wD 3SIR8MDcr3X0JR5RHpGFuncmQ3mmEbC9Okha0= 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:mime-version:content-transfer-encoding; bh=U3GmeKOEaQXpxQUs4zAPLHwHPVtyCLWudbjl/mWE2uA=; b=cQDfimIvgUyAMq4FGKf4d1NUPVUyXvpFYqt9U0LaGfSxFSo/ssIQvTQ9hBY2MXFNwI EytztecYzQqupFF/jOd1kjDa7o+Lg1oYRrywJiGlhEKeJpzt8QrssczkjexlhB8yZ8cd K6t+Gzj0EpHUOvZFgj2h62Z4e4OMT+RgtwAWIZ5YVmmVRd5FXWiQjKSdVkDJq8l2cLZr h48g5XHTtybMWT+wX5UjdGi2M7p4d7jiYuSER62vdG7unEPS2Iak+k7fqVmXeKWqnTPe efwdxiIR/clrZjZ0Cm6wETp8xOiNYJMHLNUI8vWTmHjU1rHL8kvgS8ijiW/GT/Sm1krI Es0w== X-Gm-Message-State: AJcUukd2cp437iwNYqGu9VVy9kGGf+o0H+2xUm0XrLYg+bV7YNUtoPfg TQ9xhyJke6NFzNrXBo3FRe8XeXoeqDA= X-Received: by 2002:a1c:6657:: with SMTP id a84mr11135212wmc.23.1547472502445; Mon, 14 Jan 2019 05:28:22 -0800 (PST) Received: from localhost.localdomain (aputeaux-684-1-19-62.w90-86.abo.wanadoo.fr. [90.86.222.62]) by smtp.gmail.com with ESMTPSA id 202sm33446560wmt.8.2019.01.14.05.28.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 05:28:21 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Mon, 14 Jan 2019 14:27:48 +0100 Message-Id: <20190114132758.24054-8-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190114132758.24054-1-ard.biesheuvel@linaro.org> References: <20190114132758.24054-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Subject: [edk2] [PATCH v2 07/17] MdeModulePkg/VariableRuntimeDxe: factor out boot service accesses 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: Hao Wu , Liming Gao , Michael D Kinney , Laszlo Ersek , Star Zeng Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" In preparation of providing a standalone MM based variable runtime driver, move the existing SMM driver to the new MM services table, and factor out some pieces that are specific to the traditional driver, mainly related to the use of UEFI boot services, which are not accessible to standalone MM drivers. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel Regression-tested-by: Laszlo Ersek --- MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf | 5 +- MdeModulePkg/Universal/Variable/RuntimeDxe/PrivilegePolymorphic.h | 58 +++++++++ MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockSmm.c | 18 +-- MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c | 59 +++------ MdeModulePkg/Universal/Variable/RuntimeDxe/VariableTraditionalMm.c | 130 ++++++++++++++++++++ 5 files changed, 211 insertions(+), 59 deletions(-) -- 2.20.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf index db7d220e06df..ed7392cbcffc 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf @@ -48,6 +48,7 @@ [Defines] [Sources] Reclaim.c Variable.c + VariableTraditionalMm.c VariableSmm.c VarCheck.c Variable.h @@ -66,7 +67,7 @@ [LibraryClasses] BaseLib SynchronizationLib UefiLib - SmmServicesTableLib + MmServicesTableLib BaseMemoryLib DebugLib DxeServicesTableLib @@ -85,7 +86,7 @@ [Protocols] ## PRODUCES ## UNDEFINED # SmiHandlerRegister gEfiSmmVariableProtocolGuid - gEfiSmmEndOfDxeProtocolGuid ## NOTIFY + gEfiMmEndOfDxeProtocolGuid ## NOTIFY gEdkiiSmmVarCheckProtocolGuid ## PRODUCES gEfiTcgProtocolGuid ## SOMETIMES_CONSUMES gEfiTcg2ProtocolGuid ## SOMETIMES_CONSUMES diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/PrivilegePolymorphic.h b/MdeModulePkg/Universal/Variable/RuntimeDxe/PrivilegePolymorphic.h index 7af22a4ad671..eb84589fc404 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/PrivilegePolymorphic.h +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/PrivilegePolymorphic.h @@ -97,4 +97,62 @@ VariableSpeculationBarrier ( VOID ); +/** + Notify the system that the SMM variable driver is ready +**/ +VOID +VariableNotifySmmReady ( + VOID + ); + +/** + Notify the system that the SMM variable write driver is ready +**/ +VOID +VariableNotifySmmWriteReady ( + VOID + ); + +/** + Variable service MM driver entry point +**/ +EFI_STATUS +EFIAPI +MmVariableServiceInitialize ( + VOID + ); + +/** + This function checks if the buffer is valid per processor architecture and + does not overlap with SMRAM. + + @param Buffer The buffer start address to be checked. + @param Length The buffer length to be checked. + + @retval TRUE This buffer is valid per processor architecture and does not + overlap with SMRAM. + @retval FALSE This buffer is not valid per processor architecture or overlaps + with SMRAM. +**/ +BOOLEAN +VariableSmmIsBufferOutsideSmmValid ( + IN EFI_PHYSICAL_ADDRESS Buffer, + IN UINT64 Length + ); + +/** + Whether the TCG or TCG2 protocols are installed in the UEFI protocol database. + This information is used by the MorLock code to infer whether an existing + MOR variable is legitimate or not. + + @retval TRUE Either the TCG or TCG2 protocol is installed in the UEFI + protocol database + @retval FALSE Neither the TCG nor the TCG2 protocol is installed in the UEFI + protocol database +**/ +BOOLEAN +VariableHaveTcgProtocols ( + VOID + ); + #endif diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockSmm.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockSmm.c index 28aa2893c6f8..009d96c3a65e 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockSmm.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/TcgMorLockSmm.c @@ -21,7 +21,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include #include -#include #include "Variable.h" typedef struct { @@ -419,8 +418,6 @@ MorLockInitAtEndOfDxe ( { UINTN MorSize; EFI_STATUS MorStatus; - EFI_STATUS TcgStatus; - VOID *TcgInterface; if (!mMorLockInitializationRequired) { // @@ -458,20 +455,7 @@ MorLockInitAtEndOfDxe ( // can be deduced from the absence of the TCG / TCG2 protocols, as edk2's // MOR implementation depends on (one of) those protocols. // - TcgStatus = gBS->LocateProtocol ( - &gEfiTcg2ProtocolGuid, - NULL, // Registration - &TcgInterface - ); - if (EFI_ERROR (TcgStatus)) { - TcgStatus = gBS->LocateProtocol ( - &gEfiTcgProtocolGuid, - NULL, // Registration - &TcgInterface - ); - } - - if (!EFI_ERROR (TcgStatus)) { + if (VariableHaveTcgProtocols ()) { // // The MOR variable originates from the platform firmware; set the MOR // Control Lock variable to report the locking capability to the OS. diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c index 8c53f84ff6e8..7245587052df 100644 --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.c @@ -15,6 +15,7 @@ SmmVariableGetStatistics() should also do validation based on its own knowledge. Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2018, Linaro, 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 @@ -28,18 +29,15 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include #include -#include +#include #include -#include -#include +#include #include #include "Variable.h" extern VARIABLE_INFO_ENTRY *gVariableInfo; -EFI_HANDLE mSmmVariableHandle = NULL; -EFI_HANDLE mVariableHandle = NULL; BOOLEAN mAtRuntime = FALSE; UINT8 *mVariableBufferPayload = NULL; UINTN mVariableBufferPayloadSize; @@ -218,7 +216,7 @@ GetFtwProtocol ( // // Locate Smm Fault Tolerent Write protocol // - Status = gSmst->SmmLocateProtocol ( + Status = gMmst->MmLocateProtocol ( &gEfiSmmFaultTolerantWriteProtocolGuid, NULL, FtwProtocol @@ -248,7 +246,7 @@ GetFvbByHandle ( // // To get the SMM FVB protocol interface on the handle // - return gSmst->SmmHandleProtocol ( + return gMmst->MmHandleProtocol ( FvBlockHandle, &gEfiSmmFirmwareVolumeBlockProtocolGuid, (VOID **) FvBlock @@ -287,7 +285,7 @@ GetFvbCountAndBuffer ( BufferSize = 0; *NumberHandles = 0; *Buffer = NULL; - Status = gSmst->SmmLocateHandle ( + Status = gMmst->MmLocateHandle ( ByProtocol, &gEfiSmmFirmwareVolumeBlockProtocolGuid, NULL, @@ -303,7 +301,7 @@ GetFvbCountAndBuffer ( return EFI_OUT_OF_RESOURCES; } - Status = gSmst->SmmLocateHandle ( + Status = gMmst->MmLocateHandle ( ByProtocol, &gEfiSmmFirmwareVolumeBlockProtocolGuid, NULL, @@ -500,7 +498,7 @@ SmmVariableHandler ( return EFI_SUCCESS; } - if (!SmmIsBufferOutsideSmmValid ((UINTN)CommBuffer, TempCommBufferSize)) { + if (!VariableSmmIsBufferOutsideSmmValid ((UINTN)CommBuffer, TempCommBufferSize)) { DEBUG ((EFI_D_ERROR, "SmmVariableHandler: SMM communication buffer in SMRAM or overflow!\n")); return EFI_SUCCESS; } @@ -911,13 +909,7 @@ SmmFtwNotificationEvent ( // // Notify the variable wrapper driver the variable write service is ready // - Status = gBS->InstallProtocolInterface ( - &mSmmVariableHandle, - &gSmmVariableWriteGuid, - EFI_NATIVE_INTERFACE, - NULL - ); - ASSERT_EFI_ERROR (Status); + VariableNotifySmmWriteReady (); return EFI_SUCCESS; } @@ -928,18 +920,11 @@ SmmFtwNotificationEvent ( runtime services in the EFI System Table and installs arch protocols for variable read and write services being available. It also registers a notification function for an EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE event. - - @param[in] ImageHandle The firmware allocated handle for the EFI image. - @param[in] SystemTable A pointer to the EFI System Table. - - @retval EFI_SUCCESS Variable service successfully initialized. - **/ EFI_STATUS EFIAPI -VariableServiceInitialize ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable +MmVariableServiceInitialize ( + VOID ) { EFI_STATUS Status; @@ -957,7 +942,7 @@ VariableServiceInitialize ( // Install the Smm Variable Protocol on a new handle. // VariableHandle = NULL; - Status = gSmst->SmmInstallProtocolInterface ( + Status = gMmst->MmInstallProtocolInterface ( &VariableHandle, &gEfiSmmVariableProtocolGuid, EFI_NATIVE_INTERFACE, @@ -965,7 +950,7 @@ VariableServiceInitialize ( ); ASSERT_EFI_ERROR (Status); - Status = gSmst->SmmInstallProtocolInterface ( + Status = gMmst->MmInstallProtocolInterface ( &VariableHandle, &gEdkiiSmmVarCheckProtocolGuid, EFI_NATIVE_INTERFACE, @@ -976,7 +961,7 @@ VariableServiceInitialize ( mVariableBufferPayloadSize = GetMaxVariableSize () + OFFSET_OF (SMM_VARIABLE_COMMUNICATE_VAR_CHECK_VARIABLE_PROPERTY, Name) - GetVariableHeaderSize (); - Status = gSmst->SmmAllocatePool ( + Status = gMmst->MmAllocatePool ( EfiRuntimeServicesData, mVariableBufferPayloadSize, (VOID **)&mVariableBufferPayload @@ -987,25 +972,19 @@ VariableServiceInitialize ( /// Register SMM variable SMI handler /// VariableHandle = NULL; - Status = gSmst->SmiHandlerRegister (SmmVariableHandler, &gEfiSmmVariableProtocolGuid, &VariableHandle); + Status = gMmst->MmiHandlerRegister (SmmVariableHandler, &gEfiSmmVariableProtocolGuid, &VariableHandle); ASSERT_EFI_ERROR (Status); // // Notify the variable wrapper driver the variable service is ready // - Status = SystemTable->BootServices->InstallProtocolInterface ( - &mVariableHandle, - &gEfiSmmVariableProtocolGuid, - EFI_NATIVE_INTERFACE, - &gSmmVariable - ); - ASSERT_EFI_ERROR (Status); + VariableNotifySmmReady (); // // Register EFI_SMM_END_OF_DXE_PROTOCOL_GUID notify function. // - Status = gSmst->SmmRegisterProtocolNotify ( - &gEfiSmmEndOfDxeProtocolGuid, + Status = gMmst->MmRegisterProtocolNotify ( + &gEfiMmEndOfDxeProtocolGuid, SmmEndOfDxeCallback, &SmmEndOfDxeRegistration ); @@ -1014,7 +993,7 @@ VariableServiceInitialize ( // // Register FtwNotificationEvent () notify function. // - Status = gSmst->SmmRegisterProtocolNotify ( + Status = gMmst->MmRegisterProtocolNotify ( &gEfiSmmFaultTolerantWriteProtocolGuid, SmmFtwNotificationEvent, &SmmFtwRegistration diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableTraditionalMm.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableTraditionalMm.c new file mode 100644 index 000000000000..d702c8f8db67 --- /dev/null +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableTraditionalMm.c @@ -0,0 +1,130 @@ +/** @file + + Parts of the SMM/MM implementation that are specific to traditional MM + +Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2018, Linaro, 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 +#include "Variable.h" + +/** + This function checks if the buffer is valid per processor architecture and + does not overlap with SMRAM. + + @param Buffer The buffer start address to be checked. + @param Length The buffer length to be checked. + + @retval TRUE This buffer is valid per processor architecture and does not + overlap with SMRAM. + @retval FALSE This buffer is not valid per processor architecture or overlaps + with SMRAM. +**/ +BOOLEAN +VariableSmmIsBufferOutsideSmmValid ( + IN EFI_PHYSICAL_ADDRESS Buffer, + IN UINT64 Length + ) +{ + return SmmIsBufferOutsideSmmValid (Buffer, Length); +} + +/** + Notify the system that the SMM variable driver is ready +**/ +VOID +VariableNotifySmmReady ( + VOID + ) +{ + EFI_STATUS Status; + EFI_HANDLE Handle; + + Handle = NULL; + Status = gBS->InstallProtocolInterface ( + &Handle, + &gEfiSmmVariableProtocolGuid, + EFI_NATIVE_INTERFACE, + NULL + ); + ASSERT_EFI_ERROR (Status); +} + +/** + Notify the system that the SMM variable write driver is ready +**/ +VOID +VariableNotifySmmWriteReady ( + VOID + ) +{ + EFI_STATUS Status; + EFI_HANDLE Handle; + + Handle = NULL; + Status = gBS->InstallProtocolInterface ( + &Handle, + &gSmmVariableWriteGuid, + EFI_NATIVE_INTERFACE, + NULL + ); + ASSERT_EFI_ERROR (Status); +} + +/** + Variable service MM driver entry point +**/ +EFI_STATUS +EFIAPI +VariableServiceInitialize ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + return MmVariableServiceInitialize (); +} + +/** + Whether the TCG or TCG2 protocols are installed in the UEFI protocol database. + This information is used by the MorLock code to infer whether an existing + MOR variable is legitimate or not. + + @retval TRUE Either the TCG or TCG2 protocol is installed in the UEFI + protocol database + @retval FALSE Neither the TCG nor the TCG2 protocol is installed in the UEFI + protocol database +**/ +BOOLEAN +VariableHaveTcgProtocols ( + VOID + ) +{ + EFI_STATUS Status; + VOID *Interface; + + Status = gBS->LocateProtocol ( + &gEfiTcg2ProtocolGuid, + NULL, // Registration + &Interface + ); + if (!EFI_ERROR (Status)) { + return TRUE; + } + + Status = gBS->LocateProtocol ( + &gEfiTcgProtocolGuid, + NULL, // Registration + &Interface + ); + return !EFI_ERROR (Status); +} From patchwork Mon Jan 14 13:27:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 155494 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3658864jaa; Mon, 14 Jan 2019 05:28:47 -0800 (PST) X-Google-Smtp-Source: ALg8bN7hQ1zT+ik6EBwPiBwlGB55w9yrewv1sNMnmddWBeInouByos2BuguOTNAig4WAShlBR/ZU X-Received: by 2002:a63:f141:: with SMTP id o1mr23069712pgk.134.1547472527143; Mon, 14 Jan 2019 05:28:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547472527; cv=none; d=google.com; s=arc-20160816; b=yMdVqRM/Lg2UJIplCYIzjaxD2fO9KC7jI4MY9zZhuoBXD/K9AMwOoSrxBVwhtonPhp JyAFlHRzLnVpVnrxnAn0O0eUAEis5Boix6J9LxZwLcYgpR0B/YV0E7ByGWXJdgzrIPat 89ff13qAR2VV+/L3w5DBd/+64O1wHk2IpEXDyDjAjvyqWX7SojAU5Dt1SkDpAP0mjJw5 465RYXKeTKmGk8meOLshgH7E0xmbV2tN7T1ziQQowKmDR7SQgMvOjLe6VXDZOf9rreOT wLnJ/xs2TKwVyXC5EHvV2YcgUZL+WwbI3XIOlUdsSNrwBwsm6vToG2/bnh7XysyfPXIr 0bWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=VcwLgKClHyw4HQ85x47P51jsGL3hBIeFOrmE2n8Y67o=; b=wWKKk8ZiVSfZYevZ0hPWG9mGHP12z8l+94VvOgz9hMKOMmO03X4/FX/ioXA5zICRwS L4gGeLjOAQZUDJa0qG8Oz/Jqyw63M1iaQ7JoLpb+aEKzv49V/s6vAG7bQVFA2u/LI0f7 d//q2WcYGUb95FPnr340ShB0SXcxBAZ7TG96k0M4nhA8fUU9xXjgEL/PMRt1+F8oBCrJ cqu7Yj10c6mEnib21WuvYmQptn1cDNFMrzKoLWw46b7/wCwEHZJMDx1vCKMq9PjLpP9i WNhxf1BgiQxzDQuJ4zSjAAzcukmWCwc9YScmomLzB+2FrQUzXy8mLwR3PC4e2SF71Uo2 mT0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=VsNvBqaK; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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. [198.145.21.10]) by mx.google.com with ESMTPS id e7si290870pgv.499.2019.01.14.05.28.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 05:28:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=VsNvBqaK; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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 8DAD8211B76D0; Mon, 14 Jan 2019 05:28:26 -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::436; helo=mail-wr1-x436.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) (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 9A351211B5082 for ; Mon, 14 Jan 2019 05:28:25 -0800 (PST) Received: by mail-wr1-x436.google.com with SMTP id p4so22842632wrt.7 for ; Mon, 14 Jan 2019 05:28:25 -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 :mime-version:content-transfer-encoding; bh=7VO9wOcEYQCvzyFXLfQZHElR06+/GMl9CWV/43Zvfdc=; b=VsNvBqaKIiU/g+kexHPlfAsGfMwJJd7kpgz/DsDXBe546WBpp2WCWPpRqHLZjYiQZ9 0GRBVUDADERm6b55L2HZNml8Fzk7vAXuQJn097JNgmrFQRc8SnhDJyiRbgwuG+B5nu7/ 5Vv4b8/hfQWqhzS8JX9HF5+MOdhBa7yIkw1RY= 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:mime-version:content-transfer-encoding; bh=7VO9wOcEYQCvzyFXLfQZHElR06+/GMl9CWV/43Zvfdc=; b=RLjlvS2PJ21EBUGNS6ycL8j6ZYy4Je+TstR37DfNo+feJDH4sPOZJl+zkS7X67vshg mPQvRqCyNqDFGFKJLuQoM22q2dsGDHOHO1AQNgTqzCAWzrowWKkSTj3cH9Kf1vFGT3D1 B/PrWxsdC6nKYZaD0tq7VYBo9JRELtVHheaMC18dmj+VweMu4U/U61qLBIcBQzUwtrgx Mb/ClP8ZAJ3zwDHshfxEbHMaMpyzhXEsaPXaEb8ri5jgsr8eyvcUXMpLpp+JtZfpZCf2 s2pURYMFOvdHQUnHk1+i4TPY9X93h6hl5r7aJtAwW4M+UEFuamfyVAnwem8E6vKPea+N njmQ== X-Gm-Message-State: AJcUukcbEAWD4ANeLtKK3Y1ePnsCHU14imjjAy973zeKOM52hBkpLdOK U//SyR/srgMJm9MIOkZM6pnwvHcH0Hw= X-Received: by 2002:a5d:548d:: with SMTP id h13mr23129798wrv.80.1547472503760; Mon, 14 Jan 2019 05:28:23 -0800 (PST) Received: from localhost.localdomain (aputeaux-684-1-19-62.w90-86.abo.wanadoo.fr. [90.86.222.62]) by smtp.gmail.com with ESMTPSA id 202sm33446560wmt.8.2019.01.14.05.28.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 05:28:22 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Mon, 14 Jan 2019 14:27:49 +0100 Message-Id: <20190114132758.24054-9-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190114132758.24054-1-ard.biesheuvel@linaro.org> References: <20190114132758.24054-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Subject: [edk2] [PATCH v2 08/17] MdeModulePkg/VariableRuntimeDxe: implement standalone MM version 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: Hao Wu , Liming Gao , Michael D Kinney , Laszlo Ersek , Star Zeng Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Reuse most of the existing code to implement a variable runtime driver that will be able to execute in the context of standalone MM. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel Reviewed-by: Jian J Wang Reviewed-by: Star Zeng --- MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf | 136 ++++++++++++++++++++ MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.c | 89 +++++++++++++ 2 files changed, 225 insertions(+) -- 2.20.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf new file mode 100644 index 000000000000..efb84ed87832 --- /dev/null +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf @@ -0,0 +1,136 @@ +## @file +# Provides SMM variable service. +# +# This module installs SMM variable protocol into SMM protocol database, +# which can be used by SMM driver, and installs SMM variable protocol +# into BS protocol database, which can be used to notify the SMM Runtime +# Dxe driver that the SMM variable service is ready. +# This module should be used with SMM Runtime DXE module together. The +# SMM Runtime DXE module would install variable arch protocol and variable +# write arch protocol based on SMM variable module. +# +# Caution: This module requires additional review when modified. +# This driver will have external input - variable data and communicate buffer in SMM mode. +# This external input must be validated carefully to avoid security issues such as +# buffer overflow or integer overflow. +# The whole SMM authentication variable design relies on the integrity of flash part and SMM. +# which is assumed to be protected by platform. All variable code and metadata in flash/SMM Memory +# may not be modified without authorization. If platform fails to protect these resources, +# the authentication service provided in this driver will be broken, and the behavior is undefined. +# +# Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
+# Copyright (c) 2018, Linaro, 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. +# +## + +[Defines] + INF_VERSION = 0x0001001B + BASE_NAME = VariableStandaloneMm + FILE_GUID = 7ee2c0c1-c21a-4113-a53a-66824a95696f + MODULE_TYPE = MM_STANDALONE + VERSION_STRING = 1.0 + PI_SPECIFICATION_VERSION = 0x00010032 + ENTRY_POINT = VariableServiceInitialize + +# +# The following information is for reference only and not required by the build tools. +# +# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64 +# + + +[Sources] + Reclaim.c + Variable.c + VariableSmm.c + VariableStandaloneMm.c + VarCheck.c + Variable.h + PrivilegePolymorphic.h + VariableExLib.c + TcgMorLockSmm.c + SpeculationBarrierSmm.c + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + StandaloneMmPkg/StandaloneMmPkg.dec + +[LibraryClasses] + AuthVariableLib + BaseLib + BaseMemoryLib + DebugLib + HobLib + MemoryAllocationLib + MmServicesTableLib + StandaloneMmDriverEntryPoint + SynchronizationLib + VarCheckLib + +[Protocols] + gEfiSmmFirmwareVolumeBlockProtocolGuid ## CONSUMES + ## CONSUMES + ## NOTIFY + gEfiSmmFaultTolerantWriteProtocolGuid + ## PRODUCES + ## UNDEFINED # SmiHandlerRegister + gEfiSmmVariableProtocolGuid + gEfiMmEndOfDxeProtocolGuid ## NOTIFY + gEdkiiSmmVarCheckProtocolGuid ## PRODUCES + +[Guids] + ## SOMETIMES_CONSUMES ## GUID # Signature of Variable store header + ## SOMETIMES_PRODUCES ## GUID # Signature of Variable store header + ## SOMETIMES_CONSUMES ## HOB + ## SOMETIMES_PRODUCES ## SystemTable + gEfiAuthenticatedVariableGuid + + ## SOMETIMES_CONSUMES ## GUID # Signature of Variable store header + ## SOMETIMES_PRODUCES ## GUID # Signature of Variable store header + ## SOMETIMES_CONSUMES ## HOB + ## SOMETIMES_PRODUCES ## SystemTable + gEfiVariableGuid + + ## SOMETIMES_CONSUMES ## Variable:L"PlatformLang" + ## SOMETIMES_PRODUCES ## Variable:L"PlatformLang" + ## SOMETIMES_CONSUMES ## Variable:L"Lang" + ## SOMETIMES_PRODUCES ## Variable:L"Lang" + gEfiGlobalVariableGuid + + gEfiMemoryOverwriteControlDataGuid ## SOMETIMES_CONSUMES ## Variable:L"MemoryOverwriteRequestControl" + gEfiMemoryOverwriteRequestControlLockGuid ## SOMETIMES_PRODUCES ## Variable:L"MemoryOverwriteRequestControlLock" + + gEfiSystemNvDataFvGuid ## CONSUMES ## GUID + gEdkiiFaultTolerantWriteGuid ## SOMETIMES_CONSUMES ## HOB + + ## SOMETIMES_CONSUMES ## Variable:L"VarErrorFlag" + ## SOMETIMES_PRODUCES ## Variable:L"VarErrorFlag" + gEdkiiVarErrorFlagGuid + +[FixedPcd] + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase ## SOMETIMES_CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64 ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdMaxAuthVariableSize ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVolatileVariableSize ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdMaxHardwareErrorVariableSize ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdHwErrStorageSize ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdMaxUserNvVariableSpaceSize ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdBoottimeReservedNvVariableSpaceSize ## CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdReclaimVariableSpaceAtEndOfDxe ## CONSUMES + +[FeaturePcd] + gEfiMdeModulePkgTokenSpaceGuid.PcdVariableCollectStatistics ## CONSUMES # statistic the information of variable. + gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultLangDeprecate ## CONSUMES # Auto update PlatformLang/Lang + +[Depex] + TRUE diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.c b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.c new file mode 100644 index 000000000000..51e21c599560 --- /dev/null +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.c @@ -0,0 +1,89 @@ +/** @file + + Parts of the SMM/MM implementation that are specific to standalone MM + +Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2018, Linaro, 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 "Variable.h" + +/** + This function checks if the buffer is valid per processor architecture and + does not overlap with SMRAM. + + @param Buffer The buffer start address to be checked. + @param Length The buffer length to be checked. + + @retval TRUE This buffer is valid per processor architecture and does not + overlap with SMRAM. + @retval FALSE This buffer is not valid per processor architecture or overlaps + with SMRAM. +**/ +BOOLEAN +VariableSmmIsBufferOutsideSmmValid ( + IN EFI_PHYSICAL_ADDRESS Buffer, + IN UINT64 Length + ) +{ + return TRUE; +} + +/** + Notify the system that the SMM variable driver is ready +**/ +VOID +VariableNotifySmmReady ( + VOID + ) +{ +} + +/** + Notify the system that the SMM variable write driver is ready +**/ +VOID +VariableNotifySmmWriteReady ( + VOID + ) +{ +} + +/** + Variable service MM driver entry point +**/ +EFI_STATUS +EFIAPI +VariableServiceInitialize ( + IN EFI_HANDLE ImageHandle, + IN EFI_MM_SYSTEM_TABLE *MmSystemTable + ) +{ + return MmVariableServiceInitialize (); +} + +/** + Whether the TCG or TCG2 protocols are installed in the UEFI protocol database. + This information is used by the MorLock code to infer whether an existing + MOR variable is legitimate or not. + + @retval TRUE Either the TCG or TCG2 protocol is installed in the UEFI + protocol database + @retval FALSE Neither the TCG nor the TCG2 protocol is installed in the UEFI + protocol database +**/ +BOOLEAN +VariableHaveTcgProtocols ( + VOID + ) +{ + return FALSE; +} From patchwork Mon Jan 14 13:27:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 155495 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3658927jaa; Mon, 14 Jan 2019 05:28:51 -0800 (PST) X-Google-Smtp-Source: ALg8bN5iom3q0fudwTqiLGlBvaR3KG62X0vWULBdj4Gohw8tKkEsrT6FSZlDXWZcOKWa+IDPPqIO X-Received: by 2002:a63:1e17:: with SMTP id e23mr20397503pge.130.1547472531688; Mon, 14 Jan 2019 05:28:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547472531; cv=none; d=google.com; s=arc-20160816; b=Zo8hmfVP/iO0Nctoh/RYcKq5UHAUB2Axwbv8onhJo5frW02tTldI08pQT4kvXNdRM4 ig8a8YYGlAnQ9pmmaCJmQGdnOVgXAx7aHIucQwhpfixa6OcMew2GHPdy0FCgp+Gqc2Wf Igq8FYKfWQEWvne2Wsd0z0KqGVpPvoR0aiBpFBMbt4yVBMWvvZqPE1BNfU4FNJ6uL8+n 4IxVsxIuXBr7Bm7UTrkW7JC/Px+JLGQgXZmsYBjnSMpOjWQvRWwIhoJyiv0jZo6H4XQo K6fa5Vts/Q9fOyOYaQnlVjf34L9jbNhNh6GGfy/nSrTXdZTgdJnsyER7HZuKLXEL9kkc ia6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=kWH3ypyKJr+RnNqFltCXkY2zEiBnPe3rsr4gSiSKbm0=; b=XaWRN2DJKFW7FmPjdvrWSJTovlWACqX8YpBIjA3cI67iaWkt13629p/X5+cHk6ME2q FIwUWQJrgEH0Co7OLRZF61ZlAp68wRhwL+uIAD984WUIWFZPLeB1Ea6M4wKrFLnCiyk7 tvy6irwPaMn+WXMZjdoHO2xJNe4qlY13bFHSQFMg+aExfjmF8PI02/TTy/fMmvWrcbRz bRSjzEMcF2SPcxt4Cc3lZjTjulbjbWoERsljr7AhYiWgC31Em1X/ncpAGzUnaRsKWGO7 lpFN/cXFiAbbznGHmZ/aTBTiszPrQZVc1y5weNA2JTQlbfHMXYDU16902KwoM9NDqXv3 7xBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Di10VOyg; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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. [198.145.21.10]) by mx.google.com with ESMTPS id n13si296819pgp.307.2019.01.14.05.28.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 05:28:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Di10VOyg; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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 C1479211B76C7; Mon, 14 Jan 2019 05:28:28 -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::343; helo=mail-wm1-x343.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) (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 24FE0211B5082 for ; Mon, 14 Jan 2019 05:28:27 -0800 (PST) Received: by mail-wm1-x343.google.com with SMTP id f188so8819938wmf.5 for ; Mon, 14 Jan 2019 05:28:27 -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 :mime-version:content-transfer-encoding; bh=cVuKfBDknyzMi9FTtpNRQKJe+x38oZVPyC172d8L6iY=; b=Di10VOygyB93sclkYVDU1x9jzyq6ADvooIajEIl68D0406wbq16lH8Os0C3F7EIG/J msvHDBBmH5M5NDPDKXGHf0KTV0Tb33EaKrQ2pX8vYl3bKPQ6rDqNBH+BIAiefRJvCnKH GkSLDCdWWVS/Er2UiEUtfglZCnTj5HWxOspNU= 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:mime-version:content-transfer-encoding; bh=cVuKfBDknyzMi9FTtpNRQKJe+x38oZVPyC172d8L6iY=; b=EXMr9xygRxgmlEcOyA6CgIdZtH5NMHSw3GgfTgHnbyrrLb4rOLLxIlA0G80hYArkRq bglAg/QnT7Ql7UEhCPccQyEf/XpuZ9EBxfEtu0IfUC4wKdpBN1TRf9gXmtkyQ4+HYlrD RZWdkU2Iunz6XdARuvIs6cmJoZBgR6HACwls4XbuaDXVFIeg0wtXjhOkF/3vVhfsYYNa KP+NJ8v9IRj6tk8PWQnqh0cTjUvaMSsJgpRmLX+CCveMz/scwjehfbDeuSwPbGenKdDF bB4VQ8tD4YK8YIfHKKBVToLKUWH9+2f8apavxq1sQjxAVYte1NpkpZ/DoHzpMZRBkDfD w7+g== X-Gm-Message-State: AJcUukfwvZHf8d2QHp4nHl/qE3I7KqogPf8sYzJx5SgZ2DCvSqMqhnFa aEcl/PjSiY6GDlM7R/J1qcbjDsD9Z7c= X-Received: by 2002:a1c:20cb:: with SMTP id g194mr11561147wmg.77.1547472505229; Mon, 14 Jan 2019 05:28:25 -0800 (PST) Received: from localhost.localdomain (aputeaux-684-1-19-62.w90-86.abo.wanadoo.fr. [90.86.222.62]) by smtp.gmail.com with ESMTPSA id 202sm33446560wmt.8.2019.01.14.05.28.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 05:28:24 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Mon, 14 Jan 2019 14:27:50 +0100 Message-Id: <20190114132758.24054-10-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190114132758.24054-1-ard.biesheuvel@linaro.org> References: <20190114132758.24054-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Subject: [edk2] [PATCH v2 09/17] MdePkg: introduce standalone MM entry point library class 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: Hao Wu , Liming Gao , Michael D Kinney , Laszlo Ersek , Star Zeng Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Add the library interface for the standalone MM driver entry point. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- MdePkg/MdePkg.dec | 3 + MdePkg/Include/Library/StandaloneMmDriverEntryPoint.h | 134 ++++++++++++++++++++ 2 files changed, 137 insertions(+) -- 2.20.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index a7383b6daafb..a4854083105d 100644 --- a/MdePkg/MdePkg.dec +++ b/MdePkg/MdePkg.dec @@ -247,6 +247,9 @@ [LibraryClasses] # Only available to MM_STANDALONE, SMM/DXE Combined and SMM module types. MmServicesTableLib|Include/Library/MmServicesTableLib.h + ## @libraryclass Module entry point library for standalone MM drivers. + StandaloneMmDriverEntryPoint|Include/Library/StandaloneMmDriverEntryPoint.h + [LibraryClasses.IA32, LibraryClasses.X64] ## @libraryclass Abstracts both S/W SMI generation and detection. ## diff --git a/MdePkg/Include/Library/StandaloneMmDriverEntryPoint.h b/MdePkg/Include/Library/StandaloneMmDriverEntryPoint.h new file mode 100644 index 000000000000..d08a73303dbb --- /dev/null +++ b/MdePkg/Include/Library/StandaloneMmDriverEntryPoint.h @@ -0,0 +1,134 @@ +/** @file + Module entry point library for Standalone MM Drivers. + +Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
+Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.
+Copyright (c) 2018, Linaro, Limited. 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. + +**/ + +#ifndef __MODULE_ENTRY_POINT_H__ +#define __MODULE_ENTRY_POINT_H__ + +/// +/// Declare the PI Specification Revision that this driver requires to execute +/// correctly. +/// +extern CONST UINT32 _gMmRevision; + +/** + The entry point of PE/COFF Image for a Standalone MM Driver. + + This function is the entry point for a Standalone MM Driver. + This function must call ProcessLibraryConstructorList() and + ProcessModuleEntryPointList(). + If the return status from ProcessModuleEntryPointList() + is an error status, then ProcessLibraryDestructorList() must be called. + The return value from ProcessModuleEntryPointList() is returned. + If _gDriverUnloadImageCount is greater + than zero, then an unload handler must be registered for this image and + the unload handler must invoke ProcessModuleUnloadList(). + If _gMmRevision is not zero and SystemTable->Hdr.Revision is + less than _gUefiDriverRevison, then return EFI_INCOMPATIBLE_VERSION. + + @param ImageHandle The image handle of the Standalone MM Driver. + @param SystemTable A pointer to the EFI System Table. + + @retval EFI_SUCCESS The Standalone MM Driver exited normally. + @retval EFI_INCOMPATIBLE_VERSION _gMmRevision is greater than + SystemTable->Hdr.Revision. + @retval Other Return value from + ProcessModuleEntryPointList(). + +**/ +EFI_STATUS +EFIAPI +_ModuleEntryPoint ( + IN EFI_HANDLE ImageHandle, + IN EFI_MM_SYSTEM_TABLE *MmSystemTable + ); + + +/** + Auto generated function that calls the library constructors for all of the + module's dependent libraries. + + This function must be called by _ModuleEntryPoint(). + This function calls the set of library constructors for the set of library + instances that a module depends on. This includes library instances that a + module depends on directly and library instances that a module depends on + indirectly through other libraries. This function is auto generated by build + tools and those build tools are responsible for collecting the set of library + instances, determine which ones have constructors, and calling the library + constructors in the proper order based upon each of the library instances own + dependencies. + + @param ImageHandle The image handle of the Standalone MM Driver. + @param SystemTable A pointer to the MM System Table. + +**/ +VOID +EFIAPI +ProcessLibraryConstructorList ( + IN EFI_HANDLE ImageHandle, + IN EFI_MM_SYSTEM_TABLE *MmSystemTable + ); + + +/** + Auto generated function that calls the library descructors for all of the + module's dependent libraries. + + This function may be called by _ModuleEntryPoint(). + This function calls the set of library destructors for the set of library + instances that a module depends on. This includes library instances that a + module depends on directly and library instances that a module depends on + indirectly through other libraries. + This function is auto generated by build tools and those build tools are + responsible for collecting the set of library instances, determine which ones + have destructors, and calling the library destructors in the proper order + based upon each of the library instances own dependencies. + + @param ImageHandle The image handle of the Standalone MM Driver. + @param SystemTable A pointer to the MM System Table. + +**/ +VOID +EFIAPI +ProcessLibraryDestructorList ( + IN EFI_HANDLE ImageHandle, + IN EFI_MM_SYSTEM_TABLE *MmSystemTable + ); + + +/** + Auto generated function that calls a set of module entry points. + + This function must be called by _ModuleEntryPoint(). + This function calls the set of module entry points. + This function is auto generated by build tools and those build tools are + responsible for collecting the module entry points and calling them in a + specified order. + + @param ImageHandle The image handle of the Standalone MM Driver. + @param SystemTable A pointer to the EFI System Table. + + @retval EFI_SUCCESS The Standalone MM Driver executed normally. + @retval !EFI_SUCCESS The Standalone MM Driver failed to execute normally. +**/ +EFI_STATUS +EFIAPI +ProcessModuleEntryPointList ( + IN EFI_HANDLE ImageHandle, + IN EFI_MM_SYSTEM_TABLE *MmSystemTable + ); + +#endif From patchwork Mon Jan 14 13:27:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 155496 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3659002jaa; Mon, 14 Jan 2019 05:28:56 -0800 (PST) X-Google-Smtp-Source: ALg8bN4qJMM9c7F26qyfBMWBh1CU4eMTL4x2w5JzIQa4Ago0Gp2uveG0W3JbQku7ZdFvEWFrlcy4 X-Received: by 2002:a62:22d4:: with SMTP id p81mr13280906pfj.16.1547472535935; Mon, 14 Jan 2019 05:28:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547472535; cv=none; d=google.com; s=arc-20160816; b=Bd+KmCtQE0NdnpDKGX7CZjyCJ3VUkt82K7+KJNZAmlTaWlFHxTlmlKKWTijmiVcay6 FBLTaIXYBK3fCBlMBi6xi5xM2TUh/kBh5NK5gqqRt/qu4sTapoJt5n84CHC+uLE7j6iq PKRofWEpepuKqHukifD+nW14phaVXPQUCdylc1zJygc/GOSvlxgRFPAprctt+b/u0IhB ontuP1WVmnsGNmY3tmVrmf5+LIFIyFKi1AtR5hbpiD8WYaIfrX9eCGDseH5hLtpee4aN ljbmyxgPL4AAOh6JId6z+l0Uvyx9f5VT9kQ+OGzFCBbMVgGAKxkhInsogAF9wYWHQG0f YgGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=sLSH4hexiOm6Py2S5wSGPUvzrOamimSRAbv3CExrTkg=; b=0CEbqyY3+TDZwu8uBez7coCEluoLrOChYU2b7fuTtr/ve1XsJ7mSgL7lnd0N+RinNq 9kCZTfgVFCbEEs2H2qknZRevDQ0yWtOQxOqTOhYl8e3ymdLzV0WwMB83brYnlvRd+mO0 Zqk6OuGnChxTUW0r82yyxiZ/OKQWszmSitkG6rjaVua+wFHOPuoJZbgtKqsVDbzw+hRk TxqD9X+PFN0k28C7cqyC+eiBtoYAMCWXLdt2aZ5pSUWJrukhG/3b/vekSDl85jAi/87o PasogD+jZvVntnTGM5PVZ7mNVBxdYvkuqjU4fGai8jXxOciVwzSRXQOcc5uyQbBL3g8x CuhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=HugEvXHW; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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. [198.145.21.10]) by mx.google.com with ESMTPS id i9si384887plb.35.2019.01.14.05.28.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 05:28:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=HugEvXHW; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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 EF92D211B739D; Mon, 14 Jan 2019 05:28:30 -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::32f; helo=mail-wm1-x32f.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) (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 E1C6D211B76D5 for ; Mon, 14 Jan 2019 05:28:28 -0800 (PST) Received: by mail-wm1-x32f.google.com with SMTP id t200so8898567wmt.0 for ; Mon, 14 Jan 2019 05:28:28 -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 :mime-version:content-transfer-encoding; bh=xXn1B0QGJcfAlWVOf0u5mL+nZysqhKR0xCQC+m4PYOs=; b=HugEvXHWK1PscuuuDj+GvFYrhHWn+ZIIhk75zD3/UzitpwQ1hCYSex0CSg0PZtSXR7 Jsg1PUrjrA6NqIV5n1abCFpj9BolqX35IU7XLcaGEsoORmkHgh0c58p18EsQbtgaZqSD //HZacebgHnHY4+LnPjngRvAEuJPB/iQqto/I= 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:mime-version:content-transfer-encoding; bh=xXn1B0QGJcfAlWVOf0u5mL+nZysqhKR0xCQC+m4PYOs=; b=gDv5/t6dj1nnphuk/qRaMHWc5McPfX0SV0E5q7/iy0u6YzyWTts9xcqF2TDOJr7Qod OtHaWa1U0qq2WXM6PMe9NCSVxWGOpdkAfZmR5rKSN7zeLETeMO4niSMB4pQW9ofqyZCk Ig7AVdLtQMjVyytq66eC5tU73Iu8BZK80bS4AjQpfvVtwQOMzfHBGyEuzGm0g/jX5SAO B2RppG1Q1Pw5eF33gB1o0f0wHLJvt9YsTDhILaNGgc12f1lw2hxQRCO2lxaLrf4uAhlz tDx0QYux+pCx+aFGy8HqG8sZmjiDynRDFwQ2xRErKCbhto9wfsXTlpp3MPv84bHdAjb2 Jrxg== X-Gm-Message-State: AJcUukdBQYRF+tMkL/nQJdM+frp7XttEaXO65Gx1XFcU6Q9GDnQBjp4m VMDQDv9QKm7EO7LNiAnZHIUQZ2t+fm8= X-Received: by 2002:a1c:e044:: with SMTP id x65mr3544173wmg.86.1547472506963; Mon, 14 Jan 2019 05:28:26 -0800 (PST) Received: from localhost.localdomain (aputeaux-684-1-19-62.w90-86.abo.wanadoo.fr. [90.86.222.62]) by smtp.gmail.com with ESMTPSA id 202sm33446560wmt.8.2019.01.14.05.28.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 05:28:26 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Mon, 14 Jan 2019 14:27:51 +0100 Message-Id: <20190114132758.24054-11-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190114132758.24054-1-ard.biesheuvel@linaro.org> References: <20190114132758.24054-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Subject: [edk2] [PATCH v2 10/17] MdePkg: introduce standalone MM entry point library implementation 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: Hao Wu , Liming Gao , Michael D Kinney , Laszlo Ersek , Star Zeng Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Add an implementation of the StandaloneMmDriverEntryPoint library class. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- MdePkg/MdePkg.dsc | 2 + MdePkg/Library/StandaloneMmDriverEntryPoint/StandaloneMmDriverEntryPoint.inf | 43 ++++++++++ MdePkg/Library/StandaloneMmDriverEntryPoint/StandaloneMmDriverEntryPoint.c | 90 ++++++++++++++++++++ MdePkg/Library/StandaloneMmDriverEntryPoint/StandaloneMmDriverEntryPoint.uni | 22 +++++ 4 files changed, 157 insertions(+) -- 2.20.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/MdePkg/MdePkg.dsc b/MdePkg/MdePkg.dsc index 428b14e6a4e0..ec561c53cab0 100644 --- a/MdePkg/MdePkg.dsc +++ b/MdePkg/MdePkg.dsc @@ -115,6 +115,8 @@ [Components] MdePkg/Library/SmmLibNull/SmmLibNull.inf MdePkg/Library/BaseExtractGuidedSectionLib/BaseExtractGuidedSectionLib.inf + MdePkg/Library/StandaloneMmDriverEntryPoint/StandaloneMmDriverEntryPoint.inf + [Components.IA32, Components.X64] MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf diff --git a/MdePkg/Library/StandaloneMmDriverEntryPoint/StandaloneMmDriverEntryPoint.inf b/MdePkg/Library/StandaloneMmDriverEntryPoint/StandaloneMmDriverEntryPoint.inf new file mode 100644 index 000000000000..c9309de1c755 --- /dev/null +++ b/MdePkg/Library/StandaloneMmDriverEntryPoint/StandaloneMmDriverEntryPoint.inf @@ -0,0 +1,43 @@ +## @file +# Module entry point library for Standalone MM driver. +# +# Copyright (c) 2015, Intel Corporation. All rights reserved.
+# Copyright (c) 2016-2018, ARM Ltd. All rights reserved.
+# Copyright (c) 2018, Linaro, Limited. 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. +# +# +## + +[Defines] + INF_VERSION = 0x0001001B + BASE_NAME = StandaloneMmDriverEntryPoint + MODULE_UNI_FILE = StandaloneMmDriverEntryPoint.uni + FILE_GUID = 5ca126c0-b598-4f4b-abb9-b6e7d077aea9 + MODULE_TYPE = MM_STANDALONE + VERSION_STRING = 1.0 + PI_SPECIFICATION_VERSION = 0x00010032 + LIBRARY_CLASS = StandaloneMmDriverEntryPoint|MM_STANDALONE + +# +# The following information is for reference only and not required by the build tools. +# +# VALID_ARCHITECTURES = IA32 X64 AARCH64 +# + +[Sources] + StandaloneMmDriverEntryPoint.c + +[Packages] + MdePkg/MdePkg.dec + +[LibraryClasses] + BaseLib + DebugLib + MmServicesTableLib diff --git a/MdePkg/Library/StandaloneMmDriverEntryPoint/StandaloneMmDriverEntryPoint.c b/MdePkg/Library/StandaloneMmDriverEntryPoint/StandaloneMmDriverEntryPoint.c new file mode 100644 index 000000000000..111bb1f18a2a --- /dev/null +++ b/MdePkg/Library/StandaloneMmDriverEntryPoint/StandaloneMmDriverEntryPoint.c @@ -0,0 +1,90 @@ +/** @file + Entry point to a Standalone MM driver. + +Copyright (c) 2015, Intel Corporation. All rights reserved.
+Copyright (c) 2016 - 2018, ARM Ltd. All rights reserved.
+Copyright (c) 2018, Linaro, Limited. 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 +#include +#include +#include + +/** + The entry point of PE/COFF Image for a Standalone MM Driver. + + This function is the entry point for a Standalone MM Driver. + This function must call ProcessLibraryConstructorList() and + ProcessModuleEntryPointList(). + If the return status from ProcessModuleEntryPointList() + is an error status, then ProcessLibraryDestructorList() must be called. + The return value from ProcessModuleEntryPointList() is returned. + If _gDriverUnloadImageCount is greater + than zero, then an unload handler must be registered for this image and + the unload handler must invoke ProcessModuleUnloadList(). + If _gMmRevision is not zero and SystemTable->Hdr.Revision is + less than _gUefiDriverRevison, then return EFI_INCOMPATIBLE_VERSION. + + @param ImageHandle The image handle of the Standalone MM Driver. + @param SystemTable A pointer to the EFI System Table. + + @retval EFI_SUCCESS The Standalone MM Driver exited normally. + @retval EFI_INCOMPATIBLE_VERSION _gMmRevision is greater than + SystemTable->Hdr.Revision. + @retval Other Return value from + ProcessModuleEntryPointList(). + +**/ +EFI_STATUS +EFIAPI +_ModuleEntryPoint ( + IN EFI_HANDLE ImageHandle, + IN IN EFI_MM_SYSTEM_TABLE *MmSystemTable + ) +{ + EFI_STATUS Status; + + if (_gMmRevision != 0) { + // + // Make sure that the MM spec revision of the platform + // is >= MM spec revision of the driver + // + if (MmSystemTable->Hdr.Revision < _gMmRevision) { + return EFI_INCOMPATIBLE_VERSION; + } + } + + // + // Call constructor for all libraries + // + ProcessLibraryConstructorList (ImageHandle, MmSystemTable); + + // + // Call the driver entry point + // + Status = ProcessModuleEntryPointList (ImageHandle, MmSystemTable); + + // + // If all of the drivers returned errors, then invoke all of the library destructors + // + if (EFI_ERROR (Status)) { + ProcessLibraryDestructorList (ImageHandle, MmSystemTable); + } + + // + // Return the cumulative return status code from all of the driver entry points + // + return Status; +} diff --git a/MdePkg/Library/StandaloneMmDriverEntryPoint/StandaloneMmDriverEntryPoint.uni b/MdePkg/Library/StandaloneMmDriverEntryPoint/StandaloneMmDriverEntryPoint.uni new file mode 100644 index 000000000000..11765d7fb4a6 --- /dev/null +++ b/MdePkg/Library/StandaloneMmDriverEntryPoint/StandaloneMmDriverEntryPoint.uni @@ -0,0 +1,22 @@ +// /** @file +// +// Module entry point library for standalone MM driver +// +// Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
+// Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.
+// Copyright (c) 2018, Linaro, Limited. 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. +// +// **/ + + +#string STR_MODULE_ABSTRACT #language en-US "Module entry point library for standalone MM driver" + +#string STR_MODULE_DESCRIPTION #language en-US "Module entry point library for standalone MM driver." + From patchwork Mon Jan 14 13:27:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 155497 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3659083jaa; Mon, 14 Jan 2019 05:29:00 -0800 (PST) X-Google-Smtp-Source: ALg8bN6fETm3xBB4NS61r5qEqV8aXUsDDGODGCKDXv/gnuFFhuvWbzbK1Vh7+TGwLbaW5s9XakKK X-Received: by 2002:a62:c185:: with SMTP id i127mr25628002pfg.43.1547472540781; Mon, 14 Jan 2019 05:29:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547472540; cv=none; d=google.com; s=arc-20160816; b=gaLofNBZrQ0KmVOQY3fiqv9dxz/g07b/8HztgM1nHpaLbQgexEEeHv6trmempCmize oGr3MnYEkV8BSgjP1E1GehkhznBvHI2Y5Yxvs2Ym0CBSlbJ558b8xe/nnbyUpWl/aCqz 5iVYnY1JnLAyKA2vhPJzJThMGnJVqZXpyoyMAUO3pTEoCOeAYdNx7MxlFIEhRSEIepm0 mYy69mcFtVHLMW9P+0ukO2pyMUR3Rc1mugZslkljgEKNsD2rP/1qNuq1cfqrH9oDxayk sJA7D3ahf5mb0bPjel+k7wZ5ehBQ/d1gMNuQzn2uNRkjhCrS3FbxF51R8JRcw9oSQ4AR uhPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=/aVoftCWgAt14eCt74E8j0lOzDjju0DnsV+FytL55JE=; b=UdTj/WGs8FTLjfxN8f64oQNiJKR+J1hsBlNfZmViimjHFknB7JeFSMBYobgIy9XnuB 0/YY5s0CE9RPWznaPQRnnmNmXroDJWiQVDVfh8Z33BymceIpMhfU+eKV1wToabnv31Yg tGsBxEinYgsAFl+FSqWV+U66z2vWbmiDtXFb5t8JozaUpaJcxSDGYD3UCMU5Iefb1p+d rmbvzsNv1Jk65g0xHG58gAl5NOs7bA2lGzD900OTcSJYrZh8LSTbLxoiuZobSh9XP0YZ RYqMhHFjKI/8qUpgChC9i1V0dnqLw7+XDQXu9PvFfoMAThX3qgclich5vCPmV9Wct2kn n5uA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=klBGswXe; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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. [198.145.21.10]) by mx.google.com with ESMTPS id s8si332565plq.345.2019.01.14.05.29.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 05:29:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=klBGswXe; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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 28095211B76DB; Mon, 14 Jan 2019 05:28: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::32c; helo=mail-wm1-x32c.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) (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 1C272211B1FB1 for ; Mon, 14 Jan 2019 05:28:30 -0800 (PST) Received: by mail-wm1-x32c.google.com with SMTP id a62so8901531wmh.4 for ; Mon, 14 Jan 2019 05:28:29 -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 :mime-version:content-transfer-encoding; bh=ZLc9edlLrCPE90m1+Nqbw+5Zy1YcH+Jchn359vG8Ny0=; b=klBGswXe4lpV1jrQ305pX7h8zEig6ugLIbZ6LUyH5cCVisNMLOFcPxjSOdeozEs34d wqk+awvafH/JJh8//wC9uaKpisARuVbzwq86Jezy71Ewt8y7cgH1s4NuBGvMYt5CDmbw wrjGk6nLV//eHS2AXma61tWiOzXf1wRroQD3k= 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:mime-version:content-transfer-encoding; bh=ZLc9edlLrCPE90m1+Nqbw+5Zy1YcH+Jchn359vG8Ny0=; b=aKip+x9Ehyho4Rd5CqSFdndEBgiUQkncm55nuqMzkH3KxMtySr0WYJevlVGvsk6FqC ADWPfkDhpv6SGcQzCzQv3h1BbNGMYtqa38fdr+4ahvCT5hJQqXB9ImO/EqXu6PgNdUKK sfB362tS2/3IHwMIyA3VR6KHKMsiLQ8doFAu/QNisDIVAQCbYjWa8X2LkEiukXjJ9UVj OWt/SvxeWw7iKtU3xBGkDR7HWAwt+sPExeASdABcuUVTCMri7MpWWRRJaU/0GwTWgwnT +P4vtWHArrMB1Z74ZRH+O9GK7bQBszkEZjyE2AUU07VEjqE5bXpmmbF6inG3GdMGazZu EL+w== X-Gm-Message-State: AJcUukeeIVY4kibj/F8ZwBcsAsvUWbJ7vAuDLELJwtQMwAitBDK5LMhU gBH6jzUe04qVZ41yCy6vp+760PcwegQ= X-Received: by 2002:a7b:c315:: with SMTP id k21mr11467686wmj.145.1547472508190; Mon, 14 Jan 2019 05:28:28 -0800 (PST) Received: from localhost.localdomain (aputeaux-684-1-19-62.w90-86.abo.wanadoo.fr. [90.86.222.62]) by smtp.gmail.com with ESMTPSA id 202sm33446560wmt.8.2019.01.14.05.28.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 05:28:27 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Mon, 14 Jan 2019 14:27:52 +0100 Message-Id: <20190114132758.24054-12-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190114132758.24054-1-ard.biesheuvel@linaro.org> References: <20190114132758.24054-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Subject: [edk2] [PATCH v2 11/17] MdePkg: add MM_STANDALONE implementation of MmServicesTableLib 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: Hao Wu , Liming Gao , Michael D Kinney , Laszlo Ersek , Star Zeng Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" The newly introduced generic MmServicesTableLib can be implemented for traditional SMM (as we did already), but MM_STANDALONE drivers require an implementation that is based on standalone MM. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- MdePkg/MdePkg.dsc | 1 + MdePkg/Library/StandaloneMmServicesTableLib/StandaloneMmServicesTableLib.inf | 39 +++++++++++++++++++ MdePkg/Library/StandaloneMmServicesTableLib/StandaloneMmServicesTableLib.c | 41 ++++++++++++++++++++ MdePkg/Library/StandaloneMmServicesTableLib/StandaloneMmServicesTableLib.uni | 20 ++++++++++ 4 files changed, 101 insertions(+) -- 2.20.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/MdePkg/MdePkg.dsc b/MdePkg/MdePkg.dsc index ec561c53cab0..303e1ab3bd0f 100644 --- a/MdePkg/MdePkg.dsc +++ b/MdePkg/MdePkg.dsc @@ -116,6 +116,7 @@ [Components] MdePkg/Library/BaseExtractGuidedSectionLib/BaseExtractGuidedSectionLib.inf MdePkg/Library/StandaloneMmDriverEntryPoint/StandaloneMmDriverEntryPoint.inf + MdePkg/Library/StandaloneMmServicesTableLib/StandaloneMmServicesTableLib.inf [Components.IA32, Components.X64] MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf diff --git a/MdePkg/Library/StandaloneMmServicesTableLib/StandaloneMmServicesTableLib.inf b/MdePkg/Library/StandaloneMmServicesTableLib/StandaloneMmServicesTableLib.inf new file mode 100644 index 000000000000..86f6c5c78035 --- /dev/null +++ b/MdePkg/Library/StandaloneMmServicesTableLib/StandaloneMmServicesTableLib.inf @@ -0,0 +1,39 @@ +## @file +# Standalone MM Services Table Library. +# +# Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.
+# Copyright (c) 2018, Linaro, 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. +# +# +## + +[Defines] + INF_VERSION = 0x0001001B + BASE_NAME = StandaloneMmServicesTableLib + MODULE_UNI_FILE = StandaloneMmServicesTableLib.uni + FILE_GUID = eaa4684f-fb4e-41f3-9967-307d5b409182 + MODULE_TYPE = MM_STANDALONE + VERSION_STRING = 1.0 + LIBRARY_CLASS = MmServicesTableLib|MM_STANDALONE + PI_SPECIFICATION_VERSION = 0x00010032 + CONSTRUCTOR = StandaloneMmServicesTableLibConstructor + +# +# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64 +# + +[Sources] + StandaloneMmServicesTableLib.c + +[Packages] + MdePkg/MdePkg.dec + +[LibraryClasses] + DebugLib diff --git a/MdePkg/Library/StandaloneMmServicesTableLib/StandaloneMmServicesTableLib.c b/MdePkg/Library/StandaloneMmServicesTableLib/StandaloneMmServicesTableLib.c new file mode 100644 index 000000000000..b870f25fcfed --- /dev/null +++ b/MdePkg/Library/StandaloneMmServicesTableLib/StandaloneMmServicesTableLib.c @@ -0,0 +1,41 @@ +/** @file + MM Services Table Library. + + Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
+ Copyright (c) 2018, Linaro, 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 +#include + +EFI_MM_SYSTEM_TABLE *gMmst = NULL; + +/** + The constructor function caches the pointer of the MM Services Table. + + @param ImageHandle The firmware allocated handle for the EFI image. + @param SystemTable A pointer to the EFI System Table. + + @retval EFI_SUCCESS The constructor always returns EFI_SUCCESS. + +**/ +EFI_STATUS +EFIAPI +StandaloneMmServicesTableLibConstructor ( + IN EFI_HANDLE ImageHandle, + IN EFI_MM_SYSTEM_TABLE *MmSystemTable + ) +{ + gMmst = MmSystemTable; + ASSERT (gMmst != NULL); + return EFI_SUCCESS; +} diff --git a/MdePkg/Library/StandaloneMmServicesTableLib/StandaloneMmServicesTableLib.uni b/MdePkg/Library/StandaloneMmServicesTableLib/StandaloneMmServicesTableLib.uni new file mode 100644 index 000000000000..2cabf1af1483 --- /dev/null +++ b/MdePkg/Library/StandaloneMmServicesTableLib/StandaloneMmServicesTableLib.uni @@ -0,0 +1,20 @@ +// /** @file +// +// Standalone MM Services Table Library. +// +// Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.
+// Copyright (c) 2018, Linaro, 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. +// +// **/ + + +#string STR_MODULE_ABSTRACT #language en-US "Standalone MM Services Table Library" + +#string STR_MODULE_DESCRIPTION #language en-US "Standalone MM Services Table Library." From patchwork Mon Jan 14 13:27:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 155498 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3659146jaa; Mon, 14 Jan 2019 05:29:05 -0800 (PST) X-Google-Smtp-Source: ALg8bN6Ws1Khy0wAmVLNEdE4bwOLEv6gS4NBTBjlgpmOX7lwfTT+JyvykfhAC69qfQqsoOmgNHen X-Received: by 2002:a65:5a4c:: with SMTP id z12mr22767274pgs.188.1547472545647; Mon, 14 Jan 2019 05:29:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547472545; cv=none; d=google.com; s=arc-20160816; b=jdUreb82kKiGxeKmyqzLmjX2vtSzPbUwWQQFtSO/Pn553l1uzsGZ1y9jzlfeoPFRaN uOeDr8sK//FMS9th/drJkeKVha7H38RJ+OR0qRDF3Cpt91avfRZuAgQKoQelNYawPjXp G5smYUJNC+9s3X0SQv59H4a5+4vA07M/n2RuxWgtqqeWmgjgnxFNFUlnKvTIkRsQ8kg/ OMwM02Dvtd2Fy8ZBc/QG45z7hbJ7DFl2CrG8RWqEhB+bgpTWjC3pO+nMPrtVwbv+Rfby j66k3VBZ7wjlSSaKzCYunUvuvvi3k+1KLD4l7KooGpqPUbluRmOfKCGXj46QmhTaVp2h 6tuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=V4e/3hFboSOW5rNPkSVhc4SYckt3yt5fBk35N5t6KOg=; b=v9egSeEt8Ra/W3R6paXRYuL7hhRY+rDny4vJ7DdoQLRYa03ct3w1+xt0QgRHZHyj43 M35lxJt3l2WXnsmbYU3qK15Gm2tqYccAvnHqm7wdmot+4upDjSWM+s/gNNEOkKL5SEnh UOpcaikho/6AgzBX9y2RWHZxnQNdcjI7XIWd/pLClGvSbCmB+dPG7s+39iu9xfFbhzJ2 olptjPbxU4YBv7JbOKZSKNZBIvCFPxAxHViKBqq4bYzSM3Ns0ZyWypIpzKn8yMSBDVmC JfOaqlz/8MGbUm5DAmNfl5tLg85KJfEd5XeHxaE6UhngrHSimYbs3O4GW4wccVS2lNRe wFwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=V52qnANn; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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. [198.145.21.10]) by mx.google.com with ESMTPS id g83si339939pfb.278.2019.01.14.05.29.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 05:29:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=V52qnANn; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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 5BA1C211B76DE; Mon, 14 Jan 2019 05:28:33 -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::42a; helo=mail-wr1-x42a.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) (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 E50C3211B76D9 for ; Mon, 14 Jan 2019 05:28:31 -0800 (PST) Received: by mail-wr1-x42a.google.com with SMTP id q18so22812186wrx.9 for ; Mon, 14 Jan 2019 05:28:31 -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 :mime-version:content-transfer-encoding; bh=sUIuypifh9naCPs6m4JpPOEOPQIxbji9UKpWoKjfBV0=; b=V52qnANn9eiVag4UXNdniZ1cnSG5ee6930eK/h1GcjwxQUOi9zxIzQlWdLvtOEiXHC sBczrwS70eZJguJZruDTxVojAdnp/sy6tTbpJmnPmtUphxnUGT4yC8B74LgHfhtRabr4 aGy6neB0x9qRzCcgWwo4IRfkQON8Hy8K3HhsA= 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:mime-version:content-transfer-encoding; bh=sUIuypifh9naCPs6m4JpPOEOPQIxbji9UKpWoKjfBV0=; b=bY+jfsbsRpRQT9TQNuZ7e5Rz35gy14uUDDqqSdoWdaGH2w+JiqQaJgYyh9kQYpfbzZ qJYs9ZmcQdGY2DqTykKVUudUNpZebISuYj+6oG0oAsmv1M8Pz74mqxyiArOYzyBX26Cw 9ynA2Tt8MgYRMOQo190Oax8Y5DADHiaLwcDZX1Jev18wiG75NYxml5WU/pncn1eBKNNa i8GB/YFA54g4V7Yh4zSq49BBsNVwEkDlUxvgTSW/T+UlC0QWaATNZ5yalgilPtj4o+83 y6PEKak/deSCsiQKgBgQPJZkihx6R2pOsSh1kCiTApIhjELzUPBWY+2bdjRyc5l6Pd+z p7QA== X-Gm-Message-State: AJcUukeBDJT978aVGLWOpmqWFYRRQjV4GCl8hXkABOgmM7A7/lwlswUq B7ClWo+4Y2DrcCytlfKggSqm7asj/Pk= X-Received: by 2002:adf:b608:: with SMTP id f8mr23613908wre.120.1547472509640; Mon, 14 Jan 2019 05:28:29 -0800 (PST) Received: from localhost.localdomain (aputeaux-684-1-19-62.w90-86.abo.wanadoo.fr. [90.86.222.62]) by smtp.gmail.com with ESMTPSA id 202sm33446560wmt.8.2019.01.14.05.28.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 05:28:28 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Mon, 14 Jan 2019 14:27:53 +0100 Message-Id: <20190114132758.24054-13-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190114132758.24054-1-ard.biesheuvel@linaro.org> References: <20190114132758.24054-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Subject: [edk2] [PATCH v2 12/17] MdeModulePkg: implement NULL instance of HobLib library class 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: Hao Wu , Liming Gao , Michael D Kinney , Laszlo Ersek , Star Zeng Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" In order to permit MM_STANDALONE modules to be built without relying on StandaloneMmPkg, provide a BASE type NULL implementation of HobLib. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- MdeModulePkg/Library/BaseHobLibNull/BaseHobLibNull.inf | 38 ++ MdeModulePkg/Library/BaseHobLibNull/BaseHobLibNull.c | 542 ++++++++++++++++++++ MdeModulePkg/Library/BaseHobLibNull/BaseHobLibNull.uni | 20 + 3 files changed, 600 insertions(+) -- 2.20.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Star Zeng diff --git a/MdeModulePkg/Library/BaseHobLibNull/BaseHobLibNull.inf b/MdeModulePkg/Library/BaseHobLibNull/BaseHobLibNull.inf new file mode 100644 index 000000000000..c0e927ff14be --- /dev/null +++ b/MdeModulePkg/Library/BaseHobLibNull/BaseHobLibNull.inf @@ -0,0 +1,38 @@ +## @file +# Null instance of HOB Library. +# +# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+# Copyright (c) 2018, Linaro, 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. +# +# +## + +[Defines] + INF_VERSION = 0x0001001B + BASE_NAME = BaseHobLibNull + MODULE_UNI_FILE = BaseHobLibNull.uni + FILE_GUID = a89dea6f-c9a0-40be-903c-7cac2ef8a0e7 + MODULE_TYPE = BASE + VERSION_STRING = 1.0 + LIBRARY_CLASS = HobLib + + +# +# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64 +# + +[Sources] + BaseHobLibNull.c + +[Packages] + MdePkg/MdePkg.dec + +[LibraryClasses] + DebugLib diff --git a/MdeModulePkg/Library/BaseHobLibNull/BaseHobLibNull.c b/MdeModulePkg/Library/BaseHobLibNull/BaseHobLibNull.c new file mode 100644 index 000000000000..0ea7d9304e9d --- /dev/null +++ b/MdeModulePkg/Library/BaseHobLibNull/BaseHobLibNull.c @@ -0,0 +1,542 @@ +/** @file + Provide Hob Library functions for build testing only. + +Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2018, Linaro, 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 + +#include +#include + +/** + Returns the pointer to the HOB list. + + This function returns the pointer to first HOB in the list. + For PEI phase, the PEI service GetHobList() can be used to retrieve the pointer + to the HOB list. For the DXE phase, the HOB list pointer can be retrieved through + the EFI System Table by looking up theHOB list GUID in the System Configuration Table. + Since the System Configuration Table does not exist that the time the DXE Core is + launched, the DXE Core uses a global variable from the DXE Core Entry Point Library + to manage the pointer to the HOB list. + + If the pointer to the HOB list is NULL, then ASSERT(). + + @return The pointer to the HOB list. + +**/ +VOID * +EFIAPI +GetHobList ( + VOID + ) +{ + ASSERT (FALSE); + return NULL; +} + +/** + Returns the next instance of a HOB type from the starting HOB. + + This function searches the first instance of a HOB type from the starting HOB pointer. + If there does not exist such HOB type from the starting HOB pointer, it will return NULL. + In contrast with macro GET_NEXT_HOB(), this function does not skip the starting HOB pointer + unconditionally: it returns HobStart back if HobStart itself meets the requirement; + caller is required to use GET_NEXT_HOB() if it wishes to skip current HobStart. + + If HobStart is NULL, then ASSERT(). + + @param Type The HOB type to return. + @param HobStart The starting HOB pointer to search from. + + @return The next instance of a HOB type from the starting HOB. + +**/ +VOID * +EFIAPI +GetNextHob ( + IN UINT16 Type, + IN CONST VOID *HobStart + ) +{ + ASSERT (FALSE); + return NULL; +} + +/** + Returns the first instance of a HOB type among the whole HOB list. + + This function searches the first instance of a HOB type among the whole HOB list. + If there does not exist such HOB type in the HOB list, it will return NULL. + + If the pointer to the HOB list is NULL, then ASSERT(). + + @param Type The HOB type to return. + + @return The next instance of a HOB type from the starting HOB. + +**/ +VOID * +EFIAPI +GetFirstHob ( + IN UINT16 Type + ) +{ + ASSERT (FALSE); + return NULL; +} + +/** + Returns the next instance of the matched GUID HOB from the starting HOB. + + This function searches the first instance of a HOB from the starting HOB pointer. + Such HOB should satisfy two conditions: + its HOB type is EFI_HOB_TYPE_GUID_EXTENSION and its GUID Name equals to the input Guid. + If there does not exist such HOB from the starting HOB pointer, it will return NULL. + Caller is required to apply GET_GUID_HOB_DATA () and GET_GUID_HOB_DATA_SIZE () + to extract the data section and its size information, respectively. + In contrast with macro GET_NEXT_HOB(), this function does not skip the starting HOB pointer + unconditionally: it returns HobStart back if HobStart itself meets the requirement; + caller is required to use GET_NEXT_HOB() if it wishes to skip current HobStart. + + If Guid is NULL, then ASSERT(). + If HobStart is NULL, then ASSERT(). + + @param Guid The GUID to match with in the HOB list. + @param HobStart A pointer to a Guid. + + @return The next instance of the matched GUID HOB from the starting HOB. + +**/ +VOID * +EFIAPI +GetNextGuidHob ( + IN CONST EFI_GUID *Guid, + IN CONST VOID *HobStart + ) +{ + ASSERT (FALSE); + return NULL; +} + +/** + Returns the first instance of the matched GUID HOB among the whole HOB list. + + This function searches the first instance of a HOB among the whole HOB list. + Such HOB should satisfy two conditions: + its HOB type is EFI_HOB_TYPE_GUID_EXTENSION and its GUID Name equals to the input Guid. + If there does not exist such HOB from the starting HOB pointer, it will return NULL. + Caller is required to apply GET_GUID_HOB_DATA () and GET_GUID_HOB_DATA_SIZE () + to extract the data section and its size information, respectively. + + If the pointer to the HOB list is NULL, then ASSERT(). + If Guid is NULL, then ASSERT(). + + @param Guid The GUID to match with in the HOB list. + + @return The first instance of the matched GUID HOB among the whole HOB list. + +**/ +VOID * +EFIAPI +GetFirstGuidHob ( + IN CONST EFI_GUID *Guid + ) +{ + ASSERT (FALSE); + return NULL; +} + +/** + Get the system boot mode from the HOB list. + + This function returns the system boot mode information from the + PHIT HOB in HOB list. + + If the pointer to the HOB list is NULL, then ASSERT(). + + @param VOID. + + @return The Boot Mode. + +**/ +EFI_BOOT_MODE +EFIAPI +GetBootModeHob ( + VOID + ) +{ + ASSERT (FALSE); + return MAX_UINT32; +} + +/** + Builds a HOB for a loaded PE32 module. + + This function builds a HOB for a loaded PE32 module. + It can only be invoked during PEI phase; + for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. + + If ModuleName is NULL, then ASSERT(). + If there is no additional space for HOB creation, then ASSERT(). + + @param ModuleName The GUID File Name of the module. + @param MemoryAllocationModule The 64 bit physical address of the module. + @param ModuleLength The length of the module in bytes. + @param EntryPoint The 64 bit physical address of the module entry point. + +**/ +VOID +EFIAPI +BuildModuleHob ( + IN CONST EFI_GUID *ModuleName, + IN EFI_PHYSICAL_ADDRESS MemoryAllocationModule, + IN UINT64 ModuleLength, + IN EFI_PHYSICAL_ADDRESS EntryPoint + ) +{ + ASSERT (FALSE); +} + +/** + Builds a HOB that describes a chunk of system memory with Owner GUID. + + This function builds a HOB that describes a chunk of system memory. + It can only be invoked during PEI phase; + for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. + + If there is no additional space for HOB creation, then ASSERT(). + + @param ResourceType The type of resource described by this HOB. + @param ResourceAttribute The resource attributes of the memory described by this HOB. + @param PhysicalStart The 64 bit physical address of memory described by this HOB. + @param NumberOfBytes The length of the memory described by this HOB in bytes. + @param OwnerGUID GUID for the owner of this resource. + +**/ +VOID +EFIAPI +BuildResourceDescriptorWithOwnerHob ( + IN EFI_RESOURCE_TYPE ResourceType, + IN EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute, + IN EFI_PHYSICAL_ADDRESS PhysicalStart, + IN UINT64 NumberOfBytes, + IN EFI_GUID *OwnerGUID + ) +{ + ASSERT (FALSE); +} + +/** + Builds a HOB that describes a chunk of system memory. + + This function builds a HOB that describes a chunk of system memory. + It can only be invoked during PEI phase; + for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. + + If there is no additional space for HOB creation, then ASSERT(). + + @param ResourceType The type of resource described by this HOB. + @param ResourceAttribute The resource attributes of the memory described by this HOB. + @param PhysicalStart The 64 bit physical address of memory described by this HOB. + @param NumberOfBytes The length of the memory described by this HOB in bytes. + +**/ +VOID +EFIAPI +BuildResourceDescriptorHob ( + IN EFI_RESOURCE_TYPE ResourceType, + IN EFI_RESOURCE_ATTRIBUTE_TYPE ResourceAttribute, + IN EFI_PHYSICAL_ADDRESS PhysicalStart, + IN UINT64 NumberOfBytes + ) +{ + ASSERT (FALSE); +} + +/** + Builds a customized HOB tagged with a GUID for identification and returns + the start address of GUID HOB data. + + This function builds a customized HOB tagged with a GUID for identification + and returns the start address of GUID HOB data so that caller can fill the customized data. + The HOB Header and Name field is already stripped. + It can only be invoked during PEI phase; + for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. + + If Guid is NULL, then ASSERT(). + If there is no additional space for HOB creation, then ASSERT(). + If DataLength > (0xFFF8 - sizeof (EFI_HOB_GUID_TYPE)), then ASSERT(). + HobLength is UINT16 and multiples of 8 bytes, so the max HobLength is 0xFFF8. + + @param Guid The GUID to tag the customized HOB. + @param DataLength The size of the data payload for the GUID HOB. + + @retval NULL The GUID HOB could not be allocated. + @retval others The start address of GUID HOB data. + +**/ +VOID * +EFIAPI +BuildGuidHob ( + IN CONST EFI_GUID *Guid, + IN UINTN DataLength + ) +{ + ASSERT (FALSE); + return NULL; +} + +/** + Builds a customized HOB tagged with a GUID for identification, copies the input data to the HOB + data field, and returns the start address of the GUID HOB data. + + This function builds a customized HOB tagged with a GUID for identification and copies the input + data to the HOB data field and returns the start address of the GUID HOB data. It can only be + invoked during PEI phase; for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. + The HOB Header and Name field is already stripped. + It can only be invoked during PEI phase; + for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. + + If Guid is NULL, then ASSERT(). + If Data is NULL and DataLength > 0, then ASSERT(). + If there is no additional space for HOB creation, then ASSERT(). + If DataLength > (0xFFF8 - sizeof (EFI_HOB_GUID_TYPE)), then ASSERT(). + HobLength is UINT16 and multiples of 8 bytes, so the max HobLength is 0xFFF8. + + @param Guid The GUID to tag the customized HOB. + @param Data The data to be copied into the data field of the GUID HOB. + @param DataLength The size of the data payload for the GUID HOB. + + @retval NULL The GUID HOB could not be allocated. + @retval others The start address of GUID HOB data. + +**/ +VOID * +EFIAPI +BuildGuidDataHob ( + IN CONST EFI_GUID *Guid, + IN VOID *Data, + IN UINTN DataLength + ) +{ + ASSERT (FALSE); + return NULL; +} + +/** + Builds a Firmware Volume HOB. + + This function builds a Firmware Volume HOB. + It can only be invoked during PEI phase; + for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. + + If there is no additional space for HOB creation, then ASSERT(). + If the FvImage buffer is not at its required alignment, then ASSERT(). + + @param BaseAddress The base address of the Firmware Volume. + @param Length The size of the Firmware Volume in bytes. + +**/ +VOID +EFIAPI +BuildFvHob ( + IN EFI_PHYSICAL_ADDRESS BaseAddress, + IN UINT64 Length + ) +{ + ASSERT (FALSE); +} + +/** + Builds a EFI_HOB_TYPE_FV2 HOB. + + This function builds a EFI_HOB_TYPE_FV2 HOB. + It can only be invoked during PEI phase; + for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. + + If there is no additional space for HOB creation, then ASSERT(). + If the FvImage buffer is not at its required alignment, then ASSERT(). + + @param BaseAddress The base address of the Firmware Volume. + @param Length The size of the Firmware Volume in bytes. + @param FvName The name of the Firmware Volume. + @param FileName The name of the file. + +**/ +VOID +EFIAPI +BuildFv2Hob ( + IN EFI_PHYSICAL_ADDRESS BaseAddress, + IN UINT64 Length, + IN CONST EFI_GUID *FvName, + IN CONST EFI_GUID *FileName + ) +{ + ASSERT (FALSE); +} + +/** + Builds a EFI_HOB_TYPE_FV3 HOB. + + This function builds a EFI_HOB_TYPE_FV3 HOB. + It can only be invoked during PEI phase; + for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. + + If there is no additional space for HOB creation, then ASSERT(). + If the FvImage buffer is not at its required alignment, then ASSERT(). + + @param BaseAddress The base address of the Firmware Volume. + @param Length The size of the Firmware Volume in bytes. + @param AuthenticationStatus The authentication status. + @param ExtractedFv TRUE if the FV was extracted as a file within + another firmware volume. FALSE otherwise. + @param FvName The name of the Firmware Volume. + Valid only if IsExtractedFv is TRUE. + @param FileName The name of the file. + Valid only if IsExtractedFv is TRUE. + +**/ +VOID +EFIAPI +BuildFv3Hob ( + IN EFI_PHYSICAL_ADDRESS BaseAddress, + IN UINT64 Length, + IN UINT32 AuthenticationStatus, + IN BOOLEAN ExtractedFv, + IN CONST EFI_GUID *FvName, OPTIONAL + IN CONST EFI_GUID *FileName OPTIONAL + ) +{ + ASSERT (FALSE); +} + +/** + Builds a Capsule Volume HOB. + + This function builds a Capsule Volume HOB. + It can only be invoked during PEI phase; + for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. + + If the platform does not support Capsule Volume HOBs, then ASSERT(). + If there is no additional space for HOB creation, then ASSERT(). + + @param BaseAddress The base address of the Capsule Volume. + @param Length The size of the Capsule Volume in bytes. + +**/ +VOID +EFIAPI +BuildCvHob ( + IN EFI_PHYSICAL_ADDRESS BaseAddress, + IN UINT64 Length + ) +{ + ASSERT (FALSE); +} + +/** + Builds a HOB for the CPU. + + This function builds a HOB for the CPU. + It can only be invoked during PEI phase; + for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. + + If there is no additional space for HOB creation, then ASSERT(). + + @param SizeOfMemorySpace The maximum physical memory addressability of the processor. + @param SizeOfIoSpace The maximum physical I/O addressability of the processor. + +**/ +VOID +EFIAPI +BuildCpuHob ( + IN UINT8 SizeOfMemorySpace, + IN UINT8 SizeOfIoSpace + ) +{ + ASSERT (FALSE); +} + +/** + Builds a HOB for the Stack. + + This function builds a HOB for the stack. + It can only be invoked during PEI phase; + for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. + + If there is no additional space for HOB creation, then ASSERT(). + + @param BaseAddress The 64 bit physical address of the Stack. + @param Length The length of the stack in bytes. + +**/ +VOID +EFIAPI +BuildStackHob ( + IN EFI_PHYSICAL_ADDRESS BaseAddress, + IN UINT64 Length + ) +{ + ASSERT (FALSE); +} + +/** + Builds a HOB for the BSP store. + + This function builds a HOB for BSP store. + It can only be invoked during PEI phase; + for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. + + If there is no additional space for HOB creation, then ASSERT(). + + @param BaseAddress The 64 bit physical address of the BSP. + @param Length The length of the BSP store in bytes. + @param MemoryType The type of memory allocated by this HOB. + +**/ +VOID +EFIAPI +BuildBspStoreHob ( + IN EFI_PHYSICAL_ADDRESS BaseAddress, + IN UINT64 Length, + IN EFI_MEMORY_TYPE MemoryType + ) +{ + ASSERT (FALSE); +} + +/** + Builds a HOB for the memory allocation. + + This function builds a HOB for the memory allocation. + It can only be invoked during PEI phase; + for DXE phase, it will ASSERT() since PEI HOB is read-only for DXE phase. + + If there is no additional space for HOB creation, then ASSERT(). + + @param BaseAddress The 64 bit physical address of the memory. + @param Length The length of the memory allocation in bytes. + @param MemoryType The type of memory allocated by this HOB. + +**/ +VOID +EFIAPI +BuildMemoryAllocationHob ( + IN EFI_PHYSICAL_ADDRESS BaseAddress, + IN UINT64 Length, + IN EFI_MEMORY_TYPE MemoryType + ) +{ + ASSERT (FALSE); +} diff --git a/MdeModulePkg/Library/BaseHobLibNull/BaseHobLibNull.uni b/MdeModulePkg/Library/BaseHobLibNull/BaseHobLibNull.uni new file mode 100644 index 000000000000..4a999e381aa0 --- /dev/null +++ b/MdeModulePkg/Library/BaseHobLibNull/BaseHobLibNull.uni @@ -0,0 +1,20 @@ +// /** @file +// Null instance of HOB Library. +// +// Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.
+// Copyright (c) 2018, Linaro, 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. +// +// **/ + + +#string STR_MODULE_ABSTRACT #language en-US "Null instance of HOB Library" + +#string STR_MODULE_DESCRIPTION #language en-US "HOB Library implementation for build testing only." + From patchwork Mon Jan 14 13:27:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 155499 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3659215jaa; Mon, 14 Jan 2019 05:29:10 -0800 (PST) X-Google-Smtp-Source: ALg8bN4S+mEPvvMhprhYi/0pR328Hg0uj6acrGfQjDN3ZR1x4IcuRZC6Qhfultcx/V4+4B2ktvQv X-Received: by 2002:a63:a35c:: with SMTP id v28mr22755549pgn.205.1547472550090; Mon, 14 Jan 2019 05:29:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547472550; cv=none; d=google.com; s=arc-20160816; b=CDkkxEUTfrfe7iG7AKgNfHXaB/5IR6PWoQudZVIHm2Sz3UCIfm72iQr/GCuioRotmn HNkW8yATNHWBUW/AvrafUnioEgilXmo671ktrAbqPeJTGfmLnGdnMAvJk9sEvdjP69xB 58Mf62pWqIAobCeb9RKnAuDbdUMillKQl1cAeKKqUWJ1grqnLnp3Irh5/zUqtJT13XCW IqTX9GJ/l0KaVOwYLA2nwROoF+oHJVWQcS0JTQaKdJuhQrNG+SUI4buN2bCXYkpjiqbk vWCzN9EE7PD9x4iv6w9emcFMHaSvw5XhEr7VekpFjTd8nizL8Xp3eh5Chgcd0+lUrLre 1Rmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=n8uGol9sfu1y4RaX1S7ztmDg36RrqRjP8fkE7uthTTo=; b=1GZiCBqVtkoy7DPpz/8x8khSLX36mMP18B+jJ7/KoxqaEPpWTrm+YXA5Nj7pBnu39v 2qC3ai50d7oauEYRpdeyfE/p+/QtajuNkpgDUQcKsG2SUrT/LJ9QTY5BvZq/ggKR09S4 f8Yb6aW/a4F8BOJk1ycb03o2Fgc6cRAKzJdfmP5L/V/iVRYWz9PGmfcOwv+TMxZZJETU c3mlKlE/crQsJkaX0nlGOt8aVtqMl2QeL5o0u0K85osdplKHF1vOjCgAo7flwEY4cDUU SrvXxN+t17sY3drb6PiGJcDtPpPvuDbKxKhny5S2vuozQ0wKvW5jCjW3eYquLE+QkMdM Ft8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=P8eYAs6T; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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. [198.145.21.10]) by mx.google.com with ESMTPS id j22si334345pfi.252.2019.01.14.05.29.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 05:29:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=P8eYAs6T; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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 922AA211B76DA; Mon, 14 Jan 2019 05:28:35 -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::344; helo=mail-wm1-x344.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) (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 559A7211B1FB1 for ; Mon, 14 Jan 2019 05:28:33 -0800 (PST) Received: by mail-wm1-x344.google.com with SMTP id y8so8812377wmi.4 for ; Mon, 14 Jan 2019 05:28:33 -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 :mime-version:content-transfer-encoding; bh=M6nbbJ35rbq3/aL1BHqWC6GPm7xC+RTG/8jp1o/d7is=; b=P8eYAs6Tci2IqP484e0jLk38hS9Xy4kchxtybVMx1W8OM1AsJV+B/+E3asb0NRtshe x27hZgXvLWyG6tVS7IoCdUo0kjYFUh0VUfvsoV5Q116a3DbUCazFQCe5p966MilcKHqU kiFgv+p+Ari4Bd+BBfqw7Iv8AChrb9v7M4mE4= 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:mime-version:content-transfer-encoding; bh=M6nbbJ35rbq3/aL1BHqWC6GPm7xC+RTG/8jp1o/d7is=; b=VROVtxL1WuJ2KLzaAzHKypuQWwsV1INsuKp0Pb0tdJgwjib/fEdlEL8Qyo0Oo5FtC/ pkbIRo2c74WFFLH3lxzTtZp+HymS7gHly6gnbTI9Azk6XHXl8Fh53ecnMGl8Hzp3xhPZ yuEAb2bh38u95iwphVyzVke40QfB4MyeMo6QQjGXd/NDP0+YtHGAv3YgJc/6bLX95PBB evJJszOn6uj8P55DbHoaHMAe5jzT+WYP7kug6AQWdv+wnpLwhTSDbiq9NVNqqoMXFNdk gP+DRiX4Hp709mxaUoh0ZkpbUh036+Ed94vkJVx8/1hfEwCCy2zlq/TzYM6DME8OgLuE u8gQ== X-Gm-Message-State: AJcUukdnKaRrWBT3UVG5EjpHcMRKcuWqxbOdZh+9nIDJCQ5uYeMWlOfL z/hC0oZuMHblIsvkG3PslwoZz4B9mYQ= X-Received: by 2002:a1c:bc82:: with SMTP id m124mr11593127wmf.77.1547472511053; Mon, 14 Jan 2019 05:28:31 -0800 (PST) Received: from localhost.localdomain (aputeaux-684-1-19-62.w90-86.abo.wanadoo.fr. [90.86.222.62]) by smtp.gmail.com with ESMTPSA id 202sm33446560wmt.8.2019.01.14.05.28.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 05:28:30 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Mon, 14 Jan 2019 14:27:54 +0100 Message-Id: <20190114132758.24054-14-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190114132758.24054-1-ard.biesheuvel@linaro.org> References: <20190114132758.24054-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Subject: [edk2] [PATCH v2 13/17] MdeModulePkg: implement NULL instance of MemoryAllocationLib library class 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: Hao Wu , Liming Gao , Michael D Kinney , Laszlo Ersek , Star Zeng Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" In order to permit MM_STANDALONE modules to be built without relying on StandaloneMmPkg, provide a BASE type NULL implementation of MemoryAllocationLib. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- MdeModulePkg/Library/BaseMemoryAllocationLibNull/BaseMemoryAllocationLibNull.inf | 38 ++ MdeModulePkg/Library/BaseMemoryAllocationLibNull/BaseMemoryAllocationLibNull.c | 575 ++++++++++++++++++++ MdeModulePkg/Library/BaseMemoryAllocationLibNull/BaseMemoryAllocationLibNull.uni | 20 + 3 files changed, 633 insertions(+) -- 2.20.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/MdeModulePkg/Library/BaseMemoryAllocationLibNull/BaseMemoryAllocationLibNull.inf b/MdeModulePkg/Library/BaseMemoryAllocationLibNull/BaseMemoryAllocationLibNull.inf new file mode 100644 index 000000000000..c231cd0e271b --- /dev/null +++ b/MdeModulePkg/Library/BaseMemoryAllocationLibNull/BaseMemoryAllocationLibNull.inf @@ -0,0 +1,38 @@ +## @file +# Null instance of Memory Allocation Library. +# +# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
+# Copyright (c) 2018, Linaro, 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. +# +# +## + +[Defines] + INF_VERSION = 0x0001001B + BASE_NAME = BaseMemoryAllocationLibNull + MODULE_UNI_FILE = BaseMemoryAllocationLibNull.uni + FILE_GUID = fd56f5d6-f194-448f-be69-c0cbb0c281af + MODULE_TYPE = BASE + VERSION_STRING = 1.0 + LIBRARY_CLASS = MemoryAllocationLib + + +# +# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64 +# + +[Sources] + BaseMemoryAllocationLibNull.c + +[Packages] + MdePkg/MdePkg.dec + +[LibraryClasses] + DebugLib diff --git a/MdeModulePkg/Library/BaseMemoryAllocationLibNull/BaseMemoryAllocationLibNull.c b/MdeModulePkg/Library/BaseMemoryAllocationLibNull/BaseMemoryAllocationLibNull.c new file mode 100644 index 000000000000..16812d3f9bb3 --- /dev/null +++ b/MdeModulePkg/Library/BaseMemoryAllocationLibNull/BaseMemoryAllocationLibNull.c @@ -0,0 +1,575 @@ +/** @file + DUmmy support routines for memory allocation + + Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+ Copyright (c) 2018, Linaro, 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 +#include + + +/** + Allocates one or more 4KB pages of type EfiBootServicesData. + + Allocates the number of 4KB pages of type EfiBootServicesData and returns a pointer to the + allocated buffer. The buffer returned is aligned on a 4KB boundary. If Pages is 0, then NULL + is returned. If there is not enough memory remaining to satisfy the request, then NULL is + returned. + + @param Pages The number of 4 KB pages to allocate. + + @return A pointer to the allocated buffer or NULL if allocation fails. + +**/ +VOID * +EFIAPI +AllocatePages ( + IN UINTN Pages + ) +{ + ASSERT (FALSE); + return NULL; +} + +/** + Allocates one or more 4KB pages of type EfiRuntimeServicesData. + + Allocates the number of 4KB pages of type EfiRuntimeServicesData and returns a pointer to the + allocated buffer. The buffer returned is aligned on a 4KB boundary. If Pages is 0, then NULL + is returned. If there is not enough memory remaining to satisfy the request, then NULL is + returned. + + @param Pages The number of 4 KB pages to allocate. + + @return A pointer to the allocated buffer or NULL if allocation fails. + +**/ +VOID * +EFIAPI +AllocateRuntimePages ( + IN UINTN Pages + ) +{ + ASSERT (FALSE); + return NULL; +} + +/** + Allocates one or more 4KB pages of type EfiReservedMemoryType. + + Allocates the number of 4KB pages of type EfiReservedMemoryType and returns a pointer to the + allocated buffer. The buffer returned is aligned on a 4KB boundary. If Pages is 0, then NULL + is returned. If there is not enough memory remaining to satisfy the request, then NULL is + returned. + + @param Pages The number of 4 KB pages to allocate. + + @return A pointer to the allocated buffer or NULL if allocation fails. + +**/ +VOID * +EFIAPI +AllocateReservedPages ( + IN UINTN Pages + ) +{ + ASSERT (FALSE); + return NULL; +} + +/** + Frees one or more 4KB pages that were previously allocated with one of the page allocation + functions in the Memory Allocation Library. + + Frees the number of 4KB pages specified by Pages from the buffer specified by Buffer. Buffer + must have been allocated on a previous call to the page allocation services of the Memory + Allocation Library. If it is not possible to free allocated pages, then this function will + perform no actions. + + If Buffer was not allocated with a page allocation function in the Memory Allocation Library, + then ASSERT(). + If Pages is zero, then ASSERT(). + + @param Buffer The pointer to the buffer of pages to free. + @param Pages The number of 4 KB pages to free. + +**/ +VOID +EFIAPI +FreePages ( + IN VOID *Buffer, + IN UINTN Pages + ) +{ + ASSERT (FALSE); +} + +/** + Allocates one or more 4KB pages of type EfiBootServicesData at a specified alignment. + + Allocates the number of 4KB pages specified by Pages of type EfiBootServicesData with an + alignment specified by Alignment. The allocated buffer is returned. If Pages is 0, then NULL is + returned. If there is not enough memory at the specified alignment remaining to satisfy the + request, then NULL is returned. + + If Alignment is not a power of two and Alignment is not zero, then ASSERT(). + If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT(). + + @param Pages The number of 4 KB pages to allocate. + @param Alignment The requested alignment of the allocation. + Must be a power of two. + If Alignment is zero, then byte alignment is used. + + @return A pointer to the allocated buffer or NULL if allocation fails. + +**/ +VOID * +EFIAPI +AllocateAlignedPages ( + IN UINTN Pages, + IN UINTN Alignment + ) +{ + ASSERT (FALSE); + return NULL; +} + +/** + Allocates one or more 4KB pages of type EfiRuntimeServicesData at a specified alignment. + + Allocates the number of 4KB pages specified by Pages of type EfiRuntimeServicesData with an + alignment specified by Alignment. The allocated buffer is returned. If Pages is 0, then NULL is + returned. If there is not enough memory at the specified alignment remaining to satisfy the + request, then NULL is returned. + + If Alignment is not a power of two and Alignment is not zero, then ASSERT(). + If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT(). + + @param Pages The number of 4 KB pages to allocate. + @param Alignment The requested alignment of the allocation. + Must be a power of two. + If Alignment is zero, then byte alignment is used. + + @return A pointer to the allocated buffer or NULL if allocation fails. + +**/ +VOID * +EFIAPI +AllocateAlignedRuntimePages ( + IN UINTN Pages, + IN UINTN Alignment + ) +{ + ASSERT (FALSE); + return NULL; +} + +/** + Allocates one or more 4KB pages of type EfiReservedMemoryType at a specified alignment. + + Allocates the number of 4KB pages specified by Pages of type EfiReservedMemoryType with an + alignment specified by Alignment. The allocated buffer is returned. If Pages is 0, then NULL is + returned. If there is not enough memory at the specified alignment remaining to satisfy the + request, then NULL is returned. + + If Alignment is not a power of two and Alignment is not zero, then ASSERT(). + If Pages plus EFI_SIZE_TO_PAGES (Alignment) overflows, then ASSERT(). + + @param Pages The number of 4 KB pages to allocate. + @param Alignment The requested alignment of the allocation. + Must be a power of two. + If Alignment is zero, then byte alignment is used. + + @return A pointer to the allocated buffer or NULL if allocation fails. + +**/ +VOID * +EFIAPI +AllocateAlignedReservedPages ( + IN UINTN Pages, + IN UINTN Alignment + ) +{ + ASSERT (FALSE); + return NULL; +} + +/** + Frees one or more 4KB pages that were previously allocated with one of the aligned page + allocation functions in the Memory Allocation Library. + + Frees the number of 4KB pages specified by Pages from the buffer specified by Buffer. Buffer + must have been allocated on a previous call to the aligned page allocation services of the Memory + Allocation Library. If it is not possible to free allocated pages, then this function will + perform no actions. + + If Buffer was not allocated with an aligned page allocation function in the Memory Allocation + Library, then ASSERT(). + If Pages is zero, then ASSERT(). + + @param Buffer The pointer to the buffer of pages to free. + @param Pages The number of 4 KB pages to free. + +**/ +VOID +EFIAPI +FreeAlignedPages ( + IN VOID *Buffer, + IN UINTN Pages + ) +{ + ASSERT (FALSE); +} + +/** + Allocates a buffer of type EfiBootServicesData. + + Allocates the number bytes specified by AllocationSize of type EfiBootServicesData and returns a + pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is + returned. If there is not enough memory remaining to satisfy the request, then NULL is returned. + + @param AllocationSize The number of bytes to allocate. + + @return A pointer to the allocated buffer or NULL if allocation fails. + +**/ +VOID * +EFIAPI +AllocatePool ( + IN UINTN AllocationSize + ) +{ + ASSERT (FALSE); + return NULL; +} + +/** + Allocates a buffer of type EfiRuntimeServicesData. + + Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData and returns + a pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is + returned. If there is not enough memory remaining to satisfy the request, then NULL is returned. + + @param AllocationSize The number of bytes to allocate. + + @return A pointer to the allocated buffer or NULL if allocation fails. + +**/ +VOID * +EFIAPI +AllocateRuntimePool ( + IN UINTN AllocationSize + ) +{ + ASSERT (FALSE); + return NULL; +} + +/** + Allocates a buffer of type EfiReservedMemoryType. + + Allocates the number bytes specified by AllocationSize of type EfiReservedMemoryType and returns + a pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is + returned. If there is not enough memory remaining to satisfy the request, then NULL is returned. + + @param AllocationSize The number of bytes to allocate. + + @return A pointer to the allocated buffer or NULL if allocation fails. + +**/ +VOID * +EFIAPI +AllocateReservedPool ( + IN UINTN AllocationSize + ) +{ + ASSERT (FALSE); + return NULL; +} + +/** + Allocates and zeros a buffer of type EfiBootServicesData. + + Allocates the number bytes specified by AllocationSize of type EfiBootServicesData, clears the + buffer with zeros, and returns a pointer to the allocated buffer. If AllocationSize is 0, then a + valid buffer of 0 size is returned. If there is not enough memory remaining to satisfy the + request, then NULL is returned. + + @param AllocationSize The number of bytes to allocate and zero. + + @return A pointer to the allocated buffer or NULL if allocation fails. + +**/ +VOID * +EFIAPI +AllocateZeroPool ( + IN UINTN AllocationSize + ) +{ + ASSERT (FALSE); + return NULL; +} + +/** + Allocates and zeros a buffer of type EfiRuntimeServicesData. + + Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData, clears the + buffer with zeros, and returns a pointer to the allocated buffer. If AllocationSize is 0, then a + valid buffer of 0 size is returned. If there is not enough memory remaining to satisfy the + request, then NULL is returned. + + @param AllocationSize The number of bytes to allocate and zero. + + @return A pointer to the allocated buffer or NULL if allocation fails. + +**/ +VOID * +EFIAPI +AllocateRuntimeZeroPool ( + IN UINTN AllocationSize + ) +{ + ASSERT (FALSE); + return NULL; +} + +/** + Allocates and zeros a buffer of type EfiReservedMemoryType. + + Allocates the number bytes specified by AllocationSize of type EfiReservedMemoryType, clears the + buffer with zeros, and returns a pointer to the allocated buffer. If AllocationSize is 0, then a + valid buffer of 0 size is returned. If there is not enough memory remaining to satisfy the + request, then NULL is returned. + + @param AllocationSize The number of bytes to allocate and zero. + + @return A pointer to the allocated buffer or NULL if allocation fails. + +**/ +VOID * +EFIAPI +AllocateReservedZeroPool ( + IN UINTN AllocationSize + ) +{ + ASSERT (FALSE); + return NULL; +} + +/** + Copies a buffer to an allocated buffer of type EfiBootServicesData. + + Allocates the number bytes specified by AllocationSize of type EfiBootServicesData, copies + AllocationSize bytes from Buffer to the newly allocated buffer, and returns a pointer to the + allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there + is not enough memory remaining to satisfy the request, then NULL is returned. + + If Buffer is NULL, then ASSERT(). + If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). + + @param AllocationSize The number of bytes to allocate and zero. + @param Buffer The buffer to copy to the allocated buffer. + + @return A pointer to the allocated buffer or NULL if allocation fails. + +**/ +VOID * +EFIAPI +AllocateCopyPool ( + IN UINTN AllocationSize, + IN CONST VOID *Buffer + ) +{ + ASSERT (FALSE); + return NULL; +} + +/** + Copies a buffer to an allocated buffer of type EfiRuntimeServicesData. + + Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData, copies + AllocationSize bytes from Buffer to the newly allocated buffer, and returns a pointer to the + allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there + is not enough memory remaining to satisfy the request, then NULL is returned. + + If Buffer is NULL, then ASSERT(). + If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). + + @param AllocationSize The number of bytes to allocate and zero. + @param Buffer The buffer to copy to the allocated buffer. + + @return A pointer to the allocated buffer or NULL if allocation fails. + +**/ +VOID * +EFIAPI +AllocateRuntimeCopyPool ( + IN UINTN AllocationSize, + IN CONST VOID *Buffer + ) +{ + ASSERT (FALSE); + return NULL; +} + +/** + Copies a buffer to an allocated buffer of type EfiReservedMemoryType. + + Allocates the number bytes specified by AllocationSize of type EfiReservedMemoryType, copies + AllocationSize bytes from Buffer to the newly allocated buffer, and returns a pointer to the + allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there + is not enough memory remaining to satisfy the request, then NULL is returned. + + If Buffer is NULL, then ASSERT(). + If AllocationSize is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT(). + + @param AllocationSize The number of bytes to allocate and zero. + @param Buffer The buffer to copy to the allocated buffer. + + @return A pointer to the allocated buffer or NULL if allocation fails. + +**/ +VOID * +EFIAPI +AllocateReservedCopyPool ( + IN UINTN AllocationSize, + IN CONST VOID *Buffer + ) +{ + ASSERT (FALSE); + return NULL; +} + +/** + Reallocates a buffer of type EfiBootServicesData. + + Allocates and zeros the number bytes specified by NewSize from memory of type + EfiBootServicesData. If OldBuffer is not NULL, then the smaller of OldSize and + NewSize bytes are copied from OldBuffer to the newly allocated buffer, and + OldBuffer is freed. A pointer to the newly allocated buffer is returned. + If NewSize is 0, then a valid buffer of 0 size is returned. If there is not + enough memory remaining to satisfy the request, then NULL is returned. + + If the allocation of the new buffer is successful and the smaller of NewSize and OldSize + is greater than (MAX_ADDRESS - OldBuffer + 1), then ASSERT(). + + @param OldSize The size, in bytes, of OldBuffer. + @param NewSize The size, in bytes, of the buffer to reallocate. + @param OldBuffer The buffer to copy to the allocated buffer. This is an optional + parameter that may be NULL. + + @return A pointer to the allocated buffer or NULL if allocation fails. + +**/ +VOID * +EFIAPI +ReallocatePool ( + IN UINTN OldSize, + IN UINTN NewSize, + IN VOID *OldBuffer OPTIONAL + ) +{ + ASSERT (FALSE); + return NULL; +} + +/** + Reallocates a buffer of type EfiRuntimeServicesData. + + Allocates and zeros the number bytes specified by NewSize from memory of type + EfiRuntimeServicesData. If OldBuffer is not NULL, then the smaller of OldSize and + NewSize bytes are copied from OldBuffer to the newly allocated buffer, and + OldBuffer is freed. A pointer to the newly allocated buffer is returned. + If NewSize is 0, then a valid buffer of 0 size is returned. If there is not + enough memory remaining to satisfy the request, then NULL is returned. + + If the allocation of the new buffer is successful and the smaller of NewSize and OldSize + is greater than (MAX_ADDRESS - OldBuffer + 1), then ASSERT(). + + @param OldSize The size, in bytes, of OldBuffer. + @param NewSize The size, in bytes, of the buffer to reallocate. + @param OldBuffer The buffer to copy to the allocated buffer. This is an optional + parameter that may be NULL. + + @return A pointer to the allocated buffer or NULL if allocation fails. + +**/ +VOID * +EFIAPI +ReallocateRuntimePool ( + IN UINTN OldSize, + IN UINTN NewSize, + IN VOID *OldBuffer OPTIONAL + ) +{ + ASSERT (FALSE); + return NULL; +} + +/** + Reallocates a buffer of type EfiReservedMemoryType. + + Allocates and zeros the number bytes specified by NewSize from memory of type + EfiReservedMemoryType. If OldBuffer is not NULL, then the smaller of OldSize and + NewSize bytes are copied from OldBuffer to the newly allocated buffer, and + OldBuffer is freed. A pointer to the newly allocated buffer is returned. + If NewSize is 0, then a valid buffer of 0 size is returned. If there is not + enough memory remaining to satisfy the request, then NULL is returned. + + If the allocation of the new buffer is successful and the smaller of NewSize and OldSize + is greater than (MAX_ADDRESS - OldBuffer + 1), then ASSERT(). + + @param OldSize The size, in bytes, of OldBuffer. + @param NewSize The size, in bytes, of the buffer to reallocate. + @param OldBuffer The buffer to copy to the allocated buffer. This is an + optional parameter that may be NULL. + + @return A pointer to the allocated buffer or NULL if allocation fails. + +**/ +VOID * +EFIAPI +ReallocateReservedPool ( + IN UINTN OldSize, + IN UINTN NewSize, + IN VOID *OldBuffer OPTIONAL + ) +{ + ASSERT (FALSE); + return NULL; +} + +/** + Frees a buffer that was previously allocated with one of the pool allocation functions in the + Memory Allocation Library. + + Frees the buffer specified by Buffer. Buffer must have been allocated on a previous call to the + pool allocation services of the Memory Allocation Library. If it is not possible to free pool + resources, then this function will perform no actions. + + If Buffer was not allocated with a pool allocation function in the Memory Allocation Library, + then ASSERT(). + + @param Buffer The pointer to the buffer to free. + +**/ +VOID +EFIAPI +FreePool ( + IN VOID *Buffer + ) +{ + ASSERT (FALSE); +} diff --git a/MdeModulePkg/Library/BaseMemoryAllocationLibNull/BaseMemoryAllocationLibNull.uni b/MdeModulePkg/Library/BaseMemoryAllocationLibNull/BaseMemoryAllocationLibNull.uni new file mode 100644 index 000000000000..9acf17bc2038 --- /dev/null +++ b/MdeModulePkg/Library/BaseMemoryAllocationLibNull/BaseMemoryAllocationLibNull.uni @@ -0,0 +1,20 @@ +// /** @file +// Null instance of Memory Allocation Library +// +// Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
+// Copyright (c) 2018, Linaro, 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. +// +// **/ + + +#string STR_MODULE_ABSTRACT #language en-US "Null instance of Memory Allocation Library" + +#string STR_MODULE_DESCRIPTION #language en-US "Memory Allocation Library for build testing only." + From patchwork Mon Jan 14 13:27:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 155500 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3659315jaa; Mon, 14 Jan 2019 05:29:16 -0800 (PST) X-Google-Smtp-Source: ALg8bN639KV27dLbn9d/oCKXza+I686twuX9i/8ScIyEnmrrSzZS+8eLgaOutrqOEPdVjjnlOttJ X-Received: by 2002:a17:902:8d95:: with SMTP id v21mr25457175plo.162.1547472555870; Mon, 14 Jan 2019 05:29:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547472555; cv=none; d=google.com; s=arc-20160816; b=FZruj23tsTeo1uTyvwBskOoL7SAPTdFGUPYQABBuYpoo7FF57nBNX3kyQAP3lR4h2/ pHTGT2AYt+tf6Yfil2bHmuTa3souR6K/iU37yPdOCrLvncqvJdJZ46p/UVsn8A7Njx8g xNPGuasV8InEthg3nSHpPvCUlJ++bZvLxbtTvmlqB7hORR7uksbM92/zBXYlNs4MqZvC 3noMLguUGRqoDmJUL3ap8KeLFC9XGVzTVF/YpAFo9qfqVVvgkL5eJiYLTiFFAKqxB7dP frFa0q6puui6kHxzxViXbIssVN6TH+Nd0NeS6/g3Xz1ncUCw8dGb+dVHmcSLiTwT/+FB PgMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=eKhrq8q3Gobz32soSd2Y3Cgx9wZYnvM6jtK6yjtYOWg=; b=Pjr70VOPH22OBHCSMbJ2zDBzHq89VYyDyJOsebOoYQKREUxhcBk32UfUMPouF6kWwj kmvfkSodjqAkirN6HbYcHg/gHF8V/CB/1mRY44iBe3mcvKM0HtO7L5qUo2rXOW3Q2YR1 ms+vxSwhdydcjDllMHFa+eEN7jkjNYo2H5lmGqwjRrMgZoEIzyZSwuFL5EoDRIh8u0PC cE59sTQtLE2tu+drxqSWKLkZHvzILXOueMBQHWAV2t7mTAFhGbqovfdyjTwH3EHgJNPo Fgq8F4mg7XF4RniIr23vO1l92mXNsgSjQEHiVo6aFJ9wgOmHTbcj50A1RwqSXT8d/23f dciA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=YKMSEyZK; 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 z18si332400pgk.367.2019.01.14.05.29.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 05:29:15 -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=YKMSEyZK; 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 BE8F2211B7F63; Mon, 14 Jan 2019 05:28:35 -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::344; helo=mail-wm1-x344.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) (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 68D5A211B1FB1 for ; Mon, 14 Jan 2019 05:28:34 -0800 (PST) Received: by mail-wm1-x344.google.com with SMTP id r24so7376054wmh.0 for ; Mon, 14 Jan 2019 05:28:34 -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 :mime-version:content-transfer-encoding; bh=1fEU4QNia4meaBC9JOsGNT/tD8NI/LMiEAPHddx2ZI4=; b=YKMSEyZKi/9FEza62Fl5Z7tcPAkhaBw2jyuA5HCm6RyI1eXvJNJ6rjkRIcYVNrgnUI wJrMALSwSg6D0nSLzC0zK2jiDOGir7k78GlTbKfZROg5dSc31O4EUjKN2NBPJOnn7Y5T fjxrWb0/mbmzN3w54pgm4A7ESLGdw3PLqRUJ4= 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:mime-version:content-transfer-encoding; bh=1fEU4QNia4meaBC9JOsGNT/tD8NI/LMiEAPHddx2ZI4=; b=KUK8uA2G3OSd/iVNFaB4n8hAl9ztfsg+uc6iu+623s0mOkgxXiZgiYaCX540qNI3lL C0jjos1NvYEL0YtrX9BPLzbOha9M8qQAHsdMn/iguRoaZV9zXaf21sSLyHIMH+7gSC2S c7wLY34WcAg57gb6pNpKr6FG+p5p1u6V4ZZnCXDoVw75FKU6gamPof8kqOJodMw3w+VR 0bznGf99TuBZbVpIG07LK0zCklYn1qK8pkwPwiz1VxYNhMrSp/uSLwZ7TWlIgS701g6B YNXjCoTWI8c69ZQhWCm3GTdHFTwe0QUlk1XUy4xK02lm+tzaWDrv8L+r+jcntvLdTclb /hIQ== X-Gm-Message-State: AJcUukf7gRmYyljNiFyKBszGP3U9MNvGcsjQzZRbBeUZiV8XdIHv8XXc R54goLjxUnsQnIQ4L3G051m3KqH+8M0= X-Received: by 2002:a1c:e287:: with SMTP id z129mr11726634wmg.71.1547472512709; Mon, 14 Jan 2019 05:28:32 -0800 (PST) Received: from localhost.localdomain (aputeaux-684-1-19-62.w90-86.abo.wanadoo.fr. [90.86.222.62]) by smtp.gmail.com with ESMTPSA id 202sm33446560wmt.8.2019.01.14.05.28.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 05:28:31 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Mon, 14 Jan 2019 14:27:55 +0100 Message-Id: <20190114132758.24054-15-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190114132758.24054-1-ard.biesheuvel@linaro.org> References: <20190114132758.24054-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Subject: [edk2] [PATCH v2 14/17] MdeModulePkg/MdeModulePkg/dsc: move DxeDebugSupportDxe to x86 only section 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: Hao Wu , Liming Gao , Michael D Kinney , Laszlo Ersek , Star Zeng Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" MdeModulePkg/Universal/DebugSupportDxe/DebugSupportDxe.inf does not build for AARCH64 since it does not provide the needed PlDebugSupport.h header. So move the module to a x86 only section. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- MdeModulePkg/MdeModulePkg.dsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.20.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Star Zeng diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc index 967fe082aaae..3e9a9daf1649 100644 --- a/MdeModulePkg/MdeModulePkg.dsc +++ b/MdeModulePkg/MdeModulePkg.dsc @@ -421,7 +421,6 @@ [Components] MdeModulePkg/Library/DxeCapsuleLibFmp/DxeRuntimeCapsuleLib.inf [Components.IA32, Components.X64, Components.AARCH64] - MdeModulePkg/Universal/DebugSupportDxe/DebugSupportDxe.inf MdeModulePkg/Universal/EbcDxe/EbcDxe.inf MdeModulePkg/Universal/EbcDxe/EbcDebugger.inf MdeModulePkg/Universal/EbcDxe/EbcDebuggerConfig.inf @@ -438,6 +437,7 @@ [Components.IA32, Components.X64, Components.Ebc] MdeModulePkg/Universal/Variable/EmuRuntimeDxe/EmuVariableRuntimeDxe.inf [Components.IA32, Components.X64] + MdeModulePkg/Universal/DebugSupportDxe/DebugSupportDxe.inf MdeModulePkg/Application/SmiHandlerProfileInfo/SmiHandlerProfileInfo.inf MdeModulePkg/Core/PiSmmCore/PiSmmIpl.inf MdeModulePkg/Core/PiSmmCore/PiSmmCore.inf From patchwork Mon Jan 14 13:27:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 155501 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3659397jaa; Mon, 14 Jan 2019 05:29:21 -0800 (PST) X-Google-Smtp-Source: ALg8bN72rrryqLCR2vz7Z4rr5CFZWbAdksmPydoq956z7vyL1kczGduPWIvMBXG6YQLangavws0Y X-Received: by 2002:a63:5455:: with SMTP id e21mr23014293pgm.316.1547472561463; Mon, 14 Jan 2019 05:29:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547472561; cv=none; d=google.com; s=arc-20160816; b=mavBzKk9TZjxtzjBDnzaObb+evP1xAepj2bGYUs2ghvjOrN8tXCgtnwHoxsGb7c9Jj 2lHZDwTsjEBohqjturWHs31iL/n+S77xr9E566k5eqXSWe7ci8mJcDvJtwzHN+4Aqi1x v5DWf13+pjDdsXIfbadBAbjQ6t3Abz/c9v9ZrXFWA0jbxxfrk9tV0X7OWQHhHkpsbqCC /UXPC+4tJ8yhlUqyBpzVflQFyHt6khRBiaHrRAFPxsdoUKycvo8nx2S+iIB4lL+oPhFF JRT4vmgzzj7GL8Kc4rjlQZLNUdT6l8vtGNJf2QKlwSIvl3a+8dEP2hUZN7aP5TU8Yadj zPcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=371P4x6kcS074TsIFJqAcCBbjFlQBjTpTJet3WDZTBs=; b=QU6ZsKmZ29AbjZkbhPO4BBlXPovUY0BouikPT3RU9Q1iEwAeNDDSn/z7b/R3BF5a2T b7v0ONXeHX4jHds1FapmfcMkuo2/A5cntyEFwGnGMk4FrfJ8VJkedgDCMImRvnFnHIE1 pGSyQd8SpuZFGLpPXItNgtIO8g5VcTnxT9eYowpPhlzAAK/umL+AawptQ3veltxmjlOe EY+00o4rK5AC4O0NhPozWQhvhkfjqro432ciqJs8qGzXY/W7i5qIOKkdhaJN/t7cjBjJ KywgWvkIciSOaPnmnW6zyeiR+Ymy2plAIe379kaehOBVZVZHzD3WUpfv5pb43ewtq/G/ zh6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Vhs6EoUG; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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. [198.145.21.10]) by mx.google.com with ESMTPS id cf17si385710plb.52.2019.01.14.05.29.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 05:29:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Vhs6EoUG; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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 0173C211B7F67; Mon, 14 Jan 2019 05:28:37 -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::443; helo=mail-wr1-x443.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) (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 C0A56211B7F64 for ; Mon, 14 Jan 2019 05:28:35 -0800 (PST) Received: by mail-wr1-x443.google.com with SMTP id t27so22838415wra.6 for ; Mon, 14 Jan 2019 05:28:35 -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 :mime-version:content-transfer-encoding; bh=Let0UcWjISeBsXY8uH6MZkXOrpB1t5HE63AJk02n0aw=; b=Vhs6EoUGKWeTF+SGiJnZNx0Hk8PJVFkp76SiMNUnVP3ZE5QK299nTO4/mh2lFUW9d2 pK/5ikAOt6kD1LTTYjnselF90jN2t72e43AgZGCkhd/IYRxLZjaD4kVZJvDN9zYoxwMQ K+KPxpRWXldDnhFzondYY9W0pIN8hQ2ikzB4o= 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:mime-version:content-transfer-encoding; bh=Let0UcWjISeBsXY8uH6MZkXOrpB1t5HE63AJk02n0aw=; b=ra4X+hZUqUqFuGopyTojovF+tatmZlW7cvKLh2Ldv1IVxlV0KCLpiglyZNxDM8Zl5K TmE7xpi/Qzgmnb/Sz8JFepVXkJetxbO7kq8+GDBr6NRz6YwBamugO2FcdWSrqhIhgc5W C4XdrkuoK76fu7dRGf+OcDHbxtFcpnisbNfb3GyrNIalwWKLC2kJg2Uj6W/Uj421Ju+7 02GnMgp3WMpjo3tgy4AiBKgZMqiLTbagcePCrx93jfegn0UCJDjZ50iPhsDSw0OXfUwx NsSirohjfI5GFIDiDk53XZ6GC+DdtnYJGI+K5B0rIJNs+eLl3jxIZ10CSKcQwgSLaQty L7+A== X-Gm-Message-State: AJcUukd+7jfaXsShy1zQUWeAHLN/mIYNNTRFYGw5T34KvcrmZA4DjVnv HkbMODNVk4bPDWXNxYruNZbEUiS7Rvk= X-Received: by 2002:adf:e54a:: with SMTP id z10mr23564722wrm.238.1547472514161; Mon, 14 Jan 2019 05:28:34 -0800 (PST) Received: from localhost.localdomain (aputeaux-684-1-19-62.w90-86.abo.wanadoo.fr. [90.86.222.62]) by smtp.gmail.com with ESMTPSA id 202sm33446560wmt.8.2019.01.14.05.28.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 05:28:33 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Mon, 14 Jan 2019 14:27:56 +0100 Message-Id: <20190114132758.24054-16-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190114132758.24054-1-ard.biesheuvel@linaro.org> References: <20190114132758.24054-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Subject: [edk2] [PATCH v2 15/17] MdeModulePkg/AuthVariableLibNull: add MM_STANDALONE support 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: Hao Wu , Liming Gao , Michael D Kinney , Laszlo Ersek , Star Zeng Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Add MM_STANDALONE to the list of permitted module types of the AuthVariableLibNull library implementation. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.20.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Star Zeng diff --git a/MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf b/MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf index 900fef5d4989..93f3e675a2ff 100644 --- a/MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf +++ b/MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf @@ -21,7 +21,7 @@ [Defines] FILE_GUID = 435CB0E4-7C9A-4BB7-9907-8FD4643E978A MODULE_TYPE = DXE_RUNTIME_DRIVER VERSION_STRING = 1.0 - LIBRARY_CLASS = AuthVariableLib|DXE_RUNTIME_DRIVER DXE_SMM_DRIVER + LIBRARY_CLASS = AuthVariableLib|DXE_RUNTIME_DRIVER DXE_SMM_DRIVER MM_STANDALONE # # The following information is for reference only and not required by the build tools. From patchwork Mon Jan 14 13:27:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 155502 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3659460jaa; Mon, 14 Jan 2019 05:29:26 -0800 (PST) X-Google-Smtp-Source: ALg8bN5K9TB/0gYgX/rGLKAGvZXBe1qo5cK5H074AqxJG2UxleAl48z4wOCXgU13FAR1Tl2ez1jy X-Received: by 2002:a17:902:4401:: with SMTP id k1mr25623063pld.307.1547472566424; Mon, 14 Jan 2019 05:29:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547472566; cv=none; d=google.com; s=arc-20160816; b=BjT9T6LgK15oHPrDzo2o+UhwXwDqw3TKo3E9ipJmb6yy2rSkUMRerbrGUVeOxglbIN uSgIbjQ6hKKJUDZ3jYXiw6NJ9fSxZ6jxqxKwKel6J1gsmk1axr279QsVNDGblRz91Tb7 trp6XS5V+K/bzCFCdU9XJKw0N3d5m8cp+pVt6DrW0nij58mxcqzuykgt316wO9RG9Lgd rjineut1N9Oqq5Mqn6oH4qfai3/e9PwYUbIXHg1oCwZi5tmRwCMfJGUehvN/Kb06y+Q1 tuS3x25CW2AX8wwjjOpCVXSgp311+caw1C26vAxZ3Q+nJIvjGBLAwfNleZA9pNFj5x/j 3/dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=/kjxufyFP9I7Zgg3Ot/287C1+T3/RBsiR+1a2L9EIfY=; b=CfMITDRVoaL2Ige/w4Qs3EJmoTqFVh6d2u8WoM7Lf6/xaK8gTlKhPbQL/3T3sryCPE OTfPg/b8vHKIkUTS6E/53RZCM7JwbZEs6UzLs9xvlOvcZ6aLLQROFEYMh5Pp04z0znnS BLGtBLA3UP0ZAqFI9oN5G7ZCxLOoI0CCPWiS2ab2csHUGinyPK5hNTUQWVp0ChmXqK+J 9PzGyxxuHuJ0TkIUnhAILa0oIb0YzYDtIepS/jtzV5US3PrQZwzZzJwluv1kciRrDx0I QCrEidcf6R2ehY2XNpnewtr70EoHLghEWJTcqlQJjQyuTdP5PWMWTU7VsoGPvVu5/HqY XIXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=jdjLh960; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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. [198.145.21.10]) by mx.google.com with ESMTPS id i13si362864pgg.100.2019.01.14.05.29.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 05:29:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=jdjLh960; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 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 2A012211B7F64; Mon, 14 Jan 2019 05:28:40 -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::441; helo=mail-wr1-x441.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) (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 08D08211B7F6A for ; Mon, 14 Jan 2019 05:28:37 -0800 (PST) Received: by mail-wr1-x441.google.com with SMTP id t27so22838486wra.6 for ; Mon, 14 Jan 2019 05:28:36 -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 :mime-version:content-transfer-encoding; bh=VOMhhb0VKVS3zz6gF1eTR3jRz1OVZq9h/rgeJnnTUGM=; b=jdjLh960bV4a0TYAEmOUBjO/pI9m/2oqQmIkEoOTaVQWh5rYoHPn2VUnp5mrjWAl5p B5HKh4GTd6LrAZWwVA+mR0bdCfoUDxRSZWCodKgiDI8i1D/NgwUl+pTaGkR0NeyfxMd7 fU5/PcVwILA9hJmUDt7wmPRx8LvhCf1dJN5oI= 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:mime-version:content-transfer-encoding; bh=VOMhhb0VKVS3zz6gF1eTR3jRz1OVZq9h/rgeJnnTUGM=; b=f6UHeJ7qYQRoYbwWYefQyUSA3on8LAqusodWDYi0PGyGCpsK08f2lliakwRFeRd43S F2jQoTf1PX7ffpPXIeEII8vCtTV+8/zHJhrbnGFYScDfo144bKlvTOto1DXE0rSnApap d3QpvJ6jz2y9+2psdbLTvkXkrvxnQpWWQSFhxbKD8Oee8cYDw2Hf+zL45APFVJWcTz3m GGVBxa3DxOnxluabwi/XqJoEi7cd3Gmw3ji5Sdd7pnTfVNGfoIZN/I8nlWNIRxKm9QG7 gXv6qO6DhgPfuWMC9BPCBVFRI2EIrlfI4mE6jkL0MSeM/ENQYQF/FadXbaC4Bw8Uredo +cOw== X-Gm-Message-State: AJcUukf9yewIs+n+gKGvZgf0nT9MolM2bqrer3agpxS+3MEhkEIu1SWx J28DEUBxSg1LlHsNzJENLlAQ2VbNkKs= X-Received: by 2002:adf:9361:: with SMTP id 88mr23551599wro.204.1547472515395; Mon, 14 Jan 2019 05:28:35 -0800 (PST) Received: from localhost.localdomain (aputeaux-684-1-19-62.w90-86.abo.wanadoo.fr. [90.86.222.62]) by smtp.gmail.com with ESMTPSA id 202sm33446560wmt.8.2019.01.14.05.28.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 05:28:34 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Mon, 14 Jan 2019 14:27:57 +0100 Message-Id: <20190114132758.24054-17-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190114132758.24054-1-ard.biesheuvel@linaro.org> References: <20190114132758.24054-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Subject: [edk2] [PATCH v2 16/17] MdeModulePkg/VarCheckLib: add MM_STANDALONE support 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: Hao Wu , Liming Gao , Michael D Kinney , Laszlo Ersek , Star Zeng Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Add MM_STANDALONE to the list of permitted module types of the VarCheckLib library implementation. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.20.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Star Zeng diff --git a/MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf b/MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf index 099f83dd6aee..b1041c290df9 100644 --- a/MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf +++ b/MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf @@ -21,7 +21,7 @@ [Defines] FILE_GUID = 63E12D08-0C5D-47F8-95E4-09F89D7506C5 MODULE_TYPE = DXE_RUNTIME_DRIVER VERSION_STRING = 1.0 - LIBRARY_CLASS = VarCheckLib|DXE_RUNTIME_DRIVER DXE_SMM_DRIVER + LIBRARY_CLASS = VarCheckLib|DXE_RUNTIME_DRIVER DXE_SMM_DRIVER MM_STANDALONE # # The following information is for reference only and not required by the build tools. From patchwork Mon Jan 14 13:27:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 155503 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3659535jaa; Mon, 14 Jan 2019 05:29:30 -0800 (PST) X-Google-Smtp-Source: ALg8bN6gxfvmmuWJ690mRQ7eGOJZxdcEl9K5q87wvNWV4fHSgLqiS8FeMM8bk/y7RUueHdf0Vvuo X-Received: by 2002:a17:902:4681:: with SMTP id p1mr26072956pld.184.1547472570916; Mon, 14 Jan 2019 05:29:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547472570; cv=none; d=google.com; s=arc-20160816; b=IUOtljexEs7ARyZqNsnbSBLmyvdzyU2dXjJwZWegEB0d9phWx8Rz/cAdYYnqrT7lNg hyiEaJd2jx/fVqJh7Ug5hQmuLdT+wHvvlnh2CSJhdYHSOVm+0DGwLvCIQpyoJqEAN/nE yvGoPoq4oaQ45+KaDMyGrnhnvU4avQngg5zD1XSa9yD9AnW9tbqbiDsFfM2L8P8VjbwM ZC4es1CfKkIWzQQi3N491a4sKjXN+ULAvA3wb7to+4Fi8INnqqLAG6gingWcGSuBBPtp fbIwzd2tyG3ENtY/VkDVY7hqvXrSip2/YJvM775AFOac6W/AuYI9ydDBD6GhOGDQBsyc cHcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=WKB6jF1ecnEtthuhzF3FJYaD9FbbE5SmRW0Dna/Z5YE=; b=ysY6U98Sait1Iuj0NVHIrAF3AICQEUhkHbANE1kk31MSlrKoZ0UPD33ZOmCzFZ+OvR UhYXL8+4d+yrPccmEG4qlQhEGzL6oG4bu6rnkMohYF7jmYS4eTQ4D1XgQjaSxbA9uNY9 xr1WhJwS4FpGvFiC6TIyXdKJs72WLNB+YbLR7QFRLv6Mfuyn8h1RYkmJ34RpkyJM+clT g/AAQZbFzdvUgJMpcPacuL/KgU7NWQkd/V10FCJraBtzrKGmrS2x+IsLAwySqU0P+AKG MlX1ylbuWLwNXtheeLVRYULjPVYk8O5Tm+CbjvKCRnVIKBNUa+owIXYWCuuHgGJCD+Lx fzUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=WrmCusp9; 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 v6si368898pfv.181.2019.01.14.05.29.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 05:29:30 -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=WrmCusp9; 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 56F90211B7F6D; Mon, 14 Jan 2019 05:28:40 -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::442; helo=mail-wr1-x442.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) (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 51F6321BADAB6 for ; Mon, 14 Jan 2019 05:28:38 -0800 (PST) Received: by mail-wr1-x442.google.com with SMTP id x10so22805365wrs.8 for ; Mon, 14 Jan 2019 05:28:38 -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 :mime-version:content-transfer-encoding; bh=qXBo4E182Fs9V1AAJvmBgLQGZQmMp94CWMACFESlM14=; b=WrmCusp9DPCgB7e26+BFStx9Xf556+7PFJAoQTbqadPGTa8DE23yTJF8B79DdoNjFR dSQowx/tq+7d23SIh3lTMAnwluPZrh0qv5cOhw/BoFuL21LWIQk/nzSJ66vHWhtBOyGi 1tdla0NkOwrEqV+ZTtVCmvBUhyvLtYCXDcKuE= 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:mime-version:content-transfer-encoding; bh=qXBo4E182Fs9V1AAJvmBgLQGZQmMp94CWMACFESlM14=; b=TXFlMei1MpqadyUNtmNQmxVzn+f/9e2R4z11sBHKKZbkZzNU1SwsQV1i+29dZvNax4 w5/UasjtUsxkOm7SbGnRoziNkD4fYzHXxn2jAH6XCkgZhl9VxEcBB2FbgPHnJm+5cIGf 2Yli6nWK6//27fZy6ioGc4R3CmcxYdnJBtAgYONoT+ok2p38Bw2LJUSOY3iE/Q2+1R0v 3VRBoTu3QcmjZbikIDe1TjASRZpBGhjnmOUa3sSJy+ZK+TQ5IMWKRwW7c8/9o+6qmvqc UVXXdWU+R7xdj/0HxxXe6aetJ7uOIX3QMBUMW+Efb1Thi4MaZG5k4OtQ1a9fEfPR2TJh zp/A== X-Gm-Message-State: AJcUuke3/9B5IevPd1MUP2O+z6tM6KDn0ZNq+QzPzx5UwPQ8RG4rgX/G PURyVZCS4SXZg3uytSLdutoMuyNEygk= X-Received: by 2002:a5d:64c7:: with SMTP id y7mr23777028wrv.207.1547472516673; Mon, 14 Jan 2019 05:28:36 -0800 (PST) Received: from localhost.localdomain (aputeaux-684-1-19-62.w90-86.abo.wanadoo.fr. [90.86.222.62]) by smtp.gmail.com with ESMTPSA id 202sm33446560wmt.8.2019.01.14.05.28.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 05:28:35 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Mon, 14 Jan 2019 14:27:58 +0100 Message-Id: <20190114132758.24054-18-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190114132758.24054-1-ard.biesheuvel@linaro.org> References: <20190114132758.24054-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Subject: [edk2] [PATCH v2 17/17] MdeModulePkg/MdeModulePkg.dsc: add MM_STANDALONE FTW and variable 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: Hao Wu , Liming Gao , Michael D Kinney , Laszlo Ersek , Star Zeng Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" For build testing coverage, add the newly introduced MM_STANDALONE versions of the fault tolerant write (FTW) and variable runtime driver to MdeModulePkg.dsc. Note that the resulting binaries will not be able to run, since they rely on dummy implementations of MemoryAllocationLib and HobLib. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- MdeModulePkg/MdeModulePkg.dsc | 9 +++++++++ 1 file changed, 9 insertions(+) -- 2.20.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Star Zeng diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc index 3e9a9daf1649..93eaf4b404a1 100644 --- a/MdeModulePkg/MdeModulePkg.dsc +++ b/MdeModulePkg/MdeModulePkg.dsc @@ -168,6 +168,12 @@ [LibraryClasses.common.UEFI_APPLICATION] MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf DebugLib|MdePkg/Library/UefiDebugLibStdErr/UefiDebugLibStdErr.inf +[LibraryClasses.common.MM_STANDALONE] + HobLib|MdeModulePkg/Library/BaseHobLibNull/BaseHobLibNull.inf + MemoryAllocationLib|MdeModulePkg/Library/BaseMemoryAllocationLibNull/BaseMemoryAllocationLibNull.inf + StandaloneMmDriverEntryPoint|MdePkg/Library/StandaloneMmDriverEntryPoint/StandaloneMmDriverEntryPoint.inf + MmServicesTableLib|MdePkg/Library/StandaloneMmServicesTableLib/StandaloneMmServicesTableLib.inf + [LibraryClasses.ARM, LibraryClasses.AARCH64] ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf ArmMmuLib|ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf @@ -420,6 +426,9 @@ [Components] MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.inf MdeModulePkg/Library/DxeCapsuleLibFmp/DxeRuntimeCapsuleLib.inf + MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteStandaloneMm.inf + MdeModulePkg/Universal/Variable/RuntimeDxe/VariableStandaloneMm.inf + [Components.IA32, Components.X64, Components.AARCH64] MdeModulePkg/Universal/EbcDxe/EbcDxe.inf MdeModulePkg/Universal/EbcDxe/EbcDebugger.inf