From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from esa1.hc3370-68.iphmx.com (esa1.hc3370-68.iphmx.com [216.71.145.142]) by mx.groups.io with SMTP id smtpd.web10.26137.1626689518097008908 for ; Mon, 19 Jul 2021 03:11:58 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@citrix.com header.s=securemail header.b=ETrRNUPm; spf=pass (domain: citrix.com, ip: 216.71.145.142, mailfrom: anthony.perard@citrix.com) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1626689517; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=z2WwLrSYkxIqp70/1wn41a6b+MyBnYfUy1vvMMtldUE=; b=ETrRNUPmrvYu/0Ku2kvloQ8bDz3Iyb2vhvZhLQz++zdP+nKXffsikX64 LnGclywGiriZqDGmrr6uNUgZaXLZLa6upskvZ1NelXUQvHGdglas+BhzU xDgjmQnMTgCeATBEzsO85cUNuVV/64HzyeLjyj/jN/4iQqVocabo6QIrO 8=; Authentication-Results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none IronPort-SDR: 49gANWc5zWXBZuY84vfDXv52K4KfDZH42cEMRijfo0MGVB/EdoXvHskNXJ4nK8jiOdXUHsZwID lrh1jeJzmh4uUPkZgVZRGOsreoMLFoGJHt3WPwXkeNV3w4+RrjN9kQzB8F2uwMydDIMGDYTYhc zXPkh5+4zG8QE3rbChYZ1wS6Cal8bhOwUOA776aa0ogiaCtIZJpQiiC+fCgrZzEvXL2kpDESRC goA3wsgQfrziokCqT/DycRpzLpOdDlxjcqFbB5tI6RKezD7EUkfPw3TMQco/Hc6CRHVQkEs2YH yzMkKGjZcn4Xy1A5q8HRA7Q/ X-SBRS: 5.1 X-MesageID: 48931723 X-Ironport-Server: esa1.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED IronPort-HdrOrdr: A9a23:vF3YsKuSIKcYuclcXd5ysRCV7skDdtV00zEX/kB9WHVpmszxra 6TddAgpHvJYVcqKRQdcL+7VZVoLUmxyXcx2/h3AV7AZniFhILLFuFfBOLZqlWKcREWtNQttp uIG5IObuEYZmIasS+V2maFL+o= X-IronPort-AV: E=Sophos;i="5.84,251,1620705600"; d="scan'208";a="48931723" Date: Mon, 19 Jul 2021 11:11:53 +0100 From: "Anthony PERARD" To: Gary Lin CC: , Laszlo Ersek , Ard Biesheuvel , Jordan Justen , Julien Grall , Jim Fehlig Subject: Re: [RFC PATCH] OvmfPkg/OvmfXen: set PcdAcpiS3Enable at initialization Message-ID: References: <20210708040549.8364-1-glin@suse.com> MIME-Version: 1.0 In-Reply-To: <20210708040549.8364-1-glin@suse.com> Return-Path: anthony.perard@citrix.com Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline On Thu, Jul 08, 2021 at 12:05:49PM +0800, Gary Lin 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. > > Setting PcdAcpiS3Enable at InitializeXenPlatform() "fixes" the crash > reported by my colleague. The other possible direction is to replace > QemuFwCfgS3Enabled() with PcdAcpiS3Enable. I'm not sure which one is > the right fix. QemuFwCfgS3Enabled() should always return false as we don't enable QEMU's fwcfg interface in most case when running a Xen guest. So I don't expect "PcdAcpiS3Enable" to ever been set via this patch. Now, maybe we want to set PcdAcpiS3Enable unconditionally but I don't know if S3 support is going to work as expected with OVMF under Xen, I never look at that. What kind of guest are you trying to fix? When does the crash happen? Thanks, -- Anthony PERARD