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 D5FA2AC1046 for ; Tue, 5 Mar 2024 09:42:55 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=VOFL0C/kAbi7zJ8wkwwWY7Q0VHRikRzuxIY/df6j2B8=; 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=1709631774; v=1; b=h1BZAab1T2aYckqREQtqcED11kzVrnlBtv0bR6ndD1/2aMBVmZWuADZUDBvwN58klFCC1WaY 1qRr1/w6fKJ0QFFUt1Srlrx4iOQ777EzPPD4QygC45FJC1sYfN87lJHKDfQ4nfAaTu7oud6B/Dz ETvnSG0iwfWStX4l7GyEB/us= X-Received: by 127.0.0.2 with SMTP id WxB9YY7687511xO7qQd7Vz1l; Tue, 05 Mar 2024 01:42:54 -0800 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.web11.18511.1709631773701653881 for ; Tue, 05 Mar 2024 01:42:53 -0800 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.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-582-LZx6C8IPMY-TL2VlZcY3EA-1; Tue, 05 Mar 2024 04:42:49 -0500 X-MC-Unique: LZx6C8IPMY-TL2VlZcY3EA-1 X-Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (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 C65141869B7E; Tue, 5 Mar 2024 09:27:03 +0000 (UTC) X-Received: from [10.39.193.2] (unknown [10.39.193.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 30F1F1C060A6; Tue, 5 Mar 2024 09:27:00 +0000 (UTC) Message-ID: <5a32d905-fe40-9db0-de3f-3e90919e0bc3@redhat.com> Date: Tue, 5 Mar 2024 10:26:59 +0100 MIME-Version: 1.0 Subject: Re: [edk2-devel] [PATCH v8 14/37] UefiCpuPkg: Add CpuMmuLib to UefiCpuPkg To: devel@edk2.groups.io, lichao@loongson.cn, "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> From: "Laszlo Ersek" In-Reply-To: <0dd107d1-4e12-45d7-ac27-a755272c55c2@loongson.cn> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 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: jqYMuzHvuVaUJoBbTwxFpmulx7686176AA= 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=h1BZAab1; 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 Hello Chao, On 3/4/24 04:39, Chao Li wrote: > Hi Laszlo, >=20 > OK. >=20 > When I discussed the CpuMmuLib API as a public API with Ray in the early > 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. >=20 > The paths for ARM and RISCV version APIs: >=20 > ARM: ArmPkg/Include/Library/ArmMmuLib.h >=20 > 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 (#116357): https://edk2.groups.io/g/devel/message/116357 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-