From fb4f8e4e560e280d029027bfe710528e0145631e Mon Sep 17 00:00:00 2001 From: "Yang,Yu-chu" Date: Wed, 10 Mar 2021 19:54:33 -0800 Subject: [PATCH] config-tools: fix "is_tpm_passthru" always return "False" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "is_tpm_passthru" would always return "False" with the existing logic. 1. Replace "get_leaf_tag_map_bool" with "get_leaf_tag_map". Instead returning a dictrionary with boolean diction values, just get the string value. 2. Return "True" if any vm has enabled the passtrhough tpm with option "y". Tracked-On: #5710 Signed-off-by: Yang,Yu-chu --- misc/config_tools/library/board_cfg_lib.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/misc/config_tools/library/board_cfg_lib.py b/misc/config_tools/library/board_cfg_lib.py index 98d9175f5..529c2819a 100644 --- a/misc/config_tools/library/board_cfg_lib.py +++ b/misc/config_tools/library/board_cfg_lib.py @@ -612,8 +612,8 @@ def is_tpm_passthru(): tpm_passthru = False (_, board) = common.get_board_name() - tpm2_passthru_enabled = common.get_leaf_tag_map_bool(common.SCENARIO_INFO_FILE, "mmio_resources", "TPM2") - if board in TPM_PASSTHRU_BOARD and tpm2_passthru_enabled and tpm2_passthru_enabled == 'y': + tpm2_passthru_enabled = common.get_leaf_tag_map(common.SCENARIO_INFO_FILE, "mmio_resources", "TPM2") + if board in TPM_PASSTHRU_BOARD and tpm2_passthru_enabled and 'y' in tpm2_passthru_enabled.values(): tpm_passthru = True return tpm_passthru