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 20C1FD80A5F for ; Thu, 18 Jan 2024 16:41:47 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=VMCxYm/7oPWvPrUPD0E+SE8bzqFOe/sG4QUK4YcMDsM=; c=relaxed/simple; d=groups.io; h=Subject:To:From:User-Agent:MIME-Version:Date:References:In-Reply-To:Message-ID:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type; s=20140610; t=1705596106; v=1; b=irS3eS1bYT0d1GBz8bddVlZco+cikkIWbf3DY7twHJPah+IzKJLFxgWmlrvQ3nEsSsse1G/h EFYrdMzS++ED4QCpgnX4lyhlU00JHWLkaOqOPlBNXWTtL3/UsX5vL/qdV98zEUXbRWO6vN8UInM NSuQiWk928AkGcYjSJFy9uRY= X-Received: by 127.0.0.2 with SMTP id J7GXYY7687511xtghe013l7X; Thu, 18 Jan 2024 08:41:46 -0800 Subject: Re: [edk2-devel] [PATCH v1 1/1] MdePkg/BaseCacheMaintenanceLib: RV64 replace asserts with logs To: Pedro Falcato ,devel@edk2.groups.io From: "Yang Cheng" X-Originating-Location: Boardman, Oregon, US (54.214.109.136) X-Originating-Platform: Windows Chrome 120 User-Agent: GROUPS.IO Web Poster MIME-Version: 1.0 Date: Thu, 18 Jan 2024 08:41:46 -0800 References: In-Reply-To: Message-ID: <18041.1705596106197003511@groups.io> 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,yangcheng.work@foxmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: zhTEIl901RLKoJbTNJOHHALtx7686176AA= Content-Type: multipart/alternative; boundary="ebV5CwuR9koC46MJt0ie" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=irS3eS1b; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=foxmail.com (policy=none) --ebV5CwuR9koC46MJt0ie Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable What's very confusing about the current situation is that we have a Pcd tha= t can set whether I support CMO instructions. When I correctly set up my pl= atform to not support CMO instructions and hope that everything goes well, = I will trigger Assert in the debug version. But I also can't set the Pcd to= support CMO instructions because that would cause me to trigger an illegal= instruction exception. If we decide that=C2=A0this library can only be used by RISCV platforms tha= t support CMO instructions, then we should use some stronger prompts than A= SSERT, such as reporting an error at compile time so that developers can fi= nd other library alternatives. After all, ASSERT is being released version = will lose its functionality which may lead to some unexpected errors. If we= decide that this library can be used by platforms that do not support CMO = instructions as before, then we should still use logs instead of ASSERT, ot= herwise it is meaningless to set whether CMO instructions are supported in = Pcd and check Pcd at runtime. Yang Cheng -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#114000): https://edk2.groups.io/g/devel/message/114000 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] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- --ebV5CwuR9koC46MJt0ie Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable What's very confusing about the current situation is that we have a Pcd tha= t can set whether I support CMO instructions. When I correctly set up my pl= atform to not support CMO instructions and hope that everything goes well, = I will trigger Assert in the debug version. But I also can't set the Pcd to= support CMO instructions because that would cause me to trigger an illegal= instruction exception.

If we decide that this library can = only be used by RISCV platforms that support CMO instructions, then we shou= ld use some stronger prompts than ASSERT, such as reporting an error at com= pile time so that developers can find other library alternatives. After all= , ASSERT is being released version will lose its functionality which may le= ad to some unexpected errors. If we decide that this library can be used by= platforms that do not support CMO instructions as before, then we should s= till use logs instead of ASSERT, otherwise it is meaningless to set whether= CMO instructions are supported in Pcd and check Pcd at runtime.

Yang Cheng
_._,_._,_

Groups.io Links:

=20 You receive all messages sent to this group. =20 =20

View/Reply Online (#114000) | =20 | Mute= This Topic | New Topic
Your Subscriptio= n | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
--ebV5CwuR9koC46MJt0ie--