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 6F6EEAC1043 for ; Mon, 29 Jan 2024 12:29:39 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=KJDcumW+Y6RkbxqLca9RGZwXITDMkomQPk/x1qnojZc=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding:Content-Type; s=20140610; t=1706531378; v=1; b=DUkB3bVEjXg3gnjnOnN4GNDRCwWpKEK7LVwOL1SiblsX4GUNzl7kmzvF2X4WH2T3eMowTdEn fQKpGKfWmMF0tESq0gUp3DjykhliB4tGeQpM7jsgjuqpZG+LfPJKMVbSihvUpC3zT6BD1TK9Et0 e1jyjArm3opmBK5Plgw3HM8A= X-Received: by 127.0.0.2 with SMTP id YaDzYY7687511xDS4cokq6Tc; Mon, 29 Jan 2024 04:29:38 -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.13559.1706531377538517316 for ; Mon, 29 Jan 2024 04:29:37 -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-339-E_CH5UdHOsC-rPfP7xKdJw-1; Mon, 29 Jan 2024 07:29:33 -0500 X-MC-Unique: E_CH5UdHOsC-rPfP7xKdJw-1 X-Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (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 9722E185A786; Mon, 29 Jan 2024 12:29:32 +0000 (UTC) X-Received: from sirius.home.kraxel.org (unknown [10.39.192.180]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0D67A2166B31; Mon, 29 Jan 2024 12:29:32 +0000 (UTC) X-Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 2442B180038B; Mon, 29 Jan 2024 13:29:29 +0100 (CET) From: "Gerd Hoffmann" To: devel@edk2.groups.io Cc: Laszlo Ersek , Erdem Aktas , Tom Lendacky , Jiewen Yao , Gerd Hoffmann , Ard Biesheuvel , Michael Roth , Min Xu , Oliver Steffen Subject: [edk2-devel] [PATCH v3 1/1] OvmfPkg/ResetVector: send post codes to qemu debug console Date: Mon, 29 Jan 2024 13:29:29 +0100 Message-ID: <20240129122929.349726-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.6 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,kraxel@redhat.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: H6ydzbg4LF76R8PX9GbpHiLbx7686176AA= Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=DUkB3bVE; 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 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 --- 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 (#114698): https://edk2.groups.io/g/devel/message/114698 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] -=-=-=-=-=-=-=-=-=-=-=-