From 9aa774f6357d97297ae09b5ad139a5cf2a86867c Mon Sep 17 00:00:00 2001 From: Maurice Ma Date: Wed, 13 Oct 2021 14:42:34 -0700 Subject: [PATCH] Issue cache flush before FWU reset in Shell Since the commit below was reverted 24f5aa59b5b15638cd7ee8f1772bc4b793e02048. The cache flush need to be moved into the place where data consistency across warm reset is required. The patch added the WBINVD to flush the cache before "fwupdate" command issues warm reset. Signed-off-by: Maurice Ma --- .../ApollolakeBoardPkg/Library/ShellExtensionLib/CmdFwUpdate.c | 1 + .../CoffeelakeBoardPkg/Library/ShellExtensionLib/CmdFwUpdate.c | 1 + .../CometlakeBoardPkg/Library/ShellExtensionLib/CmdFwUpdate.c | 1 + .../CometlakevBoardPkg/Library/ShellExtensionLib/CmdFwUpdate.c | 1 + .../ElkhartlakeBoardPkg/Library/ShellExtensionLib/CmdFwUpdate.c | 1 + .../TigerlakeBoardPkg/Library/ShellExtensionLib/CmdFwUpdate.c | 1 + 6 files changed, 6 insertions(+) diff --git a/Platform/ApollolakeBoardPkg/Library/ShellExtensionLib/CmdFwUpdate.c b/Platform/ApollolakeBoardPkg/Library/ShellExtensionLib/CmdFwUpdate.c index d746708b..8214402c 100644 --- a/Platform/ApollolakeBoardPkg/Library/ShellExtensionLib/CmdFwUpdate.c +++ b/Platform/ApollolakeBoardPkg/Library/ShellExtensionLib/CmdFwUpdate.c @@ -178,6 +178,7 @@ ShellCommandFwUpdateFunc ( // PlatformService = (PLATFORM_SERVICE *) GetServiceBySignature (PLATFORM_SERVICE_SIGNATURE); if (PlatformService != NULL && PlatformService->ResetSystem != NULL) { + AsmWbinvd (); PlatformService->ResetSystem(EfiResetWarm); } diff --git a/Platform/CoffeelakeBoardPkg/Library/ShellExtensionLib/CmdFwUpdate.c b/Platform/CoffeelakeBoardPkg/Library/ShellExtensionLib/CmdFwUpdate.c index 8704c3d9..7260e21b 100644 --- a/Platform/CoffeelakeBoardPkg/Library/ShellExtensionLib/CmdFwUpdate.c +++ b/Platform/CoffeelakeBoardPkg/Library/ShellExtensionLib/CmdFwUpdate.c @@ -78,6 +78,7 @@ ShellCommandFwUpdateFunc ( // PlatformService = (PLATFORM_SERVICE *) GetServiceBySignature (PLATFORM_SERVICE_SIGNATURE); if (PlatformService != NULL && PlatformService->ResetSystem != NULL) { + AsmWbinvd (); PlatformService->ResetSystem(EfiResetWarm); } diff --git a/Platform/CometlakeBoardPkg/Library/ShellExtensionLib/CmdFwUpdate.c b/Platform/CometlakeBoardPkg/Library/ShellExtensionLib/CmdFwUpdate.c index 8704c3d9..7260e21b 100644 --- a/Platform/CometlakeBoardPkg/Library/ShellExtensionLib/CmdFwUpdate.c +++ b/Platform/CometlakeBoardPkg/Library/ShellExtensionLib/CmdFwUpdate.c @@ -78,6 +78,7 @@ ShellCommandFwUpdateFunc ( // PlatformService = (PLATFORM_SERVICE *) GetServiceBySignature (PLATFORM_SERVICE_SIGNATURE); if (PlatformService != NULL && PlatformService->ResetSystem != NULL) { + AsmWbinvd (); PlatformService->ResetSystem(EfiResetWarm); } diff --git a/Platform/CometlakevBoardPkg/Library/ShellExtensionLib/CmdFwUpdate.c b/Platform/CometlakevBoardPkg/Library/ShellExtensionLib/CmdFwUpdate.c index 8704c3d9..7260e21b 100644 --- a/Platform/CometlakevBoardPkg/Library/ShellExtensionLib/CmdFwUpdate.c +++ b/Platform/CometlakevBoardPkg/Library/ShellExtensionLib/CmdFwUpdate.c @@ -78,6 +78,7 @@ ShellCommandFwUpdateFunc ( // PlatformService = (PLATFORM_SERVICE *) GetServiceBySignature (PLATFORM_SERVICE_SIGNATURE); if (PlatformService != NULL && PlatformService->ResetSystem != NULL) { + AsmWbinvd (); PlatformService->ResetSystem(EfiResetWarm); } diff --git a/Platform/ElkhartlakeBoardPkg/Library/ShellExtensionLib/CmdFwUpdate.c b/Platform/ElkhartlakeBoardPkg/Library/ShellExtensionLib/CmdFwUpdate.c index 26dcdc18..bce39685 100644 --- a/Platform/ElkhartlakeBoardPkg/Library/ShellExtensionLib/CmdFwUpdate.c +++ b/Platform/ElkhartlakeBoardPkg/Library/ShellExtensionLib/CmdFwUpdate.c @@ -75,6 +75,7 @@ ShellCommandFwUpdateFunc ( // PlatformService = (PLATFORM_SERVICE *) GetServiceBySignature (PLATFORM_SERVICE_SIGNATURE); if (PlatformService != NULL && PlatformService->ResetSystem != NULL) { + AsmWbinvd (); PlatformService->ResetSystem(EfiResetWarm); } diff --git a/Platform/TigerlakeBoardPkg/Library/ShellExtensionLib/CmdFwUpdate.c b/Platform/TigerlakeBoardPkg/Library/ShellExtensionLib/CmdFwUpdate.c index 1375650b..33ce4ce7 100644 --- a/Platform/TigerlakeBoardPkg/Library/ShellExtensionLib/CmdFwUpdate.c +++ b/Platform/TigerlakeBoardPkg/Library/ShellExtensionLib/CmdFwUpdate.c @@ -78,6 +78,7 @@ ShellCommandFwUpdateFunc ( // PlatformService = (PLATFORM_SERVICE *) GetServiceBySignature (PLATFORM_SERVICE_SIGNATURE); if (PlatformService != NULL && PlatformService->ResetSystem != NULL) { + AsmWbinvd (); PlatformService->ResetSystem(EfiResetWarm); }