From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by mx.groups.io with SMTP id smtpd.web11.20969.1629097634707982326 for ; Mon, 16 Aug 2021 00:07:14 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Gcqnj8sf; spf=pass (domain: kernel.org, ip: 198.145.29.99, mailfrom: ardb@kernel.org) Received: by mail.kernel.org (Postfix) with ESMTPSA id 1209F61A8E for ; Mon, 16 Aug 2021 07:07:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1629097633; bh=py/M5lPsEYWNmR0QfNfEtsm7bndqfnqEM3wT9UnPNc0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Gcqnj8sfqYva3yvtgmowYPxpj7q0PoAbZ7oLyamyZiw+z0hIf4H3LRy2o9Z1wdm8V Yoa41eoUseu7UoNwLdOTrrvigZeRQtOYwD5F5Ou6ouA9UNisMr86XvZk8YRaVxtdg5 XOQQXuV17y/MlXLDo1COOKFsEyT/7Vml20lj126XAZdLgsGR2zUm93wZFa5fcM/AG0 5WnyYEaYwfjowL/2daGOEMGTPllqyTndTdQFupK2D1yvIqfUilFTV6hyQByey3uoQP joI3uc0QmKHXMe4Mr5N7n6pSSHdg4Bm1NkgQ8ArXGU15UNbYjntzSeEsgtpE7B0W2S GOCXj7oLDlIuQ== Received: by mail-ot1-f53.google.com with SMTP id c19-20020a9d6153000000b0051829acbfc7so4941942otk.9 for ; Mon, 16 Aug 2021 00:07:13 -0700 (PDT) X-Gm-Message-State: AOAM531xbxtVw4N6YuqDnZpB72B1ZnLm6gSSHMZJ0Z7+WR4NG5RdcPDF P2G8/n9YB2rqabrxWWx9oVx39CJeQe+/ZoCbtM0= X-Google-Smtp-Source: ABdhPJyqkPykWgd+s7aJ8mz/V/qTREh0xpXVcfrg5kl+grCyGHodVdBsUYQG3KKWep6KOpLxiuCeXSCTzHW+Bi1zjww= X-Received: by 2002:a9d:5c2:: with SMTP id 60mr11235455otd.77.1629097632427; Mon, 16 Aug 2021 00:07:12 -0700 (PDT) MIME-Version: 1.0 References: <20210813061305.17519-1-gary.lin@hpe.com> <20210813061305.17519-2-gary.lin@hpe.com> In-Reply-To: <20210813061305.17519-2-gary.lin@hpe.com> From: "Ard Biesheuvel" Date: Mon, 16 Aug 2021 09:07:01 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [edk2-devel] [PATCH v2 1/5] OvmfPkg/OvmfXen: set PcdAcpiS3Enable at initialization To: edk2-devel-groups-io , gary.lin@hpe.com Cc: Ard Biesheuvel , Jiewen Yao , Jordan Justen , Anthony Perard , Julien Grall , Jim Fehlig , Joey Li Content-Type: text/plain; charset="UTF-8" Does this series have a cover letter? On Fri, 13 Aug 2021 at 08:13, Lin, Gary (HPS OE-Linux) wrote: > > There are several functions in OvmfPkg/Library using > QemuFwCfgS3Enabled() to detect the S3 support status. However, in > MdeModulePkg, PcdAcpiS3Enable is used to check S3 support. Since > InitializeXenPlatform() didn't set PcdAcpiS3Enable as > InitializePlatform() did, this made the inconsistency between > drivers/functions. > > For example, S3SaveStateDxe checked PcdAcpiS3Enable and skipped > S3BootScript because the default value is FALSE. On the other hand, > PlatformBootManagerBeforeConsole() from OvmfPkg/Library called > QemuFwCfgS3Enabled() and found it returned TRUE, so it invoked > SaveS3BootScript(). However, S3SaveStateDxe skipped S3BootScript, so > SaveS3BootScript() asserted due to EFI_NOT_FOUND. > > This issue mainly affects "HVM Direct Kernel Boot". If "acpi_s3" is > set as "True" in xl.cfg, then the S3 Support bit is set and passed > with fw_cfg. > > v2: > - Amend the description and address "HVM Direct Kernel Boot" > - Add the comment for the conditional test of QemuFwCfgS3Enabled() > - Remove unused QemuFwCfgLib > > Cc: Ard Biesheuvel > Cc: Jiewen Yao > Cc: Jordan Justen > Cc: Anthony Perard > Cc: Julien Grall > Cc: Jim Fehlig > Cc: Joey Li > Signed-off-by: Gary Lin > --- > OvmfPkg/XenPlatformPei/XenPlatformPei.inf | 2 ++ > OvmfPkg/XenPlatformPei/Platform.c | 13 +++++++++++++ > 2 files changed, 15 insertions(+) > > diff --git a/OvmfPkg/XenPlatformPei/XenPlatformPei.inf b/OvmfPkg/XenPlatformPei/XenPlatformPei.inf > index 597cb6fcd7ff..20c27ff34b6c 100644 > --- a/OvmfPkg/XenPlatformPei/XenPlatformPei.inf > +++ b/OvmfPkg/XenPlatformPei/XenPlatformPei.inf > @@ -57,6 +57,7 @@ [LibraryClasses] > ResourcePublicationLib > > PeiServicesLib > > PeimEntryPoint > > + QemuFwCfgS3Lib > > MtrrLib > > MemEncryptSevLib > > PcdLib > > @@ -79,6 +80,7 @@ [Pcd] > gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Base > > gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Size > > gUefiOvmfPkgTokenSpaceGuid.PcdQ35TsegMbytes > > + gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiS3Enable > > gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize > > gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved > > gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode > > diff --git a/OvmfPkg/XenPlatformPei/Platform.c b/OvmfPkg/XenPlatformPei/Platform.c > index a811e72ee301..e60478fdb493 100644 > --- a/OvmfPkg/XenPlatformPei/Platform.c > +++ b/OvmfPkg/XenPlatformPei/Platform.c > @@ -26,6 +26,7 @@ > #include > > #include > > #include > > +#include > > #include > > #include > > #include > > @@ -423,6 +424,8 @@ InitializeXenPlatform ( > IN CONST EFI_PEI_SERVICES **PeiServices > > ) > > { > > + EFI_STATUS Status; > > + > > DEBUG ((DEBUG_INFO, "Platform PEIM Loaded\n")); > > > > DebugDumpCmos (); > > @@ -433,6 +436,16 @@ InitializeXenPlatform ( > CpuDeadLoop (); > > } > > > > + // > > + // This S3 conditional test is mainly for HVM Direct Kernel Boot since > > + // QEMU fwcfg isn't really supported other than that. > > + // > > + if (QemuFwCfgS3Enabled ()) { > > + DEBUG ((DEBUG_INFO, "S3 support was detected on QEMU\n")); > > + Status = PcdSetBoolS (PcdAcpiS3Enable, TRUE); > > + ASSERT_EFI_ERROR (Status); > > + } > > + > > XenConnect (); > > > > BootModeInitialization (); > > -- > 2.31.1 > > > > > >