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 D739DD811C3 for ; Wed, 27 Mar 2024 08:30:02 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=n/ip0tP+TPEz3QBPv4xKZs0Uae0+/mZ65oMdz0rmJwE=; 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:Resent-Date:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type; s=20240206; t=1711528201; v=1; b=iGWVSHnRLjm4OmqXn6BHbVpAR1Z723mbEqFmb+A8yVY0eB1VsFVn2rXACuBvtMBRwt3+bzpv /HPg2eSnjGrAJLWXOqCS9o18XKwEynk+/xadbdsU3R68yVEF0h7gR04jTpYM00JbI1N7ofYGQ84 C19jg4IMY9Ji3mNiilKHZfKOnmCPW3mXOC13UNLpAu3u6stnwIdNIii1EaJ4e8d+8wHP8sQRZZu wMKZBiVRP/889n/FdckQblN7dScbdXTHB9xkVfgE8WdkmYXRa9vDSqtG2MazMIvrrLRaiagZE8Z xSWhKkxSU654A+4+RKENhDiExJvxU7KUdkKboiC4C+fxA== X-Received: by 127.0.0.2 with SMTP id oJS6YY7687511xKytr4KX3Ka; Wed, 27 Mar 2024 01:30:01 -0700 X-Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by mx.groups.io with SMTP id smtpd.web10.32602.1711528200101691332 for ; Wed, 27 Mar 2024 01:30:00 -0700 X-Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 21819CE2381 for ; Wed, 27 Mar 2024 08:29:57 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60481C43390 for ; Wed, 27 Mar 2024 08:29:56 +0000 (UTC) X-Received: by mail-lj1-f176.google.com with SMTP id 38308e7fff4ca-2d6fd3cfaa6so2216971fa.2 for ; Wed, 27 Mar 2024 01:29:56 -0700 (PDT) X-Gm-Message-State: GgSDmjAlx1yup2R9tsk2Ksdfx7686176AA= X-Google-Smtp-Source: AGHT+IELTkss94KBsoIFcfr/1EgD4bfKchizh0oxeltaq24lvZRtemJNl31G03yNCTDHeFP7J7qrHVrltegod0b52E8= X-Received: by 2002:a2e:834e:0:b0:2d4:3c32:814d with SMTP id l14-20020a2e834e000000b002d43c32814dmr2594446ljh.26.1711528194712; Wed, 27 Mar 2024 01:29:54 -0700 (PDT) MIME-Version: 1.0 References: <20240326170742.4480-1-sami.mujawar@arm.com> In-Reply-To: <20240326170742.4480-1-sami.mujawar@arm.com> From: "Ard Biesheuvel" Date: Wed, 27 Mar 2024 10:29:43 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [edk2-devel] [PATCH v1 1/1] ArmVirtPkg: Kvmtool: Fix ACPI/DT boot selection To: Sami Mujawar 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 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 Resent-Date: Wed, 27 Mar 2024 01:30:00 -0700 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" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=iGWVSHnR; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=kernel.org (policy=none) Hello Sami, On Tue, 26 Mar 2024 at 19:07, Sami Mujawar 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 > Cc: Leif Lindholm > Cc: Gerd Hoffmann > Signed-off-by: Sami Mujawar > --- > 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] -=-=-=-=-=-=-=-=-=-=-=-