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.web11.1466.1589230193971254932 for ; Mon, 11 May 2020 13:49:54 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=G3cls2ca; 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=1589230193; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9WHWFMfRiqIAlvg6nlPrdpSsPl3f1VVuyks3Utk7q+k=; b=G3cls2ca1LRsumAnWmDxMhucAgOlUzoT6iI+tOuG2F7ZaIbzFGNH34v+c/FB8/FSAScu2A Z9YInV9Wf52dgb11NkTG2MRVbJHYV3uzGoX09Ad7e5IrmIgCBBaoOZ8TPK3QAkizhb54Qa flx4dJjUotv81XkG7T5Sh3V8caDdTb4= 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-104-bULaeTrhM0m0SreCu_NwWw-1; Mon, 11 May 2020 16:49:49 -0400 X-MC-Unique: bULaeTrhM0m0SreCu_NwWw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1CC48802EAC; Mon, 11 May 2020 20:49:48 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-113-11.ams2.redhat.com [10.36.113.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4D93867642; Mon, 11 May 2020 20:49:47 +0000 (UTC) Subject: Re: [edk2-devel] [PATCH V4 16/27] OvmfPkg: Add support for DebugCommonLib To: devel@edk2.groups.io, cheptsov@ispras.ru References: <20200511154121.3878-1-cheptsov@ispras.ru> <20200511154121.3878-17-cheptsov@ispras.ru> From: "Laszlo Ersek" Message-ID: Date: Mon, 11 May 2020 22:49:46 +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: <20200511154121.3878-17-cheptsov@ispras.ru> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 05/11/20 17:41, Vitaly Cheptsov wrote: > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2054 > > Signed-off-by: Vitaly Cheptsov > --- > OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c | 98 -------------------- > OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPort.inf | 1 + > OvmfPkg/OvmfPkgIa32.dsc | 1 + > OvmfPkg/OvmfPkgIa32X64.dsc | 1 + > OvmfPkg/OvmfPkgX64.dsc | 1 + > OvmfPkg/OvmfXen.dsc | 1 + > 6 files changed, 5 insertions(+), 98 deletions(-) > > diff --git a/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c b/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c > index dffb20822d..a4e0861d00 100644 > --- a/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c > +++ b/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c > @@ -261,101 +261,3 @@ DebugClearMemory ( > // > return SetMem (Buffer, Length, PcdGet8(PcdDebugClearMemoryValue)); > } > - > - > -/** > - Returns TRUE if ASSERT() macros are enabled. > - > - This function returns TRUE if the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of > - PcdDebugProperyMask is set. Otherwise FALSE is returned. > - > - @retval TRUE The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set. > - @retval FALSE The DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is clear. > - > -**/ > -BOOLEAN > -EFIAPI > -DebugAssertEnabled ( > - VOID > - ) > -{ > - return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED) != 0); > -} > - > - > -/** > - Returns TRUE if DEBUG() macros are enabled. > - > - This function returns TRUE if the DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of > - PcdDebugProperyMask is set. Otherwise FALSE is returned. > - > - @retval TRUE The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is set. > - @retval FALSE The DEBUG_PROPERTY_DEBUG_PRINT_ENABLED bit of PcdDebugProperyMask is clear. > - > -**/ > -BOOLEAN > -EFIAPI > -DebugPrintEnabled ( > - VOID > - ) > -{ > - return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_PRINT_ENABLED) != 0); > -} > - > - > -/** > - Returns TRUE if DEBUG_CODE() macros are enabled. > - > - This function returns TRUE if the DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of > - PcdDebugProperyMask is set. Otherwise FALSE is returned. > - > - @retval TRUE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is set. > - @retval FALSE The DEBUG_PROPERTY_DEBUG_CODE_ENABLED bit of PcdDebugProperyMask is clear. > - > -**/ > -BOOLEAN > -EFIAPI > -DebugCodeEnabled ( > - VOID > - ) > -{ > - return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_DEBUG_CODE_ENABLED) != 0); > -} > - > - > -/** > - Returns TRUE if DEBUG_CLEAR_MEMORY() macro is enabled. > - > - This function returns TRUE if the DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of > - PcdDebugProperyMask is set. Otherwise FALSE is returned. > - > - @retval TRUE The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is set. > - @retval FALSE The DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED bit of PcdDebugProperyMask is clear. > - > -**/ > -BOOLEAN > -EFIAPI > -DebugClearMemoryEnabled ( > - VOID > - ) > -{ > - return (BOOLEAN) ((PcdGet8(PcdDebugPropertyMask) & DEBUG_PROPERTY_CLEAR_MEMORY_ENABLED) != 0); > -} > - > -/** > - Returns TRUE if any one of the bit is set both in ErrorLevel and PcdFixedDebugPrintErrorLevel. > - > - This function compares the bit mask of ErrorLevel and PcdFixedDebugPrintErrorLevel. > - > - @retval TRUE Current ErrorLevel is supported. > - @retval FALSE Current ErrorLevel is not supported. > - > -**/ > -BOOLEAN > -EFIAPI > -DebugPrintLevelEnabled ( > - IN CONST UINTN ErrorLevel > - ) > -{ > - return (BOOLEAN) ((ErrorLevel & PcdGet32(PcdFixedDebugPrintErrorLevel)) != 0); > -} > diff --git a/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPort.inf b/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPort.inf > index 8f721d249d..4078f0e361 100644 > --- a/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPort.inf > +++ b/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformRomDebugLibIoPort.inf > @@ -39,6 +39,7 @@ [LibraryClasses] > PcdLib > PrintLib > BaseLib > + DebugCommonLib > DebugPrintErrorLevelLib > > [Pcd] (1) The other two INF files in the same directory should get the same update. (I.e., a dependency on DebugCommonLib.) (2) I believe it should be possible to remove "PcdFixedDebugPrintErrorLevel" from all three INF files in the same directory. (The only reference, which is being removed, is in DebugPrintLevelEnabled().) Otherwise, the patch looks OK to me. Thanks! Laszlo > diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc > index 7c8b51f43b..c8adf75730 100644 > --- a/OvmfPkg/OvmfPkgIa32.dsc > +++ b/OvmfPkg/OvmfPkgIa32.dsc > @@ -180,6 +180,7 @@ [LibraryClasses] > !endif > > LocalApicLib|UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf > + DebugCommonLib|MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf > DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf > > IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf > diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc > index a0596c4416..4df757ae68 100644 > --- a/OvmfPkg/OvmfPkgIa32X64.dsc > +++ b/OvmfPkg/OvmfPkgIa32X64.dsc > @@ -184,6 +184,7 @@ [LibraryClasses] > !endif > > LocalApicLib|UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf > + DebugCommonLib|MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf > DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf > > IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf > diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc > index 2e764b6b72..f0f6226f67 100644 > --- a/OvmfPkg/OvmfPkgX64.dsc > +++ b/OvmfPkg/OvmfPkgX64.dsc > @@ -184,6 +184,7 @@ [LibraryClasses] > !endif > > LocalApicLib|UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf > + DebugCommonLib|MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf > DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf > > IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf > diff --git a/OvmfPkg/OvmfXen.dsc b/OvmfPkg/OvmfXen.dsc > index 8b3615e0b0..257e2c1740 100644 > --- a/OvmfPkg/OvmfXen.dsc > +++ b/OvmfPkg/OvmfXen.dsc > @@ -171,6 +171,7 @@ [LibraryClasses] > !endif > > LocalApicLib|UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.inf > + DebugCommonLib|MdePkg/Library/BaseDebugCommonLib/BaseDebugCommonLib.inf > DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf > > IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf >