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 63E2DAC1310 for ; Thu, 21 Dec 2023 12:41:12 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=6kf4RG0V/Z6TWfYS8Qt8Zmfm1jqom3Bys2jA96yjkg4=; 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-Type; s=20140610; t=1703162471; v=1; b=MKbT9QXlPCgHpWyDadnDzU/3CNUJXzeAKVE5cICvAftSq8K29rMF5QBr8c/Ppy78cTHzlVsS 9q/kAmnSpXoWEskcMXZhS9Men+KjAYD5Ywtzd4xzRIZoizuls18MGqaPSTOvN3/FvUOZgDwxzet ERzhEehLOnPRYALxQN3ON++E= X-Received: by 127.0.0.2 with SMTP id 7KP9YY7687511x1kWoMuzR0G; Thu, 21 Dec 2023 04:41:11 -0800 X-Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by mx.groups.io with SMTP id smtpd.web11.49953.1703162469450886520 for ; Thu, 21 Dec 2023 04:41:10 -0800 X-Received: from loongson.cn (unknown [10.40.24.149]) by gateway (Coremail) with SMTP id _____8Cx9OphMoRlIHUDAA--.13285S3; Thu, 21 Dec 2023 20:41:05 +0800 (CST) X-Received: from [10.40.24.149] (unknown [10.40.24.149]) by localhost.localdomain (Coremail) with SMTP id AQAAf8AxzuReMoRlwsYDAA--.20053S3; Thu, 21 Dec 2023 20:41:02 +0800 (CST) Message-ID: <0a00f876-0bc5-4cf7-9252-b21520463034@loongson.cn> Date: Thu, 21 Dec 2023 20:41:02 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [edk2-devel] [PATCH v4 19/37] UefiCpuPkg: Add MMIO method in CpuIo2Dxe To: devel@edk2.groups.io, ardb@kernel.org Cc: ray.ni@intel.com, "Kumar, Rahul R" , Gerd Hoffmann , Leif Lindholm , Ard Biesheuvel , Sami Mujawar References: <20231212130932.2467028-1-lichao@loongson.cn> <17A017C201FEB90D.32321@groups.io> <9014a7b3-095c-42b1-a9ef-5a388818385d@loongson.cn> From: "Chao Li" In-Reply-To: X-CM-TRANSID: AQAAf8AxzuReMoRlwsYDAA--.20053S3 X-CM-SenderInfo: xolfxt3r6o00pqjv00gofq/1tbiAQAMCGWDoK4NlAABs1 X-Coremail-Antispam: 1Uk129KBj93XoW7Cw4xtF1fXFWDCF15Xry3KFX_yoW8Cw1Dpw 45tF90yr1qgw1j934UAr1UZa4SvwsavFy8tFn0y34093Z7JFZ7Kay3G34Du3yUGr1Fva1U Xr4Y9ws5GFyj9agCm3ZEXasCq-sJn29KB7ZKAUJUUUU8529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3UbIjqfuFe4nvWSU5nxnvy29KBjDU0xBIdaVrnRJUUUvjb4IE77IF4wAF F20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r 1Y6r17M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAF wI0_Jr0_JF4l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Jr0_Gr1l84ACjcxK6I8E87Iv67 AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AKxVW8Jr0_Cr1UM2AIxVAIcxkEcVAq 07x20xvEncxIr21l57IF6xkI12xvs2x26I8E6xACxx1lYx0E2Ix0cI8IcVAFwI0_JrI_Jr ylYx0Ex4A2jsIE14v26r4j6F4UMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvEwIxGrwCj r7xvwVCIw2I0I7xG6c02F41l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr 1l4IxYO2xFxVAFwI0_JF0_Jw1lx2IqxVAqx4xG67AKxVWUGVWUWwC20s026x8GjcxK67AK xVWUGVWUWwC2zVAF1VAY17CE14v26r1q6r43MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcV AFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r1j6r4UMIIF0xvE42xK8VAvwI8I cIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E87Iv6xkF7I0E14v26r 4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjxU7UGYDUUUU 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,lichao@loongson.cn List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: r3dOsImOvqiRNG9v1QcQRNDIx7686176AA= Content-Type: multipart/alternative; boundary="------------nfBeD8p0vHoL7PsxMK3QKZwB" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=MKbT9QXl; dmarc=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 --------------nfBeD8p0vHoL7PsxMK3QKZwB Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Thanks, Chao On 2023/12/21 20:31, Ard Biesheuvel wrote: > On Thu, 21 Dec 2023 at 13:11, Chao Li wrote: >> Hi Ard, >> >> >> Thanks, >> Chao >> On 2023/12/21 15:31, Ard Biesheuvel wrote: >> >> On Thu, 21 Dec 2023 at 04:48, Chao Li wrote: >> >> ... >> >> Ard, >> >> PcdPciIoTranslationIsEnabled is only use for whether to trigger the Ffio= read or write, it seem that only x86 or x64 need them, not others. >> >> When I was submitted the patch V2, CpuIo2Dxe was private to LoongArch, j= ust like Arm and RISC-V. Gerd recommended finding a better place for ArmPci= CpuIo2Dxe so that other ARCH can easily use it. And then I found the UefiCp= uPkg/CpuIo2Dxe might be able to accommodate the MMIO methods, so I merged t= hem togeter in this change. >> >> I think it makes sense to have a shared implementation under >> UefiCpuPkg or even MdeModulePkg. But merging it with the x86 >> implementation using function pointers that are dereferenced at >> runtime seems unnecessary to me. >> >> So what do you suggest? Write some new functions to handle the MMIO meth= od under the CpuIo2Dxe? >> > A given platform will either be able to use port IO, or it will need > to use MMIO translation. So a driver that can do both based on a PCD > is not very useful, it makes more sense to have two different drivers, > and the platform incorporates the one it can use. Ok, I get it, I think you are more inclined to move the ArmCpuIo2Dxe to=20 a new place and rename it, maybe: CpuMmio2Dxe, while some platforms=20 choose the different CpuIo2 drvier by themselves when building FW, right? > > >=20 > -=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 (#112813): https://edk2.groups.io/g/devel/message/112813 Mute This Topic: https://groups.io/mt/103261693/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- --------------nfBeD8p0vHoL7PsxMK3QKZwB Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable



=
Thanks,
Chao
On 2023/12/21 20:31, Ard Biesheuvel wrote:
On Thu, 21 Dec 2023 at 13:11, =
Chao Li <lichao@loongson.cn> wrote:
Hi Ard,


Thanks,
Chao
On 2023/12/21 15:31, Ard Biesheuvel wrote:

On Thu, 21 Dec 2023 at 04:48, Chao Li <lichao@loongson.cn> wrote:

...

Ard,

PcdPciIoTranslationIsEnabled is only use for whether to trigger the Ffio re=
ad or write, it seem that only x86 or x64 need them, not others.

When I was submitted the patch V2, CpuIo2Dxe was private to LoongArch, just=
 like Arm and RISC-V. Gerd recommended finding a better place for ArmPciCpu=
Io2Dxe so that other ARCH can easily use it. And then I found the UefiCpuPk=
g/CpuIo2Dxe might be able to accommodate the MMIO methods, so I merged them=
 togeter in this change.

I think it makes sense to have a shared implementation under
UefiCpuPkg or even MdeModulePkg. But merging it with the x86
implementation using function pointers that are dereferenced at
runtime seems unnecessary to me.

So what do you suggest? Write some new functions to handle the MMIO method =
under the CpuIo2Dxe?

A given platform will either be able to use port IO, or it will need
to use MMIO translation. So a driver that can do both based on a PCD
is not very useful, it makes more sense to have two different drivers,
and the platform incorporates the one it can use.
Ok, I get it, I think you are more inclined to move the ArmCpuIo2Dxe to a new place and rename it, maybe: CpuMmio2Dxe, while some platforms choose the different CpuIo2 drvier by themselves when building FW, right?




_._,_._,_

Groups.io Links:

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

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

_._,_._,_
--------------nfBeD8p0vHoL7PsxMK3QKZwB--