From patchwork Fri Jan 4 11:03:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 154756 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp495397ljp; Fri, 4 Jan 2019 03:03:29 -0800 (PST) X-Google-Smtp-Source: ALg8bN7gYrFht+mJJaiQg5KlWIMRuzDfD8F7tEPOXJc7R3V6sV5iOKBBnKFUC1+KhnGmXN1YEoAv X-Received: by 2002:a63:cf48:: with SMTP id b8mr1263172pgj.17.1546599809432; Fri, 04 Jan 2019 03:03:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546599809; cv=none; d=google.com; s=arc-20160816; b=GL2mBDMJhMbgq+Tmn43XagQiTR0Mrej2zpCEhQeeVp6lBr6eQKxOF8ycVkaKOoge8f MScym1VLfNiYOBntk5ppRp2x1R+XpnK+a7L938hnBAkUfBBVRJVdgXsWyv4ssgoSwtZ1 NykOfZ6JaDDBJ9Lh3Elpehtb9KH+D95Yg8qZf/JtJj3o8jQmS94Zpzo+LEchqbIBMHff U2rzHjizJKnnkAWEO7RcXEuvwUFd/6DG7viBCR3cOO5PvqGAOCp2Y1Ufub2Bh3MYmybz bbNgd7fZdeW/dpEzAojrA0kO5TVKzfVzrjn89YNlunEG6W6B4w1BCNOCeHPF/MwI0g5V 4Blg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to; bh=gZl/zxB3BTe57EB971Um7B0ohkOPggtfl7oywDMg59s=; b=rFviwDenC8qj6lE0W73gTc+r2c+qcFqYvQmg/7BYDj+zMleI32A/21TiTkY5sVEQWU KMRGLnGOBcCXdh+D9F0PDeSjK/eYttdn4oWKuWk+5Vn+CIJGAdCOzkUbMTidnMyH055F itT3adGDCUcRMBA/yWGqjd/jUDi+1DV1NS7yn2HoDaCCw03jKa9aWMlatcQgFxWoIFH+ +HwWRoI9DBnApEz7CZBLFnLgtBIQC22czc8ky70Twtw6iUAMLomh2oRvApreXFinJyy4 r460tnKrJuejY/xnf4CYgLFCwONZygI6Z3QPQ8Iz10Y+bfRlHAhnLPplhqJhCbH6NnOt mJgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=TXps0GM9; 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 bh12si52359241plb.353.2019.01.04.03.03.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Jan 2019 03:03:29 -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=TXps0GM9; 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 37279211AE8B3; Fri, 4 Jan 2019 03:03: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::544; helo=mail-ed1-x544.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-ed1-x544.google.com (mail-ed1-x544.google.com [IPv6:2a00:1450:4864:20::544]) (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 71B26211A43B4 for ; Fri, 4 Jan 2019 03:03:26 -0800 (PST) Received: by mail-ed1-x544.google.com with SMTP id f9so31427122eds.10 for ; Fri, 04 Jan 2019 03:03:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Mn+xfBOPSrQhjNswrzKiSoQpUgB98/wYeS0SwYJq1gw=; b=TXps0GM94TnCYZHa+bFNJDCFleRHPk2i7zpQ9h0uMeWZf3lb/gvlf8bUsAkIiWC38/ GWJLEUEogjH/NGMlKzSRjEHWKjVii+2keGZeueAOI4HmCUs3e7kJkNKde98WSp4TPht/ 3H8uVNVhcQe8jZmgK6312X2q/jP7pIOr8XeYs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Mn+xfBOPSrQhjNswrzKiSoQpUgB98/wYeS0SwYJq1gw=; b=HC06i9MTZYNLeoCWlxfxuIizLbTrQjB7ZEqd4Nsoc53dDMTCbH0MO8by9da3jOvTzX SZbIRy/WhokFv+TOgjgy0pHzHxVK62jINc5WNRFWF+dimeM2SweiiupZVfpbWLeltip/ M7OTO8oUQ5bMy6s3BIvETwBOkgoy62koWz5Rri7zitfmKmwKM5FmqHPKihHO3BGfrajg fNfIMFs5BAfTJ0ZB8yxT7E/VPv8i44BHrm7vIn8ZR9E2NA5n4bHOazzNyhJ3ZfkB1muD E/BOjzixgE4kPEc3S0EfCrF4R9ETEFS2/wDMPFrL3DVqkOYqIEvsSc6yF8DgAGIhbduF E3Pg== X-Gm-Message-State: AA+aEWZyvFmxaB9UwqPbxuti1oiqRiFz/XbiiB2pcvuvQzRJPPM+busu FnI5rJdWzi6O4sQj2kSwZkWtIOYvH6Ci2Q== X-Received: by 2002:a50:ae8f:: with SMTP id e15mr46854599edd.250.1546599804632; Fri, 04 Jan 2019 03:03:24 -0800 (PST) Received: from dogfood.home ([2a01:cb1d:112:6f00:704e:c241:dc88:597d]) by smtp.gmail.com with ESMTPSA id n11sm26650578edn.14.2019.01.04.03.03.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Jan 2019 03:03:23 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Fri, 4 Jan 2019 12:03:08 +0100 Message-Id: <20190104110315.18339-2-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190104110315.18339-1-ard.biesheuvel@linaro.org> References: <20190104110315.18339-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH 1/8] StandaloneMmPkg/StandaloneMmCpu: fix typo Standlone -> Standalone 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: Jiewen Yao MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Fix a couple of occurrences of typo Standlone -> Standalone. Since _PiMmStandloneArmTfCpuDriverEntry() is never referenced, drop it altogether. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c | 2 +- StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.c | 6 +++--- StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.h | 8 +------- StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.inf | 4 ++-- 4 files changed, 7 insertions(+), 13 deletions(-) -- 2.17.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Supreeth Venkatesh diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c b/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c index 2814577b3fcc..25114821448a 100644 --- a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c +++ b/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c @@ -65,7 +65,7 @@ EFI_MM_CONFIGURATION_PROTOCOL mMmConfig = { STATIC EFI_MM_ENTRY_POINT mMmEntryPoint = NULL; EFI_STATUS -PiMmStandloneArmTfCpuDriverEntry ( +PiMmStandaloneArmTfCpuDriverEntry ( IN UINTN EventId, IN UINTN CpuNumber, IN UINTN NsCommBufferAddr diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.c b/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.c index 85a9c108aea4..203a32baaaf9 100644 --- a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.c +++ b/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.c @@ -74,7 +74,7 @@ GetGuidedHobData ( } EFI_STATUS -StandloneMmCpuInitialize ( +StandaloneMmCpuInitialize ( IN EFI_HANDLE ImageHandle, // not actual imagehandle IN EFI_MM_SYSTEM_TABLE *SystemTable // not actual systemtable ) @@ -147,8 +147,8 @@ StandloneMmCpuInitialize ( // Share the entry point of the CPU driver DEBUG ((DEBUG_INFO, "Sharing Cpu Driver EP *0x%lx = 0x%lx\n", (UINT64) CpuDriverEntryPointDesc->ArmTfCpuDriverEpPtr, - (UINT64) PiMmStandloneArmTfCpuDriverEntry)); - *(CpuDriverEntryPointDesc->ArmTfCpuDriverEpPtr) = PiMmStandloneArmTfCpuDriverEntry; + (UINT64) PiMmStandaloneArmTfCpuDriverEntry)); + *(CpuDriverEntryPointDesc->ArmTfCpuDriverEpPtr) = PiMmStandaloneArmTfCpuDriverEntry; // Find the descriptor that contains the whereabouts of the buffer for // communication with the Normal world. diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.h b/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.h index 7b38b65e1242..543467f67576 100644 --- a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.h +++ b/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.h @@ -40,7 +40,7 @@ extern MP_INFORMATION_HOB_DATA *mMpInformationHobData; extern EFI_MM_CONFIGURATION_PROTOCOL mMmConfig; EFI_STATUS -PiMmStandloneArmTfCpuDriverEntry ( +PiMmStandaloneArmTfCpuDriverEntry ( IN UINTN EventId, IN UINTN CpuNumber, IN UINTN NsCommBufferAddr @@ -55,10 +55,4 @@ PiMmCpuTpFwRootMmiHandler ( IN OUT UINTN *CommBufferSize OPTIONAL ); -EFI_STATUS _PiMmStandloneArmTfCpuDriverEntry ( - IN UINTN EventId, - IN UINTN CpuNumber, - IN UINTN NsCommBufferAddr - ); - #endif diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.inf b/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.inf index 9e6bbabdb103..d261e51ebc75 100644 --- a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.inf +++ b/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.inf @@ -18,12 +18,12 @@ [Defines] INF_VERSION = 0x0001001A - BASE_NAME = StandloneMmCpu + BASE_NAME = StandaloneMmCpu FILE_GUID = 58F7A62B-6280-42A7-BC38-10535A64A92C MODULE_TYPE = MM_STANDALONE VERSION_STRING = 1.0 PI_SPECIFICATION_VERSION = 0x00010032 - ENTRY_POINT = StandloneMmCpuInitialize + ENTRY_POINT = StandaloneMmCpuInitialize [Sources] StandaloneMmCpu.c From patchwork Fri Jan 4 11:03:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 154757 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp495436ljp; Fri, 4 Jan 2019 03:03:32 -0800 (PST) X-Google-Smtp-Source: ALg8bN6J2t4PnzdqitzEbIKv7gyMTd0oGYYgQ5Oz5/H4JLUyauLo93HBIRG5IkCQ8nLCAx93nbxD X-Received: by 2002:a17:902:24d:: with SMTP id 71mr49015129plc.225.1546599812060; Fri, 04 Jan 2019 03:03:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546599812; cv=none; d=google.com; s=arc-20160816; b=etyFphhxQ3jRV8EjOGtGZF6aysYc6l1hys30EK2GQ2LESDMUqPvq0zwxLSB+0C4lrB aQJM5tirBecl3HF3IHW/pkwE1f4/xTNc8ZKnll1B3Yjjdykr1LhALuAFkxjq3HRHqwSM X/9/OmjrZZ92S1K733xqBKaFoDuuUZ6fTSoVa3nahPGuRgnWqDgmN+PV6crlQ9thN2++ 2L0UV6AwQz2/96WaDEeiCWgOGA2l8NFfoAu73g9GhX9/OacaI8KeHynGiwvXZXbGUGc2 jxewP59qxL5KdSFBQsJX4rmDVsn0v22Rrh3VJo394YiX7v4IyqWNfKCJ0vQswSmL4iga j87Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to; bh=NZ+mpuPA/T8nhIg0NYa8DeP4Rz8wHXHG9PAj3/Fcpbk=; b=CMvK+fECelbArjNCAMTwWm4PLNwe3G46UpMaoiyK0HE39xfcZYiOuyVgxwAMVxBAyj 2QOnahpr0jeAdyE4pejL3mn6UPnWA2lM2fX89cRQs8R1YFxs/ZyWh+ogk4dDmt1KV4I2 6hI6Wa1a8cY7hejgscyI9ssyE0rWDRZf1xuaZ47vLzn5MQhwEgOOjlp3bhpuwOCnZApX saAnUv8LShrje4FMHPmbk7koGWzTP0q22LlEivK10lKWaKXLdBQqODSH6oxIgud0KtOi FWIwIpT7eu4V2H8pEag4pZ1nVWiL6gwa4TbK9TsedeAECG46EC+sG3gxtOaimrOBrkDk aFuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=diA+U+FJ; 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 bi6si52573505plb.279.2019.01.04.03.03.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Jan 2019 03:03:32 -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=diA+U+FJ; 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 64F8B211A43B4; Fri, 4 Jan 2019 03:03: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::541; helo=mail-ed1-x541.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-ed1-x541.google.com (mail-ed1-x541.google.com [IPv6:2a00:1450:4864:20::541]) (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 42A1C211AE8B7 for ; Fri, 4 Jan 2019 03:03:28 -0800 (PST) Received: by mail-ed1-x541.google.com with SMTP id o10so31401184edt.13 for ; Fri, 04 Jan 2019 03:03: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; bh=EB8HJMiwCcewOE/5HK8Mqp7UXOpUJwVP4GZq3DDw+M4=; b=diA+U+FJgOEXk6IcYFsiNPzWEfKM39er/eUQA7QgCqxPaSMrBdr64zAPA0OlZWk2nc qCVrrIrc9YXXTsPt1aOrO8+lppQyVgvZK4ao6ugl1NjqC71V0jMyB80zCTyHyBY479tP f/siPgu78HnkU7g4s1JcbCeNY9nXktBuViPfk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=EB8HJMiwCcewOE/5HK8Mqp7UXOpUJwVP4GZq3DDw+M4=; b=LMjm8P1+8ckmIysOhHcuD91gz+8HunPpoKxThmWBZss+fbQMOVrdnjvZwBYXSm+A3O TzOBsX+IXReXBdSp/CiQHKeGx6j13waSvDY6cmt2kAtQvD3QBgTRJM6iL64xWY88CwPO R1KpMHtcX+f2YZ6rYb/TT3VpQevzFRP/F6x1bGGZCg0rOEDEJm2+o2YQ7BBCanHAWGfU kUEN3FBZvoI/WWTFj4xXuFEALyW5GeGdDAC686nDJ/13j2LGHiLJeYpkId+6Fzsf9TLo MROcwIgbo8qzoUe4aDZPpElItFdkogewcW/0EkyzCz5eQV81sGBkp4PRj+Z+WrMJYBdb dTrQ== X-Gm-Message-State: AA+aEWZ7Q1PRWqYitGGAPuaQSn7A/9gUUfxn3i/GqQhB3U5BMa7yDXCm QBuh5vgLfA5cHOqVmOsd41kIBnI70rXODQ== X-Received: by 2002:a50:aa9b:: with SMTP id q27mr45656581edc.93.1546599806513; Fri, 04 Jan 2019 03:03:26 -0800 (PST) Received: from dogfood.home ([2a01:cb1d:112:6f00:704e:c241:dc88:597d]) by smtp.gmail.com with ESMTPSA id n11sm26650578edn.14.2019.01.04.03.03.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Jan 2019 03:03:25 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Fri, 4 Jan 2019 12:03:09 +0100 Message-Id: <20190104110315.18339-3-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190104110315.18339-1-ard.biesheuvel@linaro.org> References: <20190104110315.18339-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH 2/8] StandaloneMmPkg/StandaloneMmCoreEntryPoint: add missing SerialPortLib ref 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: Jiewen Yao MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" StandaloneMmCoreEntryPoint calls SerialPortInitialize() explicitly, so add SerialPortLib to its list of LibraryClasses. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf | 1 + 1 file changed, 1 insertion(+) -- 2.17.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Supreeth Venkatesh diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf index 3222cd359f3e..769eaeeefbea 100644 --- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf +++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf @@ -43,6 +43,7 @@ [Packages.AARCH64] [LibraryClasses] BaseLib DebugLib + SerialPortLib [LibraryClasses.AARCH64] StandaloneMmMmuLib From patchwork Fri Jan 4 11:03:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 154758 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp495486ljp; Fri, 4 Jan 2019 03:03:35 -0800 (PST) X-Google-Smtp-Source: ALg8bN5LMA8Qvsoru29mmvsENNhGikF5yr6/1zw6RJQZciovlMlutO7QH8OoCMosk6n1wkHSsgSQ X-Received: by 2002:a63:561b:: with SMTP id k27mr1246196pgb.271.1546599815246; Fri, 04 Jan 2019 03:03:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546599815; cv=none; d=google.com; s=arc-20160816; b=LvWi2mFp/tV+56X53MefsO8NR37p5CqCb2kpUh7kCwEwqoRh7iIDCOG7KHGuGad8Zw JVEhr/hHkI6UZjW8/1Pk0wiWtdPu7YQItqNuVm2Nx99qU9Kttx85VpaYsJKj1Fye8Sxh CdZIsoZ+0yZvu9AWOdzPUhcohzFWLVbAJtWO1dvrVbR5EM6gppNfkoZ9QcoZTJainmQF Zu1bCRkQwac1CJrfy9H0udcd49BA9jL7Y1tY72WzowsJDDDmJBUvyd0Ae7ZZNlj/eSPp TyFylZLyF7YvLHP76TUfKfUUkiO1Juf7UD4vmG0o9srfK5/TZ3coe+6zXj6Sa+dC1uk0 5mTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to; bh=k3GgLj+tUCu3Y3FG/T3aGG1mjSm7mL3h4mf2IijW+No=; b=RiH20lBxvN9wXB71R4E01ljCegVFak8wsxd0XF3jyVPZEeVx7wyUGf22Kz/VAnlBLj bh9k/DmuPo23KEFMxQe5fbQJ43GSoELVt700vmP7VzJJpiY5yYVsqGSpz7C4ym4KHUPK ONrUS9sc9xM+SoFPhUoKYTbjfQep4OlIW6ytEsq1ugbOm65TewV2zwYsUgLM+jpw2gTO sDYQ9zWCFuc2RZT7phQpT8p/6aaq89JUplUQ9kRLuKNAzKfvkjurGMpwMDz2xFujEQ70 eZZKWMEd1LptJgbODYTnXvgpdbwrqC+YzAMmJns7vxnl2sKCBtETUHiQIZg18enN6y+q DziA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=NBeo4fw+; 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 101si56846841pld.22.2019.01.04.03.03.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Jan 2019 03:03:35 -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=NBeo4fw+; 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 9C047211AE8BD; Fri, 4 Jan 2019 03:03: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::543; helo=mail-ed1-x543.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) (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 B188F211AE8B7 for ; Fri, 4 Jan 2019 03:03:29 -0800 (PST) Received: by mail-ed1-x543.google.com with SMTP id y20so31422779edw.9 for ; Fri, 04 Jan 2019 03:03: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; bh=o5PGhFykECSIPAt3paN1u4wno5pYTItFJUaaMuWTOXE=; b=NBeo4fw+N5NUc8eS1AyuePOFo1pNwKjVIipwZGaU2mxdFqJbEut9aFYa87aYtnHwyX gD/1hUAyyqUQ0jGtlvt+YiW+ltCoIIxaqb6UEm6nVHECUF2WDPFTEq37jbrlpnxzlmct 0t2Q3IkREswkLzeQUUfjlkH2q8oyHm1vrdb9s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=o5PGhFykECSIPAt3paN1u4wno5pYTItFJUaaMuWTOXE=; b=VUXmnULTQq1YJuftLd5dHwCMu2Ax3kDSU8kpFJxDrmdXqlZ1UHTdvBgd0YMcHDdsOV C9eC05mg1h2sR0//evuS0GHn/+dycwZtH+rF/ZSPX7Kt4tjp4Y9xAIIvZG4d4KF2+YCD HtQbMK8VUnh62H033+U8Wx6Un6Tz2CiY1RyNS2L8YD+VGHV++jMiONzXxbXliPg3DiXn 5iCwNqD+l5yCv/Q5s4bwCsS6lIJBe5CyTKdShdhdNJlJScLi4sXPh/eCxEgv34PwNmYA QKeqbS79TniVlZMRCv7HtZsKAhbcrPaZx8p2OP8duH8Gzry6FZDIv2j8OQaL/urOZ9YL 2QPw== X-Gm-Message-State: AA+aEWYDhD79cFH7QvM1/tI4iLTLL3a7hNPjiLhqCISWGtWHok1NNOAw BJlSrHq8cMAw05Z4ZN5VN4I6jHClAtELNQ== X-Received: by 2002:a17:906:4944:: with SMTP id f4-v6mr38627307ejt.72.1546599807924; Fri, 04 Jan 2019 03:03:27 -0800 (PST) Received: from dogfood.home ([2a01:cb1d:112:6f00:704e:c241:dc88:597d]) by smtp.gmail.com with ESMTPSA id n11sm26650578edn.14.2019.01.04.03.03.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Jan 2019 03:03:27 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Fri, 4 Jan 2019 12:03:10 +0100 Message-Id: <20190104110315.18339-4-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190104110315.18339-1-ard.biesheuvel@linaro.org> References: <20190104110315.18339-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH 3/8] StandaloneMmPkg/StandaloneMmCoreEntryPoint: use %a modifier for ASCII strings 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: Jiewen Yao MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" PE/COFF section names are ASCII strings so use %a not %s. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/SetPermissions.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Supreeth Venkatesh diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/SetPermissions.c b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/SetPermissions.c index 60c1f66b83fa..3ca7f6660f47 100644 --- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/SetPermissions.c +++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/SetPermissions.c @@ -78,7 +78,7 @@ UpdateMmFoundationPeCoffPermissions ( "%a: Section %d of image at 0x%lx has 0x%x permissions\n", __FUNCTION__, Index, ImageContext->ImageAddress, SectionHeader.Characteristics)); DEBUG ((DEBUG_INFO, - "%a: Section %d of image at 0x%lx has %s name\n", + "%a: Section %d of image at 0x%lx has %a name\n", __FUNCTION__, Index, ImageContext->ImageAddress, SectionHeader.Name)); DEBUG ((DEBUG_INFO, "%a: Section %d of image at 0x%lx has 0x%x address\n", From patchwork Fri Jan 4 11:03:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 154759 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp495557ljp; Fri, 4 Jan 2019 03:03:39 -0800 (PST) X-Google-Smtp-Source: AFSGD/VXyhrBlEWG0RTlC8YrP9PXr9b1WRCaobZX1UPZHw4Gty+JE4i/yLPUfqw/eERFmZuV/JRw X-Received: by 2002:a62:2702:: with SMTP id n2mr53149281pfn.29.1546599819121; Fri, 04 Jan 2019 03:03:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546599819; cv=none; d=google.com; s=arc-20160816; b=SU8yEO06Awb4usqGO2EFWMoRlPq31LniwfVzl6JAO8aXa5YdZdzS2pinBlw7o3PXdY mwmJQN1YZ5ohDl1m5tMwF0wbpAEVwRjzUQY8q7aEKqid1iOePhZcBxd2PXIeI6u3qF3L /Pe31oNb8irHZ7ZPKvmnStQcAYUggbCgbiKsMX7a0Z46v3bYL+LtaImmBEdvblnDpJzo GvsDc1znZXa9pIj8msrSD5hTrnKCd0CffWyZh1KjYRpIdYk3UAJYUbxvx+92YqVOaTwd ErcoeIYlRNCUhAiDc1iJ6qKs3pN5mpNrAw0b9EDXaGDPUKY3XJ94gVJjjRNl+HF/wCj5 n7Jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to; bh=1gonC3IG+zIe3b3ntztYYIyaTMJaweDPNMA0BmtLh5o=; b=VcLIPBoydNQxERG/8P/yq9hK8nCTzKaSTi3MSEBkyAIM+WgyD3RAu0DFy1B6VoZpie l2rJ4jX9xQWnSO+Yqvg8PGAKFqFhkxUKF9hfsoKfBrvgW/1p9Z02XB0xKejDrw7T3AyK GOMWnA8dr6Hc9nR6jle382JnFJ8EJz/QV/Te7ebDZLWQm3z42+wVUKT6Il2AfEljmW+B fgc+AjvrtYQ4egPm8l1sl/bNF5ZjK9I2+84NVGuok7R9z+eVMa3/JEDT6Pwwee8istrC Xqxshvuicm8tuJatdorIiLy2acNU+XSm/NxUyLJJRd4d3PELjPqLR2PyV932NQKi0qk/ a7+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=T0Z6wl5D; 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 t17si11934587pfh.267.2019.01.04.03.03.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Jan 2019 03:03:39 -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=T0Z6wl5D; 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 D3E15211AE8C0; Fri, 4 Jan 2019 03:03:31 -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::544; helo=mail-ed1-x544.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-ed1-x544.google.com (mail-ed1-x544.google.com [IPv6:2a00:1450:4864:20::544]) (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 ED5002194D3B3 for ; Fri, 4 Jan 2019 03:03:30 -0800 (PST) Received: by mail-ed1-x544.google.com with SMTP id y56so31395216edd.11 for ; Fri, 04 Jan 2019 03:03:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rkBXbnnSwEAuSIZQjA2ejlMMJA2NWNE2JeKzEXtMOrM=; b=T0Z6wl5D2aIodbv6SiysqZTOl7HuMyIu5vSCJY7WTdAfd7v/qYGzJICIOQWHDcdCTn eBB1tNMPHf17kxAwL8wOZeo2+ocr22kR5ltA438GNk0I5uBicZG0lsskOGVbr3PnpYX8 gURo0eIbQxBumcZidOC5Aa2aG34s0vZwg9V7Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=rkBXbnnSwEAuSIZQjA2ejlMMJA2NWNE2JeKzEXtMOrM=; b=EiKf8RPiD5efaqsTFCcpGhBN9wO4JDkkmUvcVP5jGoX0mo1wqtPFZiJBU619mpXaEx mzDTSHU/fCEcKNU4a0k6AC8UCDbi6eSnoEhm8pLkSgbAdqmonBkCBq1bmt6oD9+wsxHE R1KeKFlQBMem6vZaoGcWbtmrm+ya0NghDJ7zzKqhkh+1I46bBm6fhSvddLza9S2bgy9h QoVgWAcrLvPRSXuSF8eNIWz75M6RZAWPTBfgScz1hWeLFUXXv8zs3GMctuYFbTWU+s8a tUoUOO6A0vhFZeM8A527fTVZaMErXAKKl0QCcSLkoYI9LZwe84OtCbWLh9UE5PM49XRC puQQ== X-Gm-Message-State: AA+aEWYO+7f2IcRtYr7SFpnOgbUremcIs3hDIraPANYFd6Ukm2GesRUt YNry44dgdXU0TbDohR3BiiOCCc6iEYTlPg== X-Received: by 2002:a17:906:4e82:: with SMTP id v2-v6mr38055082eju.149.1546599809350; Fri, 04 Jan 2019 03:03:29 -0800 (PST) Received: from dogfood.home ([2a01:cb1d:112:6f00:704e:c241:dc88:597d]) by smtp.gmail.com with ESMTPSA id n11sm26650578edn.14.2019.01.04.03.03.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Jan 2019 03:03:28 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Fri, 4 Jan 2019 12:03:11 +0100 Message-Id: <20190104110315.18339-5-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190104110315.18339-1-ard.biesheuvel@linaro.org> References: <20190104110315.18339-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH 4/8] StandaloneMmPkg/StandaloneMmCoreEntryPoint: remove bogus ASSERT_EFI_ERROR()s 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: Jiewen Yao MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" ASSERT_EFI_ERROR (x) is a shorthand for ASSERT(!EFI_ERROR(x)), and so it should only be used with EFI_STATUS type expressions. So drop two instances that operate on other types, since neither looks particularly useful. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c | 2 -- 1 file changed, 2 deletions(-) -- 2.17.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Supreeth Venkatesh diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c index 05ed6c8dd0b5..5cca532456fd 100644 --- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c +++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c @@ -295,7 +295,6 @@ _ModuleEntryPoint ( // ProcessModuleEntryPointList (HobStart); - ASSERT_EFI_ERROR (CpuDriverEntryPoint); DEBUG ((DEBUG_INFO, "Shared Cpu Driver EP 0x%lx\n", (UINT64) CpuDriverEntryPoint)); finish: @@ -303,5 +302,4 @@ finish: InitMmFoundationSvcArgs.Arg0 = ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64; InitMmFoundationSvcArgs.Arg1 = Status; DelegatedEventLoop (&InitMmFoundationSvcArgs); - ASSERT_EFI_ERROR (0); } From patchwork Fri Jan 4 11:03:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 154760 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp495626ljp; Fri, 4 Jan 2019 03:03:42 -0800 (PST) X-Google-Smtp-Source: AFSGD/UDKLba3FwmltB59DgqVitiOerbkFeoqw2flRsPGw68yLEimR7ml+9sYeCgnQ9wab1NOK9f X-Received: by 2002:aa7:80d7:: with SMTP id a23mr50925574pfn.86.1546599822466; Fri, 04 Jan 2019 03:03:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546599822; cv=none; d=google.com; s=arc-20160816; b=S5zn0kmWo6egVZnpLx6mNWiXTgzz7wmWCf6MbXbtQePNTOjaZCZ1mdvR+bSFFnTJgK RX7W6FvMMpLxjTEmTwLgaIcj568cijwkNA0yZG0aDs6OLqetguNtRPDi4L4zvt2Vb7NX vLtKPA87/a03FFnPCHdi9iAV79Rq5UigQbSgN2sa+9dPGieD1E8Ec/gjxTMcee7Ap9Im e61sPiaUxdfQsvK3HhxcjIeF7XgX2f9q8UcI9gnMAL+cye6/nv31lmFb645lbDSYxaap 7MZsf17CR/Sb2JRx+BZscPskLokNbxtvwDwC8eEAzU9wmBFuzJ6nFc9z6E++Uc/ro3c+ HsxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to; bh=D479i1fKXoxmMu7EIVj3i4NBXRk4+jmTiJghqIEEWt8=; b=cBLi/nkyMYXH1yEaCiNvMAXbnujLixEpHmSrzV6MNyV66CvX/a6V8QubYEHzpGTDZt mEvPGnXlaMo6VhF6Z2k+Ag0G5VN4qCv1hkBE+KZPU34f+loJZmymXYFWTVDYe3GUxWE5 6UFZkMEyW4BAy704XUbc2DBkLS25sy6qUiygRT0KliXsAu4sPEiBczZaA/WgeDocIEwm tFbXCwm0BsDP2X3U2AFrVZ7qoUqev/G4J5YIOzXFlrqm3ts+dwEvJ2FzvtFu8H2qTx6c PRviai9IPK8hzqZ0r+jvCsZI89gAy6MmMDOx49E8h8+HH+AAxRTtGlYHhVg4sk3BbTLn ej4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=CdjgJY7C; 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 s36si20600569pld.46.2019.01.04.03.03.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Jan 2019 03:03: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=CdjgJY7C; 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 10EE3211AE8C4; Fri, 4 Jan 2019 03:03:34 -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::542; helo=mail-ed1-x542.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) (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 5C0D6211AE8B2 for ; Fri, 4 Jan 2019 03:03:32 -0800 (PST) Received: by mail-ed1-x542.google.com with SMTP id f9so31427368eds.10 for ; Fri, 04 Jan 2019 03:03:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=tRa+/INl89H+E9gOy7jcMxo+5Ay5bnSLAEu/QHG3RP4=; b=CdjgJY7C4g4U+22S3nxPqi1vMDvLzut61HLxz7hsU6TcthABKETmfa+ZRXUKUwLRke 0b7OrcoY5ST2r/JmYRrMkOCN3ZYQIU/UPJXRtecsp9OADNSMzp3PntJMNdy/qn+XCRdm jJuuH2qYkbi6mmgBDgNZa42TUd0K3IpdUdgmg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=tRa+/INl89H+E9gOy7jcMxo+5Ay5bnSLAEu/QHG3RP4=; b=ergDx4xwLcpZDyUjC84Cj3UXWTOdiT3ZDwXDeRvtnyasIA3S+OCRh2zfJaAc0DHXhT I/Fvg0jTKc/NlgT0tRusAEAYOdAvO/4eJbKDpt1dTlZkmicdATvtOIefazHegAlx4UPe WuGl0REbYYbuR01oGJ7w18KnqgbqQ5/oeJfKchsDWY0Ah1+rkDVj2eKzeKQckAMmIwcl Ug7uR0uqFjw1FahSJfr6IH1Y1I23UtMEh0V8rUhGuVYWspa4SLQV1k6XE1lYt925KLFi LXikqV9plDMz1Ob/Wnby24HNJqrVRaGbspRcV6EBagbcdYWSHuWgymFYj+E5nLnKpaqH lPoQ== X-Gm-Message-State: AJcUukeiAphdBv9I67tmtvu/eZKjTRiG9yRv2iKF4mAbuCKTzhuRVqpj zGLRSU5DiGONLEIFi3RAgkp9Hfs08UBoVA== X-Received: by 2002:a17:906:a384:: with SMTP id k4-v6mr2370267ejz.243.1546599810700; Fri, 04 Jan 2019 03:03:30 -0800 (PST) Received: from dogfood.home ([2a01:cb1d:112:6f00:704e:c241:dc88:597d]) by smtp.gmail.com with ESMTPSA id n11sm26650578edn.14.2019.01.04.03.03.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Jan 2019 03:03:29 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Fri, 4 Jan 2019 12:03:12 +0100 Message-Id: <20190104110315.18339-6-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190104110315.18339-1-ard.biesheuvel@linaro.org> References: <20190104110315.18339-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH 5/8] StandaloneMmPkg/StandaloneMmPeCoffExtraActionLib: ignore runtime attribute 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: Jiewen Yao MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" The special handling of the EFI_IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER attribute is only necessary for images that are relocated twice, i.e., in the context of SetVirtualAddressMap (). This does not apply to standalone MM modules, so drop the check. Drop some redundant DEBUG output while at it. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/AArch64/StandaloneMmPeCoffExtraActionLib.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) -- 2.17.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/AArch64/StandaloneMmPeCoffExtraActionLib.c b/StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/AArch64/StandaloneMmPeCoffExtraActionLib.c index 1c9fec201916..f6bfcc875751 100644 --- a/StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/AArch64/StandaloneMmPeCoffExtraActionLib.c +++ b/StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/AArch64/StandaloneMmPeCoffExtraActionLib.c @@ -145,8 +145,7 @@ UpdatePeCoffPermissions ( if ((SectionHeader.Characteristics & EFI_IMAGE_SCN_MEM_EXECUTE) == 0) { - if ((SectionHeader.Characteristics & EFI_IMAGE_SCN_MEM_WRITE) == 0 && - TmpContext.ImageType != EFI_IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER) { + if ((SectionHeader.Characteristics & EFI_IMAGE_SCN_MEM_WRITE) == 0) { DEBUG ((DEBUG_INFO, "%a: Mapping section %d of image at 0x%lx with RO-XN permissions and size 0x%x\n", @@ -158,14 +157,10 @@ UpdatePeCoffPermissions ( __FUNCTION__, Index, Base, SectionHeader.Misc.VirtualSize)); } } else { - DEBUG ((DEBUG_INFO, - "%a: Mapping section %d of image at 0x%lx with RO-XN permissions and size 0x%x\n", - __FUNCTION__, Index, Base, SectionHeader.Misc.VirtualSize)); - ReadOnlyUpdater (Base, SectionHeader.Misc.VirtualSize); - DEBUG ((DEBUG_INFO, "%a: Mapping section %d of image at 0x%lx with RO-X permissions and size 0x%x\n", __FUNCTION__, Index, Base, SectionHeader.Misc.VirtualSize)); + ReadOnlyUpdater (Base, SectionHeader.Misc.VirtualSize); NoExecUpdater (Base, SectionHeader.Misc.VirtualSize); } From patchwork Fri Jan 4 11:03:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 154761 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp495705ljp; Fri, 4 Jan 2019 03:03:46 -0800 (PST) X-Google-Smtp-Source: AFSGD/XnGuPQ4zwi1F27+QiFd34JcbJnNCSV9GWpdz9Z+gHn5RoSZIBVhVshBHXx8rA/h0rsKpf9 X-Received: by 2002:a62:4156:: with SMTP id o83mr51741665pfa.72.1546599826303; Fri, 04 Jan 2019 03:03:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546599826; cv=none; d=google.com; s=arc-20160816; b=CoL6r4cBE6F+fJ+5LWFwsTBPO8rh9LLdA5n3SHG234F2DNwQrWvbOutMd3jar4tnOE BPNMXml3Sfuw/YiIRfmNyqvO77lrTVjyExrNZB7bjU4bGEZJvsHvH3ZyRYvHjt22oWGQ MV4rPx2puv26g6BiGleR6zHr9PqX27c0xWyYn23WwlDC+PMnhDn39j8b/q1PZqzbZ5rU V2HdFaDowwTpi8Mi7OJYilC6aY2qMV59B3nEFT/030fOA6Nn73rebHuvN9u7h1bph+Ev nQIr3WdMDYNtqewHXu5g3UiqHZGc3YpG3gIhTQNXw8KXIsedAoT526JTRk+EB86aoqBr 2drw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to; bh=tEElhh10QdmMPt/ZNo8gYxyiLCvI4KxTvvTY9qkhCd4=; b=haDSKjUt0mUSM5wW4c3Yvn+c2qBFNIMEFNA81zJvRjtymeU1NM41CKz7SstVyUpW8V ImoeeXxbUNs3goNzOSZQMGu24Y3EVqIeqmBT+Y3v6stWtvywxI/OpNyITHS5zJv3xcYN kdR/3FPDBocC8+iZ/p1KjovbBBjDmt7kja8vq6I3v57aUmhZPjwwTc98grNO0YYikoBt d4NK0I8KP1SSGGdF5cvG591f/Gqvtf41H1gB6BQzmdt3tAYRUukoB+R2y8gYH0qDZwnU YbKdLvinKxEp+VzfO1JtFX5xBW4vpvj5odYw0+AlOyVw9OHCeY19/kLsAzTzZojceaGu e0DQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=MQ3C8ktj; 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 g34si36708659pld.15.2019.01.04.03.03.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Jan 2019 03:03:46 -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=MQ3C8ktj; 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 40D0D211AE8C6; Fri, 4 Jan 2019 03:03: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::542; helo=mail-ed1-x542.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) (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 C23B0211AE8C3 for ; Fri, 4 Jan 2019 03:03:33 -0800 (PST) Received: by mail-ed1-x542.google.com with SMTP id d39so31429276edb.12 for ; Fri, 04 Jan 2019 03:03: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; bh=zrkmfQttdsToZzhBFzUUJUcrvh6u3Vf96lPFkeOEPvg=; b=MQ3C8ktjylO1tHUH2uHjsLFK9rF3qPaWGbQNCxmOND242wrxEo+I4TuWBna5ZofBgW CdN/hLjvvgs6hSaebmrs1VqZnk3Llez7gbSbEUl56qjPG+aeUppiNqmZAhZa/wmGNO5A AGv2M4h5AC6/qoHfj5+Wwgai+IC/AO8gdiWOQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=zrkmfQttdsToZzhBFzUUJUcrvh6u3Vf96lPFkeOEPvg=; b=dknR4635VeL7+sRk/KSgkYBbbD0azhRg1+L0FxMAt5Po01QOwhvPcLRoWM7VWgcl0z VvF3GnJVp2BnYmeLw73laoxMB4Vgy2C8yVqpDT7TetYkIkE4VNcvZbdnCTzySHKx9Ttj kOyHvsoSFC3usIxlkjdD1kp7b3NZRLnB8vuMWSzMX346URDbcdKQg44KINxN/0sTDrXJ fT5dSitXvmBwCiIz8fQlX0U7BIdEYGnOkRmwpK1J4joIiT7NyM95Lv8Fh4VsKDqinsr8 4JB9TJl4JoOJ84QXyvl72PfBAao/MaqEj3aypXR3wLnPQ9bsbT19pPpbsWX+JSDBkQH4 kaow== X-Gm-Message-State: AA+aEWbXvpoU1RkJOUW6aVuc89d8FwvozwWoWCa4nhmw6ObNittuJcnf yebxUjX3ITlgj0LZnI7NFkGDI2z1QbZ+0g== X-Received: by 2002:a17:906:1f09:: with SMTP id w9-v6mr38759271ejj.22.1546599812073; Fri, 04 Jan 2019 03:03:32 -0800 (PST) Received: from dogfood.home ([2a01:cb1d:112:6f00:704e:c241:dc88:597d]) by smtp.gmail.com with ESMTPSA id n11sm26650578edn.14.2019.01.04.03.03.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Jan 2019 03:03:31 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Fri, 4 Jan 2019 12:03:13 +0100 Message-Id: <20190104110315.18339-7-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190104110315.18339-1-ard.biesheuvel@linaro.org> References: <20190104110315.18339-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH 6/8] StandaloneMmPkg/Core/Dispatcher: don't copy dispatched image twice 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: Jiewen Yao MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" The dispatcher uses the PE/COFF loader to load images into the heap, but only does so after copying the entire image first, leading to two copies being made for no good reason. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- StandaloneMmPkg/Core/Dispatcher.c | 30 +------------------- 1 file changed, 1 insertion(+), 29 deletions(-) -- 2.17.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/StandaloneMmPkg/Core/Dispatcher.c b/StandaloneMmPkg/Core/Dispatcher.c index 8d009b4f80c1..8a2ad5118d92 100644 --- a/StandaloneMmPkg/Core/Dispatcher.c +++ b/StandaloneMmPkg/Core/Dispatcher.c @@ -294,7 +294,6 @@ MmLoadImage ( IN OUT EFI_MM_DRIVER_ENTRY *DriverEntry ) { - VOID *Buffer; UINTN PageCount; EFI_STATUS Status; EFI_PHYSICAL_ADDRESS DstBuffer; @@ -302,17 +301,12 @@ MmLoadImage ( DEBUG ((DEBUG_INFO, "MmLoadImage - %g\n", &DriverEntry->FileName)); - Buffer = AllocateCopyPool (DriverEntry->Pe32DataSize, DriverEntry->Pe32Data); - if (Buffer == NULL) { - return EFI_OUT_OF_RESOURCES; - } - Status = EFI_SUCCESS; // // Initialize ImageContext // - ImageContext.Handle = Buffer; + ImageContext.Handle = DriverEntry->Pe32Data; ImageContext.ImageRead = PeCoffLoaderImageReadFromMemory; // @@ -320,9 +314,6 @@ MmLoadImage ( // Status = PeCoffLoaderGetImageInfo (&ImageContext); if (EFI_ERROR (Status)) { - if (Buffer != NULL) { - MmFreePool (Buffer); - } return Status; } @@ -336,9 +327,6 @@ MmLoadImage ( &DstBuffer ); if (EFI_ERROR (Status)) { - if (Buffer != NULL) { - MmFreePool (Buffer); - } return Status; } @@ -355,9 +343,6 @@ MmLoadImage ( // Status = PeCoffLoaderLoadImage (&ImageContext); if (EFI_ERROR (Status)) { - if (Buffer != NULL) { - MmFreePool (Buffer); - } MmFreePages (DstBuffer, PageCount); return Status; } @@ -367,9 +352,6 @@ MmLoadImage ( // Status = PeCoffLoaderRelocateImage (&ImageContext); if (EFI_ERROR (Status)) { - if (Buffer != NULL) { - MmFreePool (Buffer); - } MmFreePages (DstBuffer, PageCount); return Status; } @@ -393,9 +375,6 @@ MmLoadImage ( (VOID **)&DriverEntry->LoadedImage ); if (EFI_ERROR (Status)) { - if (Buffer != NULL) { - MmFreePool (Buffer); - } MmFreePages (DstBuffer, PageCount); return Status; } @@ -482,13 +461,6 @@ MmLoadImage ( DEBUG_CODE_END (); - // - // Free buffer allocated by Fv->ReadSection. - // - // The UEFI Boot Services FreePool() function must be used because Fv->ReadSection - // used the UEFI Boot Services AllocatePool() function - // - MmFreePool (Buffer); return Status; } From patchwork Fri Jan 4 11:03:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 154762 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp495750ljp; Fri, 4 Jan 2019 03:03:49 -0800 (PST) X-Google-Smtp-Source: ALg8bN4FhwCvrfT2MQbtO0btFfoIZK7V+KeP+Hh5mUpWtYKkb1nBTEp+U+VLjh7/Esl3RY/B9Af4 X-Received: by 2002:a63:4187:: with SMTP id o129mr1150583pga.370.1546599829817; Fri, 04 Jan 2019 03:03:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546599829; cv=none; d=google.com; s=arc-20160816; b=k5817efTENZRA2qSP0PU8NTmU2TN9/++TBJ8Rq6HPnvA6n3p0UPe+Bv/aB68texkEJ bB8Xanu3W8XAEY8MmGTsACt1FMjkngto065QezvufdoDKF+4kJeYVHstao5ylWmrMvvn qdqjynGI2Tt94ZTgQhzyBgJ+m/hmPP2RNQqC8uhknjTqT/bLCLa8d3ZnQvlZ4DDHNlDB Wj+lLydbYI6hI+gMSEUXzeCbqGsoAVQXt/8nbGkDfS8+M1LIjjkc6X64NW4kKNC/iQi1 8qDUeiAUbmCn20zwZXfjAvyl1GNJXNL65+Kz/lN9w4GG8YCDgNTbmHSXh3EDK++OtN+f pFLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to; bh=Y5bhNZ2NgQRcGPlpYRl7AM9qWtKkWncB1FoAhuEH1HU=; b=BDl4MQswdaE8xecnhTBRhrINOPJtOW44nu39rFTJh83oK8MJMDSyg2DsMnS9wc4rrC 4zb9jXT8a0b2mtct6GXlAt8Uu5IqL132J/O8llK8/dt/fdKzxiVInqedgWHN0u6GfvHC Kmg2KKzzhDgyM15baikkv5nGvVDbIgqTicHWaVtWPm7IQZiHWfDDYF+jJQt3NWhmFCCb F6pktb8pekIbJPjD0yoVNzAj/I+6TI14pGwiYddS4tIdikoZigyr7/sPqDov7RXTLX94 5uOeQUsvna8qnUNDCDr4Fr/9PUYffJ1FKV0ppHFpSaZVF0UO3Qio4WTl7kpi/sbpqtbY 5J7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=TSAXFnk7; 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 18si3128152pgo.331.2019.01.04.03.03.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Jan 2019 03:03:49 -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=TSAXFnk7; 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 6D7A7211AE8C9; Fri, 4 Jan 2019 03:03: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::544; helo=mail-ed1-x544.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-ed1-x544.google.com (mail-ed1-x544.google.com [IPv6:2a00:1450:4864:20::544]) (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 24DE8211AE8BA for ; Fri, 4 Jan 2019 03:03:35 -0800 (PST) Received: by mail-ed1-x544.google.com with SMTP id a20so24672291edc.8 for ; Fri, 04 Jan 2019 03:03: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; bh=Hli/q0XoE/UtzHjDRSUIMt2BcGy9QJBwUJV8lE4bcak=; b=TSAXFnk7eF4QjKPhYPI9fwrVH+A2F8w2sTQsfXCE2/YawoQlpgdo27BkXwxmK/dZDP CbbxyHdJOhchNY1U403fvFTm+lNLp/NvXcsQML2jVOyOAqN7QRZ+k60DwQcSpaOLaEHP 768OMqbKNHPlg44knqszJvLybvdNRwd7cMGcQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Hli/q0XoE/UtzHjDRSUIMt2BcGy9QJBwUJV8lE4bcak=; b=WQ9RHky+7gV8UByispJCfT4DQaE5CCHj25+8tsEhRyOsucQA9BlAI+LI/pNrYYCMIO 38UuETgNtlBUdA+qzvk637AqY8GLDZv9jXofTtlo1lk0EL6LZDS+td1CbXMoKC7GhBVu RhBKZTNEpZTumT0gX7qKziqVkB5FCU+y/2A17hNgMpoc3iUb7DUcg16fsfF/9vFP7FvP 6kU8MtzRsSo64+dIiLpQUPabpV1te34RCMZgeewCJOdcvwsbhNdhPEDnshipH0SJocuz 1aeb+MTwoQNFVfoa9aHWGbMmGwnDUSWyRiWddvwOxDou3GbR+10NqHA2L/2vcDvfPNK6 dm0w== X-Gm-Message-State: AA+aEWYFdY0Htc2oczApL68Z2KWBoX08RropPbusvxJFF9uWlw8lDOHr L/RaXPvGnVRPSELM5OdupGyPoQZAILqC4Q== X-Received: by 2002:a17:906:1c5b:: with SMTP id l27-v6mr38823170ejg.118.1546599813415; Fri, 04 Jan 2019 03:03:33 -0800 (PST) Received: from dogfood.home ([2a01:cb1d:112:6f00:704e:c241:dc88:597d]) by smtp.gmail.com with ESMTPSA id n11sm26650578edn.14.2019.01.04.03.03.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Jan 2019 03:03:32 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Fri, 4 Jan 2019 12:03:14 +0100 Message-Id: <20190104110315.18339-8-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190104110315.18339-1-ard.biesheuvel@linaro.org> References: <20190104110315.18339-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH 7/8] StandaloneMmPkg/StandaloneMmCoreEntryPoint: permit the use of TE images 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: Jiewen Yao MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" TE images take up less space when using 4 KB section alignment, since the FFS/FV generation code optimizes away the redundant, nested padding. This saves 4 KB of space, which is a worthwhile improvement for code that executes in place in secure context. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/SetPermissions.c | 107 +++++++++----------- 1 file changed, 46 insertions(+), 61 deletions(-) -- 2.17.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/SetPermissions.c b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/SetPermissions.c index 3ca7f6660f47..90299ebbafb6 100644 --- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/SetPermissions.c +++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/SetPermissions.c @@ -143,9 +143,12 @@ LocateStandaloneMmCorePeCoffData ( Status = FfsFindSectionData (EFI_SECTION_PE32, FileHeader, TeData, TeDataSize); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "Unable to locate Standalone MM Section data - 0x%x\n", - Status)); - return Status; + Status = FfsFindSectionData (EFI_SECTION_TE, FileHeader, TeData, TeDataSize); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "Unable to locate Standalone MM Section data - %r\n", + Status)); + return Status; + } } DEBUG ((DEBUG_INFO, "Found Standalone MM PE data - 0x%x\n", *TeData)); @@ -155,10 +158,9 @@ LocateStandaloneMmCorePeCoffData ( STATIC EFI_STATUS GetPeCoffSectionInformation ( - IN CONST PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext, - IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *TmpContext, - IN OUT UINT32 *SectionHeaderOffset, - IN OUT UINT16 *NumberOfSections + IN OUT PE_COFF_LOADER_IMAGE_CONTEXT *ImageContext, + OUT UINT32 *SectionHeaderOffset, + OUT UINT16 *NumberOfSections ) { RETURN_STATUS Status; @@ -168,44 +170,29 @@ GetPeCoffSectionInformation ( UINTN ReadSize; ASSERT (ImageContext != NULL); - ASSERT (TmpContext != NULL); ASSERT (SectionHeaderOffset != NULL); ASSERT (NumberOfSections != NULL); - // - // We need to copy ImageContext since PeCoffLoaderGetImageInfo () - // will mangle the ImageAddress field - // - CopyMem (TmpContext, ImageContext, sizeof (*TmpContext)); - - if (TmpContext->PeCoffHeaderOffset == 0) { - Status = PeCoffLoaderGetImageInfo (TmpContext); - if (RETURN_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, - "%a: PeCoffLoaderGetImageInfo () failed (Status = %r)\n", - __FUNCTION__, Status)); - return Status; - } - } - - if (TmpContext->IsTeImage && - TmpContext->ImageAddress == ImageContext->ImageAddress) { - DEBUG ((DEBUG_INFO, "%a: ignoring XIP TE image at 0x%lx\n", __FUNCTION__, - ImageContext->ImageAddress)); - return RETURN_UNSUPPORTED; + Status = PeCoffLoaderGetImageInfo (ImageContext); + if (RETURN_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, + "%a: PeCoffLoaderGetImageInfo () failed (Status == %r)\n", + __FUNCTION__, Status)); + return Status; } - if (TmpContext->SectionAlignment < EFI_PAGE_SIZE) { + if (ImageContext->SectionAlignment < EFI_PAGE_SIZE) { // // The sections need to be at least 4 KB aligned, since that is the // granularity at which we can tighten permissions. // - if (!TmpContext->IsTeImage) { + if (!ImageContext->IsTeImage) { DEBUG ((DEBUG_WARN, "%a: non-TE Image at 0x%lx has SectionAlignment < 4 KB (%lu)\n", - __FUNCTION__, ImageContext->ImageAddress, TmpContext->SectionAlignment)); + __FUNCTION__, ImageContext->ImageAddress, ImageContext->SectionAlignment)); + return RETURN_UNSUPPORTED; } - return RETURN_UNSUPPORTED; + ImageContext->SectionAlignment = EFI_PAGE_SIZE; } // @@ -217,9 +204,9 @@ GetPeCoffSectionInformation ( Hdr.Union = &HdrData; Size = sizeof (EFI_IMAGE_OPTIONAL_HEADER_UNION); ReadSize = Size; - Status = TmpContext->ImageRead ( - TmpContext->Handle, - TmpContext->PeCoffHeaderOffset, + Status = ImageContext->ImageRead ( + ImageContext->Handle, + ImageContext->PeCoffHeaderOffset, &Size, Hdr.Pe32 ); @@ -231,23 +218,28 @@ GetPeCoffSectionInformation ( return Status; } - ASSERT (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE); - - *SectionHeaderOffset = TmpContext->PeCoffHeaderOffset + sizeof (UINT32) + - sizeof (EFI_IMAGE_FILE_HEADER); - *NumberOfSections = Hdr.Pe32->FileHeader.NumberOfSections; - - switch (Hdr.Pe32->OptionalHeader.Magic) { - case EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC: - *SectionHeaderOffset += Hdr.Pe32->FileHeader.SizeOfOptionalHeader; - break; - case EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC: - *SectionHeaderOffset += Hdr.Pe32Plus->FileHeader.SizeOfOptionalHeader; - break; - default: - ASSERT (FALSE); + if (!ImageContext->IsTeImage) { + ASSERT (Hdr.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE); + + *SectionHeaderOffset = ImageContext->PeCoffHeaderOffset + sizeof (UINT32) + + sizeof (EFI_IMAGE_FILE_HEADER); + *NumberOfSections = Hdr.Pe32->FileHeader.NumberOfSections; + + switch (Hdr.Pe32->OptionalHeader.Magic) { + case EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC: + *SectionHeaderOffset += Hdr.Pe32->FileHeader.SizeOfOptionalHeader; + break; + case EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC: + *SectionHeaderOffset += Hdr.Pe32Plus->FileHeader.SizeOfOptionalHeader; + break; + default: + ASSERT (FALSE); + } + } else { + *SectionHeaderOffset = (UINTN)(sizeof (EFI_TE_IMAGE_HEADER)); + *NumberOfSections = Hdr.Te->NumberOfSections; + ImageContext->ImageAddress -= (UINT32)Hdr.Te->StrippedSize - sizeof (EFI_TE_IMAGE_HEADER); } - return RETURN_SUCCESS; } @@ -261,7 +253,6 @@ GetStandaloneMmCorePeCoffSections ( ) { EFI_STATUS Status; - PE_COFF_LOADER_IMAGE_CONTEXT TmpContext; // Initialize the Image Context ZeroMem (ImageContext, sizeof (PE_COFF_LOADER_IMAGE_CONTEXT)); @@ -270,15 +261,9 @@ GetStandaloneMmCorePeCoffSections ( DEBUG ((DEBUG_INFO, "Found Standalone MM PE data - 0x%x\n", TeData)); - Status = PeCoffLoaderGetImageInfo (ImageContext); - if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "Unable to locate Standalone MM Core PE-COFF Image information - 0x%x\n", Status)); - return Status; - } - - Status = GetPeCoffSectionInformation (ImageContext, &TmpContext, SectionHeaderOffset, NumberOfSections); + Status = GetPeCoffSectionInformation (ImageContext, SectionHeaderOffset, NumberOfSections); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "Unable to locate Standalone MM Core PE-COFF Section information - 0x%x\n", Status)); + DEBUG ((DEBUG_ERROR, "Unable to locate Standalone MM Core PE-COFF Section information - %r\n", Status)); return Status; } From patchwork Fri Jan 4 11:03:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 154763 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp495840ljp; Fri, 4 Jan 2019 03:03:53 -0800 (PST) X-Google-Smtp-Source: AFSGD/VyrR23Gr5h4q8JqSqj3n++Ig3gO4EenaHlulAXCFhg8m3F1tM8/8UOyQS/tsSqcqLt46Fu X-Received: by 2002:a62:1709:: with SMTP id 9mr51392854pfx.249.1546599833844; Fri, 04 Jan 2019 03:03:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546599833; cv=none; d=google.com; s=arc-20160816; b=o6mcGL8Z4gxK8Y5/JeYQUICLoeNOH4tiEjYhDsdCXtfwVf868I5Oq73q4vrCcQWFKe 1WTEhCrEsPaPYd1hI444VnX23TQaWOVe5PbnpoJlczDVmVMO5MDHCtVIic4zEJMoIHmI h2e7exBcO4vYY6PN7pV7dRtI/QiCL4Un4W7qY8fdKO6deGGFDyFqhUlRCVhzuZd6ccCR /pJ1gZDk+WWlHdlpR4xT33zHzZ8Js3xcgDHc6+1WXgO6Q0ZatC5N/QMmKzh/nWadmGSF TdTw1rCb8FZA6aylQZB53ZVeUYt8Lhz269ju3fmn944FXHeJ3d4xgnc/t0SKcaTE3Aoj yffQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to; bh=tLfNZpDCeNZLyd+WXsPiZ5lKeAdjeNat/1/zqj4aDfE=; b=tQegU4710/oGBuKkxBgogGaA93EP4n64+aPF+XidiaUPGnEgsocQBwEjcB+C4TD8vT 94WAcOxVPGE/6QrNlmdlQV6ikTlPBGpCjdxXTnzJs/cl/eCJoooStaH8AYDykXDe3kHV pl4RehxrDCmszMqCeDm8ZJ9YzQEZWntXH3fnCz3toPlGwbf4sEOlTbdEXKlnrinfpOS+ 7FDvZPOSB3kxQejqQQ6/6OXv6KwWmtOQZseNFrYiQfZdtJJcPg0tMMFly8VS8AOZF544 WNR4YDwZv08+dA0HjLAXlJMTqdZv20PCdm4BYAaMgoO4L8pwqkT5HZhubICGXbR+g9AH cvHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=GcpZEL0o; 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 31si18441153plh.274.2019.01.04.03.03.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Jan 2019 03:03:53 -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=GcpZEL0o; 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 9BFEB211AE8CC; Fri, 4 Jan 2019 03:03: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::541; helo=mail-ed1-x541.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-ed1-x541.google.com (mail-ed1-x541.google.com [IPv6:2a00:1450:4864:20::541]) (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 6B3972194D3B3 for ; Fri, 4 Jan 2019 03:03:36 -0800 (PST) Received: by mail-ed1-x541.google.com with SMTP id p6so31528440eds.0 for ; Fri, 04 Jan 2019 03:03: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; bh=ad37yiUnIdvmQ2MIoF2Y5MrPv5IM3gX5MH7CXAHxH84=; b=GcpZEL0ooNStMPVrfpg5IFvnhqYD8AJkKUbsTclPup1E/tlDBzJb/5y58BZiR3Zbc2 hVV7/z0rWpcz0+uLy+w7c+BQPxRh4IP+8rcVgu1gvPS3c5OSztwuGb9YC833TOrgdWgD 7PN+tRJ/7j7xuRvrhMNtadWgNVvjdhuFU/wGQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ad37yiUnIdvmQ2MIoF2Y5MrPv5IM3gX5MH7CXAHxH84=; b=Mg2xauw1pBkqEo9eP+03qDr5x+X9QJZU7zoDRfD9VLp4WleDakM8ZQdh592bhMZxrC izN7UmQ7tWzfMHUCJB8caEe9LL3hNE2Ti8DJDyZDL8lc+vLusPSwkpSFa6rXQXYNOTOm KLXVELf0XTb3XNdLJ5+WCS08PW0XOx4iWwRNGcqy786OaeP0CAcTM1Fh6BVhBsvBT6e8 hwZCMXgcG4So32eo4eSxyOjHPrLI0Yub1ye92rwh07iECZHEGRZJZIbwgMtQDb77r+/5 4/nPsUKcoeBqaQPtOH/VtAgYRTtKH1tGvFGMcoeQ37fDBTlVRYCB+MWhGXU8d0A19Hsb Nw1g== X-Gm-Message-State: AA+aEWYMSVOWQVFiiT6Qiw/y47c3VuwUi+Tb2BKqlyZvc/9H6XLr5A45 LYglATRN158YVH/M8HViHhAO+7QdT9DjAw== X-Received: by 2002:a50:cdd0:: with SMTP id h16mr46899151edj.151.1546599814765; Fri, 04 Jan 2019 03:03:34 -0800 (PST) Received: from dogfood.home ([2a01:cb1d:112:6f00:704e:c241:dc88:597d]) by smtp.gmail.com with ESMTPSA id n11sm26650578edn.14.2019.01.04.03.03.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Jan 2019 03:03:34 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Fri, 4 Jan 2019 12:03:15 +0100 Message-Id: <20190104110315.18339-9-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190104110315.18339-1-ard.biesheuvel@linaro.org> References: <20190104110315.18339-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH 8/8] StandaloneMmPkg/Core: permit encapsulated firmware volumes 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: Jiewen Yao MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Standalone MM requires 4 KB section alignment for all images, so that strict permissions can be applied. Unfortunately, this results in a lot of wasted space, which is usually costly in the secure world environment that standalone MM is expected to operate in. So let's permit the standalone MM drivers (but not the core) to be delivered in a compressed firmware volume. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- StandaloneMmPkg/Core/FwVol.c | 99 ++++++++++++++++++-- StandaloneMmPkg/Core/StandaloneMmCore.inf | 1 + StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c | 5 + StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf | 3 + 4 files changed, 99 insertions(+), 9 deletions(-) -- 2.17.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/StandaloneMmPkg/Core/FwVol.c b/StandaloneMmPkg/Core/FwVol.c index 5abf98c24797..d95491f252f9 100644 --- a/StandaloneMmPkg/Core/FwVol.c +++ b/StandaloneMmPkg/Core/FwVol.c @@ -14,6 +14,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include "StandaloneMmCore.h" #include +#include // // List of file types supported by dispatcher @@ -65,15 +66,25 @@ Returns: --*/ { - EFI_STATUS Status; - EFI_STATUS DepexStatus; - EFI_FFS_FILE_HEADER *FileHeader; - EFI_FV_FILETYPE FileType; - VOID *Pe32Data; - UINTN Pe32DataSize; - VOID *Depex; - UINTN DepexSize; - UINTN Index; + EFI_STATUS Status; + EFI_STATUS DepexStatus; + EFI_FFS_FILE_HEADER *FileHeader; + EFI_FV_FILETYPE FileType; + VOID *Pe32Data; + UINTN Pe32DataSize; + VOID *Depex; + UINTN DepexSize; + UINTN Index; + EFI_COMMON_SECTION_HEADER *Section; + VOID *SectionData; + UINTN SectionDataSize; + UINT32 DstBufferSize; + VOID *ScratchBuffer; + UINT32 ScratchBufferSize; + VOID *DstBuffer; + UINT16 SectionAttribute; + UINT32 AuthenticationStatus; + EFI_FIRMWARE_VOLUME_HEADER *InnerFvHeader; DEBUG ((DEBUG_INFO, "MmCoreFfsFindMmDriver - 0x%x\n", FwVolHeader)); @@ -83,6 +94,71 @@ Returns: FvIsBeingProcesssed (FwVolHeader); + // + // First check for encapsulated compressed firmware volumes + // + FileHeader = NULL; + do { + Status = FfsFindNextFile (EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE, + FwVolHeader, &FileHeader); + if (EFI_ERROR (Status)) { + break; + } + Status = FfsFindSectionData (EFI_SECTION_GUID_DEFINED, FileHeader, + &SectionData, &SectionDataSize); + if (EFI_ERROR (Status)) { + break; + } + Section = (EFI_COMMON_SECTION_HEADER *)(FileHeader + 1); + Status = ExtractGuidedSectionGetInfo (Section, &DstBufferSize, + &ScratchBufferSize, &SectionAttribute); + if (EFI_ERROR (Status)) { + break; + } + + // + // Allocate scratch buffer + // + ScratchBuffer = (VOID *)(UINTN)AllocatePages (EFI_SIZE_TO_PAGES (ScratchBufferSize)); + if (ScratchBuffer == NULL) { + return EFI_OUT_OF_RESOURCES; + } + + // + // Allocate destination buffer, extra one page for adjustment + // + DstBuffer = (VOID *)(UINTN)AllocatePages (EFI_SIZE_TO_PAGES (DstBufferSize)); + if (DstBuffer == NULL) { + return EFI_OUT_OF_RESOURCES; + } + + // + // Call decompress function + // + Status = ExtractGuidedSectionDecode (Section, &DstBuffer, ScratchBuffer, + &AuthenticationStatus); + FreePages (ScratchBuffer, EFI_SIZE_TO_PAGES (ScratchBufferSize)); + if (EFI_ERROR (Status)) { + goto FreeDstBuffer; + } + + DEBUG ((DEBUG_INFO, + "Processing compressed firmware volume (AuthenticationStatus == %x)\n", + AuthenticationStatus)); + + Status = FindFfsSectionInSections (DstBuffer, DstBufferSize, + EFI_SECTION_FIRMWARE_VOLUME_IMAGE, &Section); + if (EFI_ERROR (Status)) { + goto FreeDstBuffer; + } + + InnerFvHeader = (VOID *)(Section + 1); + Status = MmCoreFfsFindMmDriver (InnerFvHeader); + if (EFI_ERROR (Status)) { + goto FreeDstBuffer; + } + } while (TRUE); + for (Index = 0; Index < sizeof (mMmFileTypes) / sizeof (mMmFileTypes[0]); Index++) { DEBUG ((DEBUG_INFO, "Check MmFileTypes - 0x%x\n", mMmFileTypes[Index])); FileType = mMmFileTypes[Index]; @@ -100,5 +176,10 @@ Returns: } while (!EFI_ERROR (Status)); } + return EFI_SUCCESS; + +FreeDstBuffer: + FreePages (DstBuffer, EFI_SIZE_TO_PAGES (DstBufferSize)); + return Status; } diff --git a/StandaloneMmPkg/Core/StandaloneMmCore.inf b/StandaloneMmPkg/Core/StandaloneMmCore.inf index ff2b8b9cef03..83d31e2d92c5 100644 --- a/StandaloneMmPkg/Core/StandaloneMmCore.inf +++ b/StandaloneMmPkg/Core/StandaloneMmCore.inf @@ -49,6 +49,7 @@ [LibraryClasses] BaseMemoryLib CacheMaintenanceLib DebugLib + ExtractGuidedSectionLib FvLib HobLib MemoryAllocationLib diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c index 5cca532456fd..67ff9112d5c0 100644 --- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c +++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c @@ -205,6 +205,8 @@ GetSpmVersion (VOID) return Status; } +STATIC UINT64 mExtractGuidedSectionHandlerInfo[64]; + /** The entry point of Standalone MM Foundation. @@ -285,6 +287,9 @@ _ModuleEntryPoint ( goto finish; } + PcdSet64 (PcdGuidedExtractHandlerTableAddress, + (UINT64)mExtractGuidedSectionHandlerInfo); + // // Create Hoblist based upon boot information passed by privileged software // diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf index 769eaeeefbea..55d769fa77e4 100644 --- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf +++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf @@ -54,3 +54,6 @@ [Guids] gEfiMmPeiMmramMemoryReserveGuid gEfiStandaloneMmNonSecureBufferGuid gEfiArmTfCpuDriverEpDescriptorGuid + +[PatchPcd] + gEfiMdePkgTokenSpaceGuid.PcdGuidedExtractHandlerTableAddress