From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.61]) by mx.groups.io with SMTP id smtpd.web10.2234.1587751561824979257 for ; Fri, 24 Apr 2020 11:06:02 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SHSYUHuX; spf=pass (domain: redhat.com, ip: 205.139.110.61, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587751561; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WK3M1E+w/fSYoqZl9KobfU6YcDtI3U//2r8GsH0qFcQ=; b=SHSYUHuXGrLsYuHEWRHUtx231uXlgSXsz7SbZ+GPmk9R1Cm3aBafnWz4C1BNA5+X005Tig MOPN/7ydgs1jw7XOo+JWQzzNLyd5S9CWtGVxKjhOvJn65p2eUxa6WDFgL4ze0xbhwIVTg4 J3cUztjIUi6uefwXQ8UqNxNWxlL/FL4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-360-vnyVXs14MhSWdhdsdQOgzg-1; Fri, 24 Apr 2020 14:05:57 -0400 X-MC-Unique: vnyVXs14MhSWdhdsdQOgzg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1D404108C22E; Fri, 24 Apr 2020 18:05:56 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-113-159.ams2.redhat.com [10.36.113.159]) by smtp.corp.redhat.com (Postfix) with ESMTP id D3E325D9CA; Fri, 24 Apr 2020 18:05:54 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v2 5/5] OvmfPkg/OvmfXen: Introduce DEBUG_ON_HYPERVISOR_CONSOLE build flag To: devel@edk2.groups.io, anthony.perard@citrix.com Cc: Ard Biesheuvel , Jordan Justen , Julien Grall References: <20200423095358.2518197-1-anthony.perard@citrix.com> <20200423095358.2518197-6-anthony.perard@citrix.com> From: "Laszlo Ersek" Message-ID: Date: Fri, 24 Apr 2020 20:05:53 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200423095358.2518197-6-anthony.perard@citrix.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit On 04/23/20 11:53, Anthony PERARD wrote: > Introduce DEBUG_ON_HYPERVISOR_CONSOLE build flag to enable logging > debug output to the Xen console. > > This will work 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 > --- > OvmfPkg/OvmfXen.dsc | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > > diff --git a/OvmfPkg/OvmfXen.dsc b/OvmfPkg/OvmfXen.dsc > index 4859faf1bff7..0a8fd26990a3 100644 > --- a/OvmfPkg/OvmfXen.dsc > +++ b/OvmfPkg/OvmfXen.dsc > @@ -205,14 +205,22 @@ [LibraryClasses] > Tcg2PhysicalPresenceLib|OvmfPkg/Library/Tcg2PhysicalPresenceLibNull/DxeTcg2PhysicalPresenceLib.inf > TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf > RealTimeClockLib|OvmfPkg/Library/XenRealTimeClockLib/XenRealTimeClockLib.inf > +!ifdef $(DEBUG_ON_HYPERVISOR_CONSOLE) > + DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPortNocheck.inf > +!else > DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf > +!endif > > [LibraryClasses.common] > BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf > > [LibraryClasses.common.SEC] > QemuFwCfgLib|OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgSecLib.inf > +!ifdef $(DEBUG_ON_HYPERVISOR_CONSOLE) > + DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPortNocheck.inf > +!else > DebugLib|OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPort.inf > +!endif (1) This part can be simplified with an !ifndef, instead, I think. (When DEBUG_ON_HYPERVISOR_CONSOLE is defined, then the default resolution can take effect for SEC too.) If you wish I can change this for you as well. Alternatively, if you'd rather repost, that's OK too. (And maybe Phil intends to review more of the patches in this series; I'm not sure.) > ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf > ExtractGuidedSectionLib|MdePkg/Library/BaseExtractGuidedSectionLib/BaseExtractGuidedSectionLib.inf > !if $(SOURCE_DEBUG_ENABLE) == TRUE > @@ -405,6 +413,11 @@ [PcdsFixedAtBuild] > # > !include NetworkPkg/NetworkPcds.dsc.inc > > +!ifdef $(DEBUG_ON_HYPERVISOR_CONSOLE) > + ## Set Xen's debug IO port for PlatformDebugLibIoPort > + gUefiOvmfPkgTokenSpaceGuid.PcdDebugIoPort|0xe9 > +!endif > + > # IRQs 5, 9, 10, 11 are level-triggered > gUefiOvmfPkgTokenSpaceGuid.Pcd8259LegacyModeEdgeLevel|0x0E20 > > With (1) updated: Reviewed-by: Laszlo Ersek