From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by mx.groups.io with SMTP id smtpd.web11.33292.1628835215868328229 for ; Thu, 12 Aug 2021 23:13:36 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=CDYjeMA6; 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.143.35, mailfrom: prvs=085980678f=gary.lin@hpe.com) Received: from pps.filterd (m0134424.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 17D649x7003746; Fri, 13 Aug 2021 06:13:34 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=pps0720; bh=C7Ow+KfMeMhdELl6nKGwZqwLE6qYIseEbfsHBR97/08=; b=CDYjeMA6YEjeEfTA01r6BqRwsUEu5Hn8fLncrrKMIgYBYV8ZLJY7vLWlpiMxrE0KUpr2 Wt6vG33I4Z7N2QdI6OnTVi1Rlu+E/Qmv7sNAebZDAFm+Q06Gcw41TFVzuCWr4Ht3vYRB 6SinLWc1iHFsvdkpTfNRGXMs8PYQ5RknVg9yPg3E1NUaieUT7/2NN1Ymn2VrTrpaxRjt xKphCohQquoF6PlbKfB6/yzsC7oDtoi1vjolo95/iTi77Voafg+F2LHiZsv7lQhWMtrI IWYEDOREAlbY8nO+1RFVRwB72h/cChzD86xxG2nrviekodD7iH7kKSWMlo3vH3ac8MsL DA== Received: from g4t3425.houston.hpe.com (g4t3425.houston.hpe.com [15.241.140.78]) by mx0b-002e3701.pphosted.com with ESMTP id 3ad2027s0j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 13 Aug 2021 06:13:33 +0000 Received: from G1W8106.americas.hpqcorp.net (g1w8106.austin.hp.com [16.193.72.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by g4t3425.houston.hpe.com (Postfix) with ESMTPS id BF47ABD; Fri, 13 Aug 2021 06:13:31 +0000 (UTC) Received: from G9W8674.americas.hpqcorp.net (16.220.49.0) by G1W8106.americas.hpqcorp.net (16.193.72.61) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Fri, 13 Aug 2021 06:13:31 +0000 Received: from G9W9210.americas.hpqcorp.net (2002:10dc:429b::10dc:429b) by G9W8674.americas.hpqcorp.net (2002:10dc:3100::10dc:3100) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Fri, 13 Aug 2021 06:13:31 +0000 Received: from NAM12-BN8-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; Fri, 13 Aug 2021 06:13:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D8hhMkBGyV1idL+MCXEYJhRA3HvcqKx5mEUJpXt3FyDVCZyuYqoHUQdHwhhI64gCqy1k8Ybz2s3pno7rSmQfjEqazcYESgRy+GsNbNEjb6LlYBogsDwfMHTuR3OtD2jxe+BE1BK9s4MPu1D+zDK801pfj/kBukYd6VG4/jhN584mFpXOMwUM4d/qCUhCn134hFzoaccHOW5+a7gop+h+aL4XM7u8ePV66+PgMWNS+xTvZliv+1xlvUUS+XMlVAEX3uuJRl2bR1TPcucURvcsg9P9JvvNTrT71E/ejtx8nA2QjEUWrQM++QSRCe5sK4hsOFCWIkWfrjN0qlmWrYyFZg== 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=C7Ow+KfMeMhdELl6nKGwZqwLE6qYIseEbfsHBR97/08=; b=VpbBPF13/DI5p8xmNy5u/Rax8FoBRh/lDGV5STVP95dK/3kRLiRYoXIFEcG95qltLMt9c3X4wgcw3swak4S3N1kDh/XEfRwnES1kUWogWdMlwmiI6a7ywMM0NU32zYO+aWo933AaDusEbI6PecHUXffqjPiFcBYWAGe0UVWLmVKOWev9hm8Syy8MGdqvHJuOFIPDT0eyX7CA1FGliKOnQMuTO/hxLT7tu4ubkVPhaEUaQQjDWE+ZsdG9fawevfUFbswicA+9JUyhv844vdgocV4kk6EoruCYg0kkG6GTbRRPB7v6HPRCuz1/Fhiug+wS67MrH8EUyEI+/e1PfpVuiw== 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: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=hpe.com; Received: from AT5PR8401MB0387.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:741f::21) by AT5PR8401MB1185.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:7420::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.17; Fri, 13 Aug 2021 06:13:24 +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.018; Fri, 13 Aug 2021 06:13:24 +0000 From: "Lin, Gary (HPS OE-Linux)" To: CC: Ard Biesheuvel , Jiewen Yao , Jordan Justen , "Anthony Perard" , Julien Grall , Jim Fehlig , Joey Li Subject: [PATCH v2 1/5] OvmfPkg/OvmfXen: set PcdAcpiS3Enable at initialization Date: Fri, 13 Aug 2021 14:13:01 +0800 Message-ID: <20210813061305.17519-2-gary.lin@hpe.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210813061305.17519-1-gary.lin@hpe.com> References: <20210813061305.17519-1-gary.lin@hpe.com> X-ClientProxiedBy: HK2PR02CA0221.apcprd02.prod.outlook.com (2603:1096:201:20::33) To AT5PR8401MB0387.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:741f::21) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost (111.240.110.200) by HK2PR02CA0221.apcprd02.prod.outlook.com (2603:1096:201:20::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.14 via Frontend Transport; Fri, 13 Aug 2021 06:13:24 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c0343e4b-e7a7-4324-1cba-08d95e217550 X-MS-TrafficTypeDiagnostic: AT5PR8401MB1185: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: O9FEwqOOEnz1qWZtabUg5aTFCyPcdCgsB527mIe6ukG2I7NrJNgPgTPKeK5GEHtVmjQkw9n5+ugX5pnv93gMSiQi/7bEAW77lTKFKcH+MRbwxW29GJ2FS8mqaZn2TYqsDnBUyXNnEPpaTuGN/2G+bO1gENjh8RbdPKcoYk5IkTWpqSwXyLSdCtM2bCZ7Ht+BRu0ZfxFezebYSgv4LqzyqUCyd5w0WGx+JrAEEUvHNjyRBKSyC3cdlGuZTqmprS+Gy7XIQpxt5k0fTM7UGbw+SAOvLAnaLK6dr8sKHvFTNBbxlSQtfsPwta2/WfAc10yeaLMnNP7Q6A9v3HLhD8f3ztFuAmCgB307OiLOnhen/BG9u8Xr0Wli7rtKjES72GY3e3F1tEgw/2pzOnYJbH9xDfQbutU07QaTrhUf7fvu0m6X0YFrsQ7l8RxEuQh4uzKI2MEiatl2PKGRkR2Fw115TzcZ16CaOZeEULnrvOVHz0FC04xXzk/F74q46+bPBx13x3kU6gsNyYX2BG6XQjWN407h8nkXliQMoFHpe1oE95TmMBOQwQ/ydNwS9wIMzxZlXhzHwXwJRyd1WABlW+AOn9zDWsQJClcAmz/wDO6XG9hT6TnQBx6hYnGjJ4zRWfYApAkBVBBS2NAUuGAAvoHGRQ== 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:(346002)(396003)(39860400002)(366004)(376002)(136003)(19627235002)(6486002)(186003)(26005)(6496006)(478600001)(66946007)(66476007)(66556008)(83380400001)(6666004)(4326008)(2906002)(86362001)(8936002)(36756003)(38100700002)(8676002)(1076003)(5660300002)(6916009)(44832011)(316002)(54906003)(956004)(2616005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?2xgPmyJhaF3LB3Z79aafm4DcyDjUbliCHPBAGkO/p+KEjD/AJS7dC1t3YblA?= =?us-ascii?Q?o0p9DuInKOOegYewACRhlVlYA23jUMbzuiktcd2S46K3GKY136yFttJ9C0K9?= =?us-ascii?Q?iULeVuV7a0aynb3EANLGAF7ol1A7Zin2hR1S0EL+TiH6AeErQ4IsHsDxXeq4?= =?us-ascii?Q?dAjtPiaA9JhN7t0Y8MwCWT1mvk1OnqV9FXFrCLcdFRhZpHNz7FvoVdDCtFfp?= =?us-ascii?Q?tzed+VyMRxKx811vEH9953bH7Bikls+EMsNTm6o60q5MA1cbk0gZwQpZmIwh?= =?us-ascii?Q?EL4N0HZZt5Dy1a39GUxqvzwW3AVYDoZN4s/RzcjSmH5FFTuWwNLtQciVUO9g?= =?us-ascii?Q?JbhxWCzDE00lORkQDLdxwuAfbf71Q+wHF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ascii?Q?bKrOKGefRKOKf47tayAeChhkDN4T2gX+AlzCB27xEYhRwTJFXQY2wt7ADap2?= =?us-ascii?Q?vGqQ31sDH+qKEb0w5RCvrPUy?= X-MS-Exchange-CrossTenant-Network-Message-Id: c0343e4b-e7a7-4324-1cba-08d95e217550 X-MS-Exchange-CrossTenant-AuthSource: AT5PR8401MB0387.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2021 06:13:24.5981 (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: hl/gsC7pd3kqM4quYpdXXkzlSCXoYcPsrEwJomCQRLPmMVDmrRQTiUpUsy4gIMs77qOhpnchQup8KkRePw0BYg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AT5PR8401MB1185 X-OriginatorOrg: hpe.com X-Proofpoint-ORIG-GUID: TpB-2louNStq6WMsD-MqxTP6ZM9JKEcm X-Proofpoint-GUID: TpB-2louNStq6WMsD-MqxTP6ZM9JKEcm X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-08-13_01:2021-08-12,2021-08-13 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 mlxscore=0 spamscore=0 clxscore=1011 suspectscore=0 malwarescore=0 adultscore=0 priorityscore=1501 phishscore=0 lowpriorityscore=0 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2108130038 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain 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/XenPlatfor= mPei/XenPlatformPei.inf index 597cb6fcd7ff..20c27ff34b6c 100644 --- a/OvmfPkg/XenPlatformPei/XenPlatformPei.inf +++ b/OvmfPkg/XenPlatformPei/XenPlatformPei.inf @@ -57,6 +57,7 @@ [LibraryClasses] ResourcePublicationLib=0D PeiServicesLib=0D PeimEntryPoint=0D + QemuFwCfgS3Lib=0D MtrrLib=0D MemEncryptSevLib=0D PcdLib=0D @@ -79,6 +80,7 @@ [Pcd] gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Base=0D gUefiOvmfPkgTokenSpaceGuid.PcdPciMmio64Size=0D gUefiOvmfPkgTokenSpaceGuid.PcdQ35TsegMbytes=0D + gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiS3Enable=0D gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize=0D gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved=0D gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode=0D diff --git a/OvmfPkg/XenPlatformPei/Platform.c b/OvmfPkg/XenPlatformPei/Pla= tform.c index a811e72ee301..e60478fdb493 100644 --- a/OvmfPkg/XenPlatformPei/Platform.c +++ b/OvmfPkg/XenPlatformPei/Platform.c @@ -26,6 +26,7 @@ #include =0D #include =0D #include =0D +#include =0D #include =0D #include =0D #include =0D @@ -423,6 +424,8 @@ InitializeXenPlatform ( IN CONST EFI_PEI_SERVICES **PeiServices=0D )=0D {=0D + EFI_STATUS Status;=0D +=0D DEBUG ((DEBUG_INFO, "Platform PEIM Loaded\n"));=0D =0D DebugDumpCmos ();=0D @@ -433,6 +436,16 @@ InitializeXenPlatform ( CpuDeadLoop ();=0D }=0D =0D + //=0D + // This S3 conditional test is mainly for HVM Direct Kernel Boot since=0D + // QEMU fwcfg isn't really supported other than that.=0D + //=0D + if (QemuFwCfgS3Enabled ()) {=0D + DEBUG ((DEBUG_INFO, "S3 support was detected on QEMU\n"));=0D + Status =3D PcdSetBoolS (PcdAcpiS3Enable, TRUE);=0D + ASSERT_EFI_ERROR (Status);=0D + }=0D +=0D XenConnect ();=0D =0D BootModeInitialization ();=0D --=20 2.31.1