From nobody Fri May 3 20:22:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+57642+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1587400165; cv=none; d=zohomail.com; s=zohoarc; b=aNxogFcYWRZX03UzOU9W1N11gVx4oJychrXt4ZfEWWuiRTCSSMXgil7BeKvJC0qAIcWI+n8jE5+JS/ZK29UvDVQF7ND3xtWlvUChaBNcLtO20IYkt+2/+4LhNjBwJ35GHcydPUd/5UZsImaDW6FX14etGOk3uDuHMHY/D+vH92k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587400165; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=byoO7TpfQbDW72nye3ofceix+oloM5fiw8IRaWaCfv0=; b=elmUy+ssdwjamWRi3T/8qdLx09I/ia0r3CXSRNPPt835wsDwtDoh3AO9Tr3SVm+lvtiVgEuX0vTWrkCYbxwrYDOpVK7pPE5SVpPGTa4PsdA9ORcdA8FskV1HhErE2X1aKZg4nmovv45JOZR7oR+jx2uHjH9VEX571wToxckuvXo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+57642+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1587400165469342.7049904880813; Mon, 20 Apr 2020 09:29:25 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id IxdPYY1788612xGc7phPauLF; Mon, 20 Apr 2020 09:29:25 -0700 X-Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com [216.71.145.153]) by mx.groups.io with SMTP id smtpd.web10.5773.1587400164686683453 for ; Mon, 20 Apr 2020 09:29:24 -0700 Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+57642+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of anthony.perard@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa2.hc3370-68.iphmx.com: domain of anthony.perard@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ip4:168.245.78.127 ~all" Received-SPF: None (esa2.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa2.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: 5ft8c9/fYjn6XPNmS0s/PBto6e52ndaLyDS8QrUAZweILXmAvx+0EaIqEanSsTWXANTaITcD2t xV6wF4kEoiacOJ8f6BWPssBicaXcqrO3eZObE16PlWEERTkERXycoO4BHZ5JB//CtVEGffuEkx pukKKgJCa/GJfCr+XOxh6+lnI5UwMPL+ujKWReNDf+QuvXtwsJL+lVKl/v8EVYsBb4Xz3EoR2+ mTXSSY3Uy/roMH64LAItyCZw8TWKwU3p3RxyA6oitaymidlxt8UiNgRuwsNr59qJRBgRvLgdUb 9kg= X-SBRS: 2.7 X-MesageID: 15966566 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.72,407,1580792400"; d="scan'208";a="15966566" From: "Anthony PERARD" To: CC: Laszlo Ersek , Anthony Perard , Ard Biesheuvel , "Jordan Justen" , Julien Grall Subject: [edk2-devel] [PATCH 1/2] OvmfPkg/OvmfXen: Remove DEBUG_ON_SERIAL_PORT Date: Mon, 20 Apr 2020 17:29:17 +0100 Message-ID: <20200420162918.2312514-2-anthony.perard@citrix.com> In-Reply-To: <20200420162918.2312514-1-anthony.perard@citrix.com> References: <20200420162918.2312514-1-anthony.perard@citrix.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,anthony.perard@citrix.com X-Gm-Message-State: asWHo4x3OsmkNMq355UgwD3nx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1587400165; bh=byoO7TpfQbDW72nye3ofceix+oloM5fiw8IRaWaCfv0=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=P8neG+MhziHitUYfl7UvkWfNUTqkqoMF0FGLB/8GTmLFS5oT4/0l6vKAeJDqevZTp7r CYPcvIPiNj96/fx/URhhiidu9byom6VmAdBqDU2vjEQiL9YtEUBWd2UR/KsT/72RYiRJq yEkOMYHzThnxVsYODGo7PuQt1eSFh7rEOgQ= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Remove support for DEBUG_ON_SERIAL_PORT because OvmfXen can't be build with it due to a circular dependency: DebugLib : BaseDebugLibSerialPort -> SerialPortLib : XenConsoleSerialPortLib -> XenHypercallLib : XenHypercallLib -> DebugLib Also, if that dependency is fixed, I think it would be harder to find which console the debug is sent to when running an HVM guest. The xen console isn't the serial console used by default. Furthermore, XenHypercallLib isn't initialised early enough, so we would loose debug output from the SEC phase and early PEI phase. Signed-off-by: Anthony PERARD Reviewed-by: Laszlo Ersek --- OvmfPkg/OvmfXen.dsc | 40 +--------------------------------------- 1 file changed, 1 insertion(+), 39 deletions(-) diff --git a/OvmfPkg/OvmfXen.dsc b/OvmfPkg/OvmfXen.dsc index 47ee8db8b884..4859faf1bff7 100644 --- a/OvmfPkg/OvmfXen.dsc +++ b/OvmfPkg/OvmfXen.dsc @@ -205,17 +205,14 @@ [LibraryClasses] Tcg2PhysicalPresenceLib|OvmfPkg/Library/Tcg2PhysicalPresenceLibNull/DxeT= cg2PhysicalPresenceLib.inf TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurem= entLibNull.inf RealTimeClockLib|OvmfPkg/Library/XenRealTimeClockLib/XenRealTimeClockLib= .inf + DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf =20 [LibraryClasses.common] BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf =20 [LibraryClasses.common.SEC] QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgSecLib.inf -!ifdef $(DEBUG_ON_SERIAL_PORT) - DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf -!else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPor= t.inf -!endif ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiRepor= tStatusCodeLib.inf ExtractGuidedSectionLib|MdePkg/Library/BaseExtractGuidedSectionLib/BaseE= xtractGuidedSectionLib.inf !if $(SOURCE_DEBUG_ENABLE) =3D=3D TRUE @@ -236,11 +233,6 @@ [LibraryClasses.common.PEI_CORE] ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiRepor= tStatusCodeLib.inf OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHo= okStatusCodeLibNull.inf PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeC= offGetEntryPointLib.inf -!ifdef $(DEBUG_ON_SERIAL_PORT) - DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf -!else - DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf -!endif PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf =20 [LibraryClasses.common.PEIM] @@ -252,11 +244,6 @@ [LibraryClasses.common.PEIM] ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiRepor= tStatusCodeLib.inf OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHo= okStatusCodeLibNull.inf PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeC= offGetEntryPointLib.inf -!ifdef $(DEBUG_ON_SERIAL_PORT) - DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf -!else - DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf -!endif PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf ResourcePublicationLib|MdePkg/Library/PeiResourcePublicationLib/PeiResou= rcePublicationLib.inf ExtractGuidedSectionLib|MdePkg/Library/PeiExtractGuidedSectionLib/PeiExt= ractGuidedSectionLib.inf @@ -274,11 +261,6 @@ [LibraryClasses.common.DXE_CORE] DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf MemoryAllocationLib|MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeC= oreMemoryAllocationLib.inf ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeRepor= tStatusCodeLib.inf -!ifdef $(DEBUG_ON_SERIAL_PORT) - DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf -!else - DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf -!endif ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExt= ractGuidedSectionLib.inf !if $(SOURCE_DEBUG_ENABLE) =3D=3D TRUE DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf @@ -292,11 +274,6 @@ [LibraryClasses.common.DXE_RUNTIME_DRIVER] DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAll= ocationLib.inf ReportStatusCodeLib|MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/R= untimeDxeReportStatusCodeLib.inf -!ifdef $(DEBUG_ON_SERIAL_PORT) - DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf -!else - DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf -!endif UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf @@ -308,11 +285,6 @@ [LibraryClasses.common.UEFI_DRIVER] DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAll= ocationLib.inf ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeRepor= tStatusCodeLib.inf -!ifdef $(DEBUG_ON_SERIAL_PORT) - DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf -!else - DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf -!endif UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf =20 @@ -322,11 +294,6 @@ [LibraryClasses.common.DXE_DRIVER] MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAll= ocationLib.inf ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeRepor= tStatusCodeLib.inf UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf -!ifdef $(DEBUG_ON_SERIAL_PORT) - DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf -!else - DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf -!endif PlatformBootManagerLib|OvmfPkg/Library/PlatformBootManagerLib/PlatformBo= otManagerLib.inf PlatformBmPrintScLib|OvmfPkg/Library/PlatformBmPrintScLib/PlatformBmPrin= tScLib.inf QemuBootOrderLib|OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf @@ -344,11 +311,6 @@ [LibraryClasses.common.UEFI_APPLICATION] HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAll= ocationLib.inf ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeRepor= tStatusCodeLib.inf -!ifdef $(DEBUG_ON_SERIAL_PORT) - DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf -!else - DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf -!endif PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf =20 ##########################################################################= ###### --=20 Anthony PERARD -=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 (#57642): https://edk2.groups.io/g/devel/message/57642 Mute This Topic: https://groups.io/mt/73153290/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- From nobody Fri May 3 20:22:27 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+57643+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1587400169; cv=none; d=zohomail.com; s=zohoarc; b=YdSEe/Jqe8bD5sGOEz5OyQxjBeRz02V3dhT99K6MuP8W5/l6OWet/w/BP1KnpJosS8I5aoLHH5sW46RRX9PA6Bl3Zsm0bS0v4qaXhJWdTJQdjE+x6XWbnmod046MBVdVHMbzzjaVLBPt1iri9im77sZPUH5MHAjF5+B2WIm1UiQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587400169; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=rMr8EX377eHIiVI9nGgls+zsg0eUs8Kra/5gIUm7C0U=; b=J/mvEvHnkg2GZ6QanTe1kpufnGKKCEM0lGOrUxQ2qND16okuGFjwZrR2NMzuAD0wpgrMCSC2yncqfHnT8WbBQrQrAo5cKglrwJqK7rfOxvghPBjrVWTOOPyNm94k0HJcItvvbmm7exRgeV/7PttI+VoaG8c3F/jG5KQ6bAeSoPg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+57643+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1587400169316873.8994066916326; Mon, 20 Apr 2020 09:29:29 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id yL3uYY1788612xpJCVRKGrBi; Mon, 20 Apr 2020 09:29:28 -0700 X-Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com [216.71.155.144]) by mx.groups.io with SMTP id smtpd.web11.5901.1587400168428253085 for ; Mon, 20 Apr 2020 09:29:28 -0700 Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+57643+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: None (esa4.hc3370-68.iphmx.com: no sender authenticity information available from domain of anthony.perard@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa4.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa4.hc3370-68.iphmx.com: domain of anthony.perard@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa4.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="anthony.perard@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ip4:168.245.78.127 ~all" Received-SPF: None (esa4.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa4.hc3370-68.iphmx.com; envelope-from="anthony.perard@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: GhbUJvocxceED4a+hJm1Au06PJo7C5aC/EaU0OM3hYn+GwZyrZnMUu0DF2LOYfLDKrNNk8bV2Y x/DrSeg7Qux9DVkmXdgvmpZsbk2iMxLMPSB806laZiz2AWf0Tt/+c/eZlu1Fthn1mlQ/jOeHkS vGRfMJ3q0PX9KXnr4Elkpv1tV7e/FW1rGZvmX56WkoDqktBPrSsNrjc9+c43VR/XrCOk76/Jtn xHk7BKx219FlhLlZOuLUe0NdeAM6dazPvudhrqmzDgAsjuF6+Gr3RZ5jBG+TeWOzS6xCZep/NF Tv8= X-SBRS: 2.7 X-MesageID: 16629098 X-Ironport-Server: esa4.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.72,407,1580792400"; d="scan'208";a="16629098" From: "Anthony PERARD" To: CC: Laszlo Ersek , Anthony Perard , Ard Biesheuvel , "Jordan Justen" , Julien Grall Subject: [edk2-devel] [PATCH 2/2] OvmfPkg/OvmfXen: Introduce XenDebugLibIoPort Date: Mon, 20 Apr 2020 17:29:18 +0100 Message-ID: <20200420162918.2312514-3-anthony.perard@citrix.com> In-Reply-To: <20200420162918.2312514-1-anthony.perard@citrix.com> References: <20200420162918.2312514-1-anthony.perard@citrix.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,anthony.perard@citrix.com X-Gm-Message-State: MrzQwqSGHj3X9xO30FQ2Yy1fx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1587400168; bh=rMr8EX377eHIiVI9nGgls+zsg0eUs8Kra/5gIUm7C0U=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=qOunECyiNm7Oi3mzP2Uid918UMzXUxQJ+jF24XvImQM785bCe+QCD47xYVIafjCHIPl 4diUbYjgkXwW9LENefFejbTTlPdO4rzShegfGVqu0a6XMCQjKA2whUXqh/hUNcrA8QZGW pG/+J2Mdv9xcoeG+I4uo7KRmsrf+HR+FbfQ= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Introduce XenDebugLibIoPort which is enabled with DEBUG_ON_HYPERVISOR_CONSOLE which send the debug output to Xen's console. It's a copy PlatformDebugLibIoPort which always write to the IO port. It works with both Xen HVM guest and Xen PVH guest whereas the default PlatformDebugLibIoPort works only in HVM when QEMU is present. Signed-off-by: Anthony PERARD --- Notes: Do you think it would be better to introduce a PCD to PlatformDebugLibIoPort where we can disable the check for the debug port and simply always write to it? OvmfPkg/OvmfXen.dsc | 13 ++++++++++++ .../PlatformDebugLibIoPort.inf | 6 +++--- .../DebugLibDetect.h | 20 ------------------- .../DebugLib.c | 16 --------------- .../DebugLibDetect.c | 20 ++----------------- 5 files changed, 18 insertions(+), 57 deletions(-) copy OvmfPkg/Library/{PlatformDebugLibIoPort =3D> XenDebugLibIoPort}/Platf= ormDebugLibIoPort.inf (76%) copy OvmfPkg/Library/{PlatformDebugLibIoPort =3D> XenDebugLibIoPort}/Debug= LibDetect.h (57%) copy OvmfPkg/Library/{PlatformDebugLibIoPort =3D> XenDebugLibIoPort}/Debug= Lib.c (94%) copy OvmfPkg/Library/{PlatformDebugLibIoPort =3D> XenDebugLibIoPort}/Debug= LibDetect.c (61%) diff --git a/OvmfPkg/OvmfXen.dsc b/OvmfPkg/OvmfXen.dsc index 4859faf1bff7..8e4d70f21fc8 100644 --- a/OvmfPkg/OvmfXen.dsc +++ b/OvmfPkg/OvmfXen.dsc @@ -205,14 +205,22 @@ [LibraryClasses] Tcg2PhysicalPresenceLib|OvmfPkg/Library/Tcg2PhysicalPresenceLibNull/DxeT= cg2PhysicalPresenceLib.inf TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurem= entLibNull.inf RealTimeClockLib|OvmfPkg/Library/XenRealTimeClockLib/XenRealTimeClockLib= .inf +!ifdef $(DEBUG_ON_HYPERVISOR_CONSOLE) + DebugLib|OvmfPkg/Library/XenDebugLibIoPort/PlatformDebugLibIoPort.inf +!else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.i= nf +!endif =20 [LibraryClasses.common] BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf =20 [LibraryClasses.common.SEC] QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgSecLib.inf +!ifdef $(DEBUG_ON_HYPERVISOR_CONSOLE) + DebugLib|OvmfPkg/Library/XenDebugLibIoPort/PlatformDebugLibIoPort.inf +!else DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPor= t.inf +!endif ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiRepor= tStatusCodeLib.inf ExtractGuidedSectionLib|MdePkg/Library/BaseExtractGuidedSectionLib/BaseE= xtractGuidedSectionLib.inf !if $(SOURCE_DEBUG_ENABLE) =3D=3D TRUE @@ -405,6 +413,11 @@ [PcdsFixedAtBuild] # !include NetworkPkg/NetworkPcds.dsc.inc =20 +!ifdef $(DEBUG_ON_HYPERVISOR_CONSOLE) + ## This flag is used to control the destination port for PlatformDebugLi= bIoPort + gUefiOvmfPkgTokenSpaceGuid.PcdDebugIoPort|0xe9 +!endif + # IRQs 5, 9, 10, 11 are level-triggered gUefiOvmfPkgTokenSpaceGuid.Pcd8259LegacyModeEdgeLevel|0x0E20 =20 diff --git a/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.= inf b/OvmfPkg/Library/XenDebugLibIoPort/PlatformDebugLibIoPort.inf similarity index 76% copy from OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf copy to OvmfPkg/Library/XenDebugLibIoPort/PlatformDebugLibIoPort.inf index c09f312ffb1d..141fe7498335 100644 --- a/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf +++ b/OvmfPkg/Library/XenDebugLibIoPort/PlatformDebugLibIoPort.inf @@ -12,11 +12,11 @@ =20 [Defines] INF_VERSION =3D 0x00010005 - BASE_NAME =3D PlatformDebugLibIoPort - FILE_GUID =3D DF934DA3-CD31-49FE-AF50-B3C87C79325F + BASE_NAME =3D XenDebugLibIoPort + FILE_GUID =3D 201EE63F-79DC-4B8E-953C-FA794C0883A3 MODULE_TYPE =3D BASE VERSION_STRING =3D 1.0 - LIBRARY_CLASS =3D DebugLib|PEI_CORE PEIM DXE_CORE DXE_D= RIVER DXE_RUNTIME_DRIVER SMM_CORE DXE_SMM_DRIVER UEFI_DRIVER UEFI_APPLICATI= ON + LIBRARY_CLASS =3D DebugLib|SEC PEI_CORE PEIM DXE_CORE D= XE_DRIVER DXE_RUNTIME_DRIVER SMM_CORE DXE_SMM_DRIVER UEFI_DRIVER UEFI_APPLI= CATION CONSTRUCTOR =3D PlatformDebugLibIoPortConstructor =20 # diff --git a/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLibDetect.h b/Ovmf= Pkg/Library/XenDebugLibIoPort/DebugLibDetect.h similarity index 57% copy from OvmfPkg/Library/PlatformDebugLibIoPort/DebugLibDetect.h copy to OvmfPkg/Library/XenDebugLibIoPort/DebugLibDetect.h index 71a7f33aaf17..d5ec4063c5be 100644 --- a/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLibDetect.h +++ b/OvmfPkg/Library/XenDebugLibIoPort/DebugLibDetect.h @@ -12,26 +12,6 @@ =20 #include =20 -// -// The constant value that is read from the debug I/O port -// -#define BOCHS_DEBUG_PORT_MAGIC 0xE9 - - -/** - Helper function to return whether the virtual machine has a debug I/O po= rt. - PlatformDebugLibIoPortFound can call this function directly or cache the - result. - - @retval TRUE if the debug I/O port device was detected. - @retval FALSE otherwise - -**/ -BOOLEAN -EFIAPI -PlatformDebugLibIoPortDetect ( - VOID - ); =20 /** Return whether the virtual machine has a debug I/O port. DebugLib.c diff --git a/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c b/OvmfPkg/Li= brary/XenDebugLibIoPort/DebugLib.c similarity index 94% copy from OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c copy to OvmfPkg/Library/XenDebugLibIoPort/DebugLib.c index 3dfa3126c3d0..b3952c9936da 100644 --- a/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c +++ b/OvmfPkg/Library/XenDebugLibIoPort/DebugLib.c @@ -359,19 +359,3 @@ DebugPrintLevelEnabled ( { return (BOOLEAN) ((ErrorLevel & PcdGet32(PcdFixedDebugPrintErrorLevel)) = !=3D 0); } - -/** - Return the result of detecting the debug I/O port device. - - @retval TRUE if the debug I/O port device was detected. - @retval FALSE otherwise - -**/ -BOOLEAN -EFIAPI -PlatformDebugLibIoPortDetect ( - VOID - ) -{ - return IoRead8 (PcdGet16 (PcdDebugIoPort)) =3D=3D BOCHS_DEBUG_PORT_MAGIC; -} diff --git a/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLibDetect.c b/Ovmf= Pkg/Library/XenDebugLibIoPort/DebugLibDetect.c similarity index 61% copy from OvmfPkg/Library/PlatformDebugLibIoPort/DebugLibDetect.c copy to OvmfPkg/Library/XenDebugLibIoPort/DebugLibDetect.c index 2c659e7aea0a..04de924f3fa2 100644 --- a/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLibDetect.c +++ b/OvmfPkg/Library/XenDebugLibIoPort/DebugLibDetect.c @@ -1,6 +1,5 @@ /** @file Detection code for QEMU debug port. - Non-SEC instance, caches the result of detection. =20 Copyright (c) 2017, Red Hat, Inc.
SPDX-License-Identifier: BSD-2-Clause-Patent @@ -10,16 +9,6 @@ #include #include "DebugLibDetect.h" =20 -// -// Set to TRUE if the debug I/O port has been checked -// -STATIC BOOLEAN mDebugIoPortChecked =3D FALSE; - -// -// Set to TRUE if the debug I/O port is enabled -// -STATIC BOOLEAN mDebugIoPortFound =3D FALSE; - /** This constructor function must not do anything. =20 @@ -44,8 +33,7 @@ PlatformDebugLibIoPortConstructor ( } =20 /** - At the first call, check if the debug I/O port device is present, and ca= che - the result for later use. At subsequent calls, return the cached result. + Return the result of detecting the debug I/O port device. =20 @retval TRUE if the debug I/O port device was detected. @retval FALSE otherwise @@ -57,9 +45,5 @@ PlatformDebugLibIoPortFound ( VOID ) { - if (!mDebugIoPortChecked) { - mDebugIoPortFound =3D PlatformDebugLibIoPortDetect (); - mDebugIoPortChecked =3D TRUE; - } - return mDebugIoPortFound; + return TRUE; } --=20 Anthony PERARD -=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 (#57643): https://edk2.groups.io/g/devel/message/57643 Mute This Topic: https://groups.io/mt/73153294/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-