public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Laszlo Ersek" <lersek@redhat.com>
To: Dhaval <dhaval@rivosinc.com>, devel@edk2.groups.io
Cc: Liming Gao <gaoliming@byosoft.com.cn>,
	Michael D Kinney <michael.d.kinney@intel.com>,
	Zhiguang Liu <zhiguang.liu@intel.com>,
	Sunil V L <sunilvl@ventanamicro.com>,
	Andrei Warkentin <andrei.warkentin@intel.com>,
	Pedro Falcato <pedro.falcato@gmail.com>,
	Yang Cheng <yangcheng.work@foxmail.com>
Subject: Re: [edk2-devel] [PATCH v1 1/1] MdePkg/BaseCacheMaintenanceLib: RV64 replace asserts with logs
Date: Thu, 18 Jan 2024 15:45:39 +0100	[thread overview]
Message-ID: <b449d3dd-902c-2ec9-20f6-d3fb8186eb32@redhat.com> (raw)
In-Reply-To: <20240118095018.509362-2-dhaval@rivosinc.com>

On 1/18/24 10:50, Dhaval wrote:
> 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 <dhaval@rivosinc.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> Cc: Sunil V L <sunilvl@ventanamicro.com>
> Cc: Andrei Warkentin <andrei.warkentin@intel.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Cc: Pedro Falcato <pedro.falcato@gmail.com>
> Cc: Yang Cheng <yangcheng.work@foxmail.com>
> ---
>  MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c b/MdePkg/Library/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
>    )
>  {
> -  ASSERT (FALSE);
>    DEBUG ((
> -    DEBUG_ERROR,
> +    DEBUG_VERBOSE,
>      "WriteBackInvalidateDataCache: RISC-V unsupported function.\n"
>      ));
>  }
> @@ -226,7 +225,9 @@ WriteBackInvalidateDataCacheRange (
>    if (RiscVIsCMOEnabled ()) {
>      CacheOpCacheRange (Address, Length, CacheOpFlush);
>    } else {
> -    ASSERT (FALSE);
> +    DEBUG (
> +      (DEBUG_VERBOSE, "WriteBackInvalidateDataCacheRange not supported \n")
> +      );
>    }
>  
>    return Address;

This formatting looks very strange, normally you'd write
  DEBUG ((
    ....
    ));

LGTM otherwise:

Acked-by: Laszlo Ersek <lersek@redhat.com>


> @@ -248,7 +249,7 @@ WriteBackDataCache (
>    VOID
>    )
>  {
> -  ASSERT (FALSE);
> +  DEBUG ((DEBUG_VERBOSE, "WriteBackDataCache not supported \n"));
>  }
>  
>  /**
> @@ -283,7 +284,7 @@ WriteBackDataCacheRange (
>    if (RiscVIsCMOEnabled ()) {
>      CacheOpCacheRange (Address, Length, CacheOpClean);
>    } else {
> -    ASSERT (FALSE);
> +    DEBUG ((DEBUG_VERBOSE, "WriteBackDataCacheRange not supported \n"));
>    }
>  
>    return Address;



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#113993): https://edk2.groups.io/g/devel/message/113993
Mute This Topic: https://groups.io/mt/103805230/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



  reply	other threads:[~2024-01-18 14:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-18  9:50 [edk2-devel] [PATCH v1 0/1] Replace asserts with logs for unimplemented cache ops Dhaval Sharma
2024-01-18  9:50 ` [edk2-devel] [PATCH v1 1/1] MdePkg/BaseCacheMaintenanceLib: RV64 replace asserts with logs Dhaval Sharma
2024-01-18 14:45   ` Laszlo Ersek [this message]
2024-01-18 15:58   ` Pedro Falcato
2024-01-18 16:40     ` Dhaval Sharma
2024-01-18 16:41     ` Yang Cheng
2024-01-19  5:08     ` Sunil V L
2024-01-19  5:36   ` Sunil V L
2024-01-23  6:12     ` Dhaval Sharma
2024-01-23 13:23       ` Pedro Falcato
2024-01-23 16:54       ` Sunil V L
2024-01-24 14:27         ` Dhaval Sharma
2024-01-24 14:33           ` 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=b449d3dd-902c-2ec9-20f6-d3fb8186eb32@redhat.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