From nobody Fri May 17 05:26:18 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675685887; cv=none; d=zohomail.com; s=zohoarc; b=l37ap1J0P9Tz/jkNSMbAb7hYFahSGXPwW2YZeiW+m+vWtQSOXVWSyoFYgGimenRI5t2NgFJ/ZBlJQ7dA6/bFu1RCZBwOhdp8acOlGJ0FoQp7v50T6nMxPpBuiAaFpmXoWH3+EakpHLE0zaJTsnzVLI+t16rQjSGHh9tbh1cVMxk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675685887; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ggNkI2omzYSbcFU8obgJYTQOMlCPZdcoe7nl7q2N0Nk=; b=lkFdEl9s/KK8PGckcbMHOsVC3ok33yIlMhb6MslWJizIc1IudxMiu0cPE0EFSAwU/7uTVTi/ei68XNPUbwtCalMAxoTWQTU1nZ6yD/3H0sI69Lh5LYN2lrdBcHoW86VIWhSNYf2D8rk3l7OhM2/x/dOfHaC1Bz5tRByfMg0YOPE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675685887209557.6637911764375; Mon, 6 Feb 2023 04:18:07 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pP0R4-0007Tf-Eu; Mon, 06 Feb 2023 07:17:26 -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 1pP0R3-0007T6-7U for qemu-devel@nongnu.org; Mon, 06 Feb 2023 07:17:25 -0500 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pP0R1-0005ls-MU for qemu-devel@nongnu.org; Mon, 06 Feb 2023 07:17:24 -0500 Received: by mail-wr1-x430.google.com with SMTP id k13so2755833wrh.8 for ; Mon, 06 Feb 2023 04:17:23 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id o15-20020adfa10f000000b002bddaea7a0bsm8827462wro.57.2023.02.06.04.17.21 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Feb 2023 04:17:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ggNkI2omzYSbcFU8obgJYTQOMlCPZdcoe7nl7q2N0Nk=; b=Ex11dsO2tAxKwwh4c0Z8lX40laNBG528soWM3BI0VsHU0RL5OX0PlULKYURkFeOuU+ jP4jnlpuiog1hthmSjiYtquaFU4sKltJV6b+n28G/oLAtPokUBuOKN2Uaw7inm5t9TPL ApvPAav+tlT6ROA9xTYZoR/hY8GpgLgxvrRVoy4DQI1dh6Duon2lJolgiwvvyRdHQIJZ 5/0iFgRuq4clAjOa5S4xTK2z6BItYL1S6/mcPU8PSCv88pZRcSXwj1pxmqr1FhiSYEki ojRJeQzxQiZ2C0cL1o4HLaJPQ1eyAVjNxPzOCX4q6xP104Zna5nEs7n7iD6oAbCgeE6Q zVDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ggNkI2omzYSbcFU8obgJYTQOMlCPZdcoe7nl7q2N0Nk=; b=zZ1DUMskjRUjiOHtZocjI7z4B3zIU9PnjZ15/npuNtm7KE1nxZIhhBe2aD121p8n8D E5WEOHvzjL8l19fuZShQnCFnyRDD6DW/FGaapdHqIfjZJm0mZVepArOPXR+mp71dpGTK S/T2yvcHRyaarsKr8r8cuntQwL4diarfLK4llTEv+BR7dBPhQ0S1e8YuqIhy14cUwX+g adpUi54N/02iUfpvoZnr+ZHsmdEBLG00Ai+XxoEq1eck2FyiJd5BgMl/5rIp3Vh6rdFS 67b5JH296WgPw3SR6MKlXo5KWzxg9ng9Kl9/jLfLQBJulK+po8ZFDl7YI3xftm4eTxMU Tz0g== X-Gm-Message-State: AO0yUKX64jkxd1i4cog+Bqve5sRbrCyy/1U0dGr9IoZ67R2Z5M9qdroS g2mZPdPE2xmUugElh2gu50Pjw9vZtNM4akUV X-Google-Smtp-Source: AK7set+GRkSsrVE8+9ncbB9BwRpPPkODx1DR9a3SD20lw2L9oe8II0a82ZfIV5NUcoZS0DL465Cmdw== X-Received: by 2002:adf:c753:0:b0:2bf:ae51:807c with SMTP id b19-20020adfc753000000b002bfae51807cmr18681837wrh.22.1675685842110; Mon, 06 Feb 2023 04:17:22 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 1/9] target/arm: Restrict v7-M MMU helpers to sysemu TCG Date: Mon, 6 Feb 2023 13:17:06 +0100 Message-Id: <20230206121714.85084-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230206121714.85084-1-philmd@linaro.org> References: <20230206121714.85084-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=philmd@linaro.org; helo=mail-wr1-x430.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=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675685887962100010 Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/arm/helper.c | 2 +- target/arm/m_helper.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/target/arm/helper.c b/target/arm/helper.c index c62ed05c12..5dbeade787 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -11774,7 +11774,7 @@ int arm_mmu_idx_to_el(ARMMMUIdx mmu_idx) } } =20 -#ifndef CONFIG_TCG +#if !defined(CONFIG_TCG) || defined(CONFIG_USER_ONLY) ARMMMUIdx arm_v7m_mmu_idx_for_secstate(CPUARMState *env, bool secstate) { g_assert_not_reached(); diff --git a/target/arm/m_helper.c b/target/arm/m_helper.c index e7e746ea18..1e7e4e33bd 100644 --- a/target/arm/m_helper.c +++ b/target/arm/m_helper.c @@ -2854,8 +2854,6 @@ uint32_t HELPER(v7m_tt)(CPUARMState *env, uint32_t ad= dr, uint32_t op) return tt_resp; } =20 -#endif /* !CONFIG_USER_ONLY */ - ARMMMUIdx arm_v7m_mmu_idx_all(CPUARMState *env, bool secstate, bool priv, bool negpri) { @@ -2892,3 +2890,5 @@ ARMMMUIdx arm_v7m_mmu_idx_for_secstate(CPUARMState *e= nv, bool secstate) =20 return arm_v7m_mmu_idx_for_secstate_and_priv(env, secstate, priv); } + +#endif /* !CONFIG_USER_ONLY */ --=20 2.38.1 From nobody Fri May 17 05:26:18 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675685884; cv=none; d=zohomail.com; s=zohoarc; b=gIHdv7U+a8cn62xS/qwhr+3aM0DSSr6oonaw6isvARhN5uZqpwoprRSrgOUqRYx1Esfk7Tr1Mp1esucktcYQyYJC6xolFhOKxWFjUcQDQmwwUXrC0MSwHKN7LaJDLeYt8DkJWMzBltKAqChYTW2gVldpFKk+4x6aUMRnwrg3L/8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675685884; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=cnLR1uIdaRx63uyaDPgEE9PMokr2C9C9/vY4stomlB8=; b=HAd0tvcgPGSsq9rhrYvA39V9glJ3WLv25/vKR1vkBT/30TwhaQXPnDOFGTFw+v5zBAMe/GvIolO56nRPd7CFevfqk+ca8D1+otnqC6eDDIUlCmmEuIPszkiJ4Kb9tpBKOO4Uu21gmKtoxOReuDNsCsV3N6m0JPFE84JpWXBe/yA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675685884356994.4848289442074; Mon, 6 Feb 2023 04:18:04 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pP0RF-0007cv-C9; Mon, 06 Feb 2023 07:17:37 -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 1pP0RC-0007c2-LM for qemu-devel@nongnu.org; Mon, 06 Feb 2023 07:17:34 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pP0R6-0005nn-Q2 for qemu-devel@nongnu.org; Mon, 06 Feb 2023 07:17:31 -0500 Received: by mail-wm1-x332.google.com with SMTP id o36so8532014wms.1 for ; Mon, 06 Feb 2023 04:17:28 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id 14-20020a05600c228e00b003dd9232f036sm12708711wmf.23.2023.02.06.04.17.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Feb 2023 04:17:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=cnLR1uIdaRx63uyaDPgEE9PMokr2C9C9/vY4stomlB8=; b=pCIc1SWuqEqCCrureSTt61msuerP/ylniPzZ4d74S7kpjWDtNaay9Czimws319Fx5h ykMXm40WA3ywED/ohntCF2H8P0hs1LDfCyUDb3AHOa5OocIyQfeFBeTH6ivzgPxRw4v+ iFf5VIKxVXjxMgkse1xVbNmwHRfQenTLzjOxnbXj2sdclXKJ7Zfg+/ICYkgQKkhTdgxo gz4C2J0Mk0ygVmc0He3rNJnBP6dvKtJgFPS928KFt9YOyoKb6ODJdzyGw4dDs06EwU3A 02vqBtsrNUqoenShWpwZGFKVQQlahFsR3QaLtITvC45O0/MBMvKjg6Vu3ja+HMt5x0Q8 +F0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cnLR1uIdaRx63uyaDPgEE9PMokr2C9C9/vY4stomlB8=; b=U3jxk8xZ/V4AvjNxIRzZ5uzeOr7P8LfBqXCcIxsVLOWENj+Ds8/uuNDunnFdYFQsvC NEuo52uHCXIEb8kZEO+kR+zK4d1lgHwsy7tkPNk2ntk2cTXtQo5xlcvNr/bJNQM1MNJe h1xt6TgSAJok2jSQ17VDP79kmkqSCiJb6bTsJUJYSllPy769A2+OPTdo9kltv6eTcmf/ rIdh3WyZBfJU7EXEAGvFSPC/XcjzCNinKe+gfsEk3O9rNe8Kg/ai3pnQSpfRtSP/tm8L 7cSLiFOQ6c0dQSkb9HnmBSmDwfbLv+NjqgvC8YNJ3giRE8zRmLcuA51wWJO0aHzhYxqV r7/Q== X-Gm-Message-State: AO0yUKWahQIS+1Dt3hke7jERHg7ZZyyKvOPZxjn4xRU0u/rTHmEobRIk 3C5y6AViLVeVY0PIFJ0gT0vCI9DcwVI8WHKi X-Google-Smtp-Source: AK7set84/LM5IVA8zm893gCqicgacHvc5VGnz331HVe28G3JBmUiwBU+6Wt43sjMpZi2kh8KPEcJHA== X-Received: by 2002:a05:600c:3795:b0:3c6:e61e:ae71 with SMTP id o21-20020a05600c379500b003c6e61eae71mr21104626wmr.1.1675685847107; Mon, 06 Feb 2023 04:17:27 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 2/9] target/arm: Constify ID_PFR1 on user emulation Date: Mon, 6 Feb 2023 13:17:07 +0100 Message-Id: <20230206121714.85084-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230206121714.85084-1-philmd@linaro.org> References: <20230206121714.85084-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.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=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675685885848100005 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- target/arm/helper.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/target/arm/helper.c b/target/arm/helper.c index 5dbeade787..b58800a1a5 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -7021,6 +7021,7 @@ static void define_pmu_regs(ARMCPU *cpu) } } =20 +#ifndef CONFIG_USER_ONLY /* * We don't know until after realize whether there's a GICv3 * attached, and that is what registers the gicv3 sysregs. @@ -7038,7 +7039,6 @@ static uint64_t id_pfr1_read(CPUARMState *env, const = ARMCPRegInfo *ri) return pfr1; } =20 -#ifndef CONFIG_USER_ONLY static uint64_t id_aa64pfr0_read(CPUARMState *env, const ARMCPRegInfo *ri) { ARMCPU *cpu =3D env_archcpu(env); @@ -7998,8 +7998,16 @@ void register_cp_regs_for_features(ARMCPU *cpu) .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 1, .opc2 =3D = 1, .access =3D PL1_R, .type =3D ARM_CP_NO_RAW, .accessfn =3D access_aa32_tid3, +#ifdef CONFIG_USER_ONLY + .type =3D ARM_CP_CONST, + .resetvalue =3D cpu->isar.id_pfr1, +#else + .type =3D ARM_CP_NO_RAW, + .accessfn =3D access_aa32_tid3, .readfn =3D id_pfr1_read, - .writefn =3D arm_cp_write_ignore }, + .writefn =3D arm_cp_write_ignore +#endif + }, { .name =3D "ID_DFR0", .state =3D ARM_CP_STATE_BOTH, .opc0 =3D 3, .opc1 =3D 0, .crn =3D 0, .crm =3D 1, .opc2 =3D = 2, .access =3D PL1_R, .type =3D ARM_CP_CONST, --=20 2.38.1 From nobody Fri May 17 05:26:18 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675685955; cv=none; d=zohomail.com; s=zohoarc; b=Rhz4onbe5Ydxz/VirofRaY/PIRUxeuIyA6r63EZ3pu6FtiMYdTxtuRaeU/azv2GXptagxtPEwLfR1pyWQMFJz/eNWcBBEL0ecNtv3WJQwLbfDcOSqf2gT9yfhKD2r+ia++x0DDUCDkhvEu1MAEGEZD87eM2+x70VubE8tDZ39W4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675685955; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=oZQQqvS93Cp9O320hulFrJMLKiPY6Is3cKN8j3DtZno=; b=LokhWO3BiQ8HhzSyWqGAzChjCixabFVwcSuhURwo4llaiAqUuKwDJ5K2mFnqNXRGVHqWVIJz0XQWaEOZssdsGQHdQivIOUKm8pabjHWOy9N9Bfita9pAm3heQARB3EsZdGeGHoAWHgxlq0rOYK9GszoLtg5q6wyg51vHe9DV+Pw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 167568595523970.85173466422361; Mon, 6 Feb 2023 04:19:15 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pP0RX-0007x9-1G; Mon, 06 Feb 2023 07:17:55 -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 1pP0RI-0007jl-Cy for qemu-devel@nongnu.org; Mon, 06 Feb 2023 07:17:43 -0500 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pP0RC-0005og-Eb for qemu-devel@nongnu.org; Mon, 06 Feb 2023 07:17:38 -0500 Received: by mail-wr1-x42a.google.com with SMTP id h16so10141227wrz.12 for ; Mon, 06 Feb 2023 04:17:33 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id i14-20020a0560001ace00b002bfb8f829eesm9171354wry.71.2023.02.06.04.17.31 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Feb 2023 04:17:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=oZQQqvS93Cp9O320hulFrJMLKiPY6Is3cKN8j3DtZno=; b=tP9ZTFEZteL6qefhcYSx3zLrP0tSgupipS2jh75FsggQLEUxITcXJ/QSm6QISJrTmC ozFDJ63BFDoqsODbFUm2ctx7XoYhoioi/3H43wr2FOjHOtLYfbM8czYvAeBad/aAGQD8 m1ytOxLcwGeRuVEVpob7blJvMOBMgUe5vPLRDy3kmys7WbLC5MlcRpEBCb/IeFMq5nqD t6cMa8ScZ5LvMseIDHrom/xqZjlSl3qg2R7ARQDcMToZN9a0rTCcuVZ1AstaCbcSvvfx CUs7TOs9Q3NZrdINvy+pW6JE2j1ofQXAV50vE2lYKts4vlbLn2VInKK4BzU+YuTmTt/h uMqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oZQQqvS93Cp9O320hulFrJMLKiPY6Is3cKN8j3DtZno=; b=ZLD7KepdAq6CdgiW3UDhtgDhEFfeFQEwAfsOumFJHNWXsSYHQcduEc4rh4hRKdsbxZ dxe5vtg19n0vp/wOONK+/vpA3XgW84aZxNBCQtUVo3SXmL7hV05+fPZWrFRjipXs1Onp 4Fiy7mhlTe4CeOb8JWWv+bAuU6Xuu3YhGTJ0xowI0UUXal/17c1dNZREzUf/rMJftDMA PNetw3DmWGoQSxLmGmAg1arEwv6vD/s93R6beFoLsD9qKb71GdHIXr5JmlaOb630C9iC d3Xo6Yz83mu9Yxd2v8UrUt7mC3ZffJNLKLRd2+xLreZiiPGy+Odc49LSGjVEPp8Ulu5G hsxw== X-Gm-Message-State: AO0yUKUqZjjtoxFPJf973sh22Pa1aqBPDWKgyeipb4q4KytAQfrgF6an H72g1JBzp7M+ctHcaKF/PR4gvWD68eXNFHX0 X-Google-Smtp-Source: AK7set/oVVg1z3RIGwqN4kdFGwGq9t+LLVdL2lOTrM5A+4JwS1K4fdsPnK8eieM5XPtMbTwP00+tIQ== X-Received: by 2002:a05:6000:68f:b0:2bd:e87a:7fb7 with SMTP id bo15-20020a056000068f00b002bde87a7fb7mr18421515wrb.26.1675685852075; Mon, 06 Feb 2023 04:17:32 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 3/9] target/arm: Avoid resetting CPUARMState::eabi field Date: Mon, 6 Feb 2023 13:17:08 +0100 Message-Id: <20230206121714.85084-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230206121714.85084-1-philmd@linaro.org> References: <20230206121714.85084-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.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=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675685956223100001 Although the 'eabi' field is only used in user emulation where CPU reset doesn't occur, it doesn't belong to the area to reset. Move it after the 'end_reset_fields' for consistency. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- target/arm/cpu.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 7bc97fece9..bbbcf2e153 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -721,11 +721,6 @@ typedef struct CPUArchState { ARMVectorReg zarray[ARM_MAX_VQ * 16]; #endif =20 -#if defined(CONFIG_USER_ONLY) - /* For usermode syscall translation. */ - int eabi; -#endif - struct CPUBreakpoint *cpu_breakpoint[16]; struct CPUWatchpoint *cpu_watchpoint[16]; =20 @@ -772,6 +767,10 @@ typedef struct CPUArchState { uint32_t ctrl; } sau; =20 +#if defined(CONFIG_USER_ONLY) + /* For usermode syscall translation. */ + int eabi; +#endif void *nvic; const struct arm_boot_info *boot_info; /* Store GICv3CPUState to access from this struct */ --=20 2.38.1 From nobody Fri May 17 05:26:18 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675685933; cv=none; d=zohomail.com; s=zohoarc; b=PbkpU6PykGo4fhFI8GZDjRXEHqp6M5DAN/v3E9o0jcGuDoi94nLDbl5C9Dp5DvWBu/Spp2QfCTkfX4Nn7YvfTaSuDWyp810m9csuZOq0Kd4aWNYSj72urHI/SmL5rOCMFPvgh/oQa85VRCkQrConXaL9ebE3DUMVXwr0gVjL/TU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675685933; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=LXO14j3VKdWe9oMd0XtD7rpE8pnbdCJDTrrJ4g32Du4=; b=XEphy4ZxIRfrVUVREdnWCkrj66kPDsEfGXmqROi0iSDUfkZHG5j6jk0uZgczHcBFT/ZX/sqb2nokw2rXJmPyS0uUhVu/6CfFIT+gXBrmnXC4WcXxvYCroaNTcXR/xEB9Tz2FWRfDmdPTfQOsxULXok+UAvuY+0og9Z4XTB2EEl0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675685933030709.4031600858539; Mon, 6 Feb 2023 04:18:53 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pP0RX-00080n-C6; Mon, 06 Feb 2023 07:17:55 -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 1pP0RM-0007kh-7k for qemu-devel@nongnu.org; Mon, 06 Feb 2023 07:17:45 -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 1pP0RI-0005pD-0O for qemu-devel@nongnu.org; Mon, 06 Feb 2023 07:17:42 -0500 Received: by mail-wm1-x330.google.com with SMTP id hn2-20020a05600ca38200b003dc5cb96d46so10602891wmb.4 for ; Mon, 06 Feb 2023 04:17:38 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id bg24-20020a05600c3c9800b003e001afa274sm2564647wmb.2.2023.02.06.04.17.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Feb 2023 04:17:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=LXO14j3VKdWe9oMd0XtD7rpE8pnbdCJDTrrJ4g32Du4=; b=tTqa5kVvFUNGGqkuqndZaNDJTdCWxd3s4VkuhG/TI6WVUpJc1szlYoYwXLBPxAtehA huEnWvFDeUMDjN7s99YhxD6GWODnj3FFG1pXySaJtyDX1Qh/jGjhyW4DbQBJpZlbPBc4 xRLSCv8nxB6e6JUVbCTrfG2CugyiSIWj6WFIKKajBGSeIv0L/6FobLAiBaBHsj/vDdg5 +gjjdVSPFsXuaPS1CLPDJ8fI8gzyTvxKR2PQVfup2BGktGfQySGULEZUqXLALb1tG4XA COfSxzqnWeMTepnxH0Y+GVlasx38Xik7xWzA4I4yJJjuFV5dlWDWnwGFCyOt66RUuQHq +fAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LXO14j3VKdWe9oMd0XtD7rpE8pnbdCJDTrrJ4g32Du4=; b=sKK1HzZ2ceAbXV3I4nIXP2dK0aFq0Hhv4nFLX7FLqq+JfDayeLBC3nPddS7eh44Ss5 ktcrKZlqcv4OJIYgdEtTLU7VmCg+9/tzLAmb8KTiHakd67Lyi8UPXRZGz2nxYN99fQVr AQbWn3QO8qSlnvwpo+vPCZBB8Z+xYvi2mowCn0Sg+bIJcy0Qz2GEChJnkIpNHjLLW5Ca N0KcmP90qieMP4Z/JhrErTZ3PgX8IVOVsSttDlOaeeprTv3NflJnzis2jT15xTiDWdTu R+VwQSNaI/VkmQPCBATdmWlzesVl9aKWCB+nYaUon/5ClvByKezsxfTI3cJXrdaK/POj +gOQ== X-Gm-Message-State: AO0yUKX6xGwgnolVTw+57u7uO6tT5sD1c6UvzhTBFV66tpXFVnIrfhO/ eMVLFiejRLI2cor95J8RY6JGCqcDnR4omq7L X-Google-Smtp-Source: AK7set+L71tdIoiboQNHx6+FKXnD5rBWqqfIYDfNnFTX13cXkdKCBv6Uqe/2MKzIDE9kbL9ZSVsxtg== X-Received: by 2002:a05:600c:3d92:b0:3df:e468:17dc with SMTP id bi18-20020a05600c3d9200b003dfe46817dcmr13312294wmb.40.1675685857362; Mon, 06 Feb 2023 04:17:37 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 4/9] target/arm: Restrict CPUARMState::arm_boot_info to sysemu Date: Mon, 6 Feb 2023 13:17:09 +0100 Message-Id: <20230206121714.85084-5-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230206121714.85084-1-philmd@linaro.org> References: <20230206121714.85084-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=philmd@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=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675685934102100005 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- target/arm/cpu.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index bbbcf2e153..01d478e9ce 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -770,9 +770,10 @@ typedef struct CPUArchState { #if defined(CONFIG_USER_ONLY) /* For usermode syscall translation. */ int eabi; +#else + const struct arm_boot_info *boot_info; #endif void *nvic; - const struct arm_boot_info *boot_info; /* Store GICv3CPUState to access from this struct */ void *gicv3state; =20 --=20 2.38.1 From nobody Fri May 17 05:26:18 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675686013; cv=none; d=zohomail.com; s=zohoarc; b=hwwZvhGQM23icVG2VEIJiK90o9MzhTpJdt1ccU3ip9yJeh1QTYtkpw9I8tp81kHrlsCle2zwJjcuNJosLvtdC1gFckX/J3+tCijC6eOa+gye9XHocV1kkxGfPOlSKR3AVdvtIbYETcrZ21CLqYj8DN4FECVYKp0juMsuoMN7hFk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675686013; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=rzCkZaPJCZSEraFSTj2+J2muivnIDDfC7A8FV2foZu4=; b=e0pWQpNllglJgM+1xhp+5TQHiB59fSj0t+2m0fPCq684NX5szgj+omIJia+KCQ9FK1eVWG56Ox0yfzSAqhi1TPEwyxBMDK3XE/OGC6wJr0oeg/BpfkKbN3iUezR+QwgQfNxPmEgSQxs9sKI6DOcUHVkMIYbz7dEzSIicVIGuBrQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16756860131770.020222609792426738; Mon, 6 Feb 2023 04:20:13 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pP0RX-00082H-NG; Mon, 06 Feb 2023 07:17:55 -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 1pP0RO-0007of-TG for qemu-devel@nongnu.org; Mon, 06 Feb 2023 07:17:47 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pP0RM-0005pv-0B for qemu-devel@nongnu.org; Mon, 06 Feb 2023 07:17:46 -0500 Received: by mail-wr1-x42c.google.com with SMTP id h3so2332586wrp.10 for ; Mon, 06 Feb 2023 04:17:43 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id u17-20020adfdb91000000b002bdd96d88b4sm8815797wri.75.2023.02.06.04.17.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Feb 2023 04:17:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rzCkZaPJCZSEraFSTj2+J2muivnIDDfC7A8FV2foZu4=; b=zMt8DT/yCGraGKiJNUu6Ja5sm1HGACvgwj4q3t32FCZA+gqQTv32PUp9cSYtWWrFEM YtRBh91QTzdcWPENJZRTo01TTNlHdjjOiwd56oxtzC1X04vZOKt4Xx56dycApS+PvmMB bbn/oHwp6RoTaNdLynV2R0Gm3EfPqzMsRZwhnnL4tX9LcOHCDk1RZaaqlVNCC7+T7Mt4 MsR4Y/lCfigbqwLFGxcSPDvinl5Djzi1NRPTRKxS2Z0819HeF1y4qv67I0BWbORJlXF4 Se36U6uu/EM8yXXeG53w2q1NfVrucl2qnfA+Z02Tw0XT3t5cl+v/weyr0yapVXHtDPTO 4hrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rzCkZaPJCZSEraFSTj2+J2muivnIDDfC7A8FV2foZu4=; b=fSruWVnWny9IUb395RLDsbL0qgt4EzxT6mVRRCZWkWKaGGAUf1YFX2xiILK4sGZfJA q39J/PQsh1y1o+hZMjFQ3HO0XorUp7/U2NnAsdM+F8TguPrvV0KiHbjiaq48dhw9ooIT TM+RNZBorh6KE7XKhbTV2JJHNoLx0lhgBRXKpKFcwSNDwPtIQa16VItwOjQsrA103Yj4 WSGtDdnxlcDb7KM0cSKn5HGAhrEaSUvUbH80VwsfRRioT2zO9wb8TSO2T+ozEPUN06Ss eEMJfShol5LDSOXyxuDPCGVWJIh+DAmUsSuc4W7M9pQ8Hw4+QxzcZfvpfAYqWha1HxNF bLpg== X-Gm-Message-State: AO0yUKUIjp+i6d/YXTlwkgPnWrVDKxp4GwOSvIVgC5nPOPWR02t1xFiV BYlReGmAJt5yVtgy9YsJay1mf3MBlRHa0sdO X-Google-Smtp-Source: AK7set8KAKNjVLT6KXfOfR3qYmPU8/jC3NJwwYpYP5FTKb8TREMNKj2o5mjlqzG0uRm81Q9PazbOhw== X-Received: by 2002:a05:6000:10c2:b0:2c3:dd96:d5f2 with SMTP id b2-20020a05600010c200b002c3dd96d5f2mr7598691wrx.35.1675685862491; Mon, 06 Feb 2023 04:17:42 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 5/9] target/arm: Restrict CPUARMState::gicv3state to sysemu Date: Mon, 6 Feb 2023 13:17:10 +0100 Message-Id: <20230206121714.85084-6-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230206121714.85084-1-philmd@linaro.org> References: <20230206121714.85084-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=philmd@linaro.org; helo=mail-wr1-x42c.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=unavailable 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675686014623100001 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- target/arm/cpu.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 01d478e9ce..61681101a5 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -772,10 +772,10 @@ typedef struct CPUArchState { int eabi; #else const struct arm_boot_info *boot_info; -#endif - void *nvic; /* Store GICv3CPUState to access from this struct */ void *gicv3state; +#endif + void *nvic; =20 #ifdef TARGET_TAGGED_ADDRESSES /* Linux syscall tagged address support */ --=20 2.38.1 From nobody Fri May 17 05:26:18 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675685955; cv=none; d=zohomail.com; s=zohoarc; b=R61N8Azg4wqCT8wrH+x37T8QoiEstbrEG6fIBRpd2jo7Ite/06D6dEM4MBQlRYENc45wi5tObv2EfXSK5uQziI2tkAdo8aglv+mwQXATylGOTELQGpEn5W6x2ILmn8y3nRuORiqda2ezG4YeXVxqwOjpFP9StfK/bGfcaoiujD0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675685955; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=tL3/k24S8qIoCILSvx8NiXq6cZwR+o29+9/j7EF7mVM=; b=CpcCX1rqVPxbJn1/dBt6u0jPTs3FsqxVGU6JDrtEQKlgvvgEBvOlGY/WlYLZrsViPAKoIZrBigUgZIs8yIRdYQ2LtEyHnlNOi4MbIa1cG6ufYCpBWei8QucSPzKNoXhaM7kQFIIh7sSfzFqsQQXWgJnS/eLZRPlofjGS7EdQIh4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675685955757101.74238356301521; Mon, 6 Feb 2023 04:19:15 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pP0Ra-0008Mf-Ir; Mon, 06 Feb 2023 07:17:58 -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 1pP0RY-00087Q-IH for qemu-devel@nongnu.org; Mon, 06 Feb 2023 07:17:56 -0500 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pP0RW-0005og-5J for qemu-devel@nongnu.org; Mon, 06 Feb 2023 07:17:56 -0500 Received: by mail-wr1-x42a.google.com with SMTP id h16so10142142wrz.12 for ; Mon, 06 Feb 2023 04:17:53 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id c16-20020a056000105000b002bbb2d43f65sm8625576wrx.14.2023.02.06.04.17.46 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Feb 2023 04:17:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tL3/k24S8qIoCILSvx8NiXq6cZwR+o29+9/j7EF7mVM=; b=PxzXPiKNjsEZ02X3gSoglNG2GPJPbl8NYsR/Cqr8ImT1QqeAy5qejHxBTEsMJkFinp BFoh3n6TkPG1D1pwCnwwLEu2FIk+GWeS228CkXIC30hNnbL8XaBvK0HA5B6G/T5YVVUw ozEUYgN5G+43Z/aJu+JtoT4f4O36JtZwcUcB0nw9tHhxxVEzHmtpl7dKomLOkGQLHRNE e89plwFkO0Vpt3w6vYENBL3MMLS+cNfN19jpkIKUnogQomdTE2oVCwk3U2iYq7yCIVgK 3xGR7Wy9oXmnQtF1FtP+IiAPCK57nIMV8BZcalQxl+EBADkeKMq9nC8ROMPE3GCpFHXc XygA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tL3/k24S8qIoCILSvx8NiXq6cZwR+o29+9/j7EF7mVM=; b=NVQR41F56lfyYnM/nx8x2uNqUB4sPfHIkirwzIBHo9ZgD2+nJwSh5wB81DL1cFAQC4 ls/N+GWVx2fQ5dMrzqTA5Pur9E6BYQ0wXhoUaK+Tc/elxwhr2arP7w7sMgTBN9jrTboh QNKS9SvQucqjAYjekGXN97ko5CAYcWGVAPO8W4xCm6phKokxa4OXjqv0ofOptgyRFjM3 emyaKcx6CkG2WjjdEbI7MD84x/0U3wylm/lMihZjofayA7bEiRRmD4AoW6iQRGp7YKLp Jh59bJAURo4UO2juI5vaE2y+7z4JfZM2/yrS3hf+vn8jzsJxnx9C61aU24F/l8HMRtBD r8kg== X-Gm-Message-State: AO0yUKX2QdwbBJFYSWElmUV+yTgSFzaugzzrz9FSFcGeLBH17jPb06PE YbRmoJE1T8/YFQz9KSvYcbCb/DTVT23gHWwU X-Google-Smtp-Source: AK7set9BCBg98aHYCZLM0FtXV7tFfvxudFUrqxVojfBnG+uG4xGlyFRqJIZoYMB2xE5L2aNIZ+oAdg== X-Received: by 2002:a5d:5e81:0:b0:2bf:eb0e:cccc with SMTP id ck1-20020a5d5e81000000b002bfeb0eccccmr17380058wrb.43.1675685872950; Mon, 06 Feb 2023 04:17:52 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 6/9] target/arm: Restrict CPUARMState::nvic to sysemu and store as NVICState* Date: Mon, 6 Feb 2023 13:17:11 +0100 Message-Id: <20230206121714.85084-7-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230206121714.85084-1-philmd@linaro.org> References: <20230206121714.85084-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675685956260100003 There is no point in using a void pointer to access the NVIC. Use the real type to avoid casting it while debugging. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/intc/armv7m_nvic.c | 38 ++++++++++------------------- include/hw/intc/armv7m_nvic.h | 5 +--- target/arm/cpu.c | 1 + target/arm/cpu.h | 46 ++++++++++++++++++----------------- target/arm/m_helper.c | 2 +- 5 files changed, 40 insertions(+), 52 deletions(-) diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c index 1f7763964c..e54553283f 100644 --- a/hw/intc/armv7m_nvic.c +++ b/hw/intc/armv7m_nvic.c @@ -389,7 +389,7 @@ static inline int nvic_exec_prio(NVICState *s) return MIN(running, s->exception_prio); } =20 -bool armv7m_nvic_neg_prio_requested(void *opaque, bool secure) +bool armv7m_nvic_neg_prio_requested(NVICState *s, bool secure) { /* Return true if the requested execution priority is negative * for the specified security state, ie that security state @@ -399,8 +399,6 @@ bool armv7m_nvic_neg_prio_requested(void *opaque, bool = secure) * mean we don't allow FAULTMASK_NS to actually make the execution * priority negative). Compare pseudocode IsReqExcPriNeg(). */ - NVICState *s =3D opaque; - if (s->cpu->env.v7m.faultmask[secure]) { return true; } @@ -418,17 +416,13 @@ bool armv7m_nvic_neg_prio_requested(void *opaque, boo= l secure) return false; } =20 -bool armv7m_nvic_can_take_pending_exception(void *opaque) +bool armv7m_nvic_can_take_pending_exception(NVICState *s) { - NVICState *s =3D opaque; - return nvic_exec_prio(s) > nvic_pending_prio(s); } =20 -int armv7m_nvic_raw_execution_priority(void *opaque) +int armv7m_nvic_raw_execution_priority(NVICState *s) { - NVICState *s =3D opaque; - return s->exception_prio; } =20 @@ -506,9 +500,8 @@ static void nvic_irq_update(NVICState *s) * if @secure is true and @irq does not specify one of the fixed set * of architecturally banked exceptions. */ -static void armv7m_nvic_clear_pending(void *opaque, int irq, bool secure) +static void armv7m_nvic_clear_pending(NVICState *s, int irq, bool secure) { - NVICState *s =3D (NVICState *)opaque; VecInfo *vec; =20 assert(irq > ARMV7M_EXCP_RESET && irq < s->num_irq); @@ -666,17 +659,17 @@ static void do_armv7m_nvic_set_pending(void *opaque, = int irq, bool secure, } } =20 -void armv7m_nvic_set_pending(void *opaque, int irq, bool secure) +void armv7m_nvic_set_pending(NVICState *s, int irq, bool secure) { - do_armv7m_nvic_set_pending(opaque, irq, secure, false); + do_armv7m_nvic_set_pending(s, irq, secure, false); } =20 -void armv7m_nvic_set_pending_derived(void *opaque, int irq, bool secure) +void armv7m_nvic_set_pending_derived(NVICState *s, int irq, bool secure) { - do_armv7m_nvic_set_pending(opaque, irq, secure, true); + do_armv7m_nvic_set_pending(s, irq, secure, true); } =20 -void armv7m_nvic_set_pending_lazyfp(void *opaque, int irq, bool secure) +void armv7m_nvic_set_pending_lazyfp(NVICState *s, int irq, bool secure) { /* * Pend an exception during lazy FP stacking. This differs @@ -684,7 +677,6 @@ void armv7m_nvic_set_pending_lazyfp(void *opaque, int i= rq, bool secure) * whether we should escalate depends on the saved context * in the FPCCR register, not on the current state of the CPU/NVIC. */ - NVICState *s =3D (NVICState *)opaque; bool banked =3D exc_is_banked(irq); VecInfo *vec; bool targets_secure; @@ -773,9 +765,8 @@ void armv7m_nvic_set_pending_lazyfp(void *opaque, int i= rq, bool secure) } =20 /* Make pending IRQ active. */ -void armv7m_nvic_acknowledge_irq(void *opaque) +void armv7m_nvic_acknowledge_irq(NVICState *s) { - NVICState *s =3D (NVICState *)opaque; CPUARMState *env =3D &s->cpu->env; const int pending =3D s->vectpending; const int running =3D nvic_exec_prio(s); @@ -814,10 +805,9 @@ static bool vectpending_targets_secure(NVICState *s) exc_targets_secure(s, s->vectpending); } =20 -void armv7m_nvic_get_pending_irq_info(void *opaque, +void armv7m_nvic_get_pending_irq_info(NVICState *s, int *pirq, bool *ptargets_secure) { - NVICState *s =3D (NVICState *)opaque; const int pending =3D s->vectpending; bool targets_secure; =20 @@ -831,9 +821,8 @@ void armv7m_nvic_get_pending_irq_info(void *opaque, *pirq =3D pending; } =20 -int armv7m_nvic_complete_irq(void *opaque, int irq, bool secure) +int armv7m_nvic_complete_irq(NVICState *s, int irq, bool secure) { - NVICState *s =3D (NVICState *)opaque; VecInfo *vec =3D NULL; int ret =3D 0; =20 @@ -915,7 +904,7 @@ int armv7m_nvic_complete_irq(void *opaque, int irq, boo= l secure) return ret; } =20 -bool armv7m_nvic_get_ready_status(void *opaque, int irq, bool secure) +bool armv7m_nvic_get_ready_status(NVICState *s, int irq, bool secure) { /* * Return whether an exception is "ready", i.e. it is enabled and is @@ -926,7 +915,6 @@ bool armv7m_nvic_get_ready_status(void *opaque, int irq= , bool secure) * for non-banked exceptions secure is always false; for banked except= ions * it indicates which of the exceptions is required. */ - NVICState *s =3D (NVICState *)opaque; bool banked =3D exc_is_banked(irq); VecInfo *vec; int running =3D nvic_exec_prio(s); diff --git a/include/hw/intc/armv7m_nvic.h b/include/hw/intc/armv7m_nvic.h index 0180c7b0ca..07f9c21a5f 100644 --- a/include/hw/intc/armv7m_nvic.h +++ b/include/hw/intc/armv7m_nvic.h @@ -16,10 +16,7 @@ #include "qom/object.h" =20 #define TYPE_NVIC "armv7m_nvic" - -typedef struct NVICState NVICState; -DECLARE_INSTANCE_CHECKER(NVICState, NVIC, - TYPE_NVIC) +OBJECT_DECLARE_SIMPLE_TYPE(NVICState, NVIC) =20 /* Highest permitted number of exceptions (architectural limit) */ #define NVIC_MAX_VECTORS 512 diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 5f63316dbf..b3a2275b08 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -36,6 +36,7 @@ #if !defined(CONFIG_USER_ONLY) #include "hw/loader.h" #include "hw/boards.h" +#include "hw/intc/armv7m_nvic.h" #endif #include "sysemu/tcg.h" #include "sysemu/qtest.h" diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 61681101a5..683e186599 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -227,6 +227,8 @@ typedef struct CPUARMTBFlags { =20 typedef struct ARMMMUFaultInfo ARMMMUFaultInfo; =20 +typedef struct NVICState NVICState; + typedef struct CPUArchState { /* Regs for current mode. */ uint32_t regs[16]; @@ -774,8 +776,8 @@ typedef struct CPUArchState { const struct arm_boot_info *boot_info; /* Store GICv3CPUState to access from this struct */ void *gicv3state; + NVICState *nvic; #endif - void *nvic; =20 #ifdef TARGET_TAGGED_ADDRESSES /* Linux syscall tagged address support */ @@ -2559,16 +2561,16 @@ uint32_t arm_phys_excp_target_el(CPUState *cs, uint= 32_t excp_idx, =20 /* Interface between CPU and Interrupt controller. */ #ifndef CONFIG_USER_ONLY -bool armv7m_nvic_can_take_pending_exception(void *opaque); +bool armv7m_nvic_can_take_pending_exception(NVICState *s); #else -static inline bool armv7m_nvic_can_take_pending_exception(void *opaque) +static inline bool armv7m_nvic_can_take_pending_exception(NVICState *s) { return true; } #endif /** * armv7m_nvic_set_pending: mark the specified exception as pending - * @opaque: the NVIC + * @s: the NVIC * @irq: the exception number to mark pending * @secure: false for non-banked exceptions or for the nonsecure * version of a banked exception, true for the secure version of a banked @@ -2578,10 +2580,10 @@ static inline bool armv7m_nvic_can_take_pending_exc= eption(void *opaque) * if @secure is true and @irq does not specify one of the fixed set * of architecturally banked exceptions. */ -void armv7m_nvic_set_pending(void *opaque, int irq, bool secure); +void armv7m_nvic_set_pending(NVICState *s, int irq, bool secure); /** * armv7m_nvic_set_pending_derived: mark this derived exception as pending - * @opaque: the NVIC + * @s: the NVIC * @irq: the exception number to mark pending * @secure: false for non-banked exceptions or for the nonsecure * version of a banked exception, true for the secure version of a banked @@ -2591,10 +2593,10 @@ void armv7m_nvic_set_pending(void *opaque, int irq,= bool secure); * exceptions (exceptions generated in the course of trying to take * a different exception). */ -void armv7m_nvic_set_pending_derived(void *opaque, int irq, bool secure); +void armv7m_nvic_set_pending_derived(NVICState *s, int irq, bool secure); /** * armv7m_nvic_set_pending_lazyfp: mark this lazy FP exception as pending - * @opaque: the NVIC + * @s: the NVIC * @irq: the exception number to mark pending * @secure: false for non-banked exceptions or for the nonsecure * version of a banked exception, true for the secure version of a banked @@ -2603,11 +2605,11 @@ void armv7m_nvic_set_pending_derived(void *opaque, = int irq, bool secure); * Similar to armv7m_nvic_set_pending(), but specifically for exceptions * generated in the course of lazy stacking of FP registers. */ -void armv7m_nvic_set_pending_lazyfp(void *opaque, int irq, bool secure); +void armv7m_nvic_set_pending_lazyfp(NVICState *s, int irq, bool secure); /** * armv7m_nvic_get_pending_irq_info: return highest priority pending * exception, and whether it targets Secure state - * @opaque: the NVIC + * @s: the NVIC * @pirq: set to pending exception number * @ptargets_secure: set to whether pending exception targets Secure * @@ -2617,20 +2619,20 @@ void armv7m_nvic_set_pending_lazyfp(void *opaque, i= nt irq, bool secure); * to true if the current highest priority pending exception should * be taken to Secure state, false for NS. */ -void armv7m_nvic_get_pending_irq_info(void *opaque, int *pirq, +void armv7m_nvic_get_pending_irq_info(NVICState *s, int *pirq, bool *ptargets_secure); /** * armv7m_nvic_acknowledge_irq: make highest priority pending exception ac= tive - * @opaque: the NVIC + * @s: the NVIC * * Move the current highest priority pending exception from the pending * state to the active state, and update v7m.exception to indicate that * it is the exception currently being handled. */ -void armv7m_nvic_acknowledge_irq(void *opaque); +void armv7m_nvic_acknowledge_irq(NVICState *s); /** * armv7m_nvic_complete_irq: complete specified interrupt or exception - * @opaque: the NVIC + * @s: the NVIC * @irq: the exception number to complete * @secure: true if this exception was secure * @@ -2639,10 +2641,10 @@ void armv7m_nvic_acknowledge_irq(void *opaque); * 0 if there is still an irq active after this one was completed * (Ignoring -1, this is the same as the RETTOBASE value before completion= .) */ -int armv7m_nvic_complete_irq(void *opaque, int irq, bool secure); +int armv7m_nvic_complete_irq(NVICState *s, int irq, bool secure); /** * armv7m_nvic_get_ready_status(void *opaque, int irq, bool secure) - * @opaque: the NVIC + * @s: the NVIC * @irq: the exception number to mark pending * @secure: false for non-banked exceptions or for the nonsecure * version of a banked exception, true for the secure version of a banked @@ -2653,28 +2655,28 @@ int armv7m_nvic_complete_irq(void *opaque, int irq,= bool secure); * interrupt the current execution priority. This controls whether the * RDY bit for it in the FPCCR is set. */ -bool armv7m_nvic_get_ready_status(void *opaque, int irq, bool secure); +bool armv7m_nvic_get_ready_status(NVICState *s, int irq, bool secure); /** * armv7m_nvic_raw_execution_priority: return the raw execution priority - * @opaque: the NVIC + * @s: the NVIC * * Returns: the raw execution priority as defined by the v8M architecture. * This is the execution priority minus the effects of AIRCR.PRIS, * and minus any PRIMASK/FAULTMASK/BASEPRI priority boosting. * (v8M ARM ARM I_PKLD.) */ -int armv7m_nvic_raw_execution_priority(void *opaque); +int armv7m_nvic_raw_execution_priority(NVICState *s); /** * armv7m_nvic_neg_prio_requested: return true if the requested execution * priority is negative for the specified security state. - * @opaque: the NVIC + * @s: the NVIC * @secure: the security state to test * This corresponds to the pseudocode IsReqExecPriNeg(). */ #ifndef CONFIG_USER_ONLY -bool armv7m_nvic_neg_prio_requested(void *opaque, bool secure); +bool armv7m_nvic_neg_prio_requested(NVICState *s, bool secure); #else -static inline bool armv7m_nvic_neg_prio_requested(void *opaque, bool secur= e) +static inline bool armv7m_nvic_neg_prio_requested(NVICState *s, bool secur= e) { return false; } diff --git a/target/arm/m_helper.c b/target/arm/m_helper.c index 1e7e4e33bd..f73d3f2264 100644 --- a/target/arm/m_helper.c +++ b/target/arm/m_helper.c @@ -973,7 +973,7 @@ static void v7m_update_fpccr(CPUARMState *env, uint32_t= frameptr, * that we will need later in order to do lazy FP reg stacking. */ bool is_secure =3D env->v7m.secure; - void *nvic =3D env->nvic; + NVICState *nvic =3D env->nvic; /* * Some bits are unbanked and live always in fpccr[M_REG_S]; some bits * are banked and we want to update the bit in the bank for the --=20 2.38.1 From nobody Fri May 17 05:26:18 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675685955; cv=none; d=zohomail.com; s=zohoarc; b=iChf7VjvtMJ6Fbyycuqx1INt7g7sHmb3Wgwk0gr6aV5ao7wJD38p0owZiYdqSH/BNDQkFL47SMQljz9QuyH/KRHfwYnQnxKb3Xp3SBbGj8hHkOA0wEahT6WJN7XtVtyt36REncz1Y2tld5uBTcTz0mPtlsY/YvlzCgrcEPHW654= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675685955; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=yPKeeXf/qfQjoYgn7xRgNGOMBlz5IgFTpgVgpA92h0k=; b=O/t1RlAAl+BllLqfupumyoEkA/QVwIOXJ2kpaMXJPG2tym8dSIe+u9LZrNrCqIuG7Z9cas7HH5oQCEomsAMXhD1pZFYJU18ghDNsWiNCzyzyCo8HXyffuNrQh0iZ2ytKnq2kDRASn6CutSWGgF8ooZXkM0Gg1gf1+Ai52mNKe28= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675685955540243.9055441583714; Mon, 6 Feb 2023 04:19:15 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pP0Rh-0000e1-J7; Mon, 06 Feb 2023 07:18:05 -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 1pP0Rf-0000Vj-Eb for qemu-devel@nongnu.org; Mon, 06 Feb 2023 07:18:03 -0500 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pP0Rc-0005og-Tf for qemu-devel@nongnu.org; Mon, 06 Feb 2023 07:18:03 -0500 Received: by mail-wr1-x42a.google.com with SMTP id h16so10142398wrz.12 for ; Mon, 06 Feb 2023 04:18:00 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id h10-20020a5d4fca000000b002c3e94cb757sm2591019wrw.117.2023.02.06.04.17.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Feb 2023 04:17:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=yPKeeXf/qfQjoYgn7xRgNGOMBlz5IgFTpgVgpA92h0k=; b=U4/N7ra/Bq4fdhYnLEf5mU2pvl37+y+ESzQwqPyAJNTITUWNwc6jRXn+FWmQjl1C5R rNf5I9hAFnoKRzoW/9TO8VFCt160uGjE0sxNQQAjA/itt0QxJou9c1cS0DXIDgx8SvBv 2Dcttr+QQIecEss4nKFaomQayX3O+OddvNsVrG4lDtSCFf0HorlawJLkkCqLgAOtA+6x SPWk6J16Fw6AW9ZaOYzHX3tv4tjXEybojTaIfCtFWPRFvDdYN+vb4Kiiv9KTi71ZpxQQ JZzMnya7YB+5Zrk7lsrvBg1++wTrIJAdv5Oh9nXMpK/qrsvlAM0818MT/9c2wbUzYClj A2Kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yPKeeXf/qfQjoYgn7xRgNGOMBlz5IgFTpgVgpA92h0k=; b=7pWKiurTzI2GnUHCLjuCt8e+H27S7BFFUNApR8gE5VwnRKKnYp6mHAqLoiPbpjEgAY 1GR62dt0+R5vPMBxr0XoMj2yB3cnTooSrp54yz+CXPyKUSz7BT5SB92sfIiEECeM9+DL kNnsSYodDW43Ow+1BKqKy/bpE2Unmar9UQ8IA/1qkx1VadPd7/1I019TfloMSDnIJxrR LVPJ0EjGN/R4aF7U/gG4s/kTEY+8tf+TW2ihQAWz4K1piOgynMep5aSfXpr0ieqqlB7B cwkBaialjwcl2UXUwJiX+P9vD6g2vd5zOHyfeu/Ayt8QE9cLK48cFCkOPtNPVAKCSpZF 6htg== X-Gm-Message-State: AO0yUKVgStK2tKo0E5rjHUBrA1ErEIrVGQ2b7KBahzE3wrP0AkZzKEbZ w3lsGE7vMNBtOV1N6eHqkXnFDhyCaSaughS0 X-Google-Smtp-Source: AK7set+ooDYS5hN66ldLVl3zlSiJSeLI5wm4edUa+t4j2mgbNe2accjIWfiOKMec3ZbjhkIabx5ddg== X-Received: by 2002:adf:db01:0:b0:2c3:b47c:a0d9 with SMTP id s1-20020adfdb01000000b002c3b47ca0d9mr15377753wri.50.1675685879869; Mon, 06 Feb 2023 04:17:59 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 7/9] target/arm: Declare CPU <-> NVIC helpers in 'hw/intc/armv7m_nvic.h' Date: Mon, 6 Feb 2023 13:17:12 +0100 Message-Id: <20230206121714.85084-8-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230206121714.85084-1-philmd@linaro.org> References: <20230206121714.85084-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675685956252100002 While dozens of files include "cpu.h", only 3 files require these NVIC helper declarations. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- include/hw/intc/armv7m_nvic.h | 123 ++++++++++++++++++++++++++++++++++ target/arm/cpu.c | 4 +- target/arm/cpu.h | 123 ---------------------------------- target/arm/cpu_tcg.c | 3 + target/arm/m_helper.c | 3 + 5 files changed, 132 insertions(+), 124 deletions(-) diff --git a/include/hw/intc/armv7m_nvic.h b/include/hw/intc/armv7m_nvic.h index 07f9c21a5f..1ca262fbf8 100644 --- a/include/hw/intc/armv7m_nvic.h +++ b/include/hw/intc/armv7m_nvic.h @@ -83,4 +83,127 @@ struct NVICState { qemu_irq sysresetreq; }; =20 +/* Interface between CPU and Interrupt controller. */ +/** + * armv7m_nvic_set_pending: mark the specified exception as pending + * @s: the NVIC + * @irq: the exception number to mark pending + * @secure: false for non-banked exceptions or for the nonsecure + * version of a banked exception, true for the secure version of a banked + * exception. + * + * Marks the specified exception as pending. Note that we will assert() + * if @secure is true and @irq does not specify one of the fixed set + * of architecturally banked exceptions. + */ +void armv7m_nvic_set_pending(NVICState *s, int irq, bool secure); +/** + * armv7m_nvic_set_pending_derived: mark this derived exception as pending + * @s: the NVIC + * @irq: the exception number to mark pending + * @secure: false for non-banked exceptions or for the nonsecure + * version of a banked exception, true for the secure version of a banked + * exception. + * + * Similar to armv7m_nvic_set_pending(), but specifically for derived + * exceptions (exceptions generated in the course of trying to take + * a different exception). + */ +void armv7m_nvic_set_pending_derived(NVICState *s, int irq, bool secure); +/** + * armv7m_nvic_set_pending_lazyfp: mark this lazy FP exception as pending + * @s: the NVIC + * @irq: the exception number to mark pending + * @secure: false for non-banked exceptions or for the nonsecure + * version of a banked exception, true for the secure version of a banked + * exception. + * + * Similar to armv7m_nvic_set_pending(), but specifically for exceptions + * generated in the course of lazy stacking of FP registers. + */ +void armv7m_nvic_set_pending_lazyfp(NVICState *s, int irq, bool secure); +/** + * armv7m_nvic_get_pending_irq_info: return highest priority pending + * exception, and whether it targets Secure state + * @s: the NVIC + * @pirq: set to pending exception number + * @ptargets_secure: set to whether pending exception targets Secure + * + * This function writes the number of the highest priority pending + * exception (the one which would be made active by + * armv7m_nvic_acknowledge_irq()) to @pirq, and sets @ptargets_secure + * to true if the current highest priority pending exception should + * be taken to Secure state, false for NS. + */ +void armv7m_nvic_get_pending_irq_info(NVICState *s, int *pirq, + bool *ptargets_secure); +/** + * armv7m_nvic_acknowledge_irq: make highest priority pending exception ac= tive + * @s: the NVIC + * + * Move the current highest priority pending exception from the pending + * state to the active state, and update v7m.exception to indicate that + * it is the exception currently being handled. + */ +void armv7m_nvic_acknowledge_irq(NVICState *s); +/** + * armv7m_nvic_complete_irq: complete specified interrupt or exception + * @s: the NVIC + * @irq: the exception number to complete + * @secure: true if this exception was secure + * + * Returns: -1 if the irq was not active + * 1 if completing this irq brought us back to base (no active i= rqs) + * 0 if there is still an irq active after this one was completed + * (Ignoring -1, this is the same as the RETTOBASE value before completion= .) + */ +int armv7m_nvic_complete_irq(NVICState *s, int irq, bool secure); +/** + * armv7m_nvic_get_ready_status(void *opaque, int irq, bool secure) + * @s: the NVIC + * @irq: the exception number to mark pending + * @secure: false for non-banked exceptions or for the nonsecure + * version of a banked exception, true for the secure version of a banked + * exception. + * + * Return whether an exception is "ready", i.e. whether the exception is + * enabled and is configured at a priority which would allow it to + * interrupt the current execution priority. This controls whether the + * RDY bit for it in the FPCCR is set. + */ +bool armv7m_nvic_get_ready_status(NVICState *s, int irq, bool secure); +/** + * armv7m_nvic_raw_execution_priority: return the raw execution priority + * @s: the NVIC + * + * Returns: the raw execution priority as defined by the v8M architecture. + * This is the execution priority minus the effects of AIRCR.PRIS, + * and minus any PRIMASK/FAULTMASK/BASEPRI priority boosting. + * (v8M ARM ARM I_PKLD.) + */ +int armv7m_nvic_raw_execution_priority(NVICState *s); +/** + * armv7m_nvic_neg_prio_requested: return true if the requested execution + * priority is negative for the specified security state. + * @s: the NVIC + * @secure: the security state to test + * This corresponds to the pseudocode IsReqExecPriNeg(). + */ +#ifndef CONFIG_USER_ONLY +bool armv7m_nvic_neg_prio_requested(NVICState *s, bool secure); +#else +static inline bool armv7m_nvic_neg_prio_requested(NVICState *s, bool secur= e) +{ + return false; +} +#endif +#ifndef CONFIG_USER_ONLY +bool armv7m_nvic_can_take_pending_exception(NVICState *s); +#else +static inline bool armv7m_nvic_can_take_pending_exception(NVICState *s) +{ + return true; +} +#endif + #endif diff --git a/target/arm/cpu.c b/target/arm/cpu.c index b3a2275b08..876ab8f3bf 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -36,8 +36,10 @@ #if !defined(CONFIG_USER_ONLY) #include "hw/loader.h" #include "hw/boards.h" +#ifdef CONFIG_TCG #include "hw/intc/armv7m_nvic.h" -#endif +#endif /* CONFIG_TCG */ +#endif /* !CONFIG_USER_ONLY */ #include "sysemu/tcg.h" #include "sysemu/qtest.h" #include "sysemu/hw_accel.h" diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 683e186599..a6543c2153 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -2559,129 +2559,6 @@ void arm_cpu_list(void); uint32_t arm_phys_excp_target_el(CPUState *cs, uint32_t excp_idx, uint32_t cur_el, bool secure); =20 -/* Interface between CPU and Interrupt controller. */ -#ifndef CONFIG_USER_ONLY -bool armv7m_nvic_can_take_pending_exception(NVICState *s); -#else -static inline bool armv7m_nvic_can_take_pending_exception(NVICState *s) -{ - return true; -} -#endif -/** - * armv7m_nvic_set_pending: mark the specified exception as pending - * @s: the NVIC - * @irq: the exception number to mark pending - * @secure: false for non-banked exceptions or for the nonsecure - * version of a banked exception, true for the secure version of a banked - * exception. - * - * Marks the specified exception as pending. Note that we will assert() - * if @secure is true and @irq does not specify one of the fixed set - * of architecturally banked exceptions. - */ -void armv7m_nvic_set_pending(NVICState *s, int irq, bool secure); -/** - * armv7m_nvic_set_pending_derived: mark this derived exception as pending - * @s: the NVIC - * @irq: the exception number to mark pending - * @secure: false for non-banked exceptions or for the nonsecure - * version of a banked exception, true for the secure version of a banked - * exception. - * - * Similar to armv7m_nvic_set_pending(), but specifically for derived - * exceptions (exceptions generated in the course of trying to take - * a different exception). - */ -void armv7m_nvic_set_pending_derived(NVICState *s, int irq, bool secure); -/** - * armv7m_nvic_set_pending_lazyfp: mark this lazy FP exception as pending - * @s: the NVIC - * @irq: the exception number to mark pending - * @secure: false for non-banked exceptions or for the nonsecure - * version of a banked exception, true for the secure version of a banked - * exception. - * - * Similar to armv7m_nvic_set_pending(), but specifically for exceptions - * generated in the course of lazy stacking of FP registers. - */ -void armv7m_nvic_set_pending_lazyfp(NVICState *s, int irq, bool secure); -/** - * armv7m_nvic_get_pending_irq_info: return highest priority pending - * exception, and whether it targets Secure state - * @s: the NVIC - * @pirq: set to pending exception number - * @ptargets_secure: set to whether pending exception targets Secure - * - * This function writes the number of the highest priority pending - * exception (the one which would be made active by - * armv7m_nvic_acknowledge_irq()) to @pirq, and sets @ptargets_secure - * to true if the current highest priority pending exception should - * be taken to Secure state, false for NS. - */ -void armv7m_nvic_get_pending_irq_info(NVICState *s, int *pirq, - bool *ptargets_secure); -/** - * armv7m_nvic_acknowledge_irq: make highest priority pending exception ac= tive - * @s: the NVIC - * - * Move the current highest priority pending exception from the pending - * state to the active state, and update v7m.exception to indicate that - * it is the exception currently being handled. - */ -void armv7m_nvic_acknowledge_irq(NVICState *s); -/** - * armv7m_nvic_complete_irq: complete specified interrupt or exception - * @s: the NVIC - * @irq: the exception number to complete - * @secure: true if this exception was secure - * - * Returns: -1 if the irq was not active - * 1 if completing this irq brought us back to base (no active i= rqs) - * 0 if there is still an irq active after this one was completed - * (Ignoring -1, this is the same as the RETTOBASE value before completion= .) - */ -int armv7m_nvic_complete_irq(NVICState *s, int irq, bool secure); -/** - * armv7m_nvic_get_ready_status(void *opaque, int irq, bool secure) - * @s: the NVIC - * @irq: the exception number to mark pending - * @secure: false for non-banked exceptions or for the nonsecure - * version of a banked exception, true for the secure version of a banked - * exception. - * - * Return whether an exception is "ready", i.e. whether the exception is - * enabled and is configured at a priority which would allow it to - * interrupt the current execution priority. This controls whether the - * RDY bit for it in the FPCCR is set. - */ -bool armv7m_nvic_get_ready_status(NVICState *s, int irq, bool secure); -/** - * armv7m_nvic_raw_execution_priority: return the raw execution priority - * @s: the NVIC - * - * Returns: the raw execution priority as defined by the v8M architecture. - * This is the execution priority minus the effects of AIRCR.PRIS, - * and minus any PRIMASK/FAULTMASK/BASEPRI priority boosting. - * (v8M ARM ARM I_PKLD.) - */ -int armv7m_nvic_raw_execution_priority(NVICState *s); -/** - * armv7m_nvic_neg_prio_requested: return true if the requested execution - * priority is negative for the specified security state. - * @s: the NVIC - * @secure: the security state to test - * This corresponds to the pseudocode IsReqExecPriNeg(). - */ -#ifndef CONFIG_USER_ONLY -bool armv7m_nvic_neg_prio_requested(NVICState *s, bool secure); -#else -static inline bool armv7m_nvic_neg_prio_requested(NVICState *s, bool secur= e) -{ - return false; -} -#endif - /* Interface for defining coprocessor registers. * Registers are defined in tables of arm_cp_reginfo structs * which are passed to define_arm_cp_regs(). diff --git a/target/arm/cpu_tcg.c b/target/arm/cpu_tcg.c index ccde5080eb..df0c45e523 100644 --- a/target/arm/cpu_tcg.c +++ b/target/arm/cpu_tcg.c @@ -19,6 +19,9 @@ #include "hw/boards.h" #endif #include "cpregs.h" +#if !defined(CONFIG_USER_ONLY) && defined(CONFIG_TCG) +#include "hw/intc/armv7m_nvic.h" +#endif =20 =20 /* Share AArch32 -cpu max features with AArch64. */ diff --git a/target/arm/m_helper.c b/target/arm/m_helper.c index f73d3f2264..4dcb594a6b 100644 --- a/target/arm/m_helper.c +++ b/target/arm/m_helper.c @@ -18,6 +18,9 @@ #include "exec/cpu_ldst.h" #include "semihosting/common-semi.h" #endif +#if !defined(CONFIG_USER_ONLY) +#include "hw/intc/armv7m_nvic.h" +#endif =20 static void v7m_msr_xpsr(CPUARMState *env, uint32_t mask, uint32_t reg, uint32_t val) --=20 2.38.1 From nobody Fri May 17 05:26:18 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675685898; cv=none; d=zohomail.com; s=zohoarc; b=iY+ffoQPfQ/lEtYA9pk1dUlrGoEQHcUuIhhQVpjpKXPI/jxeSskOzdUvrVGhgkoIXSyj5uAyUHQKZGgYPHyQbf/w7j4KMLPF4uPPLcfews9dXDpiUwoEulUIiLagEo/8LlTHgqtgeLQRnbb5K1y7CgC2ZWrPkMH7z4J50QA0qsA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675685898; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=q9OtXnoXEv7c1NMHlxcIT3UzncY58Hccqx/D2ForunA=; b=AUe8+fQ3D1ayW1635NbIQuOLXdmStkju4qH0hn94dHko2dPSGh5Xpe6QttR2GM9YL4M9BzmLp07KQPchdZzY5w5lMm+JHZe+DO0hEkZhcwJ3VGQRX/pyrAIMK5a0Cu61f204TurOLRPSpcYmXoMADNrAsgugfi+Kw9NzTfcgJHY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 167568589883674.62355146113009; Mon, 6 Feb 2023 04:18:18 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pP0Rq-0000ul-ID; Mon, 06 Feb 2023 07:18:14 -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 1pP0Rl-0000kP-6G for qemu-devel@nongnu.org; Mon, 06 Feb 2023 07:18:09 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pP0Ri-0005uM-Kg for qemu-devel@nongnu.org; Mon, 06 Feb 2023 07:18:08 -0500 Received: by mail-wm1-x32b.google.com with SMTP id k8-20020a05600c1c8800b003dc57ea0dfeso10642350wms.0 for ; Mon, 06 Feb 2023 04:18:06 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id t8-20020a05600c2ac800b003ddc781b1d4sm10381648wme.33.2023.02.06.04.18.03 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Feb 2023 04:18:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=q9OtXnoXEv7c1NMHlxcIT3UzncY58Hccqx/D2ForunA=; b=uOVsfaedb4hOEkSvumSwCn2EN8zCNxNBRQv7BdlyJ5MnGgUjd31BrPJT2U+W5KlAWJ 9qNbT/gYyI6dUUM/r+j/hBe7T6bAaq37/FSl6sIJaqNTY+5h+TQswJWNEu9f8VEWVdaP PjktMwjdNoRaYIikhzNcM+0s3YUm/DRODwkZxs7qkgamQeFOoraS1z4omdqf33xki+E6 bDuw7DLWk04NMaIpz8AUnOMzYWy8wkJZ3vqCFJ4b2wyqDvVCObL46WhG8XVpHHClCu/w a629JvjICU0Q1CtKTLUrVmArq8xsHHV2G+qlhOP1hjzIQjgsQsXWHbqHev3DsGPqhgJG IGQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=q9OtXnoXEv7c1NMHlxcIT3UzncY58Hccqx/D2ForunA=; b=Lp9nddEWf3ihBXCjki5Futf4wt+nA8pP0RZauLduVtE2lvAoDLHb2ROBj20QWGsqNv TxsCMoRUznBBjCVdh3Xlaq90nnfs+61+eI8D/mxUi5KnmawtJRIQkKKEoOVDo9ETAaFo Wfkole+ayZRdWgVHdAlLXnOOKUjgosIxA+yO3rQwfeIaE/yVp9Rr4gQW4+kKqo0nQbLO hPTstPGIw/erni4/4Zbrt4vaBLuDMl1LFmTApseBEtP1jB5v1MJJdYuHU9pR/tzTZzzH OJ9/TP9tYHvzuv/DjsmreBxR26usIziSVNf1/5g9L12vlfnOaag2rFRxlDFUI0oVt7Mn 4LHg== X-Gm-Message-State: AO0yUKWCvYpSPg884nIRY8r7cHH74FABKYeO4tKB4HsGwJMsHN8nROZg Tuts5GMt/lro0FduDi/psvQSumKmV5aBxtrn X-Google-Smtp-Source: AK7set/xigteG9r8F65E78U7VpQUqaNtHRPBg9LBJUs2JIu5q3pI11Fs6o6FreaNCzfvXi2admu6GA== X-Received: by 2002:a05:600c:a0e:b0:3d3:4f56:62e1 with SMTP id z14-20020a05600c0a0e00b003d34f5662e1mr18778135wmp.27.1675685884759; Mon, 06 Feb 2023 04:18:04 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 8/9] hw/intc/armv7m_nvic: Allow calling neg_prio_requested on unrealized NVIC Date: Mon, 6 Feb 2023 13:17:13 +0100 Message-Id: <20230206121714.85084-9-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230206121714.85084-1-philmd@linaro.org> References: <20230206121714.85084-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675685899972100001 armv7m_nvic_neg_prio_requested() is called via arm_cpu_reset_hold() during CPU realize() time, when the NVIC isn't yet realized: (lldb) bt * frame #0: 0x10059ed5c armv7m_nvic_neg_prio_requested(opaque=3D0x118008= 7b0, secure=3Dtrue) at armv7m_nvic.c:404:9 frame #1: 0x100383018 arm_v7m_mmu_idx_for_secstate [inlined] arm_v7m_m= mu_idx_for_secstate_and_priv(...) at m_helper.c:2882:19 frame #2: 0x10038300c arm_v7m_mmu_idx_for_secstate(..., secstate=3Dtru= e) at m_helper.c:2893:12 frame #3: 0x10036e9bc arm_mmu_idx_el(...) at helper.c:11799:16 [artifi= cial] frame #4: 0x100366cd4 arm_rebuild_hflags [inlined] rebuild_hflags_inte= rnal(env=3D0x118411f30) at helper.c:12129:25 frame #5: 0x100366c18 arm_rebuild_hflags(env=3D0x118411f30) at helper.= c:12142:19 frame #6: 0x10035f1c4 arm_cpu_reset_hold(...) at cpu.c:541:5 [artifici= al] frame #7: 0x10066b354 resettable_phase_hold(obj=3D0x118410000, opaque= =3D0x000000000, ...) at resettable.c:0 frame #8: 0x10066ac40 resettable_assert_reset(obj=3D0x118410000, ...) = at resettable.c:60:5 frame #9: 0x10066ab1c resettable_reset(obj=3D0x118410000, type=3DRESET= _TYPE_COLD) at resettable.c:45:5 frame #10: 0x100669568 device_cold_reset(...) at qdev.c:255:5 [artifici= al] frame #11: 0x10000ca28 cpu_reset(cpu=3D0x118410000) at cpu-common.c:114= :5 frame #12: 0x10035ec74 arm_cpu_realizefn(dev=3D0x118410000, errp=3D0x16= fdfb910) at cpu.c:2145:5 frame #13: 0x10066a3e0 device_set_realized(...) at qdev.c:519:13 frame #14: 0x100671b98 property_set_bool(obj=3D0x118410000, ...) at obj= ect.c:2285:5 frame #15: 0x10066fdf4 object_property_set(obj=3D0x118410000, name=3D"r= ealized", ...) at object.c:1420:5 frame #16: 0x100673da8 object_property_set_qobject(...) at qom-qobject.= c:28:10 frame #17: 0x10067026c object_property_set_bool(...) at object.c:1489:15 frame #18: 0x100669600 qdev_realize(...) at qdev.c:292:12 [artificial] frame #19: 0x1003101bc armv7m_realize(dev=3D0x118008480, ...) at armv7m= .c:344:10 frame #20: 0x10066a3e0 device_set_realized(...) at qdev.c:519:13 frame #21: 0x100671b98 property_set_bool(obj=3D0x118008480, ...) at obj= ect.c:2285:5 frame #22: 0x10066fdf4 object_property_set(obj=3D0x118008480, name=3D"r= ealized", ...) at object.c:1420:5 frame #23: 0x100673da8 object_property_set_qobject(...) at qom-qobject.= c:28:10 frame #24: 0x10067026c object_property_set_bool(...) at object.c:1489:15 frame #25: 0x100669600 qdev_realize(...) at qdev.c:292:12 [artificial] frame #26: 0x100092da8 sysbus_realize(...) at sysbus.c:256:12 [artifici= al] frame #27: 0x100350e1c armsse_realize(dev=3D0x118008150, ...) at armsse= .c:1043:14 frame #28: 0x10066a3e0 device_set_realized(...) at qdev.c:519:13 frame #29: 0x100671b98 property_set_bool(obj=3D0x118008150, ...) at obj= ect.c:2285:5 frame #30: 0x10066fdf4 object_property_set(obj=3D0x118008150, name=3D"r= ealized", ...) at object.c:1420:5 frame #31: 0x100673da8 object_property_set_qobject(...) at qom-qobject.= c:28:10 frame #32: 0x10067026c object_property_set_bool(...) at object.c:1489:15 frame #33: 0x100669600 qdev_realize(...) at qdev.c:292:12 [artificial] frame #34: 0x100092da8 sysbus_realize(...) at sysbus.c:256:12 [artifici= al] frame #35: 0x100349354 mps2tz_common_init(machine=3D0x118008000) at mps= 2-tz.c:834:5 frame #36: 0x10008e6b8 machine_run_board_init(machine=3D0x118008000, ..= .) at machine.c:1405:5 (lldb) frame select 12 frame #12: 0x10035ec74 arm_cpu_realizefn(dev=3D0x118410000, errp=3D0x16fdfb= 910) at cpu.c:2145:5 2142 } 2143 2144 qemu_init_vcpu(cs); -> 2145 cpu_reset(cs); 2146 2147 acc->parent_realize(dev, errp); 2148 } Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/intc/armv7m_nvic.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c index e54553283f..d9c7e414bc 100644 --- a/hw/intc/armv7m_nvic.c +++ b/hw/intc/armv7m_nvic.c @@ -399,6 +399,11 @@ bool armv7m_nvic_neg_prio_requested(NVICState *s, bool= secure) * mean we don't allow FAULTMASK_NS to actually make the execution * priority negative). Compare pseudocode IsReqExcPriNeg(). */ + + if (!DEVICE(s)->realized) { /* XXX Why are we called while not realize= d? */ + return false; + } + if (s->cpu->env.v7m.faultmask[secure]) { return true; } --=20 2.38.1 From nobody Fri May 17 05:26:18 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675685930; cv=none; d=zohomail.com; s=zohoarc; b=JWIMWxHcC3hM2y2UKAjbdFpCdZUqN7GMDGV3TlYS0ORgupqsBc/hrwo7tDQ7gskhD1g49XNM6Q+YZhuXco6SpjDpLlSKAsZ4fJ/OkkKXtSkxijrbyalNs35B8vsK/Hn4CbBrLCBabZ3cVixQHmkOIzZe15zjxzR7LpR0nh2d1pQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675685930; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=xK04lMyGXiTsZ6tKZ58V/KNKtbYzeddWJbilZBnE9nw=; b=I4XgB7oI1NLzGffZcrMrcY/8HIVMJlGOJhTtOfTWJ9vDpTaChA0oYawM2UE8/5MzcB3wVhLf5jV0yCOk/1M4iTq1tDpdViKKsfFN8cxjHQDnOMS3trHO0fJEZqANpFJmfIVkXsRbSNzrxoy7GI9GKKif5kek48APXdWeQCO7mpA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 167568593037241.78457153788759; Mon, 6 Feb 2023 04:18:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pP0S2-0000xH-Uy; Mon, 06 Feb 2023 07:18:28 -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 1pP0Rp-0000tY-A9 for qemu-devel@nongnu.org; Mon, 06 Feb 2023 07:18:13 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pP0Rn-0005ur-9W for qemu-devel@nongnu.org; Mon, 06 Feb 2023 07:18:13 -0500 Received: by mail-wr1-x433.google.com with SMTP id ba1so6108101wrb.5 for ; Mon, 06 Feb 2023 04:18:10 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id s14-20020adfa28e000000b002c3be49ef94sm8895439wra.52.2023.02.06.04.18.08 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Feb 2023 04:18:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xK04lMyGXiTsZ6tKZ58V/KNKtbYzeddWJbilZBnE9nw=; b=D52LimxeEnhnCNJrq8EfTT2PUerVJl4kyndYSyRbB/gGkKyoPohRWTWepJF61XLzpy /fuucykyj5jYUspGuIrwPe+3qrmAt6IbHXEZ7bGiqcEXgjfYed8C/9hpgoHIB54OYJyg puv+BTUHHheL6Q2GX6j+auGNckfDa6KA0TMx8ge9MIglNF+hQ4uEzABFbWdtZtErwyv9 9btdeWxECtSOScwqDrjl2kiNgePa3FmXcTlWhB2QaJB3N5cOkgPNuRTjT+cFsptTOddb Qb/uNLeXFOmfSOXrD1uEHAxiPx3pH9IuZV5O8a4zxmk8Ozun0Si8kdACJcBGWtIogIut KE0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xK04lMyGXiTsZ6tKZ58V/KNKtbYzeddWJbilZBnE9nw=; b=cijcULpbKjbQ+2sykU0e7TvzRGuaBLSmzwHlzo3mj4zHYdoPnYeZOuko8giNg7oCbI SL1coX9d4WMAOKmFMpzsMPcECnOTyQRj71YZ8eLfZXrja0tjzMBZ8N9DsMq4lORsYTEI HyNcrC8Vp22FjoNknBK60OIs3LdkKBoWhLJUH9Rix5a2aHyiccSR5rAoEdtcXhNsyv+A C1cK3H6U5SaLrvKSTwbg2uacCEC68sANvLBLDPHQ+NtA2u6G2YuOUTOmmSRWgUKDc4wM UfvBD9QgkdOtMDWaOTQdQog+IU4R39o0SBS0QKiQpKQojUh0IfB4RIy1eoq9l0XjdjB6 UXAg== X-Gm-Message-State: AO0yUKW7S7sesXbuu7JXnzupf4qS0sN3fqkM7Ys7MskSeppbJ+srWavz BTHL86+1DCwtTApejfEcQK1gZIVmnoHMXu+k X-Google-Smtp-Source: AK7set8F8a/pi/sKbrEIDqU87xGhm0Dz0tj/jLeQDNRO8EDfi2TEtZ5f9L5CBl+kvEaJIMTzIgVH4w== X-Received: by 2002:a5d:6b0e:0:b0:2c2:6541:7afa with SMTP id v14-20020a5d6b0e000000b002c265417afamr19648680wrw.57.1675685889688; Mon, 06 Feb 2023 04:18:09 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Mark Cave-Ayland Subject: [PATCH 9/9] hw/arm/armv7m: Pass CPU/NVIC using object_property_add_const_link() Date: Mon, 6 Feb 2023 13:17:14 +0100 Message-Id: <20230206121714.85084-10-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230206121714.85084-1-philmd@linaro.org> References: <20230206121714.85084-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675685932222100002 Avoid having QOM objects poke at each other internals. Instead, pass references using QOM link properties. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- Cc: Mark Cave-Ayland --- hw/arm/armv7m.c | 4 ++-- hw/intc/armv7m_nvic.c | 3 ++- target/arm/cpu.c | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c index 50a9507c0b..edde774da2 100644 --- a/hw/arm/armv7m.c +++ b/hw/arm/armv7m.c @@ -338,8 +338,8 @@ static void armv7m_realize(DeviceState *dev, Error **er= rp) * Tell the CPU where the NVIC is; it will fail realize if it doesn't * have one. Similarly, tell the NVIC where its CPU is. */ - s->cpu->env.nvic =3D &s->nvic; - s->nvic.cpu =3D s->cpu; + object_property_add_const_link(OBJECT(s->cpu), "nvic", OBJECT(&s->nvic= )); + object_property_add_const_link(OBJECT(&s->nvic), "cpu", OBJECT(s->cpu)= ); =20 if (!qdev_realize(DEVICE(s->cpu), NULL, errp)) { return; diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c index d9c7e414bc..e43898a9e0 100644 --- a/hw/intc/armv7m_nvic.c +++ b/hw/intc/armv7m_nvic.c @@ -2668,7 +2668,8 @@ static void armv7m_nvic_realize(DeviceState *dev, Err= or **errp) NVICState *s =3D NVIC(dev); =20 /* The armv7m container object will have set our CPU pointer */ - if (!s->cpu || !arm_feature(&s->cpu->env, ARM_FEATURE_M)) { + s->cpu =3D ARM_CPU(object_property_get_link(OBJECT(dev), "cpu", &error= _abort)); + if (!arm_feature(&s->cpu->env, ARM_FEATURE_M)) { error_setg(errp, "The NVIC can only be used with a Cortex-M CPU"); return; } diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 876ab8f3bf..f081861947 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -1573,12 +1573,13 @@ static void arm_cpu_realizefn(DeviceState *dev, Err= or **errp) * error and will result in segfaults if not caught here. */ if (arm_feature(env, ARM_FEATURE_M)) { + env->nvic =3D NVIC(object_property_get_link(OBJECT(dev), "nvic", N= ULL)); if (!env->nvic) { error_setg(errp, "This board cannot be used with Cortex-M CPUs= "); return; } } else { - if (env->nvic) { + if (object_property_find(OBJECT(dev), "nvic")) { error_setg(errp, "This board can only be used with Cortex-M CP= Us"); return; } --=20 2.38.1