public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ard Biesheuvel" <ardb@kernel.org>
To: Sami Mujawar <sami.mujawar@arm.com>
Cc: devel@edk2.groups.io, ardb+tianocore@kernel.org,
	quic_llindhol@quicinc.com,  kraxel@redhat.com,
	Pierre.Gondois@arm.com, Akanksha.Jain2@arm.com,
	 Sibel.Allinson@arm.com, nd@arm.com
Subject: Re: [edk2-devel] [PATCH v1 1/1] ArmVirtPkg: Kvmtool: Fix ACPI/DT boot selection
Date: Wed, 27 Mar 2024 10:29:43 +0200	[thread overview]
Message-ID: <CAMj1kXGLp1BkGSVMWrAVKmKU7L7ZLyhn9vyx5O_OmK5x5VK6dw@mail.gmail.com> (raw)
In-Reply-To: <20240326170742.4480-1-sami.mujawar@arm.com>

Hello Sami,

On Tue, 26 Mar 2024 at 19:07, Sami Mujawar <sami.mujawar@arm.com> wrote:
>
> The Kvmtool guest firmware uses the dynamic HII
> PCD PcdForceNoAcpi to determine if ACPI tables
> or the DT must be used for booting an OS.
>
> This PcdForceNoAcpi is a BOOLEAN value that can
> be configured using the variable "ForceNoAcpi"
> specifing the gOvmfVariableGuid GUID which is
> "50BEA1E5-A2C5-46E9-9B3A-59596516B00A".
>
> However, this feature was not working as the
> PCD was not defined in the platform DSC file
> and the DEPEX section in KvmtoolPlatfomDxe.inf
> was not set correctly.
>

Understood. I do wonder whether gEfiVariableArchProtocolGuid is the
appropriate protocol here to DEPEX on. Shouldn't PcdDxe depend on this
already, and should we depend on the PCD protocol instead?

Other than that, this looks fine to me.

> Therefore, fix this issue so that the ACPI/DT
> boot selection can be done from the UEFI shell
> as shown below.
>
> 1. Check the status of the 'ForceNoAcpi' variable
>    setvar ForceNoAcpi -guid
>      "50BEA1E5-A2C5-46E9-9B3A-59596516B00A"
>      -nv -bs
>
>     Value 00 indicates ACPI boot
>     Value 01 indicates DT boot
>
> 2. Set the boot mode to ACPI
>    setvar ForceNoAcpi -guid
>      "50BEA1E5-A2C5-46E9-9B3A-59596516B00A"
>      -nv -bs =0x00
>
> 3. Set the boot mode to DT
>    setvar ForceNoAcpi -guid
>      "50BEA1E5-A2C5-46E9-9B3A-59596516B00A"
>      -nv -bs =0x01
>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Leif Lindholm <quic_llindhol@quicinc.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
> ---
> The changes can be seen at:
> https://github.com/samimujawar/edk2/tree/2954_kvmtool_fix_acpi_dt_selection_v1
>
>  ArmVirtPkg/ArmVirtKvmTool.dsc                        | 14 ++++++++++++++
>  ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.inf |  2 +-
>  2 files changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/ArmVirtPkg/ArmVirtKvmTool.dsc b/ArmVirtPkg/ArmVirtKvmTool.dsc
> index 20da3319667900e64755272fa110d57452d1fc67..c3c27b2765b34599c7312026ce5cb9474a22c684 100644
> --- a/ArmVirtPkg/ArmVirtKvmTool.dsc
> +++ b/ArmVirtPkg/ArmVirtKvmTool.dsc
> @@ -189,6 +189,20 @@ [PcdsPatchableInModule.common]
>  [PcdsDynamicHii]
>    gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|L"Timeout"|gEfiGlobalVariableGuid|0x0|5
>
> +  #
> +  #  Dynamic Hii PCD to select ACPI/DT boot.
> +  #
> +  #   1. Check the status of the 'ForceNoAcpi' variable
> +  #      setvar ForceNoAcpi -guid "50BEA1E5-A2C5-46E9-9B3A-59596516B00A" -nv -bs
> +  #        Value 00 indicates ACPI boot
> +  #        Value 01 indicates DT boot
> +  #   2. Set the boot mode to ACPI
> +  #      setvar ForceNoAcpi -guid "50BEA1E5-A2C5-46E9-9B3A-59596516B00A" -nv -bs =0x00
> +  #   3. Set the boot mode to DT
> +  #      setvar ForceNoAcpi -guid "50BEA1E5-A2C5-46E9-9B3A-59596516B00A" -nv -bs =0x01
> +  #
> +  gUefiOvmfPkgTokenSpaceGuid.PcdForceNoAcpi|L"ForceNoAcpi"|gOvmfVariableGuid|0x0|FALSE|NV,BS
> +
>  [PcdsDynamicDefault.common]
>    gArmTokenSpaceGuid.PcdArmArchTimerSecIntrNum|0x0
>    gArmTokenSpaceGuid.PcdArmArchTimerIntrNum|0x0
> diff --git a/ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.inf b/ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.inf
> index b0583d52058805aaeece31d7e3776ac498f101ad..508bfa60c2c2cb3f3e7456b010f4e9057437cda8 100644
> --- a/ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.inf
> +++ b/ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.inf
> @@ -42,4 +42,4 @@ [Pcd]
>    gUefiOvmfPkgTokenSpaceGuid.PcdForceNoAcpi
>
>  [Depex]
> -  TRUE
> +  gEfiVariableArchProtocolGuid
> --
> 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117160): https://edk2.groups.io/g/devel/message/117160
Mute This Topic: https://groups.io/mt/105162199/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



  reply	other threads:[~2024-03-27  8:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-26 17:07 [edk2-devel] [PATCH v1 1/1] ArmVirtPkg: Kvmtool: Fix ACPI/DT boot selection Sami Mujawar
2024-03-27  8:29 ` Ard Biesheuvel [this message]
2024-04-13 12:38   ` Sami Mujawar

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=CAMj1kXGLp1BkGSVMWrAVKmKU7L7ZLyhn9vyx5O_OmK5x5VK6dw@mail.gmail.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