From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=209.132.183.28; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 9BAFE211CD9DC for ; Fri, 1 Mar 2019 08:14:03 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1E4323018985; Fri, 1 Mar 2019 16:14:03 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-120-56.rdu2.redhat.com [10.10.120.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7E0906017B; Fri, 1 Mar 2019 16:14:01 +0000 (UTC) To: Peter Maydell Cc: Heyi Guo , "edk2-devel@lists.01.org" , Hao Wu , Julien Grall , wanghaibin.wang@huawei.com, Ard Biesheuvel References: <1551341112-21645-1-git-send-email-guoheyi@huawei.com> <668ad400-578a-672a-1df8-0ca72eb2a083@redhat.com> From: Laszlo Ersek Message-ID: <03c7e9cf-a8e2-5b0c-6aca-26502ebddba0@redhat.com> Date: Fri, 1 Mar 2019 17:14:00 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Fri, 01 Mar 2019 16:14:03 +0000 (UTC) Subject: Re: [RFC 0/3] Enable runtime serial debug for ArmVirtQemu X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Mar 2019 16:14:03 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 03/01/19 16:09, Peter Maydell wrote: > On Fri, 1 Mar 2019 at 14:59, Laszlo Ersek wrote: >> >> +Peter >> >> On 03/01/19 13:24, Heyi Guo wrote: >>> On 2019/2/28 21:39, Laszlo Ersek wrote: >> >>>> (4) What's most worrying is that this change would lead to an unexpected >>>> sharing of the PL011 device between the OS and the firmware. I don't >>>> think that's a great idea, especially if QEMU's ACPI payload explicitly >>>> advertises the port to the OS. >>> That's true, so I propose to disable the feature by default. It is only >>> used for UEFI runtime code debug. It is always painful when we don't a >>> handy debug tool for runtime services code. >> >> I think this is the only problem that we have at the design level. >> >> What I'd like to understand is whether it is safe to drive the PL011 >> serial port from both the firmware and the kernel. > > I would suggest that it probably is not safe. Certainly it > does not seem likely to be robust against all possible future > changes to the kernel's driver and/or the firmware's driver. > >> This is why I'm not a big fan of this approach. Using separate devices >> for kernel and firmware would be a lot better. >> >> I remember that Peter did some work to enable two PL011 devices on the >> "virt" board. IIRC the issue was that the PL011 enumeration order / >> numbering in edk2, and in the Linux (guest) kernel, was exactly the >> opposite. And that caused both logs to go to different devices; you >> couldn't have a single log file that started with the firmware log, and >> continued (after a definite switch-over) with the kernel log. > > Yes, that's basically it (I forget the exact details and it's the > kind of thing that may well depend on exactly what version of the > kernel or what version of the firmware you were using). I do still > have a todo list item to add a 2nd UART (probably "if the user > specifically asked for it with an extra -serial option"), but > we can't just add it to the board by default. Thanks for the info! > Note that if you are using QEMU under emulation where it is emulating > EL3 then you always get a second UART which is visible only to the > secure world. This is specifically intended for firmware to use. The ArmVirtQemu firmware doesn't handle the secure world at all (yet?). Thanks Laszlo