From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6FC54C433EF for ; Mon, 8 Nov 2021 14:52:13 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 04E2861075 for ; Mon, 8 Nov 2021 14:52:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 04E2861075 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:60756 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mk60K-0005ov-1M for qemu-devel@archiver.kernel.org; Mon, 08 Nov 2021 09:52:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35946) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mk5yg-0004Z8-SK for qemu-devel@nongnu.org; Mon, 08 Nov 2021 09:50:31 -0500 Received: from [2a00:1450:4864:20::435] (port=43531 helo=mail-wr1-x435.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mk5yb-0005c1-TB for qemu-devel@nongnu.org; Mon, 08 Nov 2021 09:50:30 -0500 Received: by mail-wr1-x435.google.com with SMTP id t30so27339067wra.10 for ; Mon, 08 Nov 2021 06:50:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=VRzp0FWK8MYVZPdHdcEq6rLwLfL7m6N+xRuLlCo5WmA=; b=ex3QiOh/4Hu71GdjoT9pJdao9Mje6JBDgCmjbmVVqrcBHzl37/fl2pkesOFN5yUtHM lLOMs5ZczoQ2zeClt35NqfGJRVaQhKTmRfYzZsXWbLqy2yq634Uq+N1G36p58u5+napr 4oxPAcANfQQqkHUcnwgNS/IOIbpdGX5yBDaJH/eJWHumK3SV2ahUGaDuYEpKJ4IK7iAh FVAg80svdKptqw1pXGB6OQMRmpQ7pmQ0YCRhWvXEDFutE2i5dx1FKG/G/d2fr1DwNQeK 6TfQC0bygdrFyJSgbgML12s8upnjvMY+y5jbL+s3PxzaKcfYbFDKmaFp9pviDHWLdf4S Tp0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=VRzp0FWK8MYVZPdHdcEq6rLwLfL7m6N+xRuLlCo5WmA=; b=rARSkDadBhxcYm0NMhpzu4RpzsHFE+sxQ/rHkvnZiPUQd4necvchWGZvsfaxlLN/u2 KwMqnTCNlQBvc/eM0EHA+aDpmsCo0AsHJ8nMOL7Z9eQTyWuKkda2I9ZWzCRsxHgRkkpW AhhbLDbjadBbvs86+d+P4DG6ddmqZkbYjVI0xmltPrwp1IQ7jFm8zksXsl8ZBvXNS5kH RtcVHXHRCpSh0uGg3TFB4tNyp9awvUzcYBIeieVtgpV5BT1I9t6AYqCAy0YAXEN3FsHH NX/zPoshnBsPuX8J1ORw8BKv3Tl+vwDAVg7ADbt9v3jbdwGHWvTvkiWD2YQybJ3Ei5W5 vP0Q== X-Gm-Message-State: AOAM532Cf5dz+uFWhOsN3oV4tVQ+l5sRSwteWIDegyXSOzIpM9mfioPr Sjj5u/QyvBFonP8BnlEPadtAuwrTN3XR5oLaR/toQQ== X-Google-Smtp-Source: ABdhPJxtX3T2eBi7TOquhLPU+qmkkYwK7igylD/oMGz/QOPMqvEMhUxeqjroz3AQ7QdN1bbyyJdz+h9aOdq4amLZgrQ= X-Received: by 2002:a05:6000:186e:: with SMTP id d14mr347046wri.376.1636383024139; Mon, 08 Nov 2021 06:50:24 -0800 (PST) MIME-Version: 1.0 References: <07e63acb-b756-2586-2ba2-b54b837f7fc8@tribudubois.net> In-Reply-To: From: Peter Maydell Date: Mon, 8 Nov 2021 14:50:12 +0000 Message-ID: Subject: Re: Qemu and ARM secure state. To: Jean-Christophe DUBOIS Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::435 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x435.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_PASS=-0.001, T_SPF_HELO_TEMPERROR=0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-arm , QEMU Developers Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Sat, 6 Nov 2021 at 18:11, Jean-Christophe DUBOIS w= rote: > > One small question/remark: > > According to the the "Arm Power State Coordinate Interface" (DEN0022D.b) = document (chapter 5) PSCI calls can only be issued by "normal world" (EL1 o= r EL2). Therefore, should we be adding a test for the current secure state = in the arm_is_psci_call() function? This would prevent calling the built-in= Qemu PSCI function if SMC is issued from secure state. This shouldn't matter, because if the machine model is configured to execute guest code in EL3 at all then it should not be enabling QEMU's internal PSCI support. The internal PSCI stuff is only there as a kind of "emulated firmware" for when we're running guest code that starts at EL2 (notably, when directly booting a Linux kernel). The problem seems to be that fsl_imx6ul_realize() and fsl_imx7_realize() unconditionally enable PSCI-via-SMC. The imx7 code also puts all the secondaries into PSCI-powered-off mode -- this should be checked to work out what the right thing is if we're not doing emulated PSCI and instead starting the guest at EL3. -- PMM