From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) by mx.groups.io with SMTP id smtpd.web11.334.1678122666091432129 for ; Mon, 06 Mar 2023 09:11:06 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@ventanamicro.com header.s=google header.b=mkoeW8hb; spf=pass (domain: ventanamicro.com, ip: 209.85.214.180, mailfrom: tphan@ventanamicro.com) Received: by mail-pl1-f180.google.com with SMTP id x11so6624305pln.12 for ; Mon, 06 Mar 2023 09:11:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1678122665; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=idLm4xt2wLeXxh/J+xJRAoErdXhac2e5ejczLh6rw2Y=; b=mkoeW8hbiDs3LW9zREznf1rJZdlEFq1x0O+Z7JwK/xtpky1ZxtezJLR1DwDZKw9tQ2 LWhLeQD20o+RmrSKq+hQqdcdjMDXvacozhgGTCiKdXOg1nUk4rQ98MdTpaMU435+Jj/L UxfCl5xP3IeubfjYOPO7jOTypDIREM8dWXkd0wawYBV996RN2IRYdBZF8F9DrX3AhLNs rc9hjDnk+FYbreR/551e0Ikcj84f9/7SdveuSMwc2O51zstHDTh7q5hl+qCXpTz+4kAY sKWHZyXjHfKdv0n9u+W7HJwxV6EVJ2izkOGrTGNJOSsTpJm8a+xTLkSR8wpmaNhtmMAc nzag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678122665; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=idLm4xt2wLeXxh/J+xJRAoErdXhac2e5ejczLh6rw2Y=; b=vwu5ziWk4PldnE9e71w4nTXzuI8jttiNiV084Gf/KfBQOk4Mv2iu2xMwEZZjXiZhwr dFmyFM69Sm1pmma7bkRzEsxpn9kp5hAchtliXrxX94VYyrqCIt4W036IJV419Vafe7Qf BCT4nT+1qF4mUbPOvZeg2w1Tu+VKAYct19buO1hXBguzzCnfWo6HmRvlk/Tmcmde81Yk RCnobqql5mDJ70DJkY42/Lh75F3EIB0c1bwgA6+Z7fJBS0YugJBf8m2/xt7hYj/pFTCe phD4EgnGGLwSGdPGVa1BYjfAwPOyDbGi3kqPYk2MQxPUmQVhKVt95bJLKFz+icHcRZNn GveA== X-Gm-Message-State: AO0yUKWkRMOwwL35TMPxogyf41CvyMF1Bxv/JHrxJhmj4JUOYXRj9ytV f+2MJDt015TIT7RQk5yoaeaqw1Gqii8AD5PC6NY8PQ== X-Google-Smtp-Source: AK7set91Cnxz62P/9oD6wJ49fHlZ7CisdXXMr/WR4KeNGMu+VLhsZoQu9PfQFFZ3xsff9XUXzZHRKQ== X-Received: by 2002:a17:903:441:b0:19b:fa9:678b with SMTP id iw1-20020a170903044100b0019b0fa9678bmr11624579plb.40.1678122665109; Mon, 06 Mar 2023 09:11:05 -0800 (PST) Return-Path: Received: from localhost.localdomain (c-174-50-177-95.hsd1.ca.comcast.net. [174.50.177.95]) by smtp.gmail.com with ESMTPSA id kv7-20020a17090328c700b0019cc88bee09sm6977285plb.58.2023.03.06.09.11.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Mar 2023 09:11:04 -0800 (PST) From: "Tuan Phan" 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, Tuan Phan Subject: [PATCH] MdePkg/BaseCacheMaintenanceLib: RISC-V: Fix instruction cache not been invalidated Date: Mon, 6 Mar 2023 09:10:58 -0800 Message-Id: <20230306171058.4579-1-tphan@ventanamicro.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable When the range instruction cache invalidating not supported, the whole instruction cache should be invalidated instead. Signed-off-by: Tuan Phan --- MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c b/MdePkg/L= ibrary/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=0D )=0D {=0D - DEBUG ((DEBUG_ERROR, "%a:RISC-V unsupported function.\n", __FUNCTION__))= ;=0D + DEBUG ((DEBUG_WARN,=0D + "%a:RISC-V unsupported function.\n"=0D + "Invalidating the whole instruction cache instead.\n", __func__));=0D + InvalidateInstructionCache ();=0D return Address;=0D }=0D =0D --=20 2.25.1