From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web08.23071.1641994961448387148 for ; Wed, 12 Jan 2022 05:42:41 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: pierre.gondois@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 82C1AD6E; Wed, 12 Jan 2022 05:42:40 -0800 (PST) Received: from [10.34.125.14] (e126645.nice.arm.com [10.34.125.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BF1493F766; Wed, 12 Jan 2022 05:42:39 -0800 (PST) Subject: Re: [PATCH v2 0/6] Add ACPI support for Kvmtool To: Ard Biesheuvel Cc: edk2-devel-groups-io , Sami Mujawar References: <20220111161611.957688-1-Pierre.Gondois@arm.com> From: "PierreGondois" Message-ID: <5ccadb6a-c84d-218a-f9ff-37e23ac60907@arm.com> Date: Wed, 12 Jan 2022 14:42:57 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------BC3F0A2E5A6195741B4793B6" Content-Language: en-US --------------BC3F0A2E5A6195741B4793B6 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Hi Ard, On 1/12/22 12:16 PM, Ard Biesheuvel wrote: > On Wed, 12 Jan 2022 at 11:51, Ard Biesheuvel wrote: >> On Tue, 11 Jan 2022 at 17:16, wrote: >>> From: Pierre Gondois >>> >>> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3742 >>> V1: https://edk2.groups.io/g/devel/message/76990 >>> V2: >>> - New patch: "DynamicTablesPkg: Print specifier macro for >>> CM_OBJECT_ID" [Laszlo] >>> - Only add AcpiView for ArmVirtKvmTool instead of all ArmVirt >>> platforms. This is done using a 'ACPIVIEW_ENABLE' switch. >>> [Laszlo] >>> - Only generate ACPI tables for AARCH64. [Laszlo] >>> - Various modifications (error handling, patch organization, >>> coding style, etc). [Laszlo] >>> >>> The changes can be seen at: https://github.com/PierreARM/edk2/tree/1456_Add_ACPI_support_for_Kvmtool_v2 >>> >>> Kvmtool dynamically generates a device tree describing the platform >>> to boot on. Using the patch-sets listed below, the DynamicTables >>> framework generates ACPI tables describing a similar platform. >>> >>> This patch-set: >>> - adds a ConfigurationManager and make use of the DynamicTablesPkg >>> in for Kvmtool for AARCH64, allowing to generate ACPI tables >>> - adds the acpiview command line utility to the ArmVirtPkg >>> platform that request if via the ACPIVIEW_ENABLE macro >>> - update ArmVirtPkg.ci.yaml to add new words and use the >>> DynamicTablesPkg >>> - adds a print specifier macro for the CM_OBJECT_ID type >>> >>> With this patchset, KvmTool on AARCH64 will use ACPI tables instead >>> of a Device Tree (cf PcdForceNoAcpi Pcd). >>> >> How did you test this? Can we boot Linux in ACPI mode with these changes? >> > I managed to run this with a recent kvmtool and a recent kernel > (v5.15+), which recognizes DBG2 serial port type 18. > > I do see some errors in the log, though: > > [ 4.590652] No ACPI PMU IRQ for CPUn > > (for each CPU) > > and > > ACPI: IORT: [Firmware Bug]: Root complex missing memory address limit > ACPI: \_SB_.PCI0.LNKA: _CRS 36 not found in _PRS > ACPI: \_SB_.PCI0.LNKA: No IRQ available. Try pci=noacpi or acpi=off > > (for each virtio-pci device) Yes effectively, a recent kernel handling 'ACPI_DBG2_16550_WITH_GAS' is required to boot. About the error messages, I should have seen them. I will send a v3 handling them. Regards, Pierre --------------BC3F0A2E5A6195741B4793B6 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit

Hi Ard,

On 1/12/22 12:16 PM, Ard Biesheuvel wrote:
On Wed, 12 Jan 2022 at 11:51, Ard Biesheuvel <ardb@kernel.org> wrote:
On Tue, 11 Jan 2022 at 17:16, <Pierre.Gondois@arm.com> wrote:
From: Pierre Gondois <Pierre.Gondois@arm.com>

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3742
V1: https://edk2.groups.io/g/devel/message/76990
V2:
- New patch: "DynamicTablesPkg: Print specifier macro for
  CM_OBJECT_ID" [Laszlo]
- Only add AcpiView for ArmVirtKvmTool instead of all ArmVirt
  platforms. This is done using a 'ACPIVIEW_ENABLE' switch.
  [Laszlo]
- Only generate ACPI tables for AARCH64. [Laszlo]
- Various modifications (error handling, patch organization,
  coding style, etc). [Laszlo]

The changes can be seen at: https://github.com/PierreARM/edk2/tree/1456_Add_ACPI_support_for_Kvmtool_v2

Kvmtool dynamically generates a device tree describing the platform
to boot on. Using the patch-sets listed below, the DynamicTables
framework generates ACPI tables describing a similar platform.

This patch-set:
 - adds a ConfigurationManager and make use of the DynamicTablesPkg
   in for Kvmtool for AARCH64, allowing to generate ACPI tables
 - adds the acpiview command line utility to the ArmVirtPkg
   platform that request if via the ACPIVIEW_ENABLE macro
 - update ArmVirtPkg.ci.yaml to add new words and use the
   DynamicTablesPkg
 - adds a print specifier macro for the CM_OBJECT_ID type

With this patchset, KvmTool on AARCH64 will use ACPI tables instead
of a Device Tree (cf PcdForceNoAcpi Pcd).

How did you test this? Can we boot Linux in ACPI mode with these changes?

I managed to run this with a recent kvmtool and a recent kernel
(v5.15+), which recognizes DBG2 serial port type 18.

I do see some errors in the log, though:

[    4.590652] No ACPI PMU IRQ for CPUn

(for each CPU)

and

ACPI: IORT: [Firmware Bug]: Root complex missing memory address limit
ACPI: \_SB_.PCI0.LNKA: _CRS 36 not found in _PRS
ACPI: \_SB_.PCI0.LNKA: No IRQ available. Try pci=noacpi or acpi=off

(for each virtio-pci device)

Yes effectively, a recent kernel handling 'ACPI_DBG2_16550_WITH_GAS' is required to boot.

About the error messages, I should have seen them. I will send a v3 handling them.

Regards,

Pierre

--------------BC3F0A2E5A6195741B4793B6--