public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v3 0/2] Create UART DebugLib implementation for runtime drivers
@ 2018-02-22 18:15 Ard Biesheuvel
  2018-02-22 18:15 ` [PATCH v3 1/2] MdePkg: introduce DxeRuntimeDebugLibSerialPort Ard Biesheuvel
  2018-02-22 18:15 ` [PATCH v3 2/2] ArmVirtPkg: switch to DXE runtime version of DebugLib where appropriate Ard Biesheuvel
  0 siblings, 2 replies; 7+ messages in thread
From: Ard Biesheuvel @ 2018-02-22 18:15 UTC (permalink / raw)
  To: edk2-devel
  Cc: leif.lindholm, lersek, liming.gao, michael.d.kinney, afish,
	star.zeng, ruiyu.ni, Ard Biesheuvel

Commit 4bf95a9f361e ("MdeModulePkg/ResetSystemRuntimeDxe: Add more debug
message") broke the DEBUG build for systems using a MMIO mapped UART for
DEBUG output. In other words, it broke the build for all ARM and AARCH64
systems, given that port I/O does not exist on those architectures.

Instead of patching it up locally, let's fix this issue once and for all,
by creating a UART DebugLib implementation for DXE_RUNTIME_DRIVER modules
that does the right thing by default.

v3:
- revert PCD changes, as they are unnecessary for the PCDs in question (since
  they are fixed or patchable only)
- drop redundant mEfiAtRuntime checks around ASSERT()s
- revert whitespace cleanup, i.e., move back to BaseDebugLibSerialPort origin
  for most of the file

v2:
- incorporate Laszlo's feedback into patch #1
- add Laszlo's R-b to patch #2
- dropped patch #3 that blacklists the original BASE implementation for
  DXE_RUNTIME_DRIVER modules

Note that I retained the deadloop/breakpoint code for ASSERT()s at runtime.
I think it is perfectly reasonable behavior for a DEBUG build at runtime,
even if other cores may be up and running as well: the purpose of these
facilities is to allow a debugger to attach to the CPU to figure out what
has happened, and both deadloops and breakpoints can achieve that just
fine even at runtime.

Ard Biesheuvel (2):
  MdePkg: introduce DxeRuntimeDebugLibSerialPort
  ArmVirtPkg: switch to DXE runtime version of DebugLib where
    appropriate

 ArmVirtPkg/ArmVirt.dsc.inc                                                   |   3 +
 MdePkg/Library/DxeRuntimeDebugLibSerialPort/DebugLib.c                       | 346 ++++++++++++++++++++
 MdePkg/Library/DxeRuntimeDebugLibSerialPort/DxeRuntimeDebugLibSerialPort.inf |  55 ++++
 MdePkg/Library/DxeRuntimeDebugLibSerialPort/DxeRuntimeDebugLibSerialPort.uni |  21 ++
 4 files changed, 425 insertions(+)
 create mode 100644 MdePkg/Library/DxeRuntimeDebugLibSerialPort/DebugLib.c
 create mode 100644 MdePkg/Library/DxeRuntimeDebugLibSerialPort/DxeRuntimeDebugLibSerialPort.inf
 create mode 100644 MdePkg/Library/DxeRuntimeDebugLibSerialPort/DxeRuntimeDebugLibSerialPort.uni

-- 
2.11.0



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-02-23  8:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-22 18:15 [PATCH v3 0/2] Create UART DebugLib implementation for runtime drivers Ard Biesheuvel
2018-02-22 18:15 ` [PATCH v3 1/2] MdePkg: introduce DxeRuntimeDebugLibSerialPort Ard Biesheuvel
2018-02-22 18:32   ` Laszlo Ersek
2018-02-22 19:40   ` Kinney, Michael D
2018-02-22 19:57     ` Ard Biesheuvel
2018-02-23  8:55       ` Laszlo Ersek
2018-02-22 18:15 ` [PATCH v3 2/2] ArmVirtPkg: switch to DXE runtime version of DebugLib where appropriate Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox