* [edk2-devel] [PATCH v2 1/1] OvmfPkg/ResetVector: send post codes to qemu debug console
@ 2024-01-26 14:29 Gerd Hoffmann
2024-01-26 16:16 ` Lendacky, Thomas via groups.io
2024-01-29 12:11 ` Laszlo Ersek
0 siblings, 2 replies; 4+ messages in thread
From: Gerd Hoffmann @ 2024-01-26 14:29 UTC (permalink / raw)
To: devel
Cc: Erdem Aktas, Oliver Steffen, Jiewen Yao, Laszlo Ersek,
Gerd Hoffmann, Michael Roth, Ard Biesheuvel, Tom Lendacky, Min Xu
Neat when doing ResetVector coding.
Incompatible with TDX and SEV, therefore not enabled by default.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
OvmfPkg/ResetVector/QemuDebugCon.asm | 35 +++++++++++++++++++++++++++
OvmfPkg/ResetVector/ResetVector.nasmb | 4 +++
2 files changed, 39 insertions(+)
create mode 100644 OvmfPkg/ResetVector/QemuDebugCon.asm
diff --git a/OvmfPkg/ResetVector/QemuDebugCon.asm b/OvmfPkg/ResetVector/QemuDebugCon.asm
new file mode 100644
index 000000000000..e385ca1be83a
--- /dev/null
+++ b/OvmfPkg/ResetVector/QemuDebugCon.asm
@@ -0,0 +1,35 @@
+;------------------------------------------------------------------------------
+; @file
+; qemu debug console support macros (based on serial port macros)
+;
+; Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>
+; SPDX-License-Identifier: BSD-2-Clause-Patent
+;
+;------------------------------------------------------------------------------
+
+%macro debugShowCharacter 1
+ mov dx, 0x402
+ mov al, %1
+ out dx, al
+%endmacro
+
+%macro debugShowHexDigit 1
+ %if (%1 < 0xa)
+ debugShowCharacter BYTE ('0' + (%1))
+ %else
+ debugShowCharacter BYTE ('a' + ((%1) - 0xa))
+ %endif
+%endmacro
+
+%macro debugShowPostCode 1
+ debugShowHexDigit (((%1) >> 4) & 0xf)
+ debugShowHexDigit ((%1) & 0xf)
+ debugShowCharacter `\r`
+ debugShowCharacter `\n`
+%endmacro
+
+BITS 16
+
+%macro debugInitialize 0
+ ; not required
+%endmacro
diff --git a/OvmfPkg/ResetVector/ResetVector.nasmb b/OvmfPkg/ResetVector/ResetVector.nasmb
index 5832aaa8abf7..69ce43ef6a96 100644
--- a/OvmfPkg/ResetVector/ResetVector.nasmb
+++ b/OvmfPkg/ResetVector/ResetVector.nasmb
@@ -40,6 +40,10 @@
%include "Port80Debug.asm"
%elifdef DEBUG_SERIAL
%include "SerialDebug.asm"
+%elif 0
+; Set ^ this to 1 to enable postcodes on the qemu debug console.
+; Disabled by default because it is incompatible with SEV and TDX.
+ %include "QemuDebugCon.asm"
%else
%include "DebugDisabled.asm"
%endif
--
2.43.0
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114617): https://edk2.groups.io/g/devel/message/114617
Mute This Topic: https://groups.io/mt/103976858/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [edk2-devel] [PATCH v2 1/1] OvmfPkg/ResetVector: send post codes to qemu debug console
2024-01-26 14:29 [edk2-devel] [PATCH v2 1/1] OvmfPkg/ResetVector: send post codes to qemu debug console Gerd Hoffmann
@ 2024-01-26 16:16 ` Lendacky, Thomas via groups.io
2024-01-27 1:17 ` Erdem Aktas via groups.io
2024-01-29 12:11 ` Laszlo Ersek
1 sibling, 1 reply; 4+ messages in thread
From: Lendacky, Thomas via groups.io @ 2024-01-26 16:16 UTC (permalink / raw)
To: Gerd Hoffmann, devel
Cc: Erdem Aktas, Oliver Steffen, Jiewen Yao, Laszlo Ersek,
Michael Roth, Ard Biesheuvel, Min Xu
On 1/26/24 08:29, Gerd Hoffmann wrote:
> Neat when doing ResetVector coding.
> Incompatible with TDX and SEV, therefore not enabled by default.
>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Tom Lendacky <thomas.lendacky@amd.com>
> ---
> OvmfPkg/ResetVector/QemuDebugCon.asm | 35 +++++++++++++++++++++++++++
> OvmfPkg/ResetVector/ResetVector.nasmb | 4 +++
> 2 files changed, 39 insertions(+)
> create mode 100644 OvmfPkg/ResetVector/QemuDebugCon.asm
>
> diff --git a/OvmfPkg/ResetVector/QemuDebugCon.asm b/OvmfPkg/ResetVector/QemuDebugCon.asm
> new file mode 100644
> index 000000000000..e385ca1be83a
> --- /dev/null
> +++ b/OvmfPkg/ResetVector/QemuDebugCon.asm
> @@ -0,0 +1,35 @@
> +;------------------------------------------------------------------------------
> +; @file
> +; qemu debug console support macros (based on serial port macros)
> +;
> +; Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>
> +; SPDX-License-Identifier: BSD-2-Clause-Patent
> +;
> +;------------------------------------------------------------------------------
> +
> +%macro debugShowCharacter 1
> + mov dx, 0x402
> + mov al, %1
> + out dx, al
> +%endmacro
> +
> +%macro debugShowHexDigit 1
> + %if (%1 < 0xa)
> + debugShowCharacter BYTE ('0' + (%1))
> + %else
> + debugShowCharacter BYTE ('a' + ((%1) - 0xa))
> + %endif
> +%endmacro
> +
> +%macro debugShowPostCode 1
> + debugShowHexDigit (((%1) >> 4) & 0xf)
> + debugShowHexDigit ((%1) & 0xf)
> + debugShowCharacter `\r`
> + debugShowCharacter `\n`
> +%endmacro
> +
> +BITS 16
> +
> +%macro debugInitialize 0
> + ; not required
> +%endmacro
> diff --git a/OvmfPkg/ResetVector/ResetVector.nasmb b/OvmfPkg/ResetVector/ResetVector.nasmb
> index 5832aaa8abf7..69ce43ef6a96 100644
> --- a/OvmfPkg/ResetVector/ResetVector.nasmb
> +++ b/OvmfPkg/ResetVector/ResetVector.nasmb
> @@ -40,6 +40,10 @@
> %include "Port80Debug.asm"
> %elifdef DEBUG_SERIAL
> %include "SerialDebug.asm"
> +%elif 0
> +; Set ^ this to 1 to enable postcodes on the qemu debug console.
> +; Disabled by default because it is incompatible with SEV and TDX.
> + %include "QemuDebugCon.asm"
> %else
> %include "DebugDisabled.asm"
> %endif
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114620): https://edk2.groups.io/g/devel/message/114620
Mute This Topic: https://groups.io/mt/103976858/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [edk2-devel] [PATCH v2 1/1] OvmfPkg/ResetVector: send post codes to qemu debug console
2024-01-26 16:16 ` Lendacky, Thomas via groups.io
@ 2024-01-27 1:17 ` Erdem Aktas via groups.io
0 siblings, 0 replies; 4+ messages in thread
From: Erdem Aktas via groups.io @ 2024-01-27 1:17 UTC (permalink / raw)
To: Tom Lendacky
Cc: Gerd Hoffmann, devel, Oliver Steffen, Jiewen Yao, Laszlo Ersek,
Michael Roth, Ard Biesheuvel, Min Xu
On Fri, Jan 26, 2024 at 8:16 AM Tom Lendacky <thomas.lendacky@amd.com> wrote:
>
> On 1/26/24 08:29, Gerd Hoffmann wrote:
> > Neat when doing ResetVector coding.
> > Incompatible with TDX and SEV, therefore not enabled by default.
> >
> > Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
>
> Acked-by: Tom Lendacky <thomas.lendacky@amd.com>
>
Acked-by: Erdem Aktas <erdemaktas@google.com>
>
> > ---
> > OvmfPkg/ResetVector/QemuDebugCon.asm | 35 +++++++++++++++++++++++++++
> > OvmfPkg/ResetVector/ResetVector.nasmb | 4 +++
> > 2 files changed, 39 insertions(+)
> > create mode 100644 OvmfPkg/ResetVector/QemuDebugCon.asm
> >
> > diff --git a/OvmfPkg/ResetVector/QemuDebugCon.asm b/OvmfPkg/ResetVector/QemuDebugCon.asm
> > new file mode 100644
> > index 000000000000..e385ca1be83a
> > --- /dev/null
> > +++ b/OvmfPkg/ResetVector/QemuDebugCon.asm
> > @@ -0,0 +1,35 @@
> > +;------------------------------------------------------------------------------
> > +; @file
> > +; qemu debug console support macros (based on serial port macros)
> > +;
> > +; Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>
> > +; SPDX-License-Identifier: BSD-2-Clause-Patent
> > +;
> > +;------------------------------------------------------------------------------
> > +
> > +%macro debugShowCharacter 1
> > + mov dx, 0x402
> > + mov al, %1
> > + out dx, al
> > +%endmacro
> > +
> > +%macro debugShowHexDigit 1
> > + %if (%1 < 0xa)
> > + debugShowCharacter BYTE ('0' + (%1))
> > + %else
> > + debugShowCharacter BYTE ('a' + ((%1) - 0xa))
> > + %endif
> > +%endmacro
> > +
> > +%macro debugShowPostCode 1
> > + debugShowHexDigit (((%1) >> 4) & 0xf)
> > + debugShowHexDigit ((%1) & 0xf)
> > + debugShowCharacter `\r`
> > + debugShowCharacter `\n`
> > +%endmacro
> > +
> > +BITS 16
> > +
> > +%macro debugInitialize 0
> > + ; not required
> > +%endmacro
> > diff --git a/OvmfPkg/ResetVector/ResetVector.nasmb b/OvmfPkg/ResetVector/ResetVector.nasmb
> > index 5832aaa8abf7..69ce43ef6a96 100644
> > --- a/OvmfPkg/ResetVector/ResetVector.nasmb
> > +++ b/OvmfPkg/ResetVector/ResetVector.nasmb
> > @@ -40,6 +40,10 @@
> > %include "Port80Debug.asm"
> > %elifdef DEBUG_SERIAL
> > %include "SerialDebug.asm"
> > +%elif 0
> > +; Set ^ this to 1 to enable postcodes on the qemu debug console.
> > +; Disabled by default because it is incompatible with SEV and TDX.
> > + %include "QemuDebugCon.asm"
> > %else
> > %include "DebugDisabled.asm"
> > %endif
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114646): https://edk2.groups.io/g/devel/message/114646
Mute This Topic: https://groups.io/mt/103976858/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [edk2-devel] [PATCH v2 1/1] OvmfPkg/ResetVector: send post codes to qemu debug console
2024-01-26 14:29 [edk2-devel] [PATCH v2 1/1] OvmfPkg/ResetVector: send post codes to qemu debug console Gerd Hoffmann
2024-01-26 16:16 ` Lendacky, Thomas via groups.io
@ 2024-01-29 12:11 ` Laszlo Ersek
1 sibling, 0 replies; 4+ messages in thread
From: Laszlo Ersek @ 2024-01-29 12:11 UTC (permalink / raw)
To: Gerd Hoffmann, devel
Cc: Erdem Aktas, Oliver Steffen, Jiewen Yao, Michael Roth,
Ard Biesheuvel, Tom Lendacky, Min Xu
On 1/26/24 15:29, Gerd Hoffmann wrote:
> Neat when doing ResetVector coding.
> Incompatible with TDX and SEV, therefore not enabled by default.
>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
> OvmfPkg/ResetVector/QemuDebugCon.asm | 35 +++++++++++++++++++++++++++
> OvmfPkg/ResetVector/ResetVector.nasmb | 4 +++
> 2 files changed, 39 insertions(+)
> create mode 100644 OvmfPkg/ResetVector/QemuDebugCon.asm
>
> diff --git a/OvmfPkg/ResetVector/QemuDebugCon.asm b/OvmfPkg/ResetVector/QemuDebugCon.asm
> new file mode 100644
> index 000000000000..e385ca1be83a
> --- /dev/null
> +++ b/OvmfPkg/ResetVector/QemuDebugCon.asm
> @@ -0,0 +1,35 @@
> +;------------------------------------------------------------------------------
> +; @file
> +; qemu debug console support macros (based on serial port macros)
> +;
> +; Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>
> +; SPDX-License-Identifier: BSD-2-Clause-Patent
> +;
> +;------------------------------------------------------------------------------
The patch looks good (I'm ready to R-b), but this copyright notice seems
wrong. *Keeping* what it currently says seems definitely justified
(derivative code and whatnot), but it's ultimately a new file you are
creating, plus the file has genuine new code. I think an RH copyright
notice *in addition* is needed here. (And I don't think I can fix up
*that* part of the patch for you.)
With the notice extended:
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Thanks
Laszlo
> +
> +%macro debugShowCharacter 1
> + mov dx, 0x402
> + mov al, %1
> + out dx, al
> +%endmacro
> +
> +%macro debugShowHexDigit 1
> + %if (%1 < 0xa)
> + debugShowCharacter BYTE ('0' + (%1))
> + %else
> + debugShowCharacter BYTE ('a' + ((%1) - 0xa))
> + %endif
> +%endmacro
> +
> +%macro debugShowPostCode 1
> + debugShowHexDigit (((%1) >> 4) & 0xf)
> + debugShowHexDigit ((%1) & 0xf)
> + debugShowCharacter `\r`
> + debugShowCharacter `\n`
> +%endmacro
> +
> +BITS 16
> +
> +%macro debugInitialize 0
> + ; not required
> +%endmacro
> diff --git a/OvmfPkg/ResetVector/ResetVector.nasmb b/OvmfPkg/ResetVector/ResetVector.nasmb
> index 5832aaa8abf7..69ce43ef6a96 100644
> --- a/OvmfPkg/ResetVector/ResetVector.nasmb
> +++ b/OvmfPkg/ResetVector/ResetVector.nasmb
> @@ -40,6 +40,10 @@
> %include "Port80Debug.asm"
> %elifdef DEBUG_SERIAL
> %include "SerialDebug.asm"
> +%elif 0
> +; Set ^ this to 1 to enable postcodes on the qemu debug console.
> +; Disabled by default because it is incompatible with SEV and TDX.
> + %include "QemuDebugCon.asm"
> %else
> %include "DebugDisabled.asm"
> %endif
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114695): https://edk2.groups.io/g/devel/message/114695
Mute This Topic: https://groups.io/mt/103976858/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-01-29 12:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-26 14:29 [edk2-devel] [PATCH v2 1/1] OvmfPkg/ResetVector: send post codes to qemu debug console Gerd Hoffmann
2024-01-26 16:16 ` Lendacky, Thomas via groups.io
2024-01-27 1:17 ` Erdem Aktas via groups.io
2024-01-29 12:11 ` Laszlo Ersek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox