From nobody Thu May 2 01:16:28 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+85035+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+85035+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1639708909; cv=none; d=zohomail.com; s=zohoarc; b=mRyqhwYQJnHlXcc3pryDdW6ZTXp90Ffr5gyt3WQGodQKD+AVDQJZg8rdg6fHJum81YC3uSgPI14rK889Bgh/e4ZOwa/jOf0zP9Ej+C6OgD2LxZCbiwD9vEUhzXC43fJAJkCbm4XN049iOMi2E64lvb/iNBiqsHAZIc6ThwsgdYQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1639708909; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=QmqZm6s5HI8uZ90vCKIB0uXbTHk0TgEWNy+AONByzmY=; b=bJyTQw05B23+izCuMikOdi+1ghNUr9DIRPBaWXReOdo5+RyPzZ3pkdjQFgxtXwcxO2gOoHQG8Pw0R0v+bWtOHHV6Mjrcpgok+gmE/2JHClpfLIymcURmFjALCiIe6Iqb6jkvaUINB+se4YXb7QMkYQB9sPiHx8QXzW6/hthsYbQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+85035+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1639708909911124.70497502599005; Thu, 16 Dec 2021 18:41:49 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id ecIPYY1788612x02Yfyo10Aa; Thu, 16 Dec 2021 18:41:49 -0800 X-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 X-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 X-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 X-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 X-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 X-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 X-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 X-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 X-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) X-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) X-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: [edk2-devel] [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-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 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,stefanb@linux.ibm.com X-Gm-Message-State: Pwr9VlSSEcARCT3rwRApqSo5x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1639708909; bh=fALqvfMZnjC0zwah2Y5LP/JJoN8DdiBoFqk6qBS3uyw=; h=Cc:Date:From:Reply-To:Subject:To; b=BzEwzcGzaRcganmy2VlHL2OiLXEiznodltcCpWRcuArbat3CarxGuxigUYdBTG5DXcp TbpRPDF3pDsaE0TPrM993LsU368o5lITMDQ+7nczy1Yje/sNgN19IG4uuVym9jvfyHp5W cyM3zscMiVtkhclU+4zofZ0EHDMV2gDCq8Q= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1639708911578100002 Content-Type: text/plain; charset="utf-8" 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 Acked-by: Gerd Hoffmann Acked-by: Jiewen Yao --- 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 ( // EfiBootManagerDispatchDeferredImages (); =20 + // + // GPU passthrough only allows Console enablement after ROM image load + // + PlatformInitializeConsole ( + XenDetected () ? gXenPlatformConsole : gPlatformConsole + ); + FrontPageTimeout =3D GetFrontPageTimeoutFromQemu (); PcdStatus =3D PcdSet16S (PcdPlatformBootTimeOut, FrontPageTimeout= ); ASSERT_RETURN_ERROR (PcdStatus); 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 ( // EfiBootManagerDispatchDeferredImages (); =20 + // + // GPU passthrough only allows Console enablement after ROM image load + // + PlatformInitializeConsole (gPlatformConsole); + PlatformRegisterOptionsAndKeys (); =20 // 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 ( // EfiBootManagerDispatchDeferredImages (); =20 + // + // GPU passthrough only allows Console enablement after ROM image load + // + PlatformInitializeConsole (gPlatformConsole); + Status =3D gRT->SetVariable ( EFI_TIME_OUT_VARIABLE_NAME, &gEfiGlobalVariableGuid, --=20 2.31.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#85035): https://edk2.groups.io/g/devel/message/85035 Mute This Topic: https://groups.io/mt/87782159/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-