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 5A30F7803D0 for ; Thu, 19 Oct 2023 09:22:35 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=ultB9kNd/zHryPhVbQ+KmOMa546i/D/zU3Ase2kV7l0=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1697707354; v=1; b=SSao72z1d29iAMyjXa2GGRHJn3XDjQi9h5EiJPdyqbUwpzlReC1s53fMc3vl2SjzFFQ/ursN PgR54hfwcUpr5jVqIBxeP+FyqvBE4LLNutAqZdlrUTNNJiFQIu5Vp6r6/ptOVN8953v/RGP1Fqf WOSH7TulWXlgcNcc+aLFa9Hs= X-Received: by 127.0.0.2 with SMTP id eAQIYY7687511xmlyX7OOyqw; Thu, 19 Oct 2023 02:22:34 -0700 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web10.23617.1697707353224601713 for ; Thu, 19 Oct 2023 02:22:33 -0700 X-Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-392-ztEY05w0P4S2MF8PRZj6VQ-1; Thu, 19 Oct 2023 05:22:28 -0400 X-MC-Unique: ztEY05w0P4S2MF8PRZj6VQ-1 X-Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8184C10201E0; Thu, 19 Oct 2023 09:22:28 +0000 (UTC) X-Received: from [10.39.193.11] (unknown [10.39.193.11]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D9E55C15BB8; Thu, 19 Oct 2023 09:22:27 +0000 (UTC) Message-ID: <5466efed-8dd4-1b8a-2bce-d0f324532f27@redhat.com> Date: Thu, 19 Oct 2023 11:22:26 +0200 MIME-Version: 1.0 Subject: Re: [edk2-devel] [PATCH v5 2/2] OvmfPkg/RiscVVirt: Override for RV CPU Features To: Dhaval Sharma Cc: devel@edk2.groups.io References: <20231017121755.190285-1-dhaval@rivosinc.com> <20231017121755.190285-3-dhaval@rivosinc.com> From: "Laszlo Ersek" In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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,lersek@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 0vlYQaCt9rXoiNbINZZqDMtmx7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=SSao72z1; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=redhat.com (policy=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 On 10/19/23 08:48, Dhaval Sharma wrote: > Hi Laszlo, > Thanks a lot for your feedback. I have modified my next patchset > addressing most of the comments. Summary below. But *before I submit the > final version* I wanted to seek clarification on a few things mentioned > below with [Dhaval]. Current PR I am planning to > submit: https://github.com/tianocore/edk2/pull/4928 > > > I am summarizing all comments for better readability: > (1) Split into four separate patches, in v6.                      >  *Done*.- with some comments below >     1a. Fix previous error from earlier patch that had declaration > outside baselib.h >     1b. Renaming RiscVInvalidateDataCacheAsm() to > RiscVInvalidateDataCacheAsmFence() etc. >     1c. Adding the new cache maintenance operations to BaseLib, > including the >           new assembly instruction encodings. >     1d. Updating BaseCacheMaintenanceLib (utilizing the new BaseLib > primitives). >     1e. I have added another one for RiscvVirt platform kind of an > override as 5th patch. > (2)  This belongs to v6 patch#4, because only BaseCacheMaintenanceLib > needs the PCD.        *Done* > (3)  "CMO" should be expanded as "cache management operations".       *Done* > (4)  The whole PCD is insufficiently documented.      *Done* > (5)  Accordingly, the default value of the PCD should be > 0xFFFFFFFFFFFFFFFF.  *Done* > (6)  The "MdePkg/MdePkg.uni" file should be kept in sync with dec.    > *Done*.  [Dhaval] Is this used beyond setup options? For some PCDs I do > not find an entry in uni. This is best cleared with the MdePkg maintainers. Some packages don't include *.uni files at all, but in those that do, my memories are that we always keep the PCDs in sync between *.dec and *.uni. If I remember correctly, the *.uni files are also used by the UEFI Packaging Tool (UPT). I recommend modifying the UNI as well. > (7)  Belongs to v6 patch#4. *Done*      > (8)  Please consider appending the "## CONSUMES" hint. *Done* > (9)  Belongs to v6 patch#3. *Done* > (10) Belongs to v6 patch#3. *Done* > (11) I agree that we should use symbolic names rather than > magic constants, but raw encodings of machine instructions don't belong > into a >      C header file. [Dhaval] This bytecode was introduced thinking what > if all compilers do not support it. but given the default compiler in > edk2 GCC 12 supports it >      we can eliminate this byte encoding completely to make it easy and > simple to consume for others. To be honest, I can't determine the minimum expected gcc version for edk2. "BaseTools/Conf/tools_def.template" states a minimum version for NASM, for example, but I can't find a similar gcc requirement there. gcc-12 does work for me personally, because my riscv cross-compiler is "riscv64-linux-gnu-gcc (GCC) 12.1.1 20220507 (Red Hat Cross 12.1.1-1)". If the CI environment that builds these patches also provides gcc-12+, then I figure you should be set. > (12) Also, filing a feature request (about these instructions). As per > (11) it is already available. > (13) As stated above, these two interfaces don't belong here. *Done* > (14) As stated above, these function declarations don't belong here. *Done* > (15) I believe this un-indented comment will not pass ECC Check / >      uncrustify. [Dhaval] I attach my stuart_build logs. I do not see > specific errors.https://github.com/tianocore/edk2/pull/4928 > Pull request all passed. > Am I missing something? Probably not. We usually indent the function-top comment bodies by two spaces, but if neither uncrustify nor ECC complain, then I won't insist. Thanks Laszlo > (16-17-18) The name of the function suggests the return type should be > BOOLEAN. *Done* > (19) Should be STATIC, and should *not* be EFIAPI. (Not a public > interface.) *Done* > (20) This will definitely not pass uncrustify. If you are talking about > bad indent seen on Ops and Length- it is fixed. *Done* > (21) Logging this error for every cache line of the requested range does > not seem useful. I suggest checking Op before the loop. *Done* > (22) As stated above, the API renames -- together with the updated > leading comments -- belong in v6 patch#2. *Done* > (23) As stated above, the API renames -- together with the updated > leading comments -- belong in v6 patch#2. *Done* > (24) The DEBUG message seems bogus; invalidating the whole I-Cache *is* > what is being requested here. *Done* > (25-26) The *API* renames belong to v6 patch#2. & The new APIs, plus the > *file* rename, belong to v6 patch#3. *Done* > (27) Please use the assembler macros from point (11). Please see (11) > (28-29-30-31) Please do not abbreviate RISC-V as "RV". It's incredibly > confusing.  Inconsistent spelling in the patch subject: "RISCV CMO". > ditto; should be RISC-V.ditto, should be PcdRiscVFeatureOverride *Done* > (32-33) Total inconsistency, RV64_ versus RV_.  Should be > RiscVIsCMOEnabled (upper case V). *Done* > > On Tue, Oct 17, 2023 at 8:09 PM Laszlo Ersek > wrote: > > On 10/17/23 14:17, Dhaval Sharma wrote: > > This PCD provides a way for platform to override any > > HW features that are default enabled by previous stages > > of FW (like OpenSBI). For the case where previous/prev > > stage has disabled the feature, this override is not > > useful and its usage should be avoided. > > > > Ard Biesheuvel > > > Jiewen Yao > > > Jordan Justen > > > Gerd Hoffmann > > > Sunil V L > > > Andrei Warkentin > > > (4) You forgot to prepend "Cc:". > > (5) The cover letter (0/2 email here) should contain all the Cc: tags > from the patches' commit messages, so that whoever gets at least one > patch CC'd from the series also get the cover letter for the series. > > Thanks > Laszlo > > > > > Signed-off-by: Dhaval Sharma > > > --- > >  OvmfPkg/RiscVVirt/RiscVVirt.dsc.inc | 2 ++ > >  1 file changed, 2 insertions(+) > > > > diff --git a/OvmfPkg/RiscVVirt/RiscVVirt.dsc.inc > b/OvmfPkg/RiscVVirt/RiscVVirt.dsc.inc > > index fe320525153f..8b5e010316ba 100644 > > --- a/OvmfPkg/RiscVVirt/RiscVVirt.dsc.inc > > +++ b/OvmfPkg/RiscVVirt/RiscVVirt.dsc.inc > > @@ -203,6 +203,8 @@ [PcdsFeatureFlag] > >    gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE > >  > >  [PcdsFixedAtBuild.common] > > +  gEfiMdePkgTokenSpaceGuid.PcdRVFeatureOverride|0 > > + > >    gEfiMdePkgTokenSpaceGuid.PcdMaximumUnicodeStringLength|1000000 > >    gEfiMdePkgTokenSpaceGuid.PcdMaximumAsciiStringLength|1000000 > >    gEfiMdePkgTokenSpaceGuid.PcdMaximumLinkedListLength|0 > > > > -- > Thanks! > =D -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109797): https://edk2.groups.io/g/devel/message/109797 Mute This Topic: https://groups.io/mt/102016149/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-