From patchwork Fri Jun 8 06:58:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 137921 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp511804lji; Thu, 7 Jun 2018 23:58:22 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLvbLB43C7zPz9ZtO7er7r+/c19BdP7Xh4JtyBTglODAhl5z04hKyg+DOamFYhalFML39vE X-Received: by 2002:a17:902:205:: with SMTP id 5-v6mr5152406plc.301.1528441102543; Thu, 07 Jun 2018 23:58:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528441102; cv=none; d=google.com; s=arc-20160816; b=MR5P5T5fuxRzXQalIgD2yMman+TilWuXVrok3MEaCCW8SZs4BjSzZ6Z0qcILlHDFCf 3YKAZnD5QZ66sVNs+FulIQU9vCfJckhlX46+kRucvnGVtLHeXTjyV0nPAgDnOI7oasic 2rA1pvtCI0OzYsFSb3lluINzs2eHOF8p8OF/eU6nbFKspTgXNqidKLSy3GAdp4EXuNSC oBozk+tFbSfeo6Od/y+QT3mNFG7qzKfT6QYBONAZUU96fU6oqguQgk4uByXRoL15z4jr JWEr48+FiFZs4oGVaRALt4xuhDKhaEsBDI3nBDOfSNNK6XQDWpBrqTdVSLXpXTX1ow49 5JcA== 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:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=Siwnu9ZJscDEAvdGUaWM5ASH7MsDxk9togl71F5Klgg=; b=F+2k1upzrv5/hxg2+A9ixrAalPnr9/Ri7fGgrm0O748ziWurhVcpX0yrJVsBVougGw rOCpiXU2vuhA+cttsOR4ruUHux42+ts01DtVRkW/XUXajjymAXZie3Inon4IlHjSuCf0 vISuGRo5e/YLlym8HOrzZBp5I/SarmStv7zsLX4Fml7nJtrPBxcS/omhFAaJVULiMfzQ bIh1HpXpxQY7q0o8HJ0HYayHrMcm67Ev+B9AQaPWJ8ogD74sz/3hddjEXVtWvazRAw+Y WZ6Ii84DFKCX7SJ2AJ04ODY08/yAkvXKF40zZ+hRMFY/x3q90ru7E9Wp7rMPczpoXnrX GVSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=WCkLcm7v; 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 d1-v6si5783070pll.375.2018.06.07.23.58.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Jun 2018 23:58:22 -0700 (PDT) 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=WCkLcm7v; 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 91EF4210F4755; Thu, 7 Jun 2018 23:58:21 -0700 (PDT) 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:400c:c09::22a; helo=mail-wm0-x22a.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm0-x22a.google.com (mail-wm0-x22a.google.com [IPv6:2a00:1450:400c:c09::22a]) (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 65915210F201E for ; Thu, 7 Jun 2018 23:58:19 -0700 (PDT) Received: by mail-wm0-x22a.google.com with SMTP id e16-v6so1408263wmd.0 for ; Thu, 07 Jun 2018 23:58:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=DNY18PLLuoo5xH0Y93jA2eXuL8iJZRAYMmZqj1YYigo=; b=WCkLcm7v+ZEBCq1hO7ntmP1uqVQGBdQeoYcAvDIkum1nh4ZWR+56d8brjb2PIM6xmO p8nKY9LzkXlDahUUiJjEbMds7CbP1xdUBBvZ7r6cvUSumP3Gs/2obOH/w/ujJM4a262Y SOadQCVlZ9Xmzl2UhjQ/QeKKcuhA29fgnPlXU= 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; bh=DNY18PLLuoo5xH0Y93jA2eXuL8iJZRAYMmZqj1YYigo=; b=DZhwmNcS9GneWW8nDFZd1WVN6tD4ocCAGAEMw7463RQHunFxg/5pZAbLYBiKfZ51YY UBslw6DrfG85II1P/XZeydr4vIorwXRmK8h7rAbo7VIVD8hpy+rx3NdXag6QlQKr6HJc 67CM2uzVyyuMKaV5zdghQ4NdNQN/ERcgsUMeWcgaBBigKO6a6yEgPmcYjeeKhoq5pCqh tN/0fi3RdYsrdtcuXAxIu0au3ldhR+3vcakT1A+rcnocOZIeOA6Btdx9M4NjN+usERvo rwDAq4N79nVDtGThIjmvrE3V+c19AtZPxjl3olnOQ693XvcqNy4BTGoQZwlSaiWvUdhX hMRA== X-Gm-Message-State: APt69E0HcmUKnCzVpz6BIS4IPJ/sR6w+q2GeVrbKH0xq4hF9oJRgaLk/ njVw53mVPyNGYyEjygy/2/cj36GKsFE= X-Received: by 2002:a1c:e618:: with SMTP id d24-v6mr588305wmh.154.1528441097843; Thu, 07 Jun 2018 23:58:17 -0700 (PDT) Received: from dogfood.home (LFbn-NIC-1-75-91.w2-15.abo.wanadoo.fr. [2.15.165.91]) by smtp.gmail.com with ESMTPSA id x130-v6sm892491wme.24.2018.06.07.23.58.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Jun 2018 23:58:16 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Fri, 8 Jun 2018 08:58:06 +0200 Message-Id: <20180608065811.2065-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.0 Subject: [edk2] [PATCH v2 0/5] MdeModulePkg ArmPkg: support for persistent capsules and progress reporting X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: michael.d.kinney@intel.com, jiewen.yao@intel.com, star.zeng@intel.com, leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" This is the delta of code required to implement PersistAcrossReset on ARM systems, and to wire up the capsule handling routines in a way that makes the new progress reporting code do something meaningful on such platforms. Changes since v1: - incorporate Star's feedback (#1, #2) - add Leif's ack (#4) Patch #1 ensures that the capsule data which is preserved in DRAM across a reboot is written back to main memory before attempting to access it with the caches off. Patch #2 modifies the logic in DxeCapsuleLibFmp so it can deal with a platform that chooses to call ProcessCapsules() only a single time after EndOfDxe. Patch #3 updates DxeCapsuleLibFmp so it does not pass down the progress indication callback if its own attempt to invoke it has already failed. Patch #4 updates ArmPkg's generic PlatformBootManagerLib implementation to only call ProcessCapsules() after the [potentially non-trusted] console is up and running, to ensure that firmware update progress can be reported to the user. Patch #5 modifies ArmSmcPsciResetSystemLib to emulate a proper warm reboot by reentering PEI with interrupts, MMU and caches enabled. This works around the lack of an architected warm reboot in most current implementations. (The PSCI spec does cover warm reboot, but it was added recently and most secure firmware implementations haven't caught up yet) Note that these patches apply on top of Mike's pending changes to DxeCapsuleLibFmp implementing progress reporting. Ard Biesheuvel (5): MdeModulePkg/CapsulePei: clean Dcache before consuming capsule data MdeModulePkg/DxeCapsuleLibFmp: permit ProcessCapsules () to be called once MdeModulePkg/DxeCapsuleLibFmp: pass progress callback only if it works ArmPkg/PlatformBootManagerLib: call ProcessCapsules() only once ArmPkg/ArmSmcPsciResetSystemLib: implement fallback for warm reboot ArmPkg/ArmPkg.dec | 4 ++ .../ArmSmcPsciResetSystemLib.c | 21 +++++++++- .../ArmSmcPsciResetSystemLib.inf | 9 +++++ .../PlatformBootManagerLib/PlatformBm.c | 15 -------- .../Library/DxeCapsuleLibFmp/DxeCapsuleLib.c | 13 +++++-- .../DxeCapsuleLibFmp/DxeCapsuleProcessLib.c | 18 ++++++--- .../Universal/CapsulePei/CapsulePei.inf | 1 + .../CapsulePei/Common/CapsuleCoalesce.c | 38 +++++++++++++------ 8 files changed, 82 insertions(+), 37 deletions(-) -- 2.17.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel