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 1BACD9417C1 for ; Mon, 29 Jan 2024 12:11:48 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=L30A/Wj/TXjWay7xaQVBTUbsVriCFi4OGcBGWuUDUuQ=; 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=1706530307; v=1; b=m1zkfW4LjEYauwpKBcYNUlrSTnNL3D99jPpr2RK3ZkjMr7B5qkcYns1KbAtxFTSCnrlWHEh2 d9o3ebEMa4e22f1ip5XQY3JDiUsRxbjc8CzP0fC28yWqndkKhs09xLyGvw3syE3wERzWxfAoQaC 6aXkabXa8hGruOGJ/DCBGUoQ= X-Received: by 127.0.0.2 with SMTP id HZMEYY7687511xAZvvGUEfIg; Mon, 29 Jan 2024 04:11:47 -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.web11.12978.1706530307246875108 for ; Mon, 29 Jan 2024 04:11:47 -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-280-9H9D4kz-NkmD9MCOlUbxnw-1; Mon, 29 Jan 2024 07:11:43 -0500 X-MC-Unique: 9H9D4kz-NkmD9MCOlUbxnw-1 X-Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (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 C2F4680F905; Mon, 29 Jan 2024 12:11:42 +0000 (UTC) X-Received: from [10.39.193.158] (unknown [10.39.193.158]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 75013202DCC8; Mon, 29 Jan 2024 12:11:41 +0000 (UTC) Message-ID: <5b7fc449-d748-9f07-62af-aa1bf58ac00c@redhat.com> Date: Mon, 29 Jan 2024 13:11:40 +0100 MIME-Version: 1.0 Subject: Re: [edk2-devel] [PATCH v2 1/1] OvmfPkg/ResetVector: send post codes to qemu debug console To: Gerd Hoffmann , devel@edk2.groups.io Cc: Erdem Aktas , Oliver Steffen , Jiewen Yao , Michael Roth , Ard Biesheuvel , Tom Lendacky , Min Xu References: <20240126142913.169210-1-kraxel@redhat.com> From: "Laszlo Ersek" In-Reply-To: <20240126142913.169210-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.4 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: GqSy21DI7LjBSNXVkuNiolsCx7686176AA= 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=m1zkfW4L; 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/26/24 15: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 > --- > OvmfPkg/ResetVector/QemuDebugCon.asm | 35 +++++++++++++++++++++++++++ > OvmfPkg/ResetVector/ResetVector.nasmb | 4 +++ > 2 files changed, 39 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..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 > +; > +;-----------------------------------------------------------------------= ------- 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 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 -=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 (#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/19134562= 12/xyzzy [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-