From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=fail (domain: intel.com, ip: , mailfrom: michael.d.kinney@intel.com) Received: from mga18.intel.com (mga18.intel.com []) by groups.io with SMTP; Sun, 30 Jun 2019 19:56:09 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Jun 2019 19:56:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,437,1557212400"; d="scan'208";a="338480245" Received: from mdkinney-mobl2.amr.corp.intel.com ([10.251.143.61]) by orsmga005.jf.intel.com with ESMTP; 30 Jun 2019 19:56:07 -0700 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Zailiang Sun , Yi Qian Subject: [edk2-platforms Patch 11/14] Vlv2TbltDevicePkg: Update boot mode/state behaviors Date: Sun, 30 Jun 2019 19:55:50 -0700 Message-Id: <20190701025553.18596-12-michael.d.kinney@intel.com> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20190701025553.18596-1-michael.d.kinney@intel.com> References: <20190701025553.18596-1-michael.d.kinney@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit * Add platform specific PcdBootState PCD to remove Intel Framework dependency * Set PcdUserPhysicalPresence to TRUE to Enable UEFI Secure Boot Setup Menus * Remove unused code when NOCS_S3_SUPPORT is not set * Update PlatformBootManagerLib to not perform a connect all when FastBoot is enabled. * Add support for BOOT_ON_FLASH_UPDATE * Remove logic in CheckSystemConfigSave() that was generating an ASSERT() when setup changes were saved. Cc: Zailiang Sun Cc: Yi Qian Signed-off-by: Michael D Kinney --- .../DxePlatformBootManagerLib/BdsPlatform.c | 33 ++++++- .../DxePlatformBootManagerLib.inf | 4 +- .../PlatformDxe/PlatformDxe.inf | 1 - .../Vlv2TbltDevicePkg/PlatformPei/BootMode.c | 99 +------------------ .../Vlv2TbltDevicePkg/PlatformPei/Platform.c | 8 -- .../Vlv2TbltDevicePkg/PlatformPei/Platform.h | 27 +---- .../Intel/Vlv2TbltDevicePkg/PlatformPkg.dec | 8 ++ .../Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc | 2 + .../Vlv2TbltDevicePkg/PlatformPkgIA32.dsc | 2 + .../Vlv2TbltDevicePkg/PlatformPkgX64.dsc | 2 + .../PlatformSetupDxe/PlatformSetupDxe.inf | 1 - .../PlatformSetupDxe/SetupInfoRecords.c | 51 ---------- 12 files changed, 51 insertions(+), 187 deletions(-) diff --git a/Platform/Intel/Vlv2TbltDevicePkg/Library/DxePlatformBootManagerLib/BdsPlatform.c b/Platform/Intel/Vlv2TbltDevicePkg/Library/DxePlatformBootManagerLib/BdsPlatform.c index 4dd3827a6e..7fbbf281c6 100644 --- a/Platform/Intel/Vlv2TbltDevicePkg/Library/DxePlatformBootManagerLib/BdsPlatform.c +++ b/Platform/Intel/Vlv2TbltDevicePkg/Library/DxePlatformBootManagerLib/BdsPlatform.c @@ -1,7 +1,7 @@ /** @file This file include all platform action which can be customized by IBV/OEM. -Copyright (c) 2017, Intel Corporation. All rights reserved.
+Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -1164,7 +1164,7 @@ PlatformBootManagerBeforeConsole ( // Fill ConIn/ConOut in Full Configuration boot mode // gBootMode = GetBootModeHob(); - DEBUG ((DEBUG_INFO, "PlatformBootManagerInit - %x\n", gBootMode)); + DEBUG ((DEBUG_INFO, "PlatformBootManagerBeforeConsole: BootMode = %x\n", gBootMode)); if (gBootMode == BOOT_WITH_FULL_CONFIGURATION || gBootMode == BOOT_WITH_DEFAULT_SETTINGS || @@ -1263,7 +1263,18 @@ ConnectSequence ( IN EFI_BOOT_MODE BootMode ) { - EfiBootManagerConnectAll (); + switch (BootMode) { + case BOOT_ASSUMING_NO_CONFIGURATION_CHANGES: + case BOOT_WITH_MINIMAL_CONFIGURATION: + case BOOT_ON_S4_RESUME: + break; + case BOOT_WITH_FULL_CONFIGURATION: + case BOOT_WITH_FULL_CONFIGURATION_PLUS_DIAGNOSTICS: + case BOOT_WITH_DEFAULT_SETTINGS: + default: + EfiBootManagerConnectAll (); + break; + } } /** @@ -1311,6 +1322,7 @@ PlatformBootManagerAfterConsole ( VOID ) { + EFI_STATUS Status; EFI_BOOT_MODE LocalBootMode; DEBUG ((DEBUG_INFO, "PlatformBootManagerAfterConsole\n")); @@ -1319,7 +1331,7 @@ PlatformBootManagerAfterConsole ( // Get current Boot Mode // LocalBootMode = gBootMode; - DEBUG ((DEBUG_INFO, "Current local bootmode - %x\n", LocalBootMode)); + DEBUG ((DEBUG_INFO, "PlatformBootManagerAfterConsole: BootMode = %x\n", gBootMode)); // // Logo show @@ -1372,6 +1384,19 @@ PlatformBootManagerAfterConsole ( break; } + // + // Use a DynamicHii type pcd to save the boot status, which is used to + // control configuration mode, such as FULL/MINIMAL/NO_CHANGES configuration. + // + DEBUG ((DEBUG_INFO, "PcdBootState = %d\n", PcdGetBool(PcdBootState))); + if (PcdGetBool(PcdBootState)) { + Status = PcdSetBoolS(PcdBootState, FALSE); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "Set PcdBootState to FALSE failed.\n")); + } + DEBUG ((DEBUG_INFO, "PcdBootState = %d\n", PcdGetBool(PcdBootState))); + } + Print (L"Press F7 for BootMenu!\n"); EfiBootManagerRefreshAllBootOption (); diff --git a/Platform/Intel/Vlv2TbltDevicePkg/Library/DxePlatformBootManagerLib/DxePlatformBootManagerLib.inf b/Platform/Intel/Vlv2TbltDevicePkg/Library/DxePlatformBootManagerLib/DxePlatformBootManagerLib.inf index b04169ad33..0579a18660 100644 --- a/Platform/Intel/Vlv2TbltDevicePkg/Library/DxePlatformBootManagerLib/DxePlatformBootManagerLib.inf +++ b/Platform/Intel/Vlv2TbltDevicePkg/Library/DxePlatformBootManagerLib/DxePlatformBootManagerLib.inf @@ -1,7 +1,7 @@ ### @file # Component name for module DxePlatformBootManagerLib # -# Copyright (c) 2017, Intel Corporation. All rights reserved.
+# Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -48,6 +48,7 @@ [Packages] MdeModulePkg/MdeModulePkg.dec SecurityPkg/SecurityPkg.dec MinPlatformPkg/MinPlatformPkg.dec + Vlv2TbltDevicePkg/PlatformPkg.dec [Pcd] gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable ## CONSUMES @@ -66,6 +67,7 @@ [Pcd] gMinPlatformPkgTokenSpaceGuid.PcdTrustedConsoleInputDevicePath ## CONSUMES gMinPlatformPkgTokenSpaceGuid.PcdTrustedConsoleOutputDevicePath ## CONSUMES gMinPlatformPkgTokenSpaceGuid.PcdTrustedStorageDevicePath ## CONSUMES + gPlatformModuleTokenSpaceGuid.PcdBootState [Sources] BdsPlatform.c diff --git a/Platform/Intel/Vlv2TbltDevicePkg/PlatformDxe/PlatformDxe.inf b/Platform/Intel/Vlv2TbltDevicePkg/PlatformDxe/PlatformDxe.inf index a9ef744ef7..9fee691365 100644 --- a/Platform/Intel/Vlv2TbltDevicePkg/PlatformDxe/PlatformDxe.inf +++ b/Platform/Intel/Vlv2TbltDevicePkg/PlatformDxe/PlatformDxe.inf @@ -84,7 +84,6 @@ [Guids] gEfiGlobalVariableGuid gEfiEventExitBootServicesGuid gEfiVlv2VariableGuid - gEfiSecureBootEnableDisableGuid gEfiEndOfDxeEventGroupGuid [Protocols] diff --git a/Platform/Intel/Vlv2TbltDevicePkg/PlatformPei/BootMode.c b/Platform/Intel/Vlv2TbltDevicePkg/PlatformPei/BootMode.c index 9fdcb620a3..5269b1ed39 100644 --- a/Platform/Intel/Vlv2TbltDevicePkg/PlatformPei/BootMode.c +++ b/Platform/Intel/Vlv2TbltDevicePkg/PlatformPei/BootMode.c @@ -1,11 +1,9 @@ /** @file - Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.
- + Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent - - Module Name: @@ -84,6 +82,7 @@ CapsulePpiNotifyCallback ( if (Status == EFI_SUCCESS) { if (Capsule->CheckCapsuleUpdate ((EFI_PEI_SERVICES**)PeiServices) == EFI_SUCCESS) { BootMode = BOOT_ON_FLASH_UPDATE; + DEBUG ((EFI_D_ERROR, "Setting BootMode to BOOT_ON_FLASH_UPDATE\n")); Status = (*PeiServices)->SetBootMode((const EFI_PEI_SERVICES **)PeiServices, BootMode); ASSERT_EFI_ERROR (Status); } @@ -93,98 +92,6 @@ CapsulePpiNotifyCallback ( return Status; } -#ifdef NOCS_S3_SUPPORT -EFI_STATUS -UpdateBootMode ( - IN CONST EFI_PEI_SERVICES **PeiServices - ) -{ - EFI_STATUS Status; - EFI_BOOT_MODE BootMode; - UINT16 SleepType; - CHAR16 *strBootMode; - - Status = (*PeiServices)->GetBootMode(PeiServices, &BootMode); - ASSERT_EFI_ERROR (Status); - if (BootMode == BOOT_IN_RECOVERY_MODE){ - return Status; - } - - // - // Let's assume things are OK if not told otherwise - // - BootMode = BOOT_WITH_FULL_CONFIGURATION; - - if (GetSleepTypeAfterWakeup (PeiServices, &SleepType)) { - switch (SleepType) { - case V_PCH_ACPI_PM1_CNT_S3: - BootMode = BOOT_ON_S3_RESUME; - Status = (*PeiServices)->NotifyPpi (PeiServices, &mCapsuleNotifyList[0]); - ASSERT_EFI_ERROR (Status); - break; - - case V_PCH_ACPI_PM1_CNT_S4: - BootMode = BOOT_ON_S4_RESUME; - break; - - case V_PCH_ACPI_PM1_CNT_S5: - BootMode = BOOT_ON_S5_RESUME; - break; - } // switch (SleepType) - } - - if (IsFastBootEnabled (PeiServices)) { - DEBUG ((EFI_D_INFO, "Prioritizing Boot mode to BOOT_WITH_MINIMAL_CONFIGURATION\n")); - PrioritizeBootMode (&BootMode, BOOT_WITH_MINIMAL_CONFIGURATION); - } - - switch (BootMode) { - case BOOT_WITH_FULL_CONFIGURATION: - strBootMode = L"BOOT_WITH_FULL_CONFIGURATION"; - break; - case BOOT_WITH_MINIMAL_CONFIGURATION: - strBootMode = L"BOOT_WITH_MINIMAL_CONFIGURATION"; - break; - case BOOT_ASSUMING_NO_CONFIGURATION_CHANGES: - strBootMode = L"BOOT_ASSUMING_NO_CONFIGURATION_CHANGES"; - break; - case BOOT_WITH_FULL_CONFIGURATION_PLUS_DIAGNOSTICS: - strBootMode = L"BOOT_WITH_FULL_CONFIGURATION_PLUS_DIAGNOSTICS"; - break; - case BOOT_WITH_DEFAULT_SETTINGS: - strBootMode = L"BOOT_WITH_DEFAULT_SETTINGS"; - break; - case BOOT_ON_S4_RESUME: - strBootMode = L"BOOT_ON_S4_RESUME"; - break; - case BOOT_ON_S5_RESUME: - strBootMode = L"BOOT_ON_S5_RESUME"; - break; - case BOOT_ON_S2_RESUME: - strBootMode = L"BOOT_ON_S2_RESUME"; - break; - case BOOT_ON_S3_RESUME: - strBootMode = L"BOOT_ON_S3_RESUME"; - - break; - case BOOT_ON_FLASH_UPDATE: - strBootMode = L"BOOT_ON_FLASH_UPDATE"; - break; - case BOOT_IN_RECOVERY_MODE: - strBootMode = L"BOOT_IN_RECOVERY_MODE"; - break; - default: - strBootMode = L"Unknown boot mode"; - } // switch (BootMode) - - DEBUG ((EFI_D_ERROR, "Setting BootMode to %s\n", strBootMode)); - Status = (*PeiServices)->SetBootMode(PeiServices, BootMode); - ASSERT_EFI_ERROR (Status); - - return Status; -} -#endif - /** Get sleep type after wakeup diff --git a/Platform/Intel/Vlv2TbltDevicePkg/PlatformPei/Platform.c b/Platform/Intel/Vlv2TbltDevicePkg/PlatformPei/Platform.c index aa03f6ea95..90998871dc 100644 --- a/Platform/Intel/Vlv2TbltDevicePkg/PlatformPei/Platform.c +++ b/Platform/Intel/Vlv2TbltDevicePkg/PlatformPei/Platform.c @@ -813,14 +813,6 @@ PeiInitPlatform ( sizeof (EFI_PLATFORM_INFO_HOB) ); - // - // Set the new boot mode for MRC - // -#ifdef NOCS_S3_SUPPORT - Status = UpdateBootMode (PeiServices); - ASSERT_EFI_ERROR (Status); -#endif - DEBUG((EFI_D_INFO, "Setup MMIO size ... \n\n")); // diff --git a/Platform/Intel/Vlv2TbltDevicePkg/PlatformPei/Platform.h b/Platform/Intel/Vlv2TbltDevicePkg/PlatformPei/Platform.h index e1817b28c6..4f71e519e0 100644 --- a/Platform/Intel/Vlv2TbltDevicePkg/PlatformPei/Platform.h +++ b/Platform/Intel/Vlv2TbltDevicePkg/PlatformPei/Platform.h @@ -1,12 +1,9 @@ /*++ - Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.
- + Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent - - - **/ @@ -24,26 +21,6 @@ typedef struct { #define STALL_PEIM_FROM_THIS(a) CR (a, STALL_CALLBACK_STATE_INFORMATION, StallNotify, STALL_PEIM_SIGNATURE) -#ifdef NOCS_S3_SUPPORT - -/** - Peform the boot mode determination logic - If the box is closed, then - 1. If it's first time to boot, it's boot with full config . - 2. If the ChassisIntrution is selected, force to be a boot with full config - 3. Otherwise it's boot with no change. - - @param PeiServices General purpose services available to every PEIM. - @param BootMode The detected boot mode. - - @retval EFI_SUCCESS if the boot mode could be set -**/ -EFI_STATUS -UpdateBootMode ( - IN CONST EFI_PEI_SERVICES **PeiServices - ); -#endif - /** This function reset the entire platform, including all processor and devices, and reboots the system. diff --git a/Platform/Intel/Vlv2TbltDevicePkg/PlatformPkg.dec b/Platform/Intel/Vlv2TbltDevicePkg/PlatformPkg.dec index 5b255f4b05..a5c7062cbb 100644 --- a/Platform/Intel/Vlv2TbltDevicePkg/PlatformPkg.dec +++ b/Platform/Intel/Vlv2TbltDevicePkg/PlatformPkg.dec @@ -161,6 +161,14 @@ [PcdsDynamic,PcdsDynamicEx] gPlatformModuleTokenSpaceGuid.PcdInConfigMode|FALSE|BOOLEAN|0x80000001 gPlatformModuleTokenSpaceGuid.PcdConnectUSBKeyboardonWaitForKeyStroke|FALSE|BOOLEAN|0x80000002 gPlatformModuleTokenSpaceGuid.PcdEnableWatchdogSwSmiInputValue|0|UINT8|0x80000003 + + ## Indicates if the machine has completed one boot cycle before. + # After the complete boot, BootState will be set to FALSE.

+ # TRUE - The complete boot cycle has not happened before.
+ # FALSE - The complete boot cycle has happened before.
+ # @Prompt Boot State Flag + gPlatformModuleTokenSpaceGuid.PcdBootState|TRUE|BOOLEAN|0x80000004 + # #device firmware update support # diff --git a/Platform/Intel/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc b/Platform/Intel/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc index e4c6750c70..2123745ccd 100644 --- a/Platform/Intel/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc +++ b/Platform/Intel/Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc @@ -680,6 +680,7 @@ [PcdsPatchableInModule.common] [PcdsDynamicHii.common.DEFAULT] gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|L"Timeout"|gEfiGlobalVariableGuid|0x0|5 # Variable: L"Timeout" gEfiMdePkgTokenSpaceGuid.PcdHardwareErrorRecordLevel|L"HwErrRecSupport"|gEfiGlobalVariableGuid|0x0|1 # Variable: L"HwErrRecSupport" + gPlatformModuleTokenSpaceGuid.PcdBootState|L"BootState"|gPlatformModuleTokenSpaceGuid|0x0|TRUE [PcdsDynamicDefault.common.DEFAULT] gEfiMdeModulePkgTokenSpaceGuid.PcdS3BootScriptTablePrivateDataPtr|0x0 @@ -733,6 +734,7 @@ [PcdsDynamicExDefault.common.DEFAULT] gEfiVLVTokenSpaceGuid.PcdCpuLockBoxDataAddress|0 gEfiVLVTokenSpaceGuid.PcdCpuSmramCpuDataAddress|0 gEfiVLVTokenSpaceGuid.PcdCpuLockBoxSize|0 + gEfiSecurityPkgTokenSpaceGuid.PcdUserPhysicalPresence|TRUE [PcdsDynamicExDefault.X64.DEFAULT] !if $(RECOVERY_ENABLE) diff --git a/Platform/Intel/Vlv2TbltDevicePkg/PlatformPkgIA32.dsc b/Platform/Intel/Vlv2TbltDevicePkg/PlatformPkgIA32.dsc index f5795e5ab0..086668d570 100644 --- a/Platform/Intel/Vlv2TbltDevicePkg/PlatformPkgIA32.dsc +++ b/Platform/Intel/Vlv2TbltDevicePkg/PlatformPkgIA32.dsc @@ -677,6 +677,7 @@ [PcdsPatchableInModule.common] [PcdsDynamicHii.common.DEFAULT] gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|L"Timeout"|gEfiGlobalVariableGuid|0x0|5 # Variable: L"Timeout" gEfiMdePkgTokenSpaceGuid.PcdHardwareErrorRecordLevel|L"HwErrRecSupport"|gEfiGlobalVariableGuid|0x0|1 # Variable: L"HwErrRecSupport" + gPlatformModuleTokenSpaceGuid.PcdBootState|L"BootState"|gPlatformModuleTokenSpaceGuid|0x0|TRUE [PcdsDynamicDefault.common.DEFAULT] gEfiMdeModulePkgTokenSpaceGuid.PcdS3BootScriptTablePrivateDataPtr|0x0 @@ -730,6 +731,7 @@ [PcdsDynamicExDefault.common.DEFAULT] gEfiVLVTokenSpaceGuid.PcdCpuLockBoxDataAddress|0 gEfiVLVTokenSpaceGuid.PcdCpuSmramCpuDataAddress|0 gEfiVLVTokenSpaceGuid.PcdCpuLockBoxSize|0 + gEfiSecurityPkgTokenSpaceGuid.PcdUserPhysicalPresence|TRUE [PcdsDynamicExDefault.X64.DEFAULT] !if $(RECOVERY_ENABLE) diff --git a/Platform/Intel/Vlv2TbltDevicePkg/PlatformPkgX64.dsc b/Platform/Intel/Vlv2TbltDevicePkg/PlatformPkgX64.dsc index a930a85a35..5f2dd65ec8 100644 --- a/Platform/Intel/Vlv2TbltDevicePkg/PlatformPkgX64.dsc +++ b/Platform/Intel/Vlv2TbltDevicePkg/PlatformPkgX64.dsc @@ -679,6 +679,7 @@ [PcdsPatchableInModule.common] [PcdsDynamicHii.common.DEFAULT] gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|L"Timeout"|gEfiGlobalVariableGuid|0x0|5 # Variable: L"Timeout" gEfiMdePkgTokenSpaceGuid.PcdHardwareErrorRecordLevel|L"HwErrRecSupport"|gEfiGlobalVariableGuid|0x0|1 # Variable: L"HwErrRecSupport" + gPlatformModuleTokenSpaceGuid.PcdBootState|L"BootState"|gPlatformModuleTokenSpaceGuid|0x0|TRUE [PcdsDynamicDefault.common.DEFAULT] gEfiMdeModulePkgTokenSpaceGuid.PcdS3BootScriptTablePrivateDataPtr|0x0 @@ -732,6 +733,7 @@ [PcdsDynamicExDefault.common.DEFAULT] gEfiVLVTokenSpaceGuid.PcdCpuLockBoxDataAddress|0 gEfiVLVTokenSpaceGuid.PcdCpuSmramCpuDataAddress|0 gEfiVLVTokenSpaceGuid.PcdCpuLockBoxSize|0 + gEfiSecurityPkgTokenSpaceGuid.PcdUserPhysicalPresence|TRUE [PcdsDynamicExDefault.X64.DEFAULT] !if $(RECOVERY_ENABLE) diff --git a/Platform/Intel/Vlv2TbltDevicePkg/PlatformSetupDxe/PlatformSetupDxe.inf b/Platform/Intel/Vlv2TbltDevicePkg/PlatformSetupDxe/PlatformSetupDxe.inf index b745574421..85e8b1e8d6 100644 --- a/Platform/Intel/Vlv2TbltDevicePkg/PlatformSetupDxe/PlatformSetupDxe.inf +++ b/Platform/Intel/Vlv2TbltDevicePkg/PlatformSetupDxe/PlatformSetupDxe.inf @@ -93,7 +93,6 @@ [Guids] gEfiIfrTianoGuid ## CONSUMES ## Guid gEfiPlatformInfoGuid gEfiNormalSetupGuid - gEfiSecureBootEnableDisableGuid gOsSelectionVariableGuid gEfiGlobalVariableGuid diff --git a/Platform/Intel/Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c b/Platform/Intel/Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c index efd4a723e1..be99356d0f 100644 --- a/Platform/Intel/Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c +++ b/Platform/Intel/Vlv2TbltDevicePkg/PlatformSetupDxe/SetupInfoRecords.c @@ -1448,60 +1448,9 @@ CheckSystemConfigLoad(SYSTEM_CONFIGURATION *SystemConfigPtr) } } - -// -// "SecureBootEnable" variable for the Secure boot feature enable/disable. -// -#define EFI_SECURE_BOOT_ENABLE_NAME L"SecureBootEnable" -extern EFI_GUID gEfiSecureBootEnableDisableGuid; - - VOID CheckSystemConfigSave(SYSTEM_CONFIGURATION *SystemConfigPtr) { - EFI_STATUS Status; - UINT8 SecureBootCfg; - BOOLEAN SecureBootNotFound; - UINTN DataSize; - - - // - // Secure Boot configuration changes - // - DataSize = sizeof(SecureBootCfg); - SecureBootNotFound = FALSE; - Status = gRT->GetVariable ( - EFI_SECURE_BOOT_ENABLE_NAME, - &gEfiSecureBootEnableDisableGuid, - NULL, - &DataSize, - &SecureBootCfg - ); - - if (EFI_ERROR(Status)) { - SecureBootNotFound = TRUE; - } - if (SecureBootNotFound) { - Status = gRT->GetVariable ( - EFI_SECURE_BOOT_ENABLE_NAME, - &gEfiSecureBootEnableDisableGuid, - NULL, - &DataSize, - &SecureBootCfg - ); - ASSERT_EFI_ERROR(Status); - } - if ((SecureBootCfg) != SystemConfigPtr->SecureBoot) { - SecureBootCfg = !SecureBootCfg; - Status = gRT->SetVariable ( - EFI_SECURE_BOOT_ENABLE_NAME, - &gEfiSecureBootEnableDisableGuid, - EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS, - sizeof (UINT8), - &SecureBootCfg - ); - } - } VOID -- 2.21.0.windows.1