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: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-Google-Smtp-Source: ADUXVKK2OroBeNtQEYgAu4vJPqkRMibr7TXjf6cmCd0D0tma5EEmLxglm+fOCcwrHlxxPcJfdVjl4w== 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 Cc: leif.lindholm@linaro.org, star.zeng@intel.com, jiewen.yao@intel.com, michael.d.kinney@intel.com, Ard Biesheuvel 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: [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: , X-List-Received-Date: Fri, 08 Jun 2018 06:58:20 -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. 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