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 10847AC1A19 for ; Thu, 1 Feb 2024 22:19:29 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=BuY61q6zus5zatJkDLoBB1Tk3nJFRYdjN9SNfOTG1F0=; 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=1706825968; v=1; b=xDKywJT4ct2Ic9DA/9tFZvxKhEzS422M8yDdc2cm2wySMK3YZo84kBsLYx+hZjQzX7SKyc9w on48Gb/IWFvgxH45EUWIYKhP5JkI8g72JkPw4cWuZ/f8R9Z3A9A/Rw1DKo27TvUvLx+hBGmsEEw cRf5f7R5UWOOQO92x+Iqw7js= X-Received: by 127.0.0.2 with SMTP id NBVQYY7687511x6He5dmoEAg; Thu, 01 Feb 2024 14:19:28 -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.web10.9126.1706825968074487373 for ; Thu, 01 Feb 2024 14:19:28 -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-472--KOUTvQTM1-fEGPTQAD7Cw-1; Thu, 01 Feb 2024 17:19:24 -0500 X-MC-Unique: -KOUTvQTM1-fEGPTQAD7Cw-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 CAA5585A588; Thu, 1 Feb 2024 22:19:23 +0000 (UTC) X-Received: from [10.39.192.71] (unknown [10.39.192.71]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4ADA11C060AF; Thu, 1 Feb 2024 22:19:22 +0000 (UTC) Message-ID: Date: Thu, 1 Feb 2024 23:19:17 +0100 MIME-Version: 1.0 Subject: Re: [edk2-devel] [PATCH v8 20/37] ArmVirtPkg: Enable CpuMmio2Dxe To: devel@edk2.groups.io, lichao@loongson.cn Cc: Ard Biesheuvel , Leif Lindholm , Sami Mujawar , Gerd Hoffmann References: <20240126062715.3099433-1-lichao@loongson.cn> <20240126062955.3102084-1-lichao@loongson.cn> From: "Laszlo Ersek" In-Reply-To: <20240126062955.3102084-1-lichao@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: so29tSmhZPWrXZ5qGgkLVTVux7686176AA= 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=xDKywJT4; 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 1/26/24 07:29, Chao Li wrote: > CpuMmio2Dxe is supports MMIO, enable it. > > Build-tested only (with "ArmVirtQemu.dsc"). > > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4584 > > Cc: Ard Biesheuvel > Cc: Laszlo Ersek > Cc: Leif Lindholm > Cc: Sami Mujawar > Cc: Gerd Hoffmann > Signed-off-by: Chao Li > --- > ArmVirtPkg/ArmVirtCloudHv.dsc | 2 +- > ArmVirtPkg/ArmVirtCloudHv.fdf | 2 +- > ArmVirtPkg/ArmVirtKvmTool.dsc | 2 +- > ArmVirtPkg/ArmVirtKvmTool.fdf | 2 +- > ArmVirtPkg/ArmVirtQemu.dsc | 2 +- > ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc | 2 +- > ArmVirtPkg/ArmVirtQemuKernel.dsc | 2 +- > 7 files changed, 7 insertions(+), 7 deletions(-) > > diff --git a/ArmVirtPkg/ArmVirtCloudHv.dsc b/ArmVirtPkg/ArmVirtCloudHv.ds= c > index 76c0d28544..5cb2a609b1 100644 > --- a/ArmVirtPkg/ArmVirtCloudHv.dsc > +++ b/ArmVirtPkg/ArmVirtCloudHv.dsc > @@ -341,7 +341,7 @@ > # > # PCI support > # > - ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf { > + UefiCpuPkg/CpuMmio2Dxe/CpuMmio2Dxe.inf { > > NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf > } > diff --git a/ArmVirtPkg/ArmVirtCloudHv.fdf b/ArmVirtPkg/ArmVirtCloudHv.fd= f > index 56d1ea6e8c..8554efc294 100644 > --- a/ArmVirtPkg/ArmVirtCloudHv.fdf > +++ b/ArmVirtPkg/ArmVirtCloudHv.fdf > @@ -201,7 +201,7 @@ READ_LOCK_STATUS =3D TRUE > # > # PCI support > # > - INF ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf > + INF UefiCpuPkg/CpuMmio2Dxe/CpuMmio2Dxe.inf > INF MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf > INF MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf > INF OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf > diff --git a/ArmVirtPkg/ArmVirtKvmTool.dsc b/ArmVirtPkg/ArmVirtKvmTool.ds= c > index cac4fe06d3..20da331966 100644 > --- a/ArmVirtPkg/ArmVirtKvmTool.dsc > +++ b/ArmVirtPkg/ArmVirtKvmTool.dsc > @@ -372,7 +372,7 @@ > # > # PCI support > # > - ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf { > + UefiCpuPkg/CpuMmio2Dxe/CpuMmio2Dxe.inf { > > NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf > NULL|OvmfPkg/Library/BaseCachingPciExpressLib/BaseCachingPciExpres= sLib.inf > diff --git a/ArmVirtPkg/ArmVirtKvmTool.fdf b/ArmVirtPkg/ArmVirtKvmTool.fd= f > index 82aff47673..cdf756c112 100644 > --- a/ArmVirtPkg/ArmVirtKvmTool.fdf > +++ b/ArmVirtPkg/ArmVirtKvmTool.fdf > @@ -195,7 +195,7 @@ READ_LOCK_STATUS =3D TRUE > # > # PCI support > # > - INF ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf > + INF UefiCpuPkg/CpuMmio2Dxe/CpuMmio2Dxe.inf > INF MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf > INF MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf > INF OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf > diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc > index cf306cac08..dbd2396c78 100644 > --- a/ArmVirtPkg/ArmVirtQemu.dsc > +++ b/ArmVirtPkg/ArmVirtQemu.dsc > @@ -526,7 +526,7 @@ > # > # PCI support > # > - ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf { > + UefiCpuPkg/CpuMmio2Dxe/CpuMmio2Dxe.inf { > > NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf > } > diff --git a/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc b/ArmVirtPkg/ArmVirtQem= uFvMain.fdf.inc > index 9b3e37d5c9..c5d097ffb9 100644 > --- a/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc > +++ b/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc > @@ -153,7 +153,7 @@ READ_LOCK_STATUS =3D TRUE > # > # PCI support > # > - INF ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf > + INF UefiCpuPkg/CpuMmio2Dxe/CpuMmio2Dxe.inf > INF MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf > INF MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf > INF OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf > diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKer= nel.dsc > index c0d079e28d..6a6ecfc12a 100644 > --- a/ArmVirtPkg/ArmVirtQemuKernel.dsc > +++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc > @@ -431,7 +431,7 @@ > # > # PCI support > # > - ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf { > + UefiCpuPkg/CpuMmio2Dxe/CpuMmio2Dxe.inf { > > NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf > } I have verified this patch as follows: * diffed "UefiCpuPkg/CpuMmio2Dxe/CpuMmio2Dxe.inf" against "ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf" -- good: >| --- ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf 2023-11-21 17:30= :08.878750682 +0100 >| +++ UefiCpuPkg/CpuMmio2Dxe/CpuMmio2Dxe.inf 2024-02-01 22:56:42.1469= 86301 +0100 >| @@ -3,30 +3,31 @@ >| # >| # Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved. >| # Copyright (c) 2016, Linaro Ltd. All rights reserved.
>| +# Copyright (c) 2024 Loongson Technology Corporation Limited. All right= s reserved.
>| # >| # SPDX-License-Identifier: BSD-2-Clause-Patent >| # >| ## >| >| [Defines] >| - INF_VERSION =3D 0x00010005 >| - BASE_NAME =3D ArmPciCpuIo2Dxe >| - FILE_GUID =3D 168D1A6E-F4A5-448A-9E95-795661BB30= 67 >| + INF_VERSION =3D 1.29 >| + BASE_NAME =3D CpuMmio2Dxe >| + MODULE_UNI_FILE =3D CpuMmio2Dxe.uni >| + FILE_GUID =3D FBC36D76-CF22-2584-DBD8-85FF765BAE= F1 >| MODULE_TYPE =3D DXE_DRIVER >| VERSION_STRING =3D 1.0 >| - ENTRY_POINT =3D ArmPciCpuIo2Initialize >| + ENTRY_POINT =3D CpuMmio2Initialize >| >| # >| # The following information is for reference only and not required by t= he build tools. >| # >| -# VALID_ARCHITECTURES =3D ARM AARCH64 >| +# VALID_ARCHITECTURES =3D ARM AARCH64 LOONGARCH64 RISCV64 >| # >| >| [Sources] >| - ArmPciCpuIo2Dxe.c >| + CpuMmio2Dxe.c >| >| [Packages] >| - ArmPkg/ArmPkg.dec >| MdePkg/MdePkg.dec >| >| [LibraryClasses] * diffed "UefiCpuPkg/CpuMmio2Dxe/CpuMmio2Dxe.c" against "ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.c" -- good: >| --- ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.c 2023-11-21 17:30= :08.878750682 +0100 >| +++ UefiCpuPkg/CpuMmio2Dxe/CpuMmio2Dxe.c 2024-02-01 22:56:42.1469= 86301 +0100 >| @@ -3,6 +3,7 @@ >| >| Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.
>| Copyright (c) 2016, Linaro Ltd. All rights reserved.
>| +Copyright (c) 2024 Loongson Technology Corporation Limited. All rights = reserved.
>| >| SPDX-License-Identifier: BSD-2-Clause-Patent >| >| @@ -513,7 +514,7 @@ >| // >| // CPU I/O 2 Protocol instance >| // >| -STATIC EFI_CPU_IO2_PROTOCOL mCpuIo2 =3D { >| +STATIC EFI_CPU_IO2_PROTOCOL mCpuMmio2 =3D { >| { >| CpuMemoryServiceRead, >| CpuMemoryServiceWrite >| @@ -536,7 +537,7 @@ >| **/ >| EFI_STATUS >| EFIAPI >| -ArmPciCpuIo2Initialize ( >| +CpuMmio2Initialize ( >| IN EFI_HANDLE ImageHandle, >| IN EFI_SYSTEM_TABLE *SystemTable >| ) >| @@ -547,7 +548,7 @@ >| Status =3D gBS->InstallMultipleProtocolInterfaces ( >| &mHandle, >| &gEfiCpuIo2ProtocolGuid, >| - &mCpuIo2, >| + &mCpuMmio2, >| NULL >| ); >| ASSERT_EFI_ERROR (Status); Therefore, no changes in functionality are expected. - Furthermore, dug a bit down in git history, to see where the NULL class resolution for FdtPciPcdProducerLib comes from. It is commit 53ee81bb686c ("ArmVirtPkg/ArmVirtQemu: switch to generic PciHostBridgeDxe", 2016-09-02). Good. Therefore: Reviewed-by: Laszlo Ersek -=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 (#114970): https://edk2.groups.io/g/devel/message/114970 Mute This Topic: https://groups.io/mt/103971664/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-