From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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-Google-Smtp-Source: ADUXVKIJFg69gW4b9jLgc5JJhJddpbcBWw673Qk8i3Ze95aDFYlIOGG1esMS4MZzO+QL37QSoJHEFQ== 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 Cc: leif.lindholm@linaro.org, michael.d.kinney@intel.com, jiewen.yao@intel.com, star.zeng@intel.com, Ard Biesheuvel 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: [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: , X-List-Received-Date: Thu, 07 Jun 2018 11:08:17 -0000 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