public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Laszlo Ersek" <lersek@redhat.com>
To: zhiguang.liu@intel.com, Ray Ni <ray.ni@intel.com>,
	Dong Guo <guo.dong@intel.com>
Cc: devel@edk2.groups.io, Jian J Wang <jian.j.wang@intel.com>,
	Hao A Wu <hao.a.wu@intel.com>, Dandan Bi <dandan.bi@intel.com>,
	Liming Gao <gaoliming@byosoft.com.cn>
Subject: Re: [edk2-devel] [Patch V2 0/2] Let AcpiTableDxe driver install Acpi table from Hob
Date: Tue, 23 Mar 2021 13:40:26 +0100	[thread overview]
Message-ID: <f3ed88c6-aea1-d947-ae01-cb0de2d82f64@redhat.com> (raw)
In-Reply-To: <20210323032438.950-3-zhiguang.liu@intel.com>

On 03/23/21 04:24, Zhiguang Liu wrote:
> If HOB contains APCI table information, entry point of AcpiTableDxe.inf
> should parse the APCI table from HOB, and install these tables.
> We assume the whole ACPI table (starting with EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER)
> is contained by a single gEfiAcpiTableGuid HOB.
> This way, for UefiPayloadPkg, there is no need to specially hanle acpi table.
> 
> Zhiguang Liu (2):
>   MdeModulePkg/ACPI: Install ACPI table from HOB.
>   UefiPayloadPkg: Remove code that installs APCI
> 
>  MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf    |   3 ++-
>  MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c | 134 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------
>  UefiPayloadPkg/BlSupportDxe/BlSupportDxe.c                   |  13 ++-----------
>  UefiPayloadPkg/BlSupportDxe/BlSupportDxe.h                   |   5 +----
>  UefiPayloadPkg/BlSupportDxe/BlSupportDxe.inf                 |   5 ++---
>  5 files changed, 133 insertions(+), 27 deletions(-)
> 

Where does this idea come from?

(1) There is no bugzilla for this, apparently (not linked in the commit
messages anyway).

(2) Also, I'm not sure if reusing an existing (and standardized) GUID
for this purpose is a good idea. I think an edk2-only
(MdeModulePkg-defined), brand new GUID, for the HOB, would be better.

(3) I'm also not convinced at all that this *whole approach* is sound.

The fact that UefiPayloadPkg has the ACPI content available to it in a
particular data representation (as a HOB, for example) is just a
platform trait. Why should that platform trait leak into the central
implementation of the ACPI table protocol?

UefiPayloadPkg can call the ACPI table protocol interfaces to install
its tables. OVMF does the same -- OVMF also does not construct its own
ACPI tables, but downloads them in a quirky representation from QEMU. We
didn't hack the central AcpiTableDxe driver for that use case; instead,
we dissected the blob (in OvmfPkg) into individual tables, and called
the proper ACPI table protocol method (InstallAcpiTable()) with the
individual tables.

I disagree with the code complexity / platform quirk in AcpiTableDxe. At
the bare minimum, this feature should be possible to compile out
altogether. I don't necessarily mean a FeaturePCD; there could be a new
INF file too, that shares most of the functionality with the current
core driver, but also includes (from a different source file) the new logic.

But I'd really like if this mess were kept out of MdeModulePkg
altogether. It's the job of the platform ACPI driver to use the ACPI
table protocol.

Of course if you can show that this HOB usage is standard / publicly
specified, that's different.

Please do not merge this series.

Laszlo


  reply	other threads:[~2021-03-23 12:40 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-23  3:24 [Patch V2 1/2] MdeModulePkg/ACPI: Install ACPI table from HOB Zhiguang Liu
2021-03-23  3:24 ` [Patch V2 2/2] UefiPayloadPkg: Remove code that installs APCI Zhiguang Liu
2021-03-23  3:44   ` Ni, Ray
2021-03-23  5:19   ` Guo Dong
2021-03-23  3:24 ` [Patch V2 0/2] Let AcpiTableDxe driver install Acpi table from Hob Zhiguang Liu
2021-03-23 12:40   ` Laszlo Ersek [this message]
2021-03-23 15:45     ` [edk2-devel] " Guo Dong
2021-03-23 16:12       ` Andrew Fish
2021-03-23 17:29         ` Guo Dong
2021-03-24  5:30         ` Ni, Ray
2021-03-23 16:48       ` Laszlo Ersek
2021-03-23 17:15         ` Guo Dong
2021-03-24  9:50           ` Laszlo Ersek
2021-03-24  4:09         ` Ni, Ray
2021-03-24 10:29           ` Laszlo Ersek
2021-03-23 23:52     ` Benjamin Doron
2021-03-24  9:53       ` Laszlo Ersek
2021-03-24 16:55         ` Benjamin Doron
2021-03-24 18:33           ` Laszlo Ersek
2021-03-25  1:10             ` Ni, Ray
2021-03-25  3:55               ` Andrew Fish
2021-03-25 17:35                 ` Laszlo Ersek
2021-03-25 17:33               ` Laszlo Ersek
2021-03-25  1:39             ` Benjamin Doron
2021-03-23  3:44 ` [Patch V2 1/2] MdeModulePkg/ACPI: Install ACPI table from HOB Ni, Ray

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f3ed88c6-aea1-d947-ae01-cb0de2d82f64@redhat.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox