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 E8E4474003A for ; Thu, 26 Oct 2023 15:30:40 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=VLbpAIzBwuE8ILO7IxcTlfgQxpd6iHokHFQc9VDnTCo=; 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=1698334239; v=1; b=wKFlje8NsHaRXm1xvXHRmQZAbdc7DBQ6h7x2Q32yHwRnK2wqdOho2dYvbXECCCaCZfSIj+Dt phGupO3nqV+6AXsXzD6fb0o6FJmChCx9cO9zvspW6LxHB9+VShZaUXp+ZF0mgyUHxfjS2AXEZbZ 56WHl2Wve03tRsF57CyvPkw8= X-Received: by 127.0.0.2 with SMTP id BTyQYY7687511xJLFWMnx3ln; Thu, 26 Oct 2023 08:30:39 -0700 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.203487.1698334239018694582 for ; Thu, 26 Oct 2023 08:30:39 -0700 X-Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-155-S0NWnyiDNNOzGSArJ3hX-A-1; Thu, 26 Oct 2023 11:30:34 -0400 X-MC-Unique: S0NWnyiDNNOzGSArJ3hX-A-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 DA7C33C28649; Thu, 26 Oct 2023 15:30:33 +0000 (UTC) X-Received: from [10.39.192.119] (unknown [10.39.192.119]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7100F2026D4C; Thu, 26 Oct 2023 15:30:32 +0000 (UTC) Message-ID: <52963604-70c5-afd3-8a84-f3a1ab3ddffe@redhat.com> Date: Thu, 26 Oct 2023 17:30:31 +0200 MIME-Version: 1.0 Subject: Re: [edk2-devel] [PATCH 0/9] ArmVirtPkg: support two PL011 UARTs To: Julien Grall , Peter Maydell Cc: devel@edk2.groups.io, ardb@kernel.org, Ard Biesheuvel , Gerd Hoffmann , Leif Lindholm , Sami Mujawar References: <20231008153912.175941-1-lersek@redhat.com> <35314dd9-3705-d322-4137-f4708d420e3e@redhat.com> <52ab22e6-94c5-4a79-a6f5-2a5c1ed62c27@xen.org> From: "Laszlo Ersek" In-Reply-To: <52ab22e6-94c5-4a79-a6f5-2a5c1ed62c27@xen.org> 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: 0557YPKaJT2ghWmSOwRgitmqx7686176AA= 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=wKFlje8N; 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 10/26/23 16:46, Julien Grall wrote: > Hi, >=20 > On 26/10/2023 15:21, Peter Maydell wrote: >> On Tue, 10 Oct 2023 at 16:33, Laszlo Ersek wrote: >>> On 10/10/23 09:43, Ard Biesheuvel wrote: >>>> Thanks for looking into this - a cleanup was overdue here. >>>> >>>> I will take a look in more detail later, but one thing that occurred >>>> to me when reading this overview is that having a separate DEBUG >>>> serial port would permit us to >>>> >>>> a) remove it from the DT >>> >>> ... as in, hide it from Linux, I assume? >>> >>>> b) add a runtime mapping for it >>>> c) keep using it after ExitBootServices >>>> >>>> This could be useful for debugging issues with the variable store etc. >>>> >>>> Not saying this is something to address in this series, but I'd like >>>> to hear your take on this. >>>> >>> >>> Sounds like a useful feature. >>> >>> I see four challenges: >>> >>> >>> (1) We'd have to coordinate it with Peter. If we hide any one of the >>> serial ports from Linux, that may not be what QEMU intends for Linux to >>> happen. Linux currently ties getties to all serial ports -- via the >>> serial* aliases, IIUC. Thus, some "positive identification" in the DT >>> could be necessary (i.e., that edk2 was welcome to hide that port from >>> Linux). >> >> The potential awkwardness here is that what the guest thinks about >> the serial ports depends on the ACPI table fragments which QEMU >> provides. EDK2 would need to edit the table fragment to remove any >> mention of the second UART if it wanted to hide it from the kernel. >> I don't know how hard that would be in EDK2. >=20 > I am not sure if it would help EDK2 in this case. But we had a similar > problem when adding support for ACPI in Xen. It was not trivial to > remove the UART from the ACPI tables provided by the host. So we ended > up to introduce the STAO table [1]. This is used to describe which > device will be hidden to the OS. >=20 > Cheers, >=20 > [1] https://wiki.xenproject.org/images/0/02/Status-override-table.pdf >=20 This is a very interesting document. It states the problem well, but the solution Xen seems to have chosen is the opposite of QEMU's. The document states that AML generation is difficult, so simple override tables such as STAO are preferred. QEMU on the other hand has grown a full-blown runtime AML generator, plus an "ACPI linker/loader script" language that allows guest firmware to cross-link and install the "tree of tables", also updating their checksums (under SeaBIOS), all the while being completely blind to the actual contents of the tables. This means that under QEMU, the sole source of "ACPI truth" is QEMU. 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 (#110119): https://edk2.groups.io/g/devel/message/110119 Mute This Topic: https://groups.io/mt/101834880/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-