From patchwork Mon Mar 6 15:34:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 659240 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp1892577wrb; Mon, 6 Mar 2023 08:03:31 -0800 (PST) X-Google-Smtp-Source: AK7set9rMeO2BUlYVwIl/Ux/yjnvdMfA6dK/eMZz1r9ur4SDwmbznbYYa8OUXnJUYkCsyl2TUv3/ X-Received: by 2002:a05:651c:513:b0:295:9659:fba5 with SMTP id o19-20020a05651c051300b002959659fba5mr4452970ljp.37.1678118611003; Mon, 06 Mar 2023 08:03:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678118610; cv=none; d=google.com; s=arc-20160816; b=R01Y/P4ntPVxgC8HuuUyBnuvL/ENhV+Si6NsgGLlCOftUr8BMfZL/tHWhjposWQ990 4fk1OLsh7OerHz2AHw5PG4GOZwlJe62BDlxSflAL1kUss8uCCrhbY2IrbeFONmDtt3hQ ayx9tI6SETaHpeeYyvGOIm5iM3mMxNSuUzbzttJqCLUQyFRgcshQ6EuoMBpTnbEvREbH tqy11bvunojB87BioN5wSq/DX1a9vQ8An+f2jPCYSN8RuCKIBLlgR87JWC8Y3nhIw0fx gfDf7t0FvPp+TmA9NrnyQn/H36vRHak75BTRd4E+pn+s8k3ZPk2HQaJsc8IUMRh4us6d eK8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=HHkN0SaKlHUsXAIviWEKUhzT0wyDiiGZB3JY5pWTgTI=; b=wkSQX3epzI2/GSXkLw/PmXtULGjl58VAs18HPXIo1x+pgcbQgy9aBjDmbaMjJnq2Tt 9m5NDKvu9AaiwBeMNoKBZ0TizKR/33Ny6nUDCb9WFeyQ4CvHN7W7VjwDVm5Tysq63OBC u/EgsR7lvKxKJIfdnzUC0FXUOTNOIhHmSTV6sP9guh4wrFOcFTgWxPV5MHqQodZPdr2B q19LiiDzN9aLqwTfWEMKwCgpkqJwASZi+W+5OqJ9+iIQMRxOjOLbpgXSgICewnyXv5aK b24BzvAuu2AMLNnam97629ZaYjQij11O8CTNcvhk/Aq+m7LIiO1ic9PobiL7rvST3xpU cD1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dP5zC1iN; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id k20-20020a05651c10b400b002948b803aa2si3957418ljn.250.2023.03.06.08.03.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 Mar 2023 08:03:30 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dP5zC1iN; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZCrZ-0004HM-65; Mon, 06 Mar 2023 10:34:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZCrU-00046G-Ny for qemu-devel@nongnu.org; Mon, 06 Mar 2023 10:34:52 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pZCrT-0002Bu-7D for qemu-devel@nongnu.org; Mon, 06 Mar 2023 10:34:52 -0500 Received: by mail-wm1-x330.google.com with SMTP id az36so5941282wmb.1 for ; Mon, 06 Mar 2023 07:34:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678116890; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=HHkN0SaKlHUsXAIviWEKUhzT0wyDiiGZB3JY5pWTgTI=; b=dP5zC1iNrsuWI7pMVkf4zh6lHRd19MUCBb8yXi36U9PBfYVbJ5F0IPcMd8VsbMeJDg 91ZIVtxRculFy+N08jc3Vw+GbqhAsY6ojGGERjo22ByI3v1w3nRPr4aYUeEhpZHPB71b TZAjct2a+LVSJTbCbuxgczvvccA9G1klDo5epPktqTF7N/fbkvtFnniLYN9c2ZezqXZS lkBIlSAwdyfpVOlBrFGsNKoRVJAGbQXHsnc28g+nRaZsSMCtwJK9v62S+6sXUZvUkFoj EEL9Vn983LAVKn1nTvqqvBVn/Kr8Uw8ZmVL0HNpBDpWPIfpNsnw6wnrDTnJLlLMZidDI h/GQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678116890; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HHkN0SaKlHUsXAIviWEKUhzT0wyDiiGZB3JY5pWTgTI=; b=n6U3d6nkjGH3zDPMpay3/RP56qGgBojCp+KO/MOGG2Gh8YIvaPlGpI/3Dj3JU9FLCK sCXItucH8L6MfWPVGfHG7S0ICppxhcrA1cJWQOigLDNHQuPn/G9QHqDEN9mo3V+PUSxT rbA1PJ5jtZ6Pi+ooyRCMusX+/MyyAz27vBiyh0749dqeAYgJOIrFpBhRsATYOTFKI3AF G9ajlzNJ8YWzXW8cNMfKlrikiG3EQXA08etDVyYNPz2+/4JkHJVaVPISxDA2Op2Ym1nL InGh4dLgw1Bf+sJnDyZahqjQf5zwIfaeKPvv7WrnkdvSD0/+RzOmQSIDYkE4OLaryLK5 VrTA== X-Gm-Message-State: AO0yUKWMQhegJqdSUZhCyLYFtJsxrJBzZDEHR42VyC0ETexoR07m/qUu kwDQ70qrMFkkB1Ijj8iK7WT9kQlpVWGqs+FJIXo= X-Received: by 2002:a05:600c:35cf:b0:3d0:6a57:66a5 with SMTP id r15-20020a05600c35cf00b003d06a5766a5mr9449125wmq.0.1678116889851; Mon, 06 Mar 2023 07:34:49 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id v7-20020a05600c444700b003eb0d6f48f3sm15287432wmn.27.2023.03.06.07.34.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Mar 2023 07:34:49 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 16/21] target/arm: Stub arm_hcr_el2_eff for m-profile Date: Mon, 6 Mar 2023 15:34:30 +0000 Message-Id: <20230306153435.490894-17-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230306153435.490894-1-peter.maydell@linaro.org> References: <20230306153435.490894-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x330.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson M-profile doesn't have HCR_EL2. While we could test features before each call, zero is a generally safe return value to disable the code in the caller. This test is required to avoid an assert in arm_is_secure_below_el3. Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson Message-id: 20230227225832.816605-3-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- target/arm/helper.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/arm/helper.c b/target/arm/helper.c index 82c546f11a9..2297626bfb3 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -5787,6 +5787,9 @@ uint64_t arm_hcr_el2_eff_secstate(CPUARMState *env, bool secure) uint64_t arm_hcr_el2_eff(CPUARMState *env) { + if (arm_feature(env, ARM_FEATURE_M)) { + return 0; + } return arm_hcr_el2_eff_secstate(env, arm_is_secure_below_el3(env)); }