From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.120]) by mx.groups.io with SMTP id smtpd.web10.2080.1587751163284132478 for ; Fri, 24 Apr 2020 10:59:23 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=MPqabwTj; spf=pass (domain: redhat.com, ip: 205.139.110.120, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587751162; 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=CWB84XWUX0hfcGsFR6doVaropuuExQlbmPS4wNffW3Q=; b=MPqabwTjo9TtdYwBWs0S8hKQaWJZHJ0DdxLffDK2ga0MAx38m+H5oGUzjngiaoAxtnJRkJ PJsshZz6VZqQmc9LDSRW/BUjGvgd2peZqzE/PEGrLVUGKQ1wg9ZFWlNwXxb51Mq37ugGzP qntF3IGKqN7X1+DvDSHtYis7Nh46qz0= 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-132-0Vpl-_e4O8e3OuKyaK4Bpw-1; Fri, 24 Apr 2020 13:59:17 -0400 X-MC-Unique: 0Vpl-_e4O8e3OuKyaK4Bpw-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 9098D100AA4E; Fri, 24 Apr 2020 17:58:50 +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 320115D9CA; Fri, 24 Apr 2020 17:58:48 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH v2 4/5] OvmfPkg/PlatformDebugLibIoPort: Introduce a Nocheck variant 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-5-anthony.perard@citrix.com> From: "Laszlo Ersek" Message-ID: <1f5cc358-7338-08e8-7761-6bdfa286e196@redhat.com> Date: Fri, 24 Apr 2020 19:58:48 +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-5-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 PlatformRomDebugLibIoPortNocheck which doesn't try to detect > the debug IO port. Instead, debug logs are always written to the IO port. > > Signed-off-by: Anthony PERARD > --- > ...f => PlatformRomDebugLibIoPortNocheck.inf} | 15 ++++++----- > .../DebugIoPortNocheck.c | 25 +++++++++++++++++++ > 2 files changed, 32 insertions(+), 8 deletions(-) > copy OvmfPkg/Library/PlatformDebugLibIoPort/{PlatformRomDebugLibIoPort.inf => PlatformRomDebugLibIoPortNocheck.inf} (65%) > create mode 100644 OvmfPkg/Library/PlatformDebugLibIoPort/DebugIoPortNocheck.c > > diff --git a/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPort.inf b/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPortNocheck.inf > similarity index 65% > copy from OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPort.inf > copy to OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPortNocheck.inf > index 8f721d249dd5..34034e1eb887 100644 > --- a/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPort.inf > +++ b/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPortNocheck.inf > @@ -1,9 +1,8 @@ > ## @file > -# Instance of Debug Library for the QEMU debug console port. > +# Instance of Debug Library for an hypervisor debug console port. > # It uses Print Library to produce formatted output strings. > # > -# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
> -# Copyright (c) 2017, Red Hat, Inc.
> +# Copyright (c) 2020, Citrix Systems, Inc. > # > # SPDX-License-Identifier: BSD-2-Clause-Patent > # > @@ -12,11 +11,11 @@ > > [Defines] > INF_VERSION = 0x00010005 > - BASE_NAME = PlatformRomDebugLibIoPort > - FILE_GUID = CEB0D9D3-328F-4C24-8C02-28FA1986AE1B > + BASE_NAME = PlatformRomDebugLibIoPortNocheck > + FILE_GUID = 92AEB68E-C2CF-466E-9AB2-3F5E713F7DE6 > MODULE_TYPE = BASE > VERSION_STRING = 1.0 > - LIBRARY_CLASS = DebugLib|SEC > + LIBRARY_CLASS = DebugLib|SEC PEI_CORE PEIM DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER SMM_CORE DXE_SMM_DRIVER UEFI_DRIVER UEFI_APPLICATION (1) The simple way to say the same is to just drop the "|..." part :) But I can fix this up for you. > CONSTRUCTOR = PlatformRomDebugLibIoPortConstructor > > # > @@ -24,10 +23,10 @@ [Defines] > # > > [Sources] > - DebugIoPortQemu.c > + DebugIoPortNocheck.c > DebugLib.c > - DebugLibDetect.h > DebugLibDetectRom.c > + DebugLibDetect.h (2) The re-ordering of "DebugLibDetect.h" is curious. Maybe you may have an LC_COLLATE setting that sorts "." after "R"? Anyway I can re-sort this when I merge the series. > > [Packages] > MdePkg/MdePkg.dec > diff --git a/OvmfPkg/Library/PlatformDebugLibIoPort/DebugIoPortNocheck.c b/OvmfPkg/Library/PlatformDebugLibIoPort/DebugIoPortNocheck.c > new file mode 100644 > index 000000000000..0ef7920a8fb8 > --- /dev/null > +++ b/OvmfPkg/Library/PlatformDebugLibIoPort/DebugIoPortNocheck.c > @@ -0,0 +1,25 @@ > +/** @file > + Dectection code for hypervisor debug port. > + > + Copyright (c) 2020, Citrix Systems, Inc. > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#include "DebugLibDetect.h" > + > +/** > + Always return TRUE without detection as the debug I/O port is always > + present. > + > + @retval TRUE The debug I/O port is always present. > + > +**/ > +BOOLEAN > +EFIAPI > +PlatformDebugLibIoPortDetect ( > + VOID > + ) > +{ > + return TRUE; > +} > Reviewed-by: Laszlo Ersek