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 6C7CDAC13B5 for ; Mon, 29 Jan 2024 18:38:08 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=3tShULuCKMJ8s3H+4qIMIM70J1//Zs3JlP3A5W2MVFc=; 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; s=20140610; t=1706553487; v=1; b=ZSEo0UO7fgumwnLczqbQHqVvGiuODy5ASi7Xw1MABklF60TdERZ0RoIvyA23vJcONmZKvDev I/J4RODQvzvkqmK1lDeX7y8falMmPO+lHFXvrM2Kp9bCpmT53gb8mji5noWYNHZ2Vs/xtYSyi7s SDoO1TCD4q4Pq8YxK1aKAvhI= X-Received: by 127.0.0.2 with SMTP id dijBYY7687511xSOwR2MZGxi; Mon, 29 Jan 2024 10:38:07 -0800 X-Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mx.groups.io with SMTP id smtpd.web11.2935.1706553486219794664 for ; Mon, 29 Jan 2024 10:38:06 -0800 X-Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id A55A1623FC for ; Mon, 29 Jan 2024 18:38:05 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5654EC43399 for ; Mon, 29 Jan 2024 18:38:05 +0000 (UTC) X-Received: by mail-lj1-f179.google.com with SMTP id 38308e7fff4ca-2cf3ed3b917so34396331fa.1 for ; Mon, 29 Jan 2024 10:38:05 -0800 (PST) X-Gm-Message-State: mzfWvOP5uFcnXlTr7aAWv09rx7686176AA= X-Google-Smtp-Source: AGHT+IFD39F1EmmMNiDz7L5ZcWbOVePiVtF5o26SnaBVZtQWPfTAM3MqFXU7NQ3iMR1p1uHSZHe4AUomkM/m6Jg2bGo= X-Received: by 2002:a2e:b1c5:0:b0:2cd:f2a5:66e3 with SMTP id e5-20020a2eb1c5000000b002cdf2a566e3mr4428221lja.3.1706553483515; Mon, 29 Jan 2024 10:38:03 -0800 (PST) MIME-Version: 1.0 References: <20240129122929.349726-1-kraxel@redhat.com> In-Reply-To: <20240129122929.349726-1-kraxel@redhat.com> From: "Ard Biesheuvel" Date: Mon, 29 Jan 2024 19:37:51 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [edk2-devel] [PATCH v3 1/1] OvmfPkg/ResetVector: send post codes to qemu debug console To: Gerd Hoffmann Cc: devel@edk2.groups.io, Laszlo Ersek , Erdem Aktas , Tom Lendacky , Jiewen Yao , Michael Roth , Min Xu , Oliver Steffen 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,ardb@kernel.org List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Type: text/plain; charset="UTF-8" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=ZSEo0UO7; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=kernel.org (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 Mon, 29 Jan 2024 at 13: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 > Reviewed-by: Laszlo Ersek Acked-by: Ard Biesheuvel > --- > OvmfPkg/ResetVector/QemuDebugCon.asm | 36 +++++++++++++++++++++++++++ > OvmfPkg/ResetVector/ResetVector.nasmb | 4 +++ > 2 files changed, 40 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..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 > -- > 2.43.0 > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#114730): https://edk2.groups.io/g/devel/message/114730 Mute This Topic: https://groups.io/mt/104029937/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-