From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by mx.groups.io with SMTP id smtpd.web09.20887.1629097876857401343 for ; Mon, 16 Aug 2021 00:11:17 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=gLlk2yDT; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: hpe.com, ip: 148.163.147.86, mailfrom: prvs=0862f9ff7b=gary.lin@hpe.com) Received: from pps.filterd (m0134421.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 17G6sXCq004136; Mon, 16 Aug 2021 07:11:15 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=date : from : to : cc : subject : message-id : references : content-type : in-reply-to : mime-version; s=pps0720; bh=wfKjkRaWeRXJS0yKJTngpC5vNg+gTSlvrrRbaFj5LQ0=; b=gLlk2yDTvVTaOQkhsQ3JZnBgpSbsktK2fjPO+g6W/vGWMP2dGdp1xL5IxHhGHpkXDPIX wZkacnyzTYqzIQs8vu+nEOYvSY2LItDS94GPh/xNbHyRCIyf6tztLM5V0ItuJLRjSNat G2XzHJQqJihWhdklxv0o4emolFJ1Ov0bvOBqDu6hnEwXZtR73SpN75aXHogzwFbpCPFw yJR08ZqQImp5vJiw+8a9z1L9XTASHl3/Y15QiTUKsIgIpipuvADE1wxZSEzORlRBeBvm NxkytsDDrChP/GgoEu29zx5uyxSvcyf8Ul8wj5ZoUN4OgWdrBX2O22kG6+JYobwzrWba Uw== Received: from g4t3426.houston.hpe.com (g4t3426.houston.hpe.com [15.241.140.75]) by mx0b-002e3701.pphosted.com with ESMTP id 3aeq71ew9p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 16 Aug 2021 07:11:15 +0000 Received: from G9W9209.americas.hpqcorp.net (g9w9209.houston.hpecorp.net [16.220.66.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by g4t3426.houston.hpe.com (Postfix) with ESMTPS id 754D64E; Mon, 16 Aug 2021 07:11:14 +0000 (UTC) Received: from G9W9210.americas.hpqcorp.net (2002:10dc:429b::10dc:429b) by G9W9209.americas.hpqcorp.net (2002:10dc:429c::10dc:429c) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Mon, 16 Aug 2021 07:11:13 +0000 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (15.241.52.13) by G9W9210.americas.hpqcorp.net (16.220.66.155) with Microsoft SMTP Server (TLS) id 15.0.1497.18 via Frontend Transport; Mon, 16 Aug 2021 07:11:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Em+7qwtsPRvCm29/rJIjBnp1uDEAT/RLOZcTpD9scVjE0KToCVj2z7mK5p+EadIjprVOVs+Br5OJhGRSjubgeUmoRjPXi4k0WCO6lBNBVGijMcj8HHcb38zH+KsDLZ3cwN7sWGQHqvT5xPY1/pGTT6anNug4T0vRrCo0YV7dOTipw2RMOGeM6xypMEsIMrvNrNjpZF1hHNVwiyA+iTpNHIr8DD676RTSnLyVw/nz2pbezZcjuGDMluFwGLSTlax0y84MICgy2g7QM9R5Hh+3CLZjKXdeS0A/uVofbTnQGlahWw5HDGz+0vg2oSFqaWh62IQ++ChvuWrKK0wWv3U2nQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wfKjkRaWeRXJS0yKJTngpC5vNg+gTSlvrrRbaFj5LQ0=; b=guvHUaQ71p2LGStiiwbSaHZE5Cwii6EDwfgOEXe7Y25ipLVO7rtGPqhG/36JZBe7lJdiwBUKfqrPEMxAUDdaWBDX6zEn85U4D4AMXdvjErRftH4P8ZTUFZMxx4AHXvZgad9mu84z1yik1BbzPfAiKHJGebBRenT7O4yrKOVOI3S3RBZ7/Dniq1WgsjpDEDaSIs0uYp5xuaZwH7Jqeyo308cs2p38+VBLaX8rvNNDw5FWdJEGyB2q6Lt1ogL6jMz9zsVus1zKicCZu8jzhUJrQW2yyoIemXDuXz/HDENfgB143LHV5znGTu5Y0MFyr1PnEwaWPtWZIFYG1ndzXwFbtw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=hpe.com; dmarc=pass action=none header.from=hpe.com; dkim=pass header.d=hpe.com; arc=none Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=hpe.com; Received: from AT5PR8401MB0387.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:741f::21) by AT5PR8401MB0563.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:7424::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.17; Mon, 16 Aug 2021 07:11:12 +0000 Received: from AT5PR8401MB0387.NAMPRD84.PROD.OUTLOOK.COM ([fe80::106b:abb8:386b:a2db]) by AT5PR8401MB0387.NAMPRD84.PROD.OUTLOOK.COM ([fe80::106b:abb8:386b:a2db%9]) with mapi id 15.20.4415.023; Mon, 16 Aug 2021 07:11:12 +0000 Date: Mon, 16 Aug 2021 15:11:05 +0800 From: "Lin, Gary (HPS OE-Linux)" To: Ard Biesheuvel CC: edk2-devel-groups-io , Ard Biesheuvel , Jiewen Yao , Jordan Justen , Anthony Perard , Julien Grall , Jim Fehlig , Joey Li Subject: Re: [edk2-devel] [PATCH v2 1/5] OvmfPkg/OvmfXen: set PcdAcpiS3Enable at initialization Message-ID: References: <20210813061305.17519-1-gary.lin@hpe.com> <20210813061305.17519-2-gary.lin@hpe.com> In-Reply-To: X-ClientProxiedBy: SA0PR11CA0198.namprd11.prod.outlook.com (2603:10b6:806:1bc::23) To AT5PR8401MB0387.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:741f::21) X-MS-Exchange-MessageSentRepresentingType: 1 Received: from GaryHPELaptop (111.240.112.145) by SA0PR11CA0198.namprd11.prod.outlook.com (2603:10b6:806:1bc::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14 via Frontend Transport; Mon, 16 Aug 2021 07:11:09 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 43ddb723-204f-427c-29cd-08d96085076c X-MS-TrafficTypeDiagnostic: AT5PR8401MB0563: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lQo4udK4hZGkhoTN8js4SXQ33XA5sTAK2eKJcNU28H5i32aarpjVd3lR5SQSmtritPh4Gz8aRyX40JFYRpOyfrI+8n6uoO4ugCSAMVkFvo6YdY1fauHj2KyLQWItnfX46u2QEwY0TYUW+Q6yyaTVwYk585p9U3XhL30nixuQ9WDhNIHpaUsT91qmjQmg4gAc2a2UJjLRj94FRevho19JKKj788b/aZe72QA2JCj/aDRds0NbwRhNXu3FShHWXiaLZsXaBq48mSvLU8sIs0Bw2MGGAkku+DNsgeVl/RR9keWVGwJfF6BeDZ9C3LRIEa3QwVAW/5PS+/1fJwQCQRkWhrzpMhGQGCVwwVNI0uKPNBdkr3OnzwpOcDxqtlwziRbio5heN5wFJ8Gbc8QjiPNUkuETiniYMWpVjnfJf4VMX3FS4T1gtJNVx3ICWZr1Tw8aP8KIDD1gEPBVCA2rZbdRCIvhtkUEfSZluM8kPVbtBVidjGi6vabFT8nRdZvNYb8+uHIrbI6ep90DW/e8CPPxJOjeBeEj1WPJlA6M5tIYLfjXN+HluKI6x4e38NTdhH61bIq+xOpKmlAAIu2vSBC0vdxH4fymlUw4S2gxEaM8dENhyJqioBqGLQgDMIqVskGDeTn56laF/u1NzqaVMSAcPzvXo6i4kUW7unIoPdh0lGZY3MWpBxNIorp9e+eiQUe+7Jny1Hu1XJxjUfcOYeJZAeRM/BeEOR4SO3QvmxtMkw8Ye+obivjnrvaN2uRZ9bP/d4J3yQVp2wSbI9vBgets9g== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AT5PR8401MB0387.NAMPRD84.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(396003)(136003)(366004)(39860400002)(376002)(346002)(66476007)(2906002)(38100700002)(8676002)(66556008)(66946007)(33716001)(478600001)(966005)(5660300002)(8936002)(316002)(9686003)(6666004)(54906003)(956004)(6916009)(26005)(186003)(86362001)(4326008)(83380400001)(55016002)(6496006)(19627235002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?6Y0b344AbDRZkI33RDve9jT2I5LmxzmIgMYTLomvMX74UgptmLJcfTXo+Eq9?= =?us-ascii?Q?pV8iBr8V0jtfd6FT338tDEq9a7PVrFPlYwCRwqguH4T9AqEaR3n39zJz+v20?= =?us-ascii?Q?K1jvDXWh99RGYXsDcuPfMIREkt3TMkX3NXkO7+o5ssGtZ6D5oqHTplH/CMIq?= =?us-ascii?Q?DSiFowBiF76LRg/YK/8wOJ062MxRDENHY//lOZrsKDl+mNU2w5wXUNKARb8s?= =?us-ascii?Q?KqYq8jTFWv8QtIs5Wq7eSUocyVzhRMoIToam03cqRFqvAyHzu7YJ2kGHimDe?= =?us-ascii?Q?4PmKW0dd1oLRtVsFQ2SQK5MBwf+ZGLnGc6DiYWvgs/YQ3fOf0uVwZidn7YJY?= =?us-ascii?Q?USFBgDHg+M+AjWBmXmfoiCySEAmIo/kgnpXwGH1Wxq+tM3Eh9bl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2ZQR0U/A4tTSsMrCv8C0tlofa0KkflvDs6qE?= =?us-ascii?Q?I8CpoQn2qgJV6JgINH0IY8LG?= X-MS-Exchange-CrossTenant-Network-Message-Id: 43ddb723-204f-427c-29cd-08d96085076c X-MS-Exchange-CrossTenant-AuthSource: AT5PR8401MB0387.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Aug 2021 07:11:12.2970 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: EYacxmkfmm/4tBchOc26GMx5dKBZL5scDHjsB7VtrwsCeqTGGJ4X4QkkAc6GM9PfkRMG4OYMI9RimBtIuUBMMQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AT5PR8401MB0563 X-OriginatorOrg: hpe.com X-Proofpoint-GUID: Mz2AzD3n-BSRVSjsInfOYjAUCbnNvzW8 X-Proofpoint-ORIG-GUID: Mz2AzD3n-BSRVSjsInfOYjAUCbnNvzW8 X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-08-16_02:2021-08-13,2021-08-16 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 bulkscore=0 mlxlogscore=999 impostorscore=0 adultscore=0 spamscore=0 priorityscore=1501 clxscore=1011 mlxscore=0 suspectscore=0 lowpriorityscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2108160045 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Aug 16, 2021 at 09:07:01AM +0200, Ard Biesheuvel wrote: > Does this series have a cover letter? > Sorry, I forgot to add Cc tags in the cover letter. https://edk2.groups.io/g/devel/topic/84857762#79245 Gary Lin > 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 > > > > > > > > > > > >