From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 43F07AC1070 for ; Thu, 18 Jan 2024 09:50:30 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=IJor2qFpE0br0/zafShGzwebYD838l91B9BhoPH0HgM=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1705571429; v=1; b=o594oppINTL1oTMG1XPxiFLrOCBiwJnXTDrMnKDW1CZMC7pJgEXppUfLSyjTC9eZYPltIRZM e/1a5xMb/N9Jqws/3XtrtVhxps6WkPCWe9KN6gdN1b5zY3mOMlepsyPl10oMaCO+KrcdEN5tHFL rXkMfaaOOMiV3bMBhDcRggUs= X-Received: by 127.0.0.2 with SMTP id tURVYY7687511x4L5dS9sM95; Thu, 18 Jan 2024 01:50:29 -0800 X-Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) by mx.groups.io with SMTP id smtpd.web10.7962.1705571428280630228 for ; Thu, 18 Jan 2024 01:50:28 -0800 X-Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-6d9344f30caso379295b3a.1 for ; Thu, 18 Jan 2024 01:50:28 -0800 (PST) X-Gm-Message-State: F6GvUnRFNJKD4MBfl80nokEZx7686176AA= X-Google-Smtp-Source: AGHT+IF2GVl8mfv5i74yb6DePUh1dSQ363drUOCOBMxU5DW/eS1PfhL4490bGxqUlbJacf5PLDuBmw== X-Received: by 2002:a05:6a00:2e8e:b0:6da:ca28:c3d2 with SMTP id fd14-20020a056a002e8e00b006daca28c3d2mr3133775pfb.4.1705571427373; Thu, 18 Jan 2024 01:50:27 -0800 (PST) X-Received: from dhaval.blr.rivosinc.com ([49.249.129.34]) by smtp.gmail.com with ESMTPSA id n24-20020aa78a58000000b006d95b565418sm2894222pfa.153.2024.01.18.01.50.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 01:50:27 -0800 (PST) From: "Dhaval Sharma" To: devel@edk2.groups.io Cc: Liming Gao , Michael D Kinney , Zhiguang Liu , Sunil V L , Andrei Warkentin , Laszlo Ersek , Pedro Falcato , Yang Cheng Subject: [edk2-devel] [PATCH v1 1/1] MdePkg/BaseCacheMaintenanceLib: RV64 replace asserts with logs Date: Thu, 18 Jan 2024 15:20:18 +0530 Message-Id: <20240118095018.509362-2-dhaval@rivosinc.com> In-Reply-To: <20240118095018.509362-1-dhaval@rivosinc.com> References: <20240118095018.509362-1-dhaval@rivosinc.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,dhaval@rivosinc.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=o594oppI; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Some platforms do not implement cache management operations. Especially for DMA drivers have code to manage data cache. The code seem to depend on the underlying CPU/cache drivers to enact functionality and simply return if such functionality is not implemented. However this causes issue with CMO implementation which has an assert causing flow to hang within debug environment. While it is not an issue in production environment there is a recommendation to conver this assert in to a harmless logger message. Eventually platform/drivers need to have better guard for such functionality. Signed-off-by: Dhaval Sharma Cc: Liming Gao Cc: Michael D Kinney Cc: Zhiguang Liu Cc: Sunil V L Cc: Andrei Warkentin Cc: Laszlo Ersek Cc: Pedro Falcato Cc: Yang Cheng --- MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c b/MdePkg/L= ibrary/BaseCacheMaintenanceLib/RiscVCache.c index 73a5a6b6b5d6..d99515bcf38b 100644 --- a/MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c +++ b/MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c @@ -183,9 +183,8 @@ WriteBackInvalidateDataCache ( VOID=0D )=0D {=0D - ASSERT (FALSE);=0D DEBUG ((=0D - DEBUG_ERROR,=0D + DEBUG_VERBOSE,=0D "WriteBackInvalidateDataCache: RISC-V unsupported function.\n"=0D ));=0D }=0D @@ -226,7 +225,9 @@ WriteBackInvalidateDataCacheRange ( if (RiscVIsCMOEnabled ()) {=0D CacheOpCacheRange (Address, Length, CacheOpFlush);=0D } else {=0D - ASSERT (FALSE);=0D + DEBUG (=0D + (DEBUG_VERBOSE, "WriteBackInvalidateDataCacheRange not supported \n"= )=0D + );=0D }=0D =0D return Address;=0D @@ -248,7 +249,7 @@ WriteBackDataCache ( VOID=0D )=0D {=0D - ASSERT (FALSE);=0D + DEBUG ((DEBUG_VERBOSE, "WriteBackDataCache not supported \n"));=0D }=0D =0D /**=0D @@ -283,7 +284,7 @@ WriteBackDataCacheRange ( if (RiscVIsCMOEnabled ()) {=0D CacheOpCacheRange (Address, Length, CacheOpClean);=0D } else {=0D - ASSERT (FALSE);=0D + DEBUG ((DEBUG_VERBOSE, "WriteBackDataCacheRange not supported \n"));=0D }=0D =0D return Address;=0D --=20 2.39.2 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#113990): https://edk2.groups.io/g/devel/message/113990 Mute This Topic: https://groups.io/mt/103805230/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-