public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] MdePkg/BaseCacheMaintenanceLib: RISC-V: Fix instruction cache not been invalidated
@ 2023-03-06 17:10 Tuan Phan
  2023-03-10  5:59 ` Sunil V L
  0 siblings, 1 reply; 4+ messages in thread
From: Tuan Phan @ 2023-03-06 17:10 UTC (permalink / raw)
  To: devel; +Cc: michael.d.kinney, gaoliming, zhiguang.liu, sunilvl, git,
	Tuan Phan

When the range instruction cache invalidating not supported, the whole
instruction cache should be invalidated instead.

Signed-off-by: Tuan Phan <tphan@ventanamicro.com>
---
 MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c b/MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c
index 67a3387ff3c6..a744b2a6f889 100644
--- a/MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c
+++ b/MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c
@@ -76,7 +76,10 @@ 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;
 }
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] MdePkg/BaseCacheMaintenanceLib: RISC-V: Fix instruction cache not been invalidated
  2023-03-06 17:10 [PATCH] MdePkg/BaseCacheMaintenanceLib: RISC-V: Fix instruction cache not been invalidated Tuan Phan
@ 2023-03-10  5:59 ` Sunil V L
  2023-03-10 21:50   ` [PATCH v2] " Tuan Phan
  0 siblings, 1 reply; 4+ messages in thread
From: Sunil V L @ 2023-03-10  5:59 UTC (permalink / raw)
  To: Tuan Phan; +Cc: devel, michael.d.kinney, gaoliming, zhiguang.liu, git

On Mon, Mar 06, 2023 at 09:10:58AM -0800, Tuan Phan wrote:
> When the range instruction cache invalidating not supported, the whole
> instruction cache should be invalidated instead.
> 
> Signed-off-by: Tuan Phan <tphan@ventanamicro.com>
> ---
>  MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c b/MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c
> index 67a3387ff3c6..a744b2a6f889 100644
> --- a/MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c
> +++ b/MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c
> @@ -76,7 +76,10 @@ 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__));
Hi Tuan,

Please run uncrustify and fix the error at this line.

Thanks,
Sunil

> +  InvalidateInstructionCache ();
>    return Address;
>  }
>  
> -- 
> 2.25.1
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] MdePkg/BaseCacheMaintenanceLib: RISC-V: Fix instruction cache not been invalidated
  2023-03-10  5:59 ` Sunil V L
@ 2023-03-10 21:50   ` Tuan Phan
  2023-03-15  5:21     ` Sunil V L
  0 siblings, 1 reply; 4+ messages in thread
From: Tuan Phan @ 2023-03-10 21:50 UTC (permalink / raw)
  To: devel
  Cc: michael.d.kinney, gaoliming, zhiguang.liu, sunilvl, git,
	andrei.warkentin, Tuan Phan

When the range instruction cache invalidating not supported, the whole
instruction cache should be invalidated instead.

Signed-off-by: Tuan Phan <tphan@ventanamicro.com>
---
  V2:
  - Format with uncrustify.

 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 67a3387ff3c6..09de53fb5687 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;
 }
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] MdePkg/BaseCacheMaintenanceLib: RISC-V: Fix instruction cache not been invalidated
  2023-03-10 21:50   ` [PATCH v2] " Tuan Phan
@ 2023-03-15  5:21     ` Sunil V L
  0 siblings, 0 replies; 4+ messages in thread
From: Sunil V L @ 2023-03-15  5:21 UTC (permalink / raw)
  To: Tuan Phan
  Cc: devel, michael.d.kinney, gaoliming, zhiguang.liu, git,
	andrei.warkentin

On Fri, Mar 10, 2023 at 01:50:19PM -0800, Tuan Phan wrote:
> When the range instruction cache invalidating not supported, the whole
> instruction cache should be invalidated instead.
> 
> Signed-off-by: Tuan Phan <tphan@ventanamicro.com>
> ---
>   V2:
>   - Format with uncrustify.
> 

Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-03-15  5:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-06 17:10 [PATCH] MdePkg/BaseCacheMaintenanceLib: RISC-V: Fix instruction cache not been invalidated Tuan Phan
2023-03-10  5:59 ` Sunil V L
2023-03-10 21:50   ` [PATCH v2] " Tuan Phan
2023-03-15  5:21     ` Sunil V L

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox