public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Tuan Phan" <tphan@ventanamicro.com>
To: devel@edk2.groups.io
Cc: michael.d.kinney@intel.com, gaoliming@byosoft.com.cn,
	zhiguang.liu@intel.com, sunilvl@ventanamicro.com,
	git@danielschaefer.me, andrei.warkentin@intel.com,
	Tuan Phan <tphan@ventanamicro.com>
Subject: [PATCH v2] MdePkg/BaseCacheMaintenanceLib: RISC-V: Fix instruction cache not been invalidated
Date: Fri, 10 Mar 2023 13:50:19 -0800	[thread overview]
Message-ID: <20230310215019.29783-1-tphan@ventanamicro.com> (raw)
In-Reply-To: <ZArHTn/3aNyuPdzk@sunil-laptop>

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


  reply	other threads:[~2023-03-10 21:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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   ` Tuan Phan [this message]
2023-03-15  5:21     ` [PATCH v2] " Sunil V L

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230310215019.29783-1-tphan@ventanamicro.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox