On 02/02/15 07:35, Liming Gao wrote:
> Implement new API DebugPrintLevelEnabled() to base on PCD
> PcdFixedDebugPrintErrorLevel.
>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Liming Gao <[email protected]>
> ---
> OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c | 19
> ++++++++++++++++++-
> .../PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf | 3 ++-
> 2 files changed, 20 insertions(+), 2 deletions(-)
>
> diff --git a/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c
> b/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c
> index 84299ca..585f9fb 100644
> --- a/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c
> +++ b/OvmfPkg/Library/PlatformDebugLibIoPort/DebugLib.c
> @@ -2,7 +2,7 @@
> Base Debug library instance for QEMU debug port.
> It uses PrintLib to send debug messages to a fixed I/O port.
>
> - Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
> + Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
> Copyright (c) 2012, Red Hat, Inc.<BR>
> This program and the accompanying materials
> are licensed and made available under the terms and conditions of the BSD
> License
> @@ -267,3 +267,20 @@ DebugClearMemoryEnabled (
> 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/PlatformDebugLibIoPort.inf
> b/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf
> index a70c7b5..0e74fe9 100644
> --- a/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf
> +++ b/OvmfPkg/Library/PlatformDebugLibIoPort/PlatformDebugLibIoPort.inf
> @@ -2,7 +2,7 @@
> # Instance of Debug Library for the QEMU debug console port.
> # It uses Print Library to produce formatted output strings.
> #
> -# Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
> +# Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
> # Copyright (c) 2012, Red Hat, Inc.<BR>
> #
> # This program and the accompanying materials
> @@ -47,4 +47,5 @@
> gUefiOvmfPkgTokenSpaceGuid.PcdDebugIoPort ## CONSUMES
> gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue ## CONSUMES
> gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask ## CONSUMES
> + gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel ## CONSUMES
>
>
The code in this patch looks okay to me, but I'd like to ask about the
context.
I can see:
- http://thread.gmane.org/gmane.comp.bios.tianocore.devel/11979
- http://thread.gmane.org/gmane.comp.bios.tianocore.devel/11961
First, in patch 1/6, I think the following is wrong:
+ # BIT28 - Error message.<BR>
That should be BIT31 (for 0x80000000).
Second, the patchset doesn't seem to introduce any DSC-specific values
for the new PcdFixedDebugPrintErrorLevel. And, the default value is
0x80000000 (ie. EFI_D_ERROR only).
If I understand correctly, after this patchset, in order for a debug
message to reach the debug output, its error level (or error mask, more
precisely) must intersect with *both* of PcdDebugPrintErrorLevel and the
new PcdFixedDebugPrintErrorLevel.
If that's the case, then the default value 0x80000000 in the .dec file
(without any DSC-specific assignments) will regress debug logging in all
platforms that log on any different level. For example, OVMF will lose
all EFI_D_INFO messages (0x00000040).
I think this patchset should not only add the new function to all
DebugLib instances, and it should not only add the new PCD to those INF
files.
I think it should also update all DSC (and DSC include) files that
assign a value different from 0x80000000 to PcdDebugPrintErrorLevel, and
it should assign the same value to PcdFixedDebugPrintErrorLevel too.
Otherwise this patchset will globally restrict debug messages to
EFI_D_ERROR.
I'm attaching the search results for non-0x80000000
PcdDebugPrintErrorLevel assignments.
Thanks,
Laszlo
AppPkg/AppPkg.dsc:41:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|$(DEBUG_PRINT_ERROR_LEVEL)
AppPkg/AppPkg.dsc:126:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80400040
ArmPlatformPkg/ArmPlatformPkg-2ndstage.dsc:271:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x8000000F
ArmPlatformPkg/ArmPlatformPkg.dsc:303:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x8000000F
ArmPlatformPkg/ArmRealViewEbPkg/ArmRealViewEb.dsc.inc:276:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x8000000F
ArmPlatformPkg/ArmVExpressPkg/ArmVExpress.dsc.inc:312:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x8000000F
ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualization.dsc.inc:282: #
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x8000000F
ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationQemu.dsc:90:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x8000004F
BeagleBoardPkg/BeagleBoardPkg.dsc:298:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x8000000F
BeagleBoardPkg/BeagleBoardPkg.dsc:436:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x800fffff
DuetPkg/DuetPkgIa32.dsc:129:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x0
DuetPkg/DuetPkgIa32.dsc:173:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000042
DuetPkg/DuetPkgX64.dsc:130:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x0
DuetPkg/DuetPkgX64.dsc:174:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000042
EmulatorPkg/EmulatorPkg.dsc:184:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000040
IntelFspPkg/IntelFspPkg.dsc:75:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80080046
IntelFspWrapperPkg/IntelFspWrapperPkg.dsc:82:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80080046
Nt32Pkg/Nt32Pkg.dsc:225:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000040
Omap35xxPkg/Omap35xxPkg.dsc:136:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000004
OptionRomPkg/OptionRomPkg.dsc:74:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000042
OvmfPkg/OvmfPkgIa32.dsc:312:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x8000004F
OvmfPkg/OvmfPkgIa32X64.dsc:317:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x8000004F
OvmfPkg/OvmfPkgX64.dsc:317:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x8000004F
StdLib/StdLib.dsc:45:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|$(DEBUG_PRINT_ERROR_LEVEL)
Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc:673:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x803805c6
Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc:759:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000046
Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc:775:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000046
Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc:816:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x803805c6
Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc:829:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000046
Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc:884:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000046
Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc:896:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000046
Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc:911:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0xF0000043
Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc:1039:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0xF0000043
Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc:1145:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0xF0000043
Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc:1484:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0xF0000043
Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc:1489:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0xF0000043
Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc:1493:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x00000043
Vlv2TbltDevicePkg/PlatformPkgGccX64.dsc:1498:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x00000043
Vlv2TbltDevicePkg/PlatformPkgIA32.dsc:673:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x803805c6
Vlv2TbltDevicePkg/PlatformPkgIA32.dsc:759:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000046
Vlv2TbltDevicePkg/PlatformPkgIA32.dsc:770:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000046
Vlv2TbltDevicePkg/PlatformPkgIA32.dsc:811:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x803805c6
Vlv2TbltDevicePkg/PlatformPkgIA32.dsc:824:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000046
Vlv2TbltDevicePkg/PlatformPkgIA32.dsc:879:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000046
Vlv2TbltDevicePkg/PlatformPkgIA32.dsc:891:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000046
Vlv2TbltDevicePkg/PlatformPkgIA32.dsc:905:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0xF0000043
Vlv2TbltDevicePkg/PlatformPkgIA32.dsc:1033:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0xF0000043
Vlv2TbltDevicePkg/PlatformPkgIA32.dsc:1133:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0xF0000043
Vlv2TbltDevicePkg/PlatformPkgIA32.dsc:1471:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0xF0000043
Vlv2TbltDevicePkg/PlatformPkgIA32.dsc:1476:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0xF0000043
Vlv2TbltDevicePkg/PlatformPkgIA32.dsc:1480:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x00000043
Vlv2TbltDevicePkg/PlatformPkgIA32.dsc:1485:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x00000043
Vlv2TbltDevicePkg/PlatformPkgX64.dsc:673:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x803805c6
Vlv2TbltDevicePkg/PlatformPkgX64.dsc:759:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000046
Vlv2TbltDevicePkg/PlatformPkgX64.dsc:770:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000046
Vlv2TbltDevicePkg/PlatformPkgX64.dsc:811:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x803805c6
Vlv2TbltDevicePkg/PlatformPkgX64.dsc:824:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000046
Vlv2TbltDevicePkg/PlatformPkgX64.dsc:879:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000046
Vlv2TbltDevicePkg/PlatformPkgX64.dsc:891:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000046
Vlv2TbltDevicePkg/PlatformPkgX64.dsc:905:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0xF0000043
Vlv2TbltDevicePkg/PlatformPkgX64.dsc:1033:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0xF0000043
Vlv2TbltDevicePkg/PlatformPkgX64.dsc:1133:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0xF0000043
Vlv2TbltDevicePkg/PlatformPkgX64.dsc:1471:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0xF0000043
Vlv2TbltDevicePkg/PlatformPkgX64.dsc:1476:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0xF0000043
Vlv2TbltDevicePkg/PlatformPkgX64.dsc:1480:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x00000043
Vlv2TbltDevicePkg/PlatformPkgX64.dsc:1485:
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x00000043
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel