From patchwork Thu Jun 7 11:08:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 137874 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1950549lji; Thu, 7 Jun 2018 04:08:21 -0700 (PDT) X-Google-Smtp-Source: ADUXVKI9D0GVGV0Zn+3GCoKYmRGwWWPGDliPK0/KlOr2zF43utqy6kzwvsQXKhIUPPRIb6YboYUS X-Received: by 2002:a17:902:b784:: with SMTP id e4-v6mr1610418pls.264.1528369701062; Thu, 07 Jun 2018 04:08:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528369701; cv=none; d=google.com; s=arc-20160816; b=WW72XZRz2dhGnRaoQDBUdEVlm8HfaoiiLgVeKowkpO2HGCoTUj73UkcjVES383ryDB HXm6JFNaMB/h41uZHEMAgpvrOroT2PERvMBsIJscjw+4/rm9yudDTngDCbfGeUBzjpcy 2JK/oYBvot97PZIdgIWUHYEkYJHnahkL5iWqSjnTr/EI+/jkcvXkIS1uzuQEHvhOq9+u SkTFQIg/G3SVTSKpugs+VbDx8we3Uf+cYDO5gHsKHXi/1bWDdvL7wKxJouz3TLhZ85BJ ucKK6EFLfX9oPxe7FcaL9icJv626Vif9pt+o7mmvPzOkmZGj+VTeO4gGFQMXwT5P2p2+ dUNA== 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=x5Q7ShE7/8cFu3zGy7QwL7CpHBBDnENI1IKJ7qv3Ods=; b=k/1D/a8a6kQO268SXao3hvRD0Hxg3CqbqnGReY8dlpHRvRqwYtNioyO21vBKU72C0Z 9TcNA0UFoyQVtaA+uUmOte/CAdsjINj+79ZAVB6x5vfMO4eFzjA5/ZTCB3KEE8NwhBlD 1jZ0uHsXs8uFhaO8aLM7HcLY3wfhMhO1YO2iULDroQ3iuZs8khUUUwTMXQrpnH9+CjFV UuyU5hGnrnbtQOu7MX4QCXh9M85TFzq8xSpX+yUdRWMpsU6m1KggrctqiQaaLaVScOPT K/KmC5eq1UVXwDCuRx6zPaUAyyTfYwk2qTqmROR36RtDKi8aMem74w9gexN6DSpISHTJ aPvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=DK+2QKSL; 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 i35-v6si15490999plg.323.2018.06.07.04.08.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Jun 2018 04:08:21 -0700 (PDT) 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=DK+2QKSL; 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 1A020211BA46A; Thu, 7 Jun 2018 04:08:19 -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:c0c::235; helo=mail-wr0-x235.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr0-x235.google.com (mail-wr0-x235.google.com [IPv6:2a00:1450:400c:c0c::235]) (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 49EB3211B85FE for ; Thu, 7 Jun 2018 04:08:16 -0700 (PDT) Received: by mail-wr0-x235.google.com with SMTP id f16-v6so9647489wrm.3 for ; Thu, 07 Jun 2018 04:08:16 -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=6bMRkBtczwc3vx8lXyGPcUKbEtv2Iw1rqymovBhyAyQ=; b=DK+2QKSL8+DQQAOqD6bgvo8pjmkAiszkF/7SWCjwdkCVh2rcm+O/BxdUFek3AUePvU JJbc07SWGSWMZfbbYv7piBEflbJIUHWlWnkF9uApK3lafxxZ5T7NzkKnepyj/KCGyoog VMm7jETzsdyKlzt2trwk0lkAIxLYcp6TaYN9E= 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=6bMRkBtczwc3vx8lXyGPcUKbEtv2Iw1rqymovBhyAyQ=; b=sOop7hj8fHALuafzsNdgVwDXCSynh8BDjdTKbsSfzsLPkU1ye6pDeMQkbWkP/xHmis Lg02z80I/ERIG3xVbWSNBx9W8Dv+Vo7hln/7+SUYnrtcUg5rfxy9QP7M6Xh0LJhjP4gR wamhbqLKxhm5Ww79VglFwpEwEIIaNeW+mIgGByA4zTRCOccyYSCXQd3DZnMebNqEMsrm In4L9aeQ2zAIpj1JD5a526I09ywIzcXZiFLaQWoi7LXqWEY2LTgwDPHX+CNt2ozEEXu3 Dy16KEjUB6gSC4zglwtf+zprZ7x9uwMt7G/hWRPuimPw6L/7+Tu4hKBSb9Iuaeq+TY9N Wpvg== X-Gm-Message-State: APt69E1FeigAnEkTu0PKhvWQD2ZYpcwbaG6hSO4Zgyump1F2Q63LAL9D rwi1MVrtSGeyBde2W00CP21z/Nzxbes= X-Received: by 2002:adf:9302:: with SMTP id 2-v6mr1291401wro.175.1528369695177; Thu, 07 Jun 2018 04:08:15 -0700 (PDT) Received: from dogfood.home ([2a01:cb1d:112:6f00:88ff:8f90:37f1:db91]) by smtp.gmail.com with ESMTPSA id 72-v6sm54997900wrb.22.2018.06.07.04.08.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Jun 2018 04:08:14 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Thu, 7 Jun 2018 13:08:07 +0200 Message-Id: <20180607110812.26778-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.0 Subject: [edk2] [PATCH 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. 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 | 20 +++++++++++------- .../Universal/CapsulePei/CapsulePei.inf | 1 + .../CapsulePei/Common/CapsuleCoalesce.c | 10 +++++++++ 8 files changed, 65 insertions(+), 28 deletions(-) -- 2.17.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel