Received: by 2002:ac2:54ba:0:0:0:0:0 with SMTP id w26csp31429lfk; Mon, 7 Feb 2022 08:02:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJzOs+i6o0QULHKt/Am2X3kgqUQWhfM1DRZtEZCw8MslWwdQgt7W9hPFz6V8b594J50BSLkC X-Received: by 2002:a05:620a:4411:: with SMTP id v17mr265526qkp.163.1644249752842; Mon, 07 Feb 2022 08:02:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644249752; cv=none; d=google.com; s=arc-20160816; b=QfYwPos29JueAyMt00v0OSqDFthbySOKnKoYsbXtwmlcESJebtQBw+kso1bLYsXYWM zx4KzQL9kCuDHCORl2K1mOjHUZjJDLcbO5lfkbT1X/zHHG4M3q+DPnxKxZnV80pi/HXB vhYe0ZU5M3JPY4FNxYBL+faZW0sspzdUAShP0jgC0VvQczJ+5ZQBd1v+iKrLmRcDzJ1Z 8PNxIVH/nU9CEP+ayWMIj9+qu4Bgq4kS0Y1TDSmztwe/S1cEP3nuQKBxk1kaPFWQRSbA mOxbv0iEJE5b9ZkWFXuaTO+lZhUFp7NmVcHO6lOdnZYiL7Mw9ZtW1YF+f8+qpEO7ac+8 woDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:in-reply-to:from:references:to :subject:user-agent:mime-version:date:message-id; bh=4Ye0wP+r5Mou4qJn97UHpvISUGhcqCwcUMivyABOQEs=; b=HzlQvqV3y6+TpKsfMzfk55Dn+TEyZM2b2SWjLYJuQlV2+y0lPgamnPVs1NDFxfroCc lucHQx2EOmHKmWWp2ehTUQqXBL0gK0kb9aBqOHd5noXTKdvh5yLVe4DQHr8QlMs0Hn5g CTmoE6oAz7QFk8+4cKvEvgZ0stPJ6/L/8ti9C+y0hY6MPJrtFndb4KGzRjbBwlkEr5ZM Uey8GjXttwwpgtR02JA8KU5NSi7aUJaAzUW8+mBzHm7MSCG/G06P9hGqAf1DJSWV0hzg KMhwq1laqqB+f0/hbBlY7CKzWqEATQSI6liT9TukRzBmb/cHpAhVszTM/9zCIvpvJU1J dtrA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y14si2536363qko.307.2022.02.07.08.02.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 07 Feb 2022 08:02:32 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org" Received: from localhost ([::1]:38882 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nH6TI-0000pA-4X for alex.bennee@linaro.org; Mon, 07 Feb 2022 11:02:32 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58796) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nH6Qh-0000lr-Jl; Mon, 07 Feb 2022 10:59:52 -0500 Received: from mail.csgraf.de ([85.25.223.15]:33900 helo=zulu616.server4you.de) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nH6Qf-0006GD-5O; Mon, 07 Feb 2022 10:59:51 -0500 Received: from [0.0.0.0] (ec2-3-122-114-9.eu-central-1.compute.amazonaws.com [3.122.114.9]) by csgraf.de (Postfix) with ESMTPSA id 593D4608119E; Mon, 7 Feb 2022 16:59:45 +0100 (CET) Content-Type: multipart/alternative; boundary="------------O2SEz3LzpOUt5MN2NwIyKpOa" Message-ID: Date: Mon, 7 Feb 2022 16:59:44 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.5.1 Subject: Re: [PATCH 06/16] hw/arm/xlnx-zcu102: Don't enable PSCI conduit when booting guest in EL3 To: "Edgar E. Iglesias" References: <20220127154639.2090164-1-peter.maydell@linaro.org> <20220127154639.2090164-7-peter.maydell@linaro.org> <2c67bde5-65b2-0af0-afde-7353a4fe2a1b@csgraf.de> <44ec9504-a7ef-6805-ae94-4435e5a37735@csgraf.de> From: Alexander Graf In-Reply-To: Received-SPF: pass client-ip=85.25.223.15; envelope-from=agraf@csgraf.de; helo=zulu616.server4you.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, HTML_MESSAGE=0.001, NICE_REPLY_A=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-arm@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , qemu-devel , Havard Skinnemoen , Yanan Wang , Rob Herring , Stefano Stabellini , Andrey Smirnov , Michal Simek , Joel Stanley , Marcel Apfelbaum , Andre Przywara , Alistair Francis , Beniamino Galvani , Niek Linnenbank , qemu-arm , Igor Mitsyanko , =?UTF-8?Q?C=c3=a9dric_Le_Goater?= , Eduardo Habkost , Andrew Jeffery , =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= , Jean-Christophe Dubois , Tyrone Ting Errors-To: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org Sender: "Qemu-arm" X-TUID: VNyBNob/ElJv This is a multi-part message in MIME format. --------------O2SEz3LzpOUt5MN2NwIyKpOa Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 07.02.22 16:52, Edgar E. Iglesias wrote: > > > On Mon, Feb 7, 2022 at 4:33 PM Alexander Graf wrote: > > > On 07.02.22 16:22, Peter Maydell wrote: > > On Mon, 7 Feb 2022 at 14:21, Alexander Graf wrote: > >> > >> On 27.01.22 16:46, Peter Maydell wrote: > >>> Change the Xilinx ZynqMP-based board xlnx-zcu102 to use the new > >>> boot.c functionality to allow us to enable psci-conduit only if > >>> the guest is being booted in EL1 or EL2, so that if the user runs > >>> guest EL3 firmware code our PSCI emulation doesn't get in its > >>> way. > >>> > >>> To do this we stop setting the psci-conduit property on the CPU > >>> objects in the SoC code, and instead set the psci_conduit field in > >>> the arm_boot_info struct to tell the common boot loader code that > >>> we'd like PSCI if the guest is starting at an EL that it makes > >>> sense with. > >>> > >>> Note that this means that EL3 guest code will have no way > >>> to power on secondary cores, because we don't model any > >>> kind of power controller that does that on this SoC. > >>> > >>> Signed-off-by: Peter Maydell > >> > >> It's been a while since I worked with ZynqMP, but typically > your ATF in > >> EL3 will want to talk to a microblaze firmware blob on the PMU. > >> > >> I only see a stand alone PMU machine for microblaze and a PMU IRQ > >> handling I/O block in QEMU, but nothing that would listen to > the events. > >> So I'm fairly sure it will be broken after this patch - and > really only > >> worked by accident before. > > Edgar submitted a power-control model patchset: > > > https://patchew.org/QEMU/20220203140141.310870-1-edgar.iglesias@gmail.com/ > > > Ah, nice. Would this also work for Versal? > > > Thanks, > > Alex > > > Hi, > > Both Versal and ZynqMP require MicroBlaze firmware to run the > reference implementations of Trusted Firmware. We never supported this > in upstream QEMU but we do support it with our fork (by running > multiple QEMU instances co-simulating). > > Having said that, we do have tons of EL3 test-cases that we use to > validate QEMU that run with EL3 enabled in upstream. > > So there's two user flows: > 1. Direct boots using QEMUs builtin PSCI (Most users use this to run > Linux, Xen, U-boot, etc) > 2. Firmware boot at EL3 without QEMUs builtin PSCI (Mostly used by > test-code) > > Number #2 is the one affected here and that by accident used to have > the builtin PSCI support enabled but now requires more power control > modelling to keep working. > Unless I'm missing something, the -kernel boots will continue to use > the builtin PSCI implementation. So nobody is using upstream QEMU to validate and prototype ATF/EL1s/EL0s code? That's a shame :). I suppose there is little value without the bitstream emulation and R cluster. Do you have plans to bring multi process emulation upstream some day to enable these there? Alex --------------O2SEz3LzpOUt5MN2NwIyKpOa Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit


On 07.02.22 16:52, Edgar E. Iglesias wrote:


On Mon, Feb 7, 2022 at 4:33 PM Alexander Graf <agraf@csgraf.de> wrote:

On 07.02.22 16:22, Peter Maydell wrote:
> On Mon, 7 Feb 2022 at 14:21, Alexander Graf <agraf@csgraf.de> wrote:
>>
>> On 27.01.22 16:46, Peter Maydell wrote:
>>> Change the Xilinx ZynqMP-based board xlnx-zcu102 to use the new
>>> boot.c functionality to allow us to enable psci-conduit only if
>>> the guest is being booted in EL1 or EL2, so that if the user runs
>>> guest EL3 firmware code our PSCI emulation doesn't get in its
>>> way.
>>>
>>> To do this we stop setting the psci-conduit property on the CPU
>>> objects in the SoC code, and instead set the psci_conduit field in
>>> the arm_boot_info struct to tell the common boot loader code that
>>> we'd like PSCI if the guest is starting at an EL that it makes
>>> sense with.
>>>
>>> Note that this means that EL3 guest code will have no way
>>> to power on secondary cores, because we don't model any
>>> kind of power controller that does that on this SoC.
>>>
>>> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
>>
>> It's been a while since I worked with ZynqMP, but typically your ATF in
>> EL3 will want to talk to a microblaze firmware blob on the PMU.
>>
>> I only see a stand alone PMU machine for microblaze and a PMU IRQ
>> handling I/O block in QEMU, but nothing that would listen to the events.
>> So I'm fairly sure it will be broken after this patch - and really only
>> worked by accident before.
> Edgar submitted a power-control model patchset:
> https://patchew.org/QEMU/20220203140141.310870-1-edgar.iglesias@gmail.com/


Ah, nice. Would this also work for Versal?


Thanks,

Alex

Hi,

Both Versal and ZynqMP require MicroBlaze firmware to run the reference implementations of Trusted Firmware. We never supported this in upstream QEMU but we do support it with our fork (by running multiple QEMU instances co-simulating).

Having said that, we do have tons of EL3 test-cases that we use to validate QEMU that run with EL3 enabled in upstream.

So there's two user flows:
1. Direct boots using QEMUs builtin PSCI (Most users use this to run Linux, Xen, U-boot, etc)
2. Firmware boot at EL3 without QEMUs builtin PSCI (Mostly used by test-code)

Number #2 is the one affected here and that by accident used to have the builtin PSCI support enabled but now requires more power control modelling to keep working.
Unless I'm missing something, the -kernel boots will continue to use the builtin PSCI implementation.


So nobody is using upstream QEMU to validate and prototype ATF/EL1s/EL0s code? That's a shame :). I suppose there is little value without the bitstream emulation and R cluster. Do you have plans to bring multi process emulation upstream some day to enable these there?


Alex

--------------O2SEz3LzpOUt5MN2NwIyKpOa--