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 B71827803CD for ; Mon, 29 Jan 2024 21:06:43 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=EduH5ZABYQd5JPkRMlz63rCRUqk0mBkCz4U9pWWsmSc=; 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=1706562402; v=1; b=olWP69EpQdaupnfe4kZMpYXLkfqzfsbw9Mwr6phG/B3+JDSpCbPo4PHEH7U2iv1G2nTeP9Vo zJMCLTvN6gYrvWHW0NPx80uQ6Pp4QKAs5+BVm1bvATEfQF+nvVJuZUUKG4KNKPi/o3+7UwHELjM f6i9120ICGrG6xYZvbHusklc= X-Received: by 127.0.0.2 with SMTP id 6PXGYY7687511xglJ5MxVOu4; Mon, 29 Jan 2024 13:06:42 -0800 X-Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.groups.io with SMTP id smtpd.web10.2338.1706562401732050978 for ; Mon, 29 Jan 2024 13:06:41 -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-467-v0160md6Ms6LNHJjn67QtA-1; Mon, 29 Jan 2024 16:06:35 -0500 X-MC-Unique: v0160md6Ms6LNHJjn67QtA-1 X-Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (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 EF47D83514B; Mon, 29 Jan 2024 21:06:34 +0000 (UTC) X-Received: from [10.39.192.97] (unknown [10.39.192.97]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A410B492BE4; Mon, 29 Jan 2024 21:06:33 +0000 (UTC) Message-ID: <738e8d0b-bcc6-85a3-a194-d9dd2e37537c@redhat.com> Date: Mon, 29 Jan 2024 22:06:32 +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.10 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: bP6viIHokB0OHjPT8MpNU76Zx7686176AA= 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=olWP69Ep; 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. > + %include "QemuDebugCon.asm" > %else > %include "DebugDisabled.asm" > %endif https://github.com/tianocore/edk2/pull/5319; commit 98c7cb3be73d. I replaced the "SEV" reference with "SEV-ES/SEV-SNP" in the comment. Thanks! Laszlo -=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 (#114746): https://edk2.groups.io/g/devel/message/114746 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-