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.web10.1592.1639709073612420196 for ; Thu, 16 Dec 2021 18:44:34 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@ibm.com header.s=pp1 header.b=k/6r5IF2; spf=pass (domain: linux.ibm.com, ip: 148.163.158.5, mailfrom: stefanb@linux.ibm.com) Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1BH2eZx9016855; Fri, 17 Dec 2021 02:44:32 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pp1; bh=OjRQ2aHtioQx58Rer6zVo5BB8iWnqchilnkscDRVwVg=; b=k/6r5IF2ZE9yjfzvIz1cj07PN4xLIj5xFvmxMysWZ7fXZtNdgHzKwIsbs/cxV7S92h0x 4CTCxZlqVjD+OXb/QuPpwyuGUBBuHPhBJdjjft5bylgj6Pj5Y9cI6UnKjBJAGW8IMRnM kg9PRKyyJJAtTm8KQy3M461Ehqdh3Ia8TzTng22oCAKjpXgL4z/f7MhDLyVnPXU9J2mQ u0O81MjMuCHLXOavwjCXyybIxpOyrTAwKrZdCIFqSIIEoqz3iEtmOtywAfAtH9QzlbBC i5wYfFfd7RJ6JBBlXj4h31lt59ivkwzjXsSD6wymkyy5uFQQXTuW3rlZxQoRo6oFunlJ mg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 3cyhym66py-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 17 Dec 2021 02:44:32 +0000 Received: from m0098414.ppops.net (m0098414.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 1BH2iVDp000579; Fri, 17 Dec 2021 02:44:31 GMT Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0b-001b2d01.pphosted.com with ESMTP id 3cyhym66pn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 17 Dec 2021 02:44:31 +0000 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 1BH2fO0h007148; Fri, 17 Dec 2021 02:44:30 GMT Received: from b03cxnp07029.gho.boulder.ibm.com (b03cxnp07029.gho.boulder.ibm.com [9.17.130.16]) by ppma01dal.us.ibm.com with ESMTP id 3cy7e4n4dp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 17 Dec 2021 02:44:30 +0000 Received: from b03ledav001.gho.boulder.ibm.com (b03ledav001.gho.boulder.ibm.com [9.17.130.232]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1BH2iUQa18547164 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 17 Dec 2021 02:44:30 GMT Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3E15F6E066; Fri, 17 Dec 2021 02:44:30 +0000 (GMT) Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C4DD46E059; Fri, 17 Dec 2021 02:44:29 +0000 (GMT) Received: from [9.47.158.152] (unknown [9.47.158.152]) by b03ledav001.gho.boulder.ibm.com (Postfix) with ESMTP; Fri, 17 Dec 2021 02:44:29 +0000 (GMT) Message-ID: <4b2e350e-eda3-1f65-f7d3-a7707abba99b@linux.ibm.com> Date: Thu, 16 Dec 2021 21:44:29 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Subject: Re: [PATCH v3] OvmfPkg: Call PlatformInitializeConsole for GPU passthrough case To: devel@edk2.groups.io Cc: marcandre.lureau@redhat.com, shivanshu3@gmail.com, Ard Biesheuvel , Jiewen Yao , Jordan Justen , Gerd Hoffmann References: <20211217024140.281271-1-stefanb@linux.ibm.com> From: "Stefan Berger" In-Reply-To: <20211217024140.281271-1-stefanb@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-GUID: g6_9qnnPkh1nu9CLgW3CWvEDKN2NLTRG X-Proofpoint-ORIG-GUID: g2qBHNuA3Q8WpAFldEfa1aYPlOD2Lvtd 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 clxscore=1015 bulkscore=0 mlxlogscore=999 mlxscore=0 phishscore=0 lowpriorityscore=0 adultscore=0 impostorscore=0 priorityscore=1501 suspectscore=0 spamscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112170011 X-MIME-Autoconverted: from 8bit to quoted-printable by mx0b-001b2d01.pphosted.com id 1BH2eZx9016855 Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable v2 had lost the cc: list for some reason. I opened this PR: https://github.com/tianocore/edk2/pull/2319 =C2=A0 Stefan On 12/16/21 21:41, Stefan Berger wrote: > For GPU passthrough support we have to initialize the console after > EfiBootManagerDispatchDeferredImages() has loaded ROMs, so call it afte= r > this. This was the calling order before the TCG physical presence suppo= rt > 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/Ovm= fPkg/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 ( > // > EfiBootManagerDispatchDeferredImages (); > =20 > + // > + // GPU passthrough only allows Console enablement after ROM image lo= ad > + // > + PlatformInitializeConsole ( > + XenDetected () ? gXenPlatformConsole : gPlatformConsole > + ); > + > FrontPageTimeout =3D GetFrontPageTimeoutFromQemu (); > PcdStatus =3D PcdSet16S (PcdPlatformBootTimeOut, FrontPageTi= meout); > ASSERT_RETURN_ERROR (PcdStatus); > diff --git a/OvmfPkg/Library/PlatformBootManagerLibBhyve/BdsPlatform.c = b/OvmfPkg/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 ( > // > EfiBootManagerDispatchDeferredImages (); > =20 > + // > + // GPU passthrough only allows Console enablement after ROM image lo= ad > + // > + PlatformInitializeConsole (gPlatformConsole); > + > PlatformRegisterOptionsAndKeys (); > =20 > // > diff --git a/OvmfPkg/Library/PlatformBootManagerLibGrub/BdsPlatform.c b= /OvmfPkg/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 ( > // > EfiBootManagerDispatchDeferredImages (); > =20 > + // > + // GPU passthrough only allows Console enablement after ROM image lo= ad > + // > + PlatformInitializeConsole (gPlatformConsole); > + > Status =3D gRT->SetVariable ( > EFI_TIME_OUT_VARIABLE_NAME, > &gEfiGlobalVariableGuid,