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 BF9CFAC198C for ; Mon, 29 Jan 2024 20:22:24 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=SU8sj+B9duzkeBE96Xk7sX/WGrnV9kYwB2/Euf+u/oY=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1706559743; v=1; b=iy8qZ0ycYBoL3IHQOJlW11fuynw87ATGzpAbeW67D3g1kAAtnNqotAQZrsxQQzPFOIChNtdG 7CKj1OPLQTeheEap3jafDIV0CHiYauT3BaCkp1p8bF2/0QW6w3lpdRrGOekz6dwri5ljvYHZFko 8UzXlHWobyApPWNVc4EXhmfE= X-Received: by 127.0.0.2 with SMTP id ieqCYY7687511xFhAvnfXQBY; Mon, 29 Jan 2024 12:22:23 -0800 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web10.1150.1706559742779517719 for ; Mon, 29 Jan 2024 12:22:22 -0800 X-Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-516-JgC-rXz2NualAVtzNbVgKQ-1; Mon, 29 Jan 2024 15:22:16 -0500 X-MC-Unique: JgC-rXz2NualAVtzNbVgKQ-1 X-Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9D09E827D85; Mon, 29 Jan 2024 20:22:15 +0000 (UTC) X-Received: from [10.39.192.97] (unknown [10.39.192.97]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 42C1A40C9444; Mon, 29 Jan 2024 20:22:14 +0000 (UTC) Message-ID: Date: Mon, 29 Jan 2024 21:22:13 +0100 MIME-Version: 1.0 Subject: Re: [edk2-devel] [PATCH v3 1/1] OvmfPkg/ResetVector: send post codes to qemu debug console To: devel@edk2.groups.io, kraxel@redhat.com Cc: Erdem Aktas , Tom Lendacky , Jiewen Yao , Ard Biesheuvel , Michael Roth , Min Xu , Oliver Steffen References: <20240129122929.349726-1-kraxel@redhat.com> From: "Laszlo Ersek" In-Reply-To: <20240129122929.349726-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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,lersek@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: F0vuteBC0Og0VghhnVcTNH16x7686176AA= Content-Language: en-US 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=iy8qZ0yc; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=redhat.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io On 1/29/24 13:29, Gerd Hoffmann wrote: > Neat when doing ResetVector coding. > Incompatible with TDX and SEV, therefore not enabled by default. >=20 > Signed-off-by: Gerd Hoffmann > Acked-by: Tom Lendacky > Acked-by: Erdem Aktas > Reviewed-by: Laszlo Ersek > --- > OvmfPkg/ResetVector/QemuDebugCon.asm | 36 +++++++++++++++++++++++++++ > OvmfPkg/ResetVector/ResetVector.nasmb | 4 +++ > 2 files changed, 40 insertions(+) > create mode 100644 OvmfPkg/ResetVector/QemuDebugCon.asm >=20 > diff --git a/OvmfPkg/ResetVector/QemuDebugCon.asm b/OvmfPkg/ResetVector/Q= emuDebugCon.asm > new file mode 100644 > index 000000000000..8729fc2ffc0a > --- /dev/null > +++ b/OvmfPkg/ResetVector/QemuDebugCon.asm > @@ -0,0 +1,36 @@ > +;-----------------------------------------------------------------------= ------- > +; @file > +; qemu debug console support macros (based on serial port macros) > +; > +; Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.
> +; Copyright (c) 2024, Red Hat, Inc.
> +; 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. I'm about to merge this, just a minor nit: as Tom stated originally in , this should be "SEV-ES/SEV-SNP", not SEV. There should be no problem under base SEV. Sorry for not noticing this earlier; my days are chaos. Laszlo > + %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 (#114744): https://edk2.groups.io/g/devel/message/114744 Mute This Topic: https://groups.io/mt/104029937/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/19134562= 12/xyzzy [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-