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 2F735D81164 for ; Thu, 21 Dec 2023 11:13:31 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=ou89VgmJylKX+050gypLfOPRBGSi5D2ECSbivB44qEo=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:User-Agent: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=1703157210; v=1; b=etckXuWkoFaujAGTsVEI6JugivDg6MkBD9q81ZyIPXLI7BomBSgDMpZn9Iy95aceOh6jy1BW bzxLLazgKqP1N5zCR0/Am5Pc7oUUxA1iOKMngymPtXdMRt53EcCbGjNo92F7RNFh9hBf/CUucvd k5FA4lUKfOSyh+sJbDY0yfrw= X-Received: by 127.0.0.2 with SMTP id D5D5YY7687511xAB9zzP7BrM; Thu, 21 Dec 2023 03:13:30 -0800 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.49336.1703157209501550005 for ; Thu, 21 Dec 2023 03:13:29 -0800 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0BE822F4; Thu, 21 Dec 2023 03:14:14 -0800 (PST) X-Received: from [10.57.46.59] (unknown [10.57.46.59]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 49EEE3F5A1; Thu, 21 Dec 2023 03:13:27 -0800 (PST) Message-ID: <4951c86b-ecd8-4253-95e7-ceb00b8192b9@arm.com> Date: Thu, 21 Dec 2023 12:13:25 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [edk2-devel] [RFC PATCH 1/1] ArmPkg,MdePkg: move ArmLib.h to MdePkg To: Leif Lindholm , devel@edk2.groups.io Cc: Jiewen Yao , Ard Biesheuvel , Liming Gao , Michael D Kinney , Sami Mujawar , Zhiguang Liu References: <20231121164228.766299-1-quic_llindhol@quicinc.com> From: "PierreGondois" In-Reply-To: <20231121164228.766299-1-quic_llindhol@quicinc.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,pierre.gondois@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 2D9CVWXAdqEDleGMgI39PJFAx7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed 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=etckXuWk; 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=arm.com (policy=none) Hello Leif, I think the following files: - ArmPkg/Include/Chipset/AArch64.h - ArmPkg/Include/Chipset/AArch64Mmu.h - ArmPkg/Include/Chipset/ArmV7.h - ArmPkg/Include/Chipset/ArmV7Mmu.h also need to be moved to the MdePkg. Otherwise the MdePkg would depend on the ArmPkg, cf. ArmLib.h: #ifdef MDE_CPU_ARM #include #elif defined (MDE_CPU_AARCH64) #include Depending on where these files are placed in the MdePkg, this might imply some renaming to include them. Meaning that all #include might need to be renamed #include <[New path]/AArch64.h> but it should be ok. A ArmLibNull.inf library might also need to be created. If the OpensslLibFullAccel.inf module will depend on the ArmLib library, a Null implementation will be necessary for non-Arm architectures. Otherwise I could apply and run the CryptoPkg/Arm native instructions patchset on top of this patch. --- As a side note, it also seems that: - ArmPkg/Include/Chipset/ArmCortexA5x.h isn't used anymore in edk2/edk2-platorms - ArmPkg/Include/Chipset/ArmCortexA9.h is barely used in edk2-platforms. Maybe the files should have been removed/simplified as part of - cffa7925a293 ("ArmPkg: remove ArmCpuLib header and implementations") - a913ad02479d ("ArmPlatformPkg: remove ArmVExpressPkg") Regards, Pierre On 11/21/23 17:42, Leif Lindholm wrote: > Related to https://bugzilla.tianocore.org/show_bug.cgi?id=3D4121, but not > resolving it. (Nearly?) all of ArmPkg describes industry standard > behaviour, and hence according to general rules, ought to live in MdePkg. >=20 > Addressing this will however be a substantial task. > Take a first step by moving the ArmLib interface definition to MdePkg, > as discussed in > https://edk2.groups.io/g/devel/topic/patch_v5_2_6/102725178 >=20 > Cc: Pierre Gondois > Cc: Jiewen Yao > Cc: Ard Biesheuvel > Cc: Liming Gao > Cc: Michael D Kinney > Cc: Sami Mujawar > Cc: Zhiguang Liu > Signed-off-by: Leif Lindholm > --- >=20 > This should have no functional differences (and the set of > platforms I have test built didn't find any problems). > This may result in some modules depending on ArmPkg only > for ArmLib now being able to drop ArmPkg dependency. >=20 > ArmPkg/ArmPkg.dec | 4 ---- > MdePkg/MdePkg.dec | 5 +++++ > {ArmPkg =3D> MdePkg}/Include/Library/ArmLib.h | 0 > Maintainers.txt | 6 ++++++ > 4 files changed, 11 insertions(+), 4 deletions(-) >=20 > diff --git a/ArmPkg/ArmPkg.dec b/ArmPkg/ArmPkg.dec > index 7fe2b9bca43b..4ce59f3e1fbd 100644 > --- a/ArmPkg/ArmPkg.dec > +++ b/ArmPkg/ArmPkg.dec > @@ -50,10 +50,6 @@ [LibraryClasses.common] > # > ArmHvcLib|Include/Library/ArmHvcLib.h > =20 > - ## @libraryclass Provides an interface to Arm registers. > - # > - ArmLib|Include/Library/ArmLib.h > - > ## @libraryclass Provides a Mmu interface. > # > ArmMmuLib|Include/Library/ArmMmuLib.h > diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec > index ac54338089e8..78e18ee444cd 100644 > --- a/MdePkg/MdePkg.dec > +++ b/MdePkg/MdePkg.dec > @@ -339,6 +339,11 @@ [LibraryClasses.RISCV64] > ## @libraryclass Provides function to make ecalls to SBI > BaseRiscVSbiLib|Include/Library/BaseRiscVSbiLib.h > =20 > +[LibraryClasses.ARM, LibraryClasses.AARCH64] > + ## @libraryclass Provides an interface to Arm registers. > + # > + ArmLib|Include/Library/ArmLib.h > + > [Guids] > # > # GUID defined in UEFI2.1/UEFI2.0/EFI1.1 > diff --git a/ArmPkg/Include/Library/ArmLib.h b/MdePkg/Include/Library/Arm= Lib.h > similarity index 100% > rename from ArmPkg/Include/Library/ArmLib.h > rename to MdePkg/Include/Library/ArmLib.h > diff --git a/Maintainers.txt b/Maintainers.txt > index 7c0b4cb58cfd..0315fa23dfce 100644 > --- a/Maintainers.txt > +++ b/Maintainers.txt > @@ -450,6 +450,12 @@ M: Abner Chang [changab] > R: Abdul Lateef Attar [abdattar] > R: Nickle Wang [nicklela] > =20 > +MdePkg: ARM/AARCH64 standard interfaces > +F: MdePkg/Include/Library/ArmLib.h > +M: Leif Lindholm [leiflindholm] > +M: Ard Biesheuvel [ardbiesheuvel] > +R: Sami Mujawar [samimujawar] > + > NetworkPkg > F: NetworkPkg/ > W: https://github.com/tianocore/tianocore.github.io/wiki/NetworkPkg -=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 (#112809): https://edk2.groups.io/g/devel/message/112809 Mute This Topic: https://groups.io/mt/102731845/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-