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 941867803CF for ; Thu, 21 Dec 2023 12:31:47 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=X31ACptdYfDx0+2RDUp7IT8ZwOQCSY2RLNG/1i78jRs=; c=relaxed/simple; d=groups.io; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:To:Cc:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Transfer-Encoding; s=20140610; t=1703161906; v=1; b=s3V0+krQ02WPDtKrBNLm/ayMJmffczUesI/reZkMRhU6pha2dUJUGzQtMlpIxmlTWuwNhZrG 8K3V/j2K10a+hBqAl8jtcblVzZM4kx9NuabfomnN7hJ7+vTkelYDvGrcIoEnKVro5xeUDedNjXX j7pqZzi/L21zy/q8ry3UHJ1Y= X-Received: by 127.0.0.2 with SMTP id oRnpYY7687511xwZmRRPh5D3; Thu, 21 Dec 2023 04:31:46 -0800 X-Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by mx.groups.io with SMTP id smtpd.web11.49848.1703161904858084267 for ; Thu, 21 Dec 2023 04:31:45 -0800 X-Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 40715CE1F36 for ; Thu, 21 Dec 2023 12:31:41 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 66081C433C8 for ; Thu, 21 Dec 2023 12:31:39 +0000 (UTC) X-Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-50e2168ab09so1142492e87.0 for ; Thu, 21 Dec 2023 04:31:39 -0800 (PST) X-Gm-Message-State: uKXLpH7LP6DDMBMdCz0bpzqXx7686176AA= X-Google-Smtp-Source: AGHT+IFXzlUMtKIIocSdGTEfwvpeXTTBXfglr7JUp2zibMXevxFw7NygdltZ3qAYIloi4o67JjDqdOMbOjivW9liYb8= X-Received: by 2002:a05:6512:201a:b0:50e:3107:29cd with SMTP id a26-20020a056512201a00b0050e310729cdmr3541260lfb.34.1703161897633; Thu, 21 Dec 2023 04:31:37 -0800 (PST) MIME-Version: 1.0 References: <20231212130932.2467028-1-lichao@loongson.cn> <17A017C201FEB90D.32321@groups.io> <9014a7b3-095c-42b1-a9ef-5a388818385d@loongson.cn> In-Reply-To: From: "Ard Biesheuvel" Date: Thu, 21 Dec 2023 13:31:26 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [edk2-devel] [PATCH v4 19/37] UefiCpuPkg: Add MMIO method in CpuIo2Dxe To: Chao Li Cc: devel@edk2.groups.io, ray.ni@intel.com, "Kumar, Rahul R" , Gerd Hoffmann , Leif Lindholm , Ard Biesheuvel , Sami Mujawar 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,ardb@kernel.org List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: 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=s3V0+krQ; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=kernel.org (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 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, ju= st like Arm and RISC-V. Gerd recommended finding a better place for ArmPciC= puIo2Dxe so that other ARCH can easily use it. And then I found the UefiCpu= Pkg/CpuIo2Dxe might be able to accommodate the MMIO methods, so I merged th= em 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 metho= d 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. -=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 (#112812): https://edk2.groups.io/g/devel/message/112812 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-