From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id E7FBFD80471 for ; Sat, 27 Jan 2024 01:17:17 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=WgeIbsWgmWzhMBzv/AvDQQ4CLcJn/5b/ybi6cZBNCMw=; c=relaxed/simple; d=groups.io; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:To:Cc:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Transfer-Encoding; s=20140610; t=1706318236; v=1; b=xIaGHzGYo5MmnpZJcvHWEc0lZ5+qcvcq52OiH3gAF1ROw3PZaejP0QoHGN7APY7hJ8RNCp+n HHplNEzXElB0utEp5DtGHugOrjs0KcNm08XdRd+bKV2Njehu/ylfW5IghJ338paUvNs5VEcI85g oeAVCPl2LWIg5FwHYRKtACn0= X-Received: by 127.0.0.2 with SMTP id M9OCYY7687511x6zfvG2mvHl; Fri, 26 Jan 2024 17:17:16 -0800 X-Received: from mail-qv1-f51.google.com (mail-qv1-f51.google.com [209.85.219.51]) by mx.groups.io with SMTP id smtpd.web10.7013.1706318235947213685 for ; Fri, 26 Jan 2024 17:17:16 -0800 X-Received: by mail-qv1-f51.google.com with SMTP id 6a1803df08f44-68c2f4c3282so5218996d6.3 for ; Fri, 26 Jan 2024 17:17:15 -0800 (PST) X-Gm-Message-State: K2LX9dKyyPWxzu4EHKx9EICBx7686176AA= X-Google-Smtp-Source: AGHT+IEBd1FVKk569pezvm0J/nA0irUh7wuOfQRa0O1UXlhgnQxAzbJnHipWxLKy3hHYevF/akmyf6dTLd3wpRVxInc= X-Received: by 2002:a05:6214:2587:b0:686:ab05:5c44 with SMTP id fq7-20020a056214258700b00686ab055c44mr960399qvb.44.1706318234942; Fri, 26 Jan 2024 17:17:14 -0800 (PST) MIME-Version: 1.0 References: <20240126142913.169210-1-kraxel@redhat.com> <65d6a640-9e5c-85b8-2cc1-55cd0cde338a@amd.com> In-Reply-To: <65d6a640-9e5c-85b8-2cc1-55cd0cde338a@amd.com> From: "Erdem Aktas via groups.io" Date: Fri, 26 Jan 2024 17:17:03 -0800 Message-ID: Subject: Re: [edk2-devel] [PATCH v2 1/1] OvmfPkg/ResetVector: send post codes to qemu debug console To: Tom Lendacky Cc: Gerd Hoffmann , devel@edk2.groups.io, Oliver Steffen , Jiewen Yao , Laszlo Ersek , Michael Roth , Ard Biesheuvel , Min Xu Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,erdemaktas@google.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=xIaGHzGY; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=none On Fri, Jan 26, 2024 at 8:16=E2=80=AFAM Tom Lendacky 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 > > Acked-by: Tom Lendacky > Acked-by: Erdem Aktas > > > --- > > 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. > > +; 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/ResetVecto= r/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 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- 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] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-