security/vboot: Remove selected_region from struct vboot_working_data
commitaeb652a4a04226f467eb8e850b2096d772c6e31e
authorYu-Ping Wu <yupingso@chromium.org>
Thu, 14 Nov 2019 07:42:25 +0000 (14 15:42 +0800)
committerPatrick Georgi <pgeorgi@google.com>
Wed, 20 Nov 2019 13:26:17 +0000 (20 13:26 +0000)
treeb213b06ebc949fa800c139587156464b5c126804
parentea544574d06e8a149c447b35c5e8fba96e61152a
security/vboot: Remove selected_region from struct vboot_working_data

Since we already have pre-RAM cache for FMAP (CB:36657), calling
load_firmware() multiple times is no longer a problem. This patch
replaces vboot_get_selected_region() usage with vboot_locate_firmware(),
which locates the firmware by reading from the CBMEM cache.

In addition, returning false from vboot_is_slot_selected() implies the
recovery path was requested, i.e., vb2_shared_data.recovery_reason was
set. Therefore, we simply remove the vboot_is_slot_selected() check from
vboot_check_recovery_request().

BRANCH=none
BUG=chromium:1021452
TEST=emerge-kukui coreboot

Change-Id: I27cb1a2175beb189053fc3e44b17b60aba474bb0
Signed-off-by: Yu-Ping Wu <yupingso@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/36845
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
src/security/vboot/bootmode.c
src/security/vboot/common.c
src/security/vboot/misc.h
src/security/vboot/vboot_loader.c
src/security/vboot/vboot_logic.c