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 E9EAD941659 for ; Tue, 5 Mar 2024 12:09:19 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=jPmSkTKWdK91U0SYBRgDPpL8BRxJSAMO2A6/wtFOEf4=; 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=1709640558; v=1; b=DEYkap1JVW2phawi6SwYn0cgYLIQcZZter+kPzoJxWyCyPSgRaFMXknjNE61C9b2jzkdYtdy ttur4RUyBWydopI5aeEGFZWHOgaNwHo8uE2irX4O21ZrLNAjDFhsPEojuKdW5FBiwG7MIqad1Hv yOITrkREuVK7idl7X4q1Fhl0= X-Received: by 127.0.0.2 with SMTP id H0dnYY7687511xbXZWulby1y; Tue, 05 Mar 2024 04:09:18 -0800 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web10.21011.1709640557776842952 for ; Tue, 05 Mar 2024 04:09:17 -0800 X-Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-533-0XKEdBKgOmGWv7niC_U2NQ-1; Tue, 05 Mar 2024 07:09:11 -0500 X-MC-Unique: 0XKEdBKgOmGWv7niC_U2NQ-1 X-Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D55651C02D29; Tue, 5 Mar 2024 12:09:10 +0000 (UTC) X-Received: from [10.39.193.2] (unknown [10.39.193.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2AB5D37F6; Tue, 5 Mar 2024 12:09:09 +0000 (UTC) Message-ID: Date: Tue, 5 Mar 2024 13:09:08 +0100 MIME-Version: 1.0 Subject: Re: [edk2-devel] [PATCH v8 14/37] UefiCpuPkg: Add CpuMmuLib to UefiCpuPkg To: Chao Li , devel@edk2.groups.io, "Ni, Ray" Cc: "Dong, Eric" , "Kumar, Rahul R" , Gerd Hoffmann , Baoqi Zhang , Dongyan Qian , Xianglai Li , Bibo Mao References: <20240126062715.3099433-1-lichao@loongson.cn> <20240126062919.3101691-1-lichao@loongson.cn> <856ebd67-d345-6e41-2e34-74b9bdd7ed7e@redhat.com> <2187d8cd-3578-4f3f-a158-2961571f851b@loongson.cn> <8e97514d-cd2f-881a-f1e4-ed1bdbd03320@redhat.com> <0dd107d1-4e12-45d7-ac27-a755272c55c2@loongson.cn> <5a32d905-fe40-9db0-de3f-3e90919e0bc3@redhat.com> <2410a5de-b801-4639-a662-49f0b4006990@loongson.cn> From: "Laszlo Ersek" In-Reply-To: <2410a5de-b801-4639-a662-49f0b4006990@loongson.cn> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 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: mGVTUL9C2zTxwhW93PlysTRIx7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8 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=DEYkap1J; 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 3/5/24 12:50, Chao Li wrote: > Hi Laszlo, >=20 > OK, I see, let's me try. And I have another question: >=20 > Where should the low-level library be placed? Under the > UefiCpuPkg/Library and as the same folder as CpuMmuLib? In my opinion: Under UefiCpuPkg/Library -- yes. In the same folder as CpuMmuLib -- no. Instances of different library classes are never placed in the same folder. Laszlo >=20 >=20 > Thanks, > Chao > On 2024/3/5 17:26, Laszlo Ersek wrote: >> Hello Chao, >> >> On 3/4/24 04:39, Chao Li wrote: >>> Hi Laszlo, >>> >>> OK. >>> >>> When I discussed the CpuMmuLib API as a public API with Ray in the earl= y >>> days, the API recommended by Ray should be the patch 13 in this series, >>> which only contains set/get memory region attribute, but in the first >>> version in this series, it contains more API, one is ConfigureMmu API, >>> which is included in ARM and RISCV versions. This API provides a >>> interface called in PEI or DXE stage, it will configures the MMU and >>> enables it, such as creating the page tables, filling the static page >>> tables, cofniguring the MMU registers, enbale MMU, etc. >>> >>> The paths for ARM and RISCV version APIs: >>> >>> ARM: ArmPkg/Include/Library/ArmMmuLib.h >>> >>> RISCV: UefiCpuPkg/Include/Library/BaseRiscVMmuLib.h >> I have now re-read this subthread in its entirey, and I think I >> understand what's up. >> >> What confused me recently was your expression "so should we open >> configure API?" >> >> I think what you meant by "opening" was "publicly declaring". >> >> Anyway, here's my recommendation (consistently with what I said earlier >> in this thread): >> >> - I think you need a new (lower-level) library class and instance for >> exposing ConfigureMemoryManagementUnit(). >> >> Please see: (msgid >> <2a91f2f0-df4c-e106-65cd-79be167224f2@redhat.com>). >> >> - I do not recommend trying to unify the new LoongArch library classes >> (low level and high level) with "ArmMmuLib.h" or "BaseRiscVMmuLib.h". >> >> Each of "ArmMmuLib.h" and "BaseRiscVMmuLib.h" seems to declare both >> low-level and high-level interfaces. For LoongArch, we apparently don't >> want that; hence the idea to introduce two library classes for LoongArch >> -- that may be considered an improved design. >> >> At the same time, I don't believe that this requires us to unify >> "ArmMmuLib.h" and "BaseRiscVMmuLib.h" with the new, LoongArch-motivated >> library class design. >> >> Laszlo -=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 (#116383): https://edk2.groups.io/g/devel/message/116383 Mute This Topic: https://groups.io/mt/103971653/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-