From 997c6967b00cdd797fe787567a28a7565aafd301 Mon Sep 17 00:00:00 2001 From: Tuan Phan Date: Fri, 10 Mar 2023 13:50:19 -0800 Subject: [PATCH] MdePkg/BaseCacheMaintenanceLib: RISC-V: Fix InvalidateInstructionCacheRange When the range instruction cache invalidating not supported, the whole instruction cache should be invalidated instead. Signed-off-by: Tuan Phan Reviewed-by: Sunil V L --- MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c b/MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c index 67a3387ff3..9a6d57d841 100644 --- a/MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c +++ b/MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c @@ -76,7 +76,12 @@ InvalidateInstructionCacheRange ( IN UINTN Length ) { - DEBUG ((DEBUG_ERROR, "%a:RISC-V unsupported function.\n", __FUNCTION__)); + DEBUG ( + (DEBUG_WARN, + "%a:RISC-V unsupported function.\n" + "Invalidating the whole instruction cache instead.\n", __func__) + ); + InvalidateInstructionCache (); return Address; }