From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.158.5]) by mx.groups.io with SMTP id smtpd.web12.1575.1639708908782866118 for ; Thu, 16 Dec 2021 18:41:49 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@ibm.com header.s=pp1 header.b=X1enGq32; spf=pass (domain: linux.ibm.com, ip: 148.163.158.5, mailfrom: stefanb@linux.ibm.com) Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1BH1okCL005072; Fri, 17 Dec 2021 02:41:48 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : content-transfer-encoding : mime-version; s=pp1; bh=QAkN8lsGwoeY5BajuyIndfZp1kXxIrTs/zvoJu6dPj0=; b=X1enGq32JbHUWINVb/PMpfcs7rYrXjsdarnP6xK1mdTWdhA18WiUYxx0qxpTFMKk6xgb CYugE16LgK4qUo+W4NK3NLNFJus4ZZu34x735106n71XRu4SprwaapAf2JVlwPmXiJoF EGt2nNgS2ubRqMKi6XSYQAt4MLxTmPlTnCjjOXovhELqUeDw+MdO7V8YtSERkCDL0QXA VFuYJ6+2RptmivR20IQtj4Fsata4ydqMCtBk3dpkp4hn9Str0aWBDjTXMIPygUaBX17t xkIZ3kKjhVUVc2mV1hKW0+RySfaoJ8eWh+rW1bNbw43C7e3QkQ39Kly8A09uG22/X3yZ cg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 3cye12qtuy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 17 Dec 2021 02:41:47 +0000 Received: from m0098419.ppops.net (m0098419.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 1BH2fPnV013304; Fri, 17 Dec 2021 02:41:47 GMT Received: from ppma04wdc.us.ibm.com (1a.90.2fa9.ip4.static.sl-reverse.com [169.47.144.26]) by mx0b-001b2d01.pphosted.com with ESMTP id 3cye12qtur-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 17 Dec 2021 02:41:46 +0000 Received: from pps.filterd (ppma04wdc.us.ibm.com [127.0.0.1]) by ppma04wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 1BH2eKf9012951; Fri, 17 Dec 2021 02:41:45 GMT Received: from b01cxnp22036.gho.pok.ibm.com (b01cxnp22036.gho.pok.ibm.com [9.57.198.26]) by ppma04wdc.us.ibm.com with ESMTP id 3cy76x1np5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 17 Dec 2021 02:41:45 +0000 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp22036.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1BH2fiYl8913612 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 17 Dec 2021 02:41:44 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id ABC3AAE062; Fri, 17 Dec 2021 02:41:44 +0000 (GMT) Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9244CAE05C; Fri, 17 Dec 2021 02:41:44 +0000 (GMT) Received: from sbct-2.pok.ibm.com (unknown [9.47.158.152]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP; Fri, 17 Dec 2021 02:41:44 +0000 (GMT) From: "Stefan Berger" To: devel@edk2.groups.io Cc: marcandre.lureau@redhat.com, shivanshu3@gmail.com, Stefan Berger , Ard Biesheuvel , Jiewen Yao , Jordan Justen , Gerd Hoffmann Subject: [PATCH v3] OvmfPkg: Call PlatformInitializeConsole for GPU passthrough case Date: Thu, 16 Dec 2021 21:41:40 -0500 Message-Id: <20211217024140.281271-1-stefanb@linux.ibm.com> X-Mailer: git-send-email 2.31.1 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: RrW1sZoM0eVqmBOLAUWL32egJWfTS2xI X-Proofpoint-ORIG-GUID: AGcLXOwFe8Hp2KRZ76xdopQP8aFwMjm6 X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2021-12-17_01,2021-12-16_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 impostorscore=0 spamscore=0 clxscore=1015 adultscore=0 mlxscore=0 lowpriorityscore=0 phishscore=0 bulkscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112170011 Content-Transfer-Encoding: quoted-printable For GPU passthrough support we have to initialize the console after EfiBootManagerDispatchDeferredImages() has loaded ROMs, so call it after this. This was the calling order before the TCG physical presence support had to be moved and the console initialized earlier so user interaction could be supported before processing TCG physical presence opcodes. Fixes: b8675deaa819631db2667df63f89799fe65fc906 Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3771 Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Jordan Justen Cc: Gerd Hoffmann Signed-off-by: Stefan Berger Tested-by: Shivanshu Goyal --- OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c | 7 +++++++ OvmfPkg/Library/PlatformBootManagerLibBhyve/BdsPlatform.c | 5 +++++ OvmfPkg/Library/PlatformBootManagerLibGrub/BdsPlatform.c | 5 +++++ 3 files changed, 17 insertions(+) diff --git a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c b/OvmfPkg= /Library/PlatformBootManagerLib/BdsPlatform.c index 5feadc51d7..0918c35f1f 100644 --- a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c +++ b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c @@ -448,6 +448,13 @@ PlatformBootManagerBeforeConsole ( //=0D EfiBootManagerDispatchDeferredImages ();=0D =0D + //=0D + // GPU passthrough only allows Console enablement after ROM image load=0D + //=0D + PlatformInitializeConsole (=0D + XenDetected () ? gXenPlatformConsole : gPlatformConsole=0D + );=0D +=0D FrontPageTimeout =3D GetFrontPageTimeoutFromQemu ();=0D PcdStatus =3D PcdSet16S (PcdPlatformBootTimeOut, FrontPageTimeout= );=0D ASSERT_RETURN_ERROR (PcdStatus);=0D diff --git a/OvmfPkg/Library/PlatformBootManagerLibBhyve/BdsPlatform.c b/Ov= mfPkg/Library/PlatformBootManagerLibBhyve/BdsPlatform.c index 119f24b330..bf2701965f 100644 --- a/OvmfPkg/Library/PlatformBootManagerLibBhyve/BdsPlatform.c +++ b/OvmfPkg/Library/PlatformBootManagerLibBhyve/BdsPlatform.c @@ -434,6 +434,11 @@ PlatformBootManagerBeforeConsole ( //=0D EfiBootManagerDispatchDeferredImages ();=0D =0D + //=0D + // GPU passthrough only allows Console enablement after ROM image load=0D + //=0D + PlatformInitializeConsole (gPlatformConsole);=0D +=0D PlatformRegisterOptionsAndKeys ();=0D =0D //=0D diff --git a/OvmfPkg/Library/PlatformBootManagerLibGrub/BdsPlatform.c b/Ovm= fPkg/Library/PlatformBootManagerLibGrub/BdsPlatform.c index 9c6848bbff..a402589206 100644 --- a/OvmfPkg/Library/PlatformBootManagerLibGrub/BdsPlatform.c +++ b/OvmfPkg/Library/PlatformBootManagerLibGrub/BdsPlatform.c @@ -392,6 +392,11 @@ PlatformBootManagerBeforeConsole ( //=0D EfiBootManagerDispatchDeferredImages ();=0D =0D + //=0D + // GPU passthrough only allows Console enablement after ROM image load=0D + //=0D + PlatformInitializeConsole (gPlatformConsole);=0D +=0D Status =3D gRT->SetVariable (=0D EFI_TIME_OUT_VARIABLE_NAME,=0D &gEfiGlobalVariableGuid,=0D --=20 2.31.1