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.web08.20249.1629702592897015850 for ; Mon, 23 Aug 2021 00:10:01 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=hYNZR/gG; spf=temperror, err=temporary DNS error (domain: hpe.com, ip: 148.163.143.35, mailfrom: prvs=0869c54ae3=gary.lin@hpe.com) Received: from pps.filterd (m0134425.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 17N73iVY008781; Mon, 23 Aug 2021 07:09:50 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-type : content-transfer-encoding : mime-version; s=pps0720; bh=ZEAEWivEjYFB1vasRm10+/D4rLrIq38Rtio8l1UNsxg=; b=hYNZR/gG5VbOahJ7eav0RNy+NWBGNmIkX83J3v9gYDKCRGRFHc2g7zAzvVez3xrIrS/W I4QC0S2d3g1MBW3PiICv2qmfCg8LeqSHTc4IcaY5c3mmVAkwarChUxANeH7IAPTOd3/g 8uBM8uJEPVNNWR5ZQUS43lzURRmHrfxJldUSdPeDNiK/bZ69dc/vYeLkeZqc/luWJPco 1en1TOENVNG42Yx87EtuZ/omLPXtVL7dKvzkDOWCW4rb1WlskKGN94R1ITOpkkgecYCu g3T8CamW+AVIsWPgrTNga+xmla+eCAroUazqwCwO9Vue1Q0SE2E22xX/Oh1hHyhf71cz sQ== Received: from g9t5008.houston.hpe.com (g9t5008.houston.hpe.com [15.241.48.72]) by mx0b-002e3701.pphosted.com with ESMTP id 3ajtsvmuxr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 23 Aug 2021 07:09:50 +0000 Received: from G9W8456.americas.hpqcorp.net (exchangepmrr1.us.hpecorp.net [16.216.161.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by g9t5008.houston.hpe.com (Postfix) with ESMTPS id 0B0DC59; Mon, 23 Aug 2021 07:09:50 +0000 (UTC) Received: from G4W9120.americas.hpqcorp.net (2002:10d2:150f::10d2:150f) by G9W8456.americas.hpqcorp.net (2002:10d8:a15f::10d8:a15f) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Mon, 23 Aug 2021 07:09:49 +0000 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (15.241.52.11) by G4W9120.americas.hpqcorp.net (16.210.21.15) with Microsoft SMTP Server (TLS) id 15.0.1497.18 via Frontend Transport; Mon, 23 Aug 2021 07:09:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ex3yl42y4OC1pIdhsss0WzloS49u6JfNyDwJ3v8A0mbGU/0w4GPcQM7YSoJCLdMC/7h9RfBtmwnEE3Q8rDOLhSvozk7LmIMJElr/y3YfGGQsu8XxhHujdHiw4gtMloGrkIgmhgUfleWbQV3oWf7d95ERFpR9zeubuvtSdbuA3Bvs9PBWShOpx2GZxY7D0MCqRhslahlQOVN6XkCcBpjCLI2B1aEMBWINQw3a3kuhnCwAkM44c1yrsxEf8Oka5KIGmynbK19Sf1G3/3ie7qP/myORrv87vpWUX01Ru5jjqVZERn05z9kWe1fri4fUl9eHJvop7z8FGtJMBL2CkQsnrA== 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=ZEAEWivEjYFB1vasRm10+/D4rLrIq38Rtio8l1UNsxg=; b=nCckhTGogG+ah9S6SHwh8vSsaZMrhbA7CHaL22WRog/9RJ3JwkUBgfAWBr321DMhKqFfzv5DcD9qgLvF94W6eoQnMA9yclZzeHWIid0QeT1rZO4mqR9WUYiKWgcAe8ELGk4rs62+XXdj/mv/93L1Fe4SDckYTDFRsUEZrCkKZGy1fZl+a8G6Ft/kTmhtZHPg7+90MsWpszEc5tTQTA+ws9RvDnYJa0SjgE4wqtaR8U+wI0i5iFm3NSQ2yXUqUYtNIRfkJSmWi3fok+B5FgdLG487U7kAWTPogCyOUYaXLdPRDd7aYYMw9oFdRPYaNbo0b96kUpVw9FPGyfD4nxPgHg== 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 AT5PR8401MB1106.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:7421::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.22; Mon, 23 Aug 2021 07:09:48 +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.4436.019; Mon, 23 Aug 2021 07:09:48 +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 v3 1/4] OvmfPkg/OvmfXen: set PcdAcpiS3Enable at initialization Date: Mon, 23 Aug 2021 15:09:22 +0800 Message-ID: <20210823070925.10095-2-gary.lin@hpe.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210823070925.10095-1-gary.lin@hpe.com> References: <20210823070925.10095-1-gary.lin@hpe.com> X-ClientProxiedBy: HK2PR03CA0062.apcprd03.prod.outlook.com (2603:1096:202:17::32) To AT5PR8401MB0387.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:741f::21) X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost (111.240.132.81) by HK2PR03CA0062.apcprd03.prod.outlook.com (2603:1096:202:17::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.5 via Frontend Transport; Mon, 23 Aug 2021 07:09:47 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9a733964-bd4d-4489-ee17-08d96604fe50 X-MS-TrafficTypeDiagnostic: AT5PR8401MB1106: 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: TD7cbegkcujFvOO55IZgemU+zjWCE9Bj7/mxbTwjKNmFZW7b/NClUmtwjhtfcwrDj66kcQ84Iv6QJhLGbaI0/dUwvoeGjIsyLnRccuvy+sQClx2I3IvVKQ/qFD/ZLGKcK7gY7gGRtSXRC8K2jiV4l+Uhq6Qjzq21i4kq+TOeIZCpcyUmhKzMpkvLsFlCSH/zp2L4/jqgIDK8jcLWLnOa2xE9IMeblPo1XFJmMvsksCdQa8THRH7ot+jAf+w8A2bWkMEIHZBmppP82J2nWXjo3EQLg0PfmLz8buk9jBPL7Oj2H23ih3yJQJca9Yz9K70JZUOGQcjxVPdI04+znv9F+Gk8sauRQqpM2w0S8SJ/MweQokc348lPnxW7QzYt21vf5I1qF5Fi2LogDq+7+pLRebID6/lfo+YHzfHwny+Ak5wcG9JQ7VRDCJn7kOJJmV208+xtiOy6xYNbVtQyypL/zNevJdGl7F68FYLxfUJa4/yxkmocmPH2/OQuxhD3iiQfBiHjc/zyICJdsT5Fp+9d/IP/kHzduiHJgyU7gB6nmnOfmiqLHAkylaKIvyrCMDOqT4wDv/p3848MHffpA6CLJzEFmMLILNYtZ8exnOuAhBmDZ85nS7SsRphPgeySzETTMeW2AQB2vkkku08ccFJust2bpDNVr1vY9HGvfxvm1zddTzirvyEGcIvLO8OrFKS4dTCm9HPUYgMsmtwP3ohUggw2MhSVTj6nDo3HgszPf9Y= 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)(376002)(136003)(396003)(366004)(39860400002)(316002)(966005)(54906003)(26005)(478600001)(83380400001)(19627235002)(1076003)(8936002)(6486002)(86362001)(36756003)(2616005)(956004)(6916009)(186003)(5660300002)(66556008)(8676002)(4326008)(66476007)(66946007)(6666004)(6496006)(2906002)(44832011)(38100700002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?HlcEzOh6Bmb7suyq47gqXa5nyQieTjgXoXiZpYSHtyvww+2TO05bF+fr28qC?= =?us-ascii?Q?NrSrbC/JhALkaU1nvdwwl+w3eboH/+DyGYUGYce2nFgk6WxE2u6zQcY2ZT/o?= =?us-ascii?Q?KYx48xblWpFHAy9uM5MEQd6n1e4Snr1+t36OZj71K2pvTF09Uclb+uzz4DpN?= =?us-ascii?Q?82Kxcu/yLzo+dYyiK0q/lzQ6NyGscpIa+De16YY9gOsTsxyPD4jQjJ/vN8cH?= =?us-ascii?Q?aYYbmm8Crpnf7jXFkOJD9hf9XlqqkVAcGzw1OaOIYBEsQ5eZXSQ86GxVrq1E?= =?us-ascii?Q?48IwSGt4AwXVOu+j7WWz98YMjdZgtwFGhDagFhHsqXpwN6REzhGJ3xCKPxTh?= =?us-ascii?Q?lhY7hW6qAyARS/9jKbEsCJSL0KAMx/ScN6CejGmfcFmNN2IryJoeErhCoN56?= =?us-ascii?Q?YTfZkR08p2sDyvJN1EIcMriSq6sLuElbrQy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cDq4I1eq9F9HutjkVdSzQxA?= X-MS-Exchange-CrossTenant-Network-Message-Id: 9a733964-bd4d-4489-ee17-08d96604fe50 X-MS-Exchange-CrossTenant-AuthSource: AT5PR8401MB0387.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2021 07:09:48.3464 (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: gozxNkzDPjKm+bF2VG5ua3vPCywUWsZ+SQgGGLumXS36oS4qfT6uEzxyZs2/tjsU/6auHiprnpIRfG+ALT8ZTA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AT5PR8401MB1106 X-OriginatorOrg: hpe.com X-Proofpoint-GUID: 4jOqqRNYSddnjTNvKYC6MlQjRaHYBxxM X-Proofpoint-ORIG-GUID: 4jOqqRNYSddnjTNvKYC6MlQjRaHYBxxM 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-23_02:2021-08-20,2021-08-23 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 bulkscore=0 mlxlogscore=999 impostorscore=0 mlxscore=0 malwarescore=0 spamscore=0 phishscore=0 suspectscore=0 clxscore=1015 lowpriorityscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2107140000 definitions=main-2108230047 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable https://bugzilla.tianocore.org/show_bug.cgi?id=3D3573 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". When used, "fw_cfg" is enabled in QEMU and QemuFwCfgS3Enabled() returns true in that case. v3: - Update the description per Anthony's suggestion - Add the bugzilla link 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