From nobody Fri May 17 02:03:39 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=1675723126; cv=none; d=zohomail.com; s=zohoarc; b=KfjhGpwcsuYLJFo30qzjf6Dv4DVeiVr7T9uE/Jv8u65vJo5ths0fx8gQJQOys5v+Bk64SI0YQpEONdNEO7ssUKVzphGWrfR1b0ZeWfPOGuc45ERjsJCjlrf9pxrYMeYns633TBxmIP958f2mzm7bXDr4v30OIOpCzlsVSsLiKDg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675723126; 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=p4gyS8VSD6RIzTedBzt7OIRvLu1nwoR5LZytAL+qtYA=; b=L5sop1nq/ghucbWBqI5bB0155h4/0YuWFrmQH2tF4CyHz35eGVrsf45po2lDejD62S5s/kYSHHYCN1zkW4LZuyMhU1JKfbPD94R3cqojIltc1LyCQeZA1banVIr68rrwjgHAnAsyidoIzbskYsVqY31E2NZzBWR64xIu7sBxtLs= 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 1675723126263146.05789311149817; Mon, 6 Feb 2023 14:38:46 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pPA5M-0001q0-EH; Mon, 06 Feb 2023 17:35:40 -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 1pPA4y-0001i5-Or for qemu-devel@nongnu.org; Mon, 06 Feb 2023 17:35:26 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pPA4w-0004QP-1s for qemu-devel@nongnu.org; Mon, 06 Feb 2023 17:35:16 -0500 Received: by mail-wm1-x333.google.com with SMTP id bg13-20020a05600c3c8d00b003d9712b29d2so11920018wmb.2 for ; Mon, 06 Feb 2023 14:35:11 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id o37-20020a05600c512500b003c6bbe910fdsm18922037wms.9.2023.02.06.14.35.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Feb 2023 14:35: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=p4gyS8VSD6RIzTedBzt7OIRvLu1nwoR5LZytAL+qtYA=; b=M0jkkyt+5OA03Ycl5VLUGKKEtqBl6coUbdTH6Dxixe+6IAEiK7xLR6nDhOkjDL41Oy P0zwEHgnfmurEJ17sVxDvcrBtPTbiKOiNroNcydc8oY721IEnr7Gs/g+y+vNwmHLBWIp UAWRkacDWwLyxGTM7uhCmotCHHg1VYE4XREeuOkPBNr8OPSz37x3MSam5Pn6VGeFsHRX qc+YWiPGLicw8SqkappHHWVNN//ANKcblzJcRxx4PVdiouZ/kx90XnH1Vh9NgEf1srsB pHe+yBR/1IGXZ5umvvftuCCsqZ524+vFUDgX6V0qZn9YCl4iAWswT/RafqrsRHfpShHh 7u6A== 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=p4gyS8VSD6RIzTedBzt7OIRvLu1nwoR5LZytAL+qtYA=; b=jeNwkItHWCr4+UDu1+vBNcNajqdOMCtYvsxu16lNovkmed3mVdrLpVGMYjrf5Z5bhI 5UKYw2yDFhwht2ITxuf4dx55bcHNkkLJZvTPXSYCObveeTDMKqZWcvUnVWdEPGgCWae3 02q0Gwsr2XzhHh5GUPjWHicWVqiEJsLVsjdyYTMSIf5ml8iQhjXOqgGOp9k1gjJkJfVL k/f2FPuCoigIamQXmQnwNyUdu3/R7YeTbdr45i6X7VQUyPfhCywVJktZ5tmUUZYiw/2q zYBEdVwqgbCAlYqhN6NZ7M31z86zhgwQe4VCLcnYnOxL2TsbfQ7y3TiQGRoeeJqcKfM3 1aoQ== X-Gm-Message-State: AO0yUKUXCnU3aVwuypioxMnNf/0GxrYwP2ol/RnX+Zj5J/mEfJi46SjI v5d/EIlNvcWnW9pFOZWLQ73eFp9Ssfz9FnjV X-Google-Smtp-Source: AK7set/V1Uj9XdLZYMpmrKo8XiJYWOgoqz5KRNO0S0Q/FaSbl4w28eRi80uLAW/3fmieYP0xvRWn8g== X-Received: by 2002:a05:600c:1613:b0:3df:b5ae:5289 with SMTP id m19-20020a05600c161300b003dfb5ae5289mr1115598wmn.8.1675722910146; Mon, 06 Feb 2023 14:35:10 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Laurent Vivier , Richard Henderson , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 01/11] hw/intc/armv7m_nvic: Use OBJECT_DECLARE_SIMPLE_TYPE() macro Date: Mon, 6 Feb 2023 23:34:52 +0100 Message-Id: <20230206223502.25122-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230206223502.25122-1-philmd@linaro.org> References: <20230206223502.25122-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::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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: 1675723126611100001 Manually convert to OBJECT_DECLARE_SIMPLE_TYPE() macro, similarly to automatic conversion from commit 8063396bf3 ("Use OBJECT_DECLARE_SIMPLE_TYPE when possible"). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- include/hw/intc/armv7m_nvic.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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 --=20 2.38.1 From nobody Fri May 17 02:03:39 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=1675722976; cv=none; d=zohomail.com; s=zohoarc; b=AUFBhEXQEQB/9DJTpEtbcLiMLlDtxiplHTreQtr6U3RaDKEa4CBt3VfoAGAI9smaSNoq4FLfkArfYII+zRswSAmBGbCEjB7nTJnNQs6hzgH7Z54N72Nm19JKVmckcn5FtbRysz9X3UWeWZndNzQlzYAjBVe157WjSRPJE4xr7e0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675722976; 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=PqS8f1SsLczkqeP2a5G3rABOyp0fVyhf7LwTVRK5JbM=; b=iIX1nxU1rEV6DsY96Yx/TUN6eGz/OMKcpC347BftXdD6GjEb7WqJXON05eGzFcR3PkwD8XxqGzSE8KI4X7eEDVZtORseOeGe72LpPMI7sR4iffndn3/RX2V3vTRWPGR+G6KBeNY5oPUrqQyxt2oYgf296iLhhKShNX5CuMwOHdE= 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 1675722976609506.97081233689846; Mon, 6 Feb 2023 14:36:16 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pPA5M-0001qA-Hg; Mon, 06 Feb 2023 17:35:40 -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 1pPA52-0001ip-VV for qemu-devel@nongnu.org; Mon, 06 Feb 2023 17:35:28 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pPA4z-0004R2-EN for qemu-devel@nongnu.org; Mon, 06 Feb 2023 17:35:19 -0500 Received: by mail-wm1-x336.google.com with SMTP id f47-20020a05600c492f00b003dc584a7b7eso11901937wmp.3 for ; Mon, 06 Feb 2023 14:35:17 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id o14-20020a05600c4fce00b003dc1a525f22sm12732030wmq.25.2023.02.06.14.35.14 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Feb 2023 14:35:15 -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=PqS8f1SsLczkqeP2a5G3rABOyp0fVyhf7LwTVRK5JbM=; b=VcQPq29oDvlBhGLhvTpTQy6lsGEwc5fzIWcgFrIwcL7y40SCRV3nzJgeKMA9/eQBWJ 2DpTKvrqN6NPihFphi6F7VXDSBrKr9FEAwURq8EOD2m/bP0suDzfdwj8SyDQvnvckRfx a17SdDEX1QJhQ1tUWB8B+CeO2kA7nDeP5d/1+hV3XBaaBlCBTjDIAPMBWwl/nrKb8dRo 4M01yK3ZvgZO6H+dJwk9YMUcbDI3nUDHxPqwSkIQTWvZ+YRf98WtgglsFZfPCAvIiGZM RHZENNbKa13TCEvS9rEIQLHVl8eq4vkW0h4/0leM8wzU80CyYFD/N2QhX7qhO0GuPsdj 0SVw== 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=PqS8f1SsLczkqeP2a5G3rABOyp0fVyhf7LwTVRK5JbM=; b=sUwLxRkprYr7DRBQ5CxdQ/hRTrS13ssn+OFH9F/G0rh4rg5SI37u1LniEv3iI5RrEO loZB5am1zUgh7aC0XpWhv86KiomBmo7I4tQ2Kbq+7hcfwFDcV6CgFv6nbd1ntFlREVgD gXXqAWnUiDHZtovlo0fHu7F6EB4KWbTpVypFj8G1EsBUDhbK6/Yj4pjldDYxxdhQpaLf xsk8ASr2nRiGRie0irjpc8Zo/zO1Qfs94wut4w/lP/RVb3oQ60oFc0AngFZ30eHCaG/h +kuKMwbgu4ifMwxkAk+FbFYL8WbeTGGaTOo9zIHCNyrIted8HWMcGOrK/6Evg03vwUD7 4Fyg== X-Gm-Message-State: AO0yUKUeOWwKVN+z2z/cuBHYU9rX+Z1q8StexbKIT36sElBI9irXklR/ tfo1xBlGVep73d/k8OLUNQ5yJ3A4mgisiz5a X-Google-Smtp-Source: AK7set/5JRahYyR1iIlSyfYcKhiaJLQdxzfTf9CQ3QVR+cb2+tSER8iBR0n9A4xmi/Nu29NJ1/jMQQ== X-Received: by 2002:a05:600c:4d21:b0:3dc:3398:cf87 with SMTP id u33-20020a05600c4d2100b003dc3398cf87mr1149674wmp.11.1675722915674; Mon, 06 Feb 2023 14:35:15 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Laurent Vivier , Richard Henderson , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 02/11] target/arm: Simplify arm_v7m_mmu_idx_for_secstate() for user emulation Date: Mon, 6 Feb 2023 23:34:53 +0100 Message-Id: <20230206223502.25122-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230206223502.25122-1-philmd@linaro.org> References: <20230206223502.25122-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::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.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: 1675722977763100006 Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- target/arm/m_helper.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/target/arm/m_helper.c b/target/arm/m_helper.c index e7e746ea18..76239c9abe 100644 --- a/target/arm/m_helper.c +++ b/target/arm/m_helper.c @@ -150,7 +150,12 @@ uint32_t HELPER(v7m_tt)(CPUARMState *env, uint32_t add= r, uint32_t op) return 0; } =20 -#else +ARMMMUIdx arm_v7m_mmu_idx_for_secstate(CPUARMState *env, bool secstate) +{ + return ARMMMUIdx_MUser; +} + +#else /* !CONFIG_USER_ONLY */ =20 /* * What kind of stack write are we doing? This affects how exceptions @@ -2854,8 +2859,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 +2895,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 02:03:39 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=1675723148; cv=none; d=zohomail.com; s=zohoarc; b=Kz7FXfQdswaWlKUnVJ5/IdwGXa3Ld2LKzvgO3SHZwi9cRLhiXJliTYaHeNjR1PsJYxAGMjuU+x8bWJ09H8QIK4Q8CDgROs8f5TJOnq9dGt+i34N6fKp+NdGF+sO6EAwTnUeEbQRJ9LKi2N4vtg6drIh4r/46ypw74XGSaUXfGe0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675723148; 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=A95YCGa6JM5usJ8r5LH9ThRro8jldDCk7TyXyCW7Wr0=; b=CN/p0dt50CK+AlvReEHdB5Xjlgk0n19LwiHsOqo3krHKfK7umtdty5oCKwyPULIv4QKV4vExqLkGeYQMXvM0AjKblVoHFH1HIRRD5ISi2PFoadGbFDr4ayzfc+mpa/XzNx82rt7VU2nPhhGH5zHK7JPVEiRZLdQTiJozSXIJxVg= 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 1675723148829913.9322165495004; Mon, 6 Feb 2023 14:39:08 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pPA5L-0001pn-O1; Mon, 06 Feb 2023 17:35:39 -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 1pPA58-0001jj-Ci for qemu-devel@nongnu.org; Mon, 06 Feb 2023 17:35:28 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pPA56-0004Rt-Oj for qemu-devel@nongnu.org; Mon, 06 Feb 2023 17:35:26 -0500 Received: by mail-wr1-x42f.google.com with SMTP id o18so11895300wrj.3 for ; Mon, 06 Feb 2023 14:35:22 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id h12-20020a5d688c000000b002b9b9445149sm9797132wru.54.2023.02.06.14.35.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Feb 2023 14:35:20 -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=A95YCGa6JM5usJ8r5LH9ThRro8jldDCk7TyXyCW7Wr0=; b=r/yrr937Nb9XGVEVXlDO8JoLMkqy5W+rWgGSuxz6xwh92VT16Iy9LFmvKr5QPhl2hS l7oib5TBVPahjANY+zFcuYFKsjYIdP58B3L+I3YPnmWNZ0JSJqTJ0DvEA6QaNCKfpotT 0gChsHDcI2avLSKsa7OZRD0gTFKOf9m/2+njh/mbsxeoyrQowtTQAog/CztxLeOU49Vw mivHUKJt7j0BkcicVLgnmLs+5WplDbIcB4aANjhqV3Q9VKLHeRmxZxxhHSUOVFQfYwln 9AUAqApUBSgAqwRluLRSGkleQdu7fDaJZCCpaTNsPRfUaj3lUcMGTUiaimqOm6Sa5O02 la9A== 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=A95YCGa6JM5usJ8r5LH9ThRro8jldDCk7TyXyCW7Wr0=; b=j3rW9bmpaAe57u/HIuO9wRT3XwZH+tC37O8KbSy5kRA+YMl2uDU2gyAsObnRvt/EQE cNdO9pTntmKCBa8faP5TgiL2NIVLqlC1Dt8kvtfOvYj2gN+CuLb+0CJn0sM0uZOoSaou /hWS1l3bA3i7fiO8wniHg04SCzIIUWhcUQXQd6+pIqzts4e5mKOBI4vJJJ7vfGWmkiD5 woSPgt3uwKFMzibV0o/WSq9mx+xepSu7AIYZwamQJ4155wIpOqveqrSrn821uB2YmUsO Syxs84+fiwdAZHlquzccIJd33MKrc+MUZ9Q2t92+aDIvgQUefZxtVEVBgsiRFGC2OHBM 2Rdg== X-Gm-Message-State: AO0yUKX0COzJUwbuntG19rLyNzUEC2xXHdIzxBksjQyqWMlnvFpl6rje 1vVxSqpFhM/LX6MhaNbbcAgoTN5iUCzK79vA X-Google-Smtp-Source: AK7set+wR9140/pIwm4oP1pfcUpyq9tgs1JXvBJbSjfZmc1WxkyZId253Jq+AVoY2z7LuVzdP0M5fA== X-Received: by 2002:a5d:6307:0:b0:2c3:e993:9d81 with SMTP id i7-20020a5d6307000000b002c3e9939d81mr622961wru.66.1675722921371; Mon, 06 Feb 2023 14:35:21 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Laurent Vivier , Richard Henderson , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 03/11] target/arm: Reduce arm_v7m_mmu_idx_[all/for_secstate_and_priv]() scope Date: Mon, 6 Feb 2023 23:34:54 +0100 Message-Id: <20230206223502.25122-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230206223502.25122-1-philmd@linaro.org> References: <20230206223502.25122-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::42f; envelope-from=philmd@linaro.org; helo=mail-wr1-x42f.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: 1675723149751100005 arm_v7m_mmu_idx_all() and arm_v7m_mmu_idx_for_secstate_and_priv() are only used for system emulation in m_helper.c. Move the definitions to avoid prototype forward declarations. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- target/arm/internals.h | 14 -------- target/arm/m_helper.c | 74 +++++++++++++++++++++--------------------- 2 files changed, 37 insertions(+), 51 deletions(-) diff --git a/target/arm/internals.h b/target/arm/internals.h index e1e018da46..759b70c646 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -597,20 +597,6 @@ static inline ARMMMUIdx core_to_aa64_mmu_idx(int mmu_i= dx) =20 int arm_mmu_idx_to_el(ARMMMUIdx mmu_idx); =20 -/* - * Return the MMU index for a v7M CPU with all relevant information - * manually specified. - */ -ARMMMUIdx arm_v7m_mmu_idx_all(CPUARMState *env, - bool secstate, bool priv, bool negpri); - -/* - * Return the MMU index for a v7M CPU in the specified security and - * privilege state. - */ -ARMMMUIdx arm_v7m_mmu_idx_for_secstate_and_priv(CPUARMState *env, - bool secstate, bool priv); - /* Return the MMU index for a v7M CPU in the specified security state */ ARMMMUIdx arm_v7m_mmu_idx_for_secstate(CPUARMState *env, bool secstate); =20 diff --git a/target/arm/m_helper.c b/target/arm/m_helper.c index 76239c9abe..b4964dca8a 100644 --- a/target/arm/m_helper.c +++ b/target/arm/m_helper.c @@ -157,6 +157,43 @@ ARMMMUIdx arm_v7m_mmu_idx_for_secstate(CPUARMState *en= v, bool secstate) =20 #else /* !CONFIG_USER_ONLY */ =20 +static ARMMMUIdx arm_v7m_mmu_idx_all(CPUARMState *env, + bool secstate, bool priv, bool negpri) +{ + ARMMMUIdx mmu_idx =3D ARM_MMU_IDX_M; + + if (priv) { + mmu_idx |=3D ARM_MMU_IDX_M_PRIV; + } + + if (negpri) { + mmu_idx |=3D ARM_MMU_IDX_M_NEGPRI; + } + + if (secstate) { + mmu_idx |=3D ARM_MMU_IDX_M_S; + } + + return mmu_idx; +} + +static ARMMMUIdx arm_v7m_mmu_idx_for_secstate_and_priv(CPUARMState *env, + bool secstate, bool= priv) +{ + bool negpri =3D armv7m_nvic_neg_prio_requested(env->nvic, secstate); + + return arm_v7m_mmu_idx_all(env, secstate, priv, negpri); +} + +/* Return the MMU index for a v7M CPU in the specified security state */ +ARMMMUIdx arm_v7m_mmu_idx_for_secstate(CPUARMState *env, bool secstate) +{ + bool priv =3D arm_v7m_is_handler_mode(env) || + !(env->v7m.control[secstate] & 1); + + return arm_v7m_mmu_idx_for_secstate_and_priv(env, secstate, priv); +} + /* * What kind of stack write are we doing? This affects how exceptions * generated during the stacking are treated. @@ -2859,41 +2896,4 @@ uint32_t HELPER(v7m_tt)(CPUARMState *env, uint32_t a= ddr, uint32_t op) return tt_resp; } =20 -ARMMMUIdx arm_v7m_mmu_idx_all(CPUARMState *env, - bool secstate, bool priv, bool negpri) -{ - ARMMMUIdx mmu_idx =3D ARM_MMU_IDX_M; - - if (priv) { - mmu_idx |=3D ARM_MMU_IDX_M_PRIV; - } - - if (negpri) { - mmu_idx |=3D ARM_MMU_IDX_M_NEGPRI; - } - - if (secstate) { - mmu_idx |=3D ARM_MMU_IDX_M_S; - } - - return mmu_idx; -} - -ARMMMUIdx arm_v7m_mmu_idx_for_secstate_and_priv(CPUARMState *env, - bool secstate, bool priv) -{ - bool negpri =3D armv7m_nvic_neg_prio_requested(env->nvic, secstate); - - return arm_v7m_mmu_idx_all(env, secstate, priv, negpri); -} - -/* Return the MMU index for a v7M CPU in the specified security state */ -ARMMMUIdx arm_v7m_mmu_idx_for_secstate(CPUARMState *env, bool secstate) -{ - bool priv =3D arm_v7m_is_handler_mode(env) || - !(env->v7m.control[secstate] & 1); - - 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 02:03:39 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=1675723008; cv=none; d=zohomail.com; s=zohoarc; b=HTgl/sybCCJ1EJ6Q93Pdg2hCxTCZPfwzG2Yz/ob4WqTDnBIoqjG1DrT/be7OQyozLo4AfkXFpYOL4vDD+YZ4V6ewa6pR6YdvZp9Mdn89+IFFYj+K3g9oZppqPev/56nCkboQwo47jbCPqAFxd01RDkhbnj2oLRBcSPrjXQ8wy98= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675723008; 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=19uwBfdpAT1fRxylT2Hyf84R7eD4Io8guMa3+/7IF5E=; b=V0GxAxLGJT8TQ2BD9+CWUUpxIL+IImQBuXgxnNACo6D1TOxi4Z+KhS2STSUiBXvq2sQWVA8KcjogCrChJ2BSkWImsDOQ+QXWTDqK0iaMgz6ThEuwlAMsZvLbdEeZ+DsUqA/7NyjUy0d6SrpOtnpmNGvugrRT+V2m+YKf4uHg4Xg= 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 1675723008029220.33414169048194; Mon, 6 Feb 2023 14:36:48 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pPA5K-0001op-UJ; Mon, 06 Feb 2023 17:35:38 -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 1pPA5B-0001kk-MD for qemu-devel@nongnu.org; Mon, 06 Feb 2023 17:35:31 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pPA5A-0004TC-6W for qemu-devel@nongnu.org; Mon, 06 Feb 2023 17:35:29 -0500 Received: by mail-wr1-x429.google.com with SMTP id j25so8350758wrc.4 for ; Mon, 06 Feb 2023 14:35:27 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id e6-20020a5d6d06000000b002be099f78c0sm10224886wrq.69.2023.02.06.14.35.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Feb 2023 14:35: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=19uwBfdpAT1fRxylT2Hyf84R7eD4Io8guMa3+/7IF5E=; b=CGJ8bxT2P13F5mXwid42JRnMFxipx7ovw7vNTLmbt+wq0xGlmfQ8fwqhsOY/s9PV28 hTbgFnbZytKVDxHEjC14d4u0bLZ56SrMQ5XmEPYACSMTqlqbzJiSzDcLGgZN1iTG5FOs Kemjol8J+ZOfuul+XIierj7z0DQmCiYmMSIg9eHOPIQSF71P0drCMGFNtEU1Z4nb4wFt z/eOSusBITbRaT9MTK/O+pq3miYOQ1sPOsobOqDLje+Xo604BgQiQwW0NvgiwaqTKtbG jTq9twDNIPiyVL098S1fELJtWXmBODyUsd1vMCoezRuaqEltOD6Q1FR3oLMoQfTLYCVV kRlQ== 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=19uwBfdpAT1fRxylT2Hyf84R7eD4Io8guMa3+/7IF5E=; b=tGRTTk7VT5oFA/+X5XIMj45/h7hnqI5VweS8rXM+/ou6eDQw5pn4STq7RV7KW4XGdT YEOJ0x31r6P6a7SIGrjhhpVLJWp6hiwWm4WSsJtReUPJmTZtpNKFBQ8d02gI57M2eVfl m4lr4UvsIgg/8BDyALAhHK9zaR9Y+jkY1wfndPJlQ47t9dCg6rZPkSoc/AuT5fRW/DPj Y0k6hYs+XPnO9GGapjteD7BUhvNIs2X4Jrg9DIv4qROpV2F6KdlCYMcykCUXyz4W0TK2 QH+S27Lqw7VhbR2SJKnLX3s+786KTVJKdljl2DYTLnGx0lHKujECJPqP4zLmj65o6QwZ MatA== X-Gm-Message-State: AO0yUKXgMOyp7N+heW2MXPhgvUA2JdEH0KAHjXVtItfvUU8NcSAgvRAG NL1zcv1ji+kz7POrrqKIkUaw/p5JuBJ1WQA6 X-Google-Smtp-Source: AK7set/RjDwpTsIvPJHlCkly3bQNT6W/Cri/YRc4VsexAE/GhmouqWQCFVc8HNntW4xjAcJ1aGKdyg== X-Received: by 2002:adf:efce:0:b0:2c3:db9e:4afe with SMTP id i14-20020adfefce000000b002c3db9e4afemr384789wrp.60.1675722926561; Mon, 06 Feb 2023 14:35:26 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Laurent Vivier , Richard Henderson , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 04/11] target/arm: Constify ID_PFR1 on user emulation Date: Mon, 6 Feb 2023 23:34:55 +0100 Message-Id: <20230206223502.25122-5-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230206223502.25122-1-philmd@linaro.org> References: <20230206223502.25122-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::429; envelope-from=philmd@linaro.org; helo=mail-wr1-x429.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: 1675723009899100006 Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- 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 c62ed05c12..22670c20c0 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 02:03:39 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=1675723140; cv=none; d=zohomail.com; s=zohoarc; b=IvIJEGS9C+XSpoX2Fv5nvOM+Q2s3X3XeF9M7sGsGtqFE2h26JTMDLu5jkxl5giKbZZP0h92UaBY8nsRv0AsXrvHPdLaIpol6gZqdPJ6zC3McTP90I/b2ffub4r7HzJfY98wHrjtKFwKcWT33HHFLeMONQoRO6UPyNtTe1G1v6uw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675723140; 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=blxTJd5Tx9NIUQZO/x0aKGGdE7GU/DbRJ0PEKLke2ts=; b=V3/ZAvTaa0d5cq0tD1HZNW6j13Z553knP5kZao7ou6e4zcjqiXT+9BzAS7RNxuwmBqbj1kv7xnThmqxinJwLRJy5y6LF0wIz6CkZ3s0fq6tE/3hoS5lBBhOtLYSubvaw4AoHxw1WFYqCIub5P5S5MhkwG53vo09ELukniyU2MNg= 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 1675723140702796.7287528960534; Mon, 6 Feb 2023 14:39:00 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pPA5L-0001pI-6V; Mon, 06 Feb 2023 17:35:39 -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 1pPA5H-0001lk-Qt for qemu-devel@nongnu.org; Mon, 06 Feb 2023 17:35:36 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pPA5F-0004Tu-Ha for qemu-devel@nongnu.org; Mon, 06 Feb 2023 17:35:35 -0500 Received: by mail-wr1-x436.google.com with SMTP id i5so4715920wrc.0 for ; Mon, 06 Feb 2023 14:35:33 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id s7-20020adfeb07000000b002bff1de8d4bsm9769030wrn.49.2023.02.06.14.35.30 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Feb 2023 14:35: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=blxTJd5Tx9NIUQZO/x0aKGGdE7GU/DbRJ0PEKLke2ts=; b=O0v/mntkLzsAwHjb/nhX4yl/zVm8bN+5Pa5mzJVvu642xpmgEbfXxmO5QktMbPnwTa FDdLZKmL5u+PUBRidLc/slaVJ/YWNFQlH68bsLYuiF9ZP+My18MhDM64zcVakMJddaAS tS3/WInDY8JAspYoDznqDPbiutDScMJ5NpuOtC6LSgiI7214SDRINdzC4kWMXB7v5LJm DAMR5yGMmECHelSHznGjsbG8bD3yovzHm76Q7EiqN84H0P+Cbe0iUCYAizx3WG2TSAqY AHa+BpdwL6XpnWm2HwUXb1zXaoGCqgKTDk6jdGt/PBle8ssh80HXkl0WHYnawdeL4gPt 37TA== 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=blxTJd5Tx9NIUQZO/x0aKGGdE7GU/DbRJ0PEKLke2ts=; b=TMLAIquybA9E0UVqj6InY7M4yhm3QMZg8yETcZie1P5NfMujHSiDKRvR7nShFWjPLl ujhNk5VNPakfB+Dg2P/iVGM/chx2ooB+dnlXyom/8K+q5nzPuDeFBdTSAUhy+2S2EWeL CLnYjBmpezMQhP61VSCfHm9WQUlR/FGy0VbL3Rz8D+XGFv5HhHp0tJKQA0oiQM+8E6nQ 2029cHis5qePWDf/225qsMWEFngLhK39+16XzSDvjgX/OnfmrDgTnHGhbliqsF/HSR1N QOxUdWYtm6iVQSvBNOm1NQpwjWffrtUjMbxvlDX3GkZ/xOxG4ayY3jM87dK0L0BLN7We r6Kg== X-Gm-Message-State: AO0yUKWLSLSoMM+R5drLMz+r6aZsuKNlBKgOTDTM8RPVyd+83m2J2OyE Xtc4AKFlovoQCMoT2k4vWFyP+gBPNZ+l0d8R X-Google-Smtp-Source: AK7set++ldX3HANNz9Vd093FscB/AXTfa5sMHQ96guUx3U8Q7TOtHG0Op+i7eO7+rObcl7uZTsAapA== X-Received: by 2002:a05:6000:1287:b0:2bf:bb71:dc55 with SMTP id f7-20020a056000128700b002bfbb71dc55mr422119wrx.52.1675722932088; Mon, 06 Feb 2023 14:35:32 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Laurent Vivier , Richard Henderson , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 05/11] target/arm: Convert CPUARMState::eabi to boolean Date: Mon, 6 Feb 2023 23:34:56 +0100 Message-Id: <20230206223502.25122-6-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230206223502.25122-1-philmd@linaro.org> References: <20230206223502.25122-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::436; envelope-from=philmd@linaro.org; helo=mail-wr1-x436.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: 1675723142662100003 Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- linux-user/arm/cpu_loop.c | 4 ++-- linux-user/user-internals.h | 2 +- target/arm/cpu.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/linux-user/arm/cpu_loop.c b/linux-user/arm/cpu_loop.c index c0790f3246..a992423257 100644 --- a/linux-user/arm/cpu_loop.c +++ b/linux-user/arm/cpu_loop.c @@ -356,7 +356,7 @@ void cpu_loop(CPUARMState *env) break; case EXCP_SWI: { - env->eabi =3D 1; + env->eabi =3D true; /* system call */ if (env->thumb) { /* Thumb is always EABI style with syscall number in r= 7 */ @@ -382,7 +382,7 @@ void cpu_loop(CPUARMState *env) * > 0xfffff and are handled below as out-of-range. */ n ^=3D ARM_SYSCALL_BASE; - env->eabi =3D 0; + env->eabi =3D false; } } =20 diff --git a/linux-user/user-internals.h b/linux-user/user-internals.h index 0280e76add..3576da413f 100644 --- a/linux-user/user-internals.h +++ b/linux-user/user-internals.h @@ -135,7 +135,7 @@ void print_termios(void *arg); #ifdef TARGET_ARM static inline int regpairs_aligned(CPUArchState *cpu_env, int num) { - return cpu_env->eabi =3D=3D 1; + return cpu_env->eabi; } #elif defined(TARGET_MIPS) && defined(TARGET_ABI_MIPSO32) static inline int regpairs_aligned(CPUArchState *cpu_env, int num) { retur= n 1; } diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 7bc97fece9..05b9012cee 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -723,7 +723,7 @@ typedef struct CPUArchState { =20 #if defined(CONFIG_USER_ONLY) /* For usermode syscall translation. */ - int eabi; + bool eabi; #endif =20 struct CPUBreakpoint *cpu_breakpoint[16]; --=20 2.38.1 From nobody Fri May 17 02:03:39 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=1675723008; cv=none; d=zohomail.com; s=zohoarc; b=JaclBFPj1oclN19yftbQU6BoNubpjFHtOapPvpZtmls8XgPMgdznIgF12UaAHlLz/WqHZTSGkVM3nnIF4rvkG2jwIQR0lXcAFRIny7kvEuLHwUgJJxanmK1Kk55pCKbAHHqQnZTO7niV7vbbCMMsgePuoz1r6UQJfb5sdNekBgU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675723008; 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=hkXbL8y61939hNYH0ESs0TMwg7eANZ0/D9elcJnMLJc=; b=ikGo/QM7TqEG9OUnATO8yEcZprNwrTaGkSGp6NFZvFJowUf55II8bhppC7fneEyUI7XdIQ36/YhHlTDJ4+GayEzaDqTeFyRNDLhQGsVqs5uFS2KNn9XxukqFQPv0JV4Fu860W9m1ArzbxD6mOQso4T8TjShJvbkncZ0eSM7UL1c= 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 1675723008326974.5587672760485; Mon, 6 Feb 2023 14:36:48 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pPA5P-0001tG-1m; Mon, 06 Feb 2023 17:35:43 -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 1pPA5N-0001rE-8E for qemu-devel@nongnu.org; Mon, 06 Feb 2023 17:35:41 -0500 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pPA5L-0004Uy-Jp for qemu-devel@nongnu.org; Mon, 06 Feb 2023 17:35:41 -0500 Received: by mail-wr1-x431.google.com with SMTP id ba1so7825155wrb.5 for ; Mon, 06 Feb 2023 14:35:39 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id g10-20020a05600c310a00b003de77597f16sm12753148wmo.21.2023.02.06.14.35.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Feb 2023 14:35:37 -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=hkXbL8y61939hNYH0ESs0TMwg7eANZ0/D9elcJnMLJc=; b=kXy245hsMKQfadouVZLsj8GRcGW/9K3Q3+eoLVcx6EYiNkvECEPRdFdZVq/NBdgLkc S8y9qE7K7P/jEpLghMETO12yS02us5hJG5R86CCNd8wo5ElsMOqvIIk6a1oaBHkUqBfK q+z1lLXlRnKKbTGosaMPTJZB6zd4D0lj6cXR+SN59ev+V8g9nwnkbq3IMs805ldh+svN /aLNBPFnR6w2QQQEqwh4DrfV5cFbmqFlvmYhEt/f+ziPUZ7LS6F8LH1AJ0i3MZReJuXQ crhNdNeyRyhsRfNQOis7POp10ZqYyB2CRI5GgOe0Ty9udRGDOXtZEC15k9EYTxQMyMgC 9msQ== 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=hkXbL8y61939hNYH0ESs0TMwg7eANZ0/D9elcJnMLJc=; b=bzrPTIHgSGhp7WMlMIQvJxjCgtHtDpaZJWoNhNXZTcXwOU5Z9OpQ6mZ+EfKWXMv8Zm tRg460YGWPa/9J0toAOI1Z+FQgiYdkJW5IDg+gsrIFSqxpxIQbavU9T8bX9RCW8NHAL7 NJzwCrbHYHqMSbOtMariI6mu9AO4yahTqHHrn7FqVhErMvUuym0EHX75EFWyyzuaFett P6tZJ/b4M19V2FiuyhvBLqY/seSjal91gAY31OebnCm4cZLaRkopqvCQRWRW57vJRSpk KiFUEb6p0NhAaHcZC2bPuNszBs8zDHW+eaAdynJfb56D3CaUTndIDz24v+PG2Wzxnh3F 7E4g== X-Gm-Message-State: AO0yUKX2T2FhnszxZ4RewCMWU4BfmvomRc6Pb+XelgR483zrVyMjdIyd Bk2JQ3qNoyK3T7qDqa9LY8SlXjp+fM4yxESd X-Google-Smtp-Source: AK7set/BliesHZ+Lvh9SWGLCLez/9h9iLezxaCE+7YV3KmRmzyescrFtN0jmVWTros9/Qby/draA0Q== X-Received: by 2002:a5d:4cc6:0:b0:2c3:d657:e951 with SMTP id c6-20020a5d4cc6000000b002c3d657e951mr425799wrt.29.1675722938070; Mon, 06 Feb 2023 14:35:38 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Laurent Vivier , Richard Henderson , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 06/11] target/arm: Avoid resetting CPUARMState::eabi field Date: Mon, 6 Feb 2023 23:34:57 +0100 Message-Id: <20230206223502.25122-7-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230206223502.25122-1-philmd@linaro.org> References: <20230206223502.25122-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::431; envelope-from=philmd@linaro.org; helo=mail-wr1-x431.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: 1675723009865100005 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. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- 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 05b9012cee..1c1e0334f0 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. */ - bool eabi; -#endif - struct CPUBreakpoint *cpu_breakpoint[16]; struct CPUWatchpoint *cpu_watchpoint[16]; =20 @@ -776,6 +771,10 @@ typedef struct CPUArchState { const struct arm_boot_info *boot_info; /* Store GICv3CPUState to access from this struct */ void *gicv3state; +#if defined(CONFIG_USER_ONLY) + /* For usermode syscall translation. */ + bool eabi; +#endif /* CONFIG_USER_ONLY */ =20 #ifdef TARGET_TAGGED_ADDRESSES /* Linux syscall tagged address support */ --=20 2.38.1 From nobody Fri May 17 02:03:39 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=1675722976; cv=none; d=zohomail.com; s=zohoarc; b=JivKMcECCFZPHFhUKD2LD8stmkxSxfDEPVfsFF2gL6FfhvC+27YOqN61rjxtKKSUkrnf0i9/jZVSinHEBhBTHDsmpoeECAAR8kgFmKOOJhd7uMNxGYfqcnf5jdol+Zx7agsFV/8+OAcOocssfP4GVMg/ODZ/WCvSJIjRPL/ksyA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675722976; 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=tq6DPJouguMrWtZeeVmDD2Re+mYoIDnT0PaG7kqN/mg=; b=T4zcjD7XEa3j2DgG5zLy9HFZ+089y9Mjv0ZzTB5jVoMaX719kAO2IZHKXzaJokf+ea50E5+Zo+7Fp/M18wmTfUuvv6C1QFhk8qDjco0046puLy6a+AdJcxI11Ubim6hHL+AApql4nOcSlrS4pgsS6rgVAFI/H7ag81uEqCdOhqc= 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 1675722976528437.40077293258526; Mon, 6 Feb 2023 14:36:16 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pPA5T-0001uK-8P; Mon, 06 Feb 2023 17:35:47 -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 1pPA5R-0001te-NI for qemu-devel@nongnu.org; Mon, 06 Feb 2023 17:35:45 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pPA5Q-0004QP-42 for qemu-devel@nongnu.org; Mon, 06 Feb 2023 17:35:45 -0500 Received: by mail-wm1-x333.google.com with SMTP id bg13-20020a05600c3c8d00b003d9712b29d2so11920715wmb.2 for ; Mon, 06 Feb 2023 14:35:43 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id h27-20020a05600c2cbb00b003db12112fcfsm13356593wmc.4.2023.02.06.14.35.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Feb 2023 14:35:42 -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=tq6DPJouguMrWtZeeVmDD2Re+mYoIDnT0PaG7kqN/mg=; b=Mek3dnXtIUsl1ep7k31ICMi0nee9DTCTRphEZbvt9Mqke9VUlh3Ka2Jy4qTXD9HOXn cEOZ3GH9dv1fw9LUQB0j113HA6zRXOuRfB+j33Vv2Nkwocyfs5Q1XE4wFOG8pUd67V7b rOs5Co5ziRFjuqm6PkSaUtgutU7SgPKxYissaaGUMlN2evYs+g9Y/i4mR/8L27vQubRj +zbtNdYROkk74UogvuHQ425jQI7Ar+d+oGZhj5MOs7HKsQ9G4OjqEtA3xAyXm4Bb1Onm 1AGRfwXRp1vwme+eE/Sa73ETLso1jP+KrmITyoiVpt9YevghxkuwHCoQlWi0flM4yH5w a/rA== 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=tq6DPJouguMrWtZeeVmDD2Re+mYoIDnT0PaG7kqN/mg=; b=p9XFUEeSkEGI2DRQzp9/g/DjbetGwUcs3V3/zlvy6+GjBJWQEwMKODq85F/paVJ48E fO1QytdGuurq1XZoOVlJqvGdI5YRDpfdp49RPvBpaGctrC0FFUPyGvaX4TUBEYsNHLuQ wYmdgJQwGciTt66UQizui2+v9Ycj1Njhzdb/efRePr/yCNXF01IghlvFXYt0IPdSTvaY TPJUuVl/MuGiBuRQt6XdBFKa4NDwadDqMVgB1evvfut/M2/4pYmNwiGbbZ8YpcAn/GMM Vff4i5z4bnl/7Ae/Y3Pc5khMHnYso59FfnQ2mTkyMWSyu4h2F5Rjpq5KhO3w998qJ2jV 01mw== X-Gm-Message-State: AO0yUKVOzV80nwDk7BdeQizV3pC++PBdzfixY2kMk9xPgJlFYEh8Zut+ P37mMFHD03ngbwc/S0QA4VnwkvhvH9L7LHLV X-Google-Smtp-Source: AK7set8f7FgTrJPAof8WWJwbmhEPwriNUc+y1ezF/wn88HfPClaOKLcpPyPSY6jAVaDDyo74AGE0iA== X-Received: by 2002:a05:600c:35c6:b0:3df:9858:c034 with SMTP id r6-20020a05600c35c600b003df9858c034mr12591508wmq.9.1675722943215; Mon, 06 Feb 2023 14:35:43 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Laurent Vivier , Richard Henderson , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 07/11] target/arm: Restrict CPUARMState::gicv3state to sysemu Date: Mon, 6 Feb 2023 23:34:58 +0100 Message-Id: <20230206223502.25122-8-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230206223502.25122-1-philmd@linaro.org> References: <20230206223502.25122-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::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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: 1675722977725100005 Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- 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 1c1e0334f0..002082eb5b 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -769,9 +769,10 @@ typedef struct CPUArchState { =20 void *nvic; const struct arm_boot_info *boot_info; +#if !defined(CONFIG_USER_ONLY) /* Store GICv3CPUState to access from this struct */ void *gicv3state; -#if defined(CONFIG_USER_ONLY) +#else /* CONFIG_USER_ONLY */ /* For usermode syscall translation. */ bool eabi; #endif /* CONFIG_USER_ONLY */ --=20 2.38.1 From nobody Fri May 17 02:03:39 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=1675723015; cv=none; d=zohomail.com; s=zohoarc; b=eEsVHObgQRhcC30ZSsC0bFOofUsMlPr+41+ttiYbx9z4XS6SjrarwEh1w5VgVXhe3Nq77cOtW9bBRMHK8nKoBwlrHNENVCHQFQyuAWQ6HGYW1PMv5viATCxwu3xKkoe7vSZnSWWdfQh8vUu13OqAZkd7Znqrf8Bmr2uVZWjjPec= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675723015; 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=E4wwJ9rgwf3OGu6ruHO5E3WC10MpsXTe+i4WOyzlxyQ=; b=lGxsfdpRfDdY0AVDu+tnjRJ9EtZwECrExNM2BpgvOHbPaREGL9a2TjK5r10RVTM15AfYEUG+MOkxKHavpWn5WRxoBYSmWayEfKod+v+Ps5T/s/I26kcK9L7xvJay7ylsLBdu/SaYlLT4YoO7PHuAYnKzDnu4DHiJnuqtjXmqGKg= 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 1675723015371536.5271863089891; Mon, 6 Feb 2023 14:36:55 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pPA5e-0001wu-Dd; Mon, 06 Feb 2023 17:36:03 -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 1pPA5X-0001uw-EP for qemu-devel@nongnu.org; Mon, 06 Feb 2023 17:35:54 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pPA5V-0004XC-TC for qemu-devel@nongnu.org; Mon, 06 Feb 2023 17:35:51 -0500 Received: by mail-wm1-x336.google.com with SMTP id k8-20020a05600c1c8800b003dc57ea0dfeso11935537wms.0 for ; Mon, 06 Feb 2023 14:35:49 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id z17-20020a7bc7d1000000b003dc3f07c876sm17500100wmk.46.2023.02.06.14.35.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Feb 2023 14:35:48 -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=E4wwJ9rgwf3OGu6ruHO5E3WC10MpsXTe+i4WOyzlxyQ=; b=uiJC8y6Scd+xH5k6JhmB1Txo0p0Al4I43GaNRNM1U1OoqQZUHDELm4AWJjDOlYpiJ1 ksqh1SE4wUDIluR7RVkTB3BQ2w8QmVlqNu9AOFeUqfB0vQj/zslF+vWiaKfGk4asAOgE zNqs1ZG4dma4urO/4+kgM9bRJEazewBlNP/EWXySmrJOMv4qs6eKRdz0EV7UZecUyzTp B5dGuBIds/LA/gd9xHTW3WyMcRn98g2UTQuD75hkhJuCinNLqubBQ6CB+ooQ99HtAjxM iCjSNr+SkTpg9p9MwZnjaP7gprQ+jJ5A5hpe7Qi5Wh5AxiHDaAOXr9xPlYAvXKGh18+r dXsQ== 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=E4wwJ9rgwf3OGu6ruHO5E3WC10MpsXTe+i4WOyzlxyQ=; b=wJfZeY8B2LuGCz7AAZmQr6VEU11HJNrPgs3aLFe+XQj6oLhQaOh+NGVPfTpG1UUW5S /VbNqad+0c9VyMJBP9Ey6WVyV0kwR7Jpym+yey3iITAgDZfJ88li5EwfdfEWML/UfVH4 5v17C23tj9/0EsKrdcZtlYfQ6/hrmCikdyViBXuiAEy0yydbiVIDFbFWu1BUyiWBSzTX fm4NYSuBEEyJjKZqWnY/03Mf+jbA32SYKZ1E7p8zGVLAntFvEbpMyo4t8bu3S7INj0Nq E9C55RBxKHYL9mmXk6wkDMHWpmT73EVt7mEviNR9vrXIDVfd4SaN+IzN6ENMgVNd/oyV fVow== X-Gm-Message-State: AO0yUKUiaHZewQjpJf8EmA19Q8L//3x/CeSSiCbFw7TUpS7inF+E3Kl9 p1IkasvrYDdynOdJRM8W4AWxhrgdFQUfI+i3 X-Google-Smtp-Source: AK7set9vqos7aFG5IPZxS/XD6u0MtMnk6E7EPmnMrxjW32jElHNNDMMUD/wVubBmSkPPaZm3ItVzAQ== X-Received: by 2002:a05:600c:319d:b0:3dc:5950:b358 with SMTP id s29-20020a05600c319d00b003dc5950b358mr1160116wmp.14.1675722948488; Mon, 06 Feb 2023 14:35:48 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Laurent Vivier , Richard Henderson , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 08/11] target/arm: Restrict CPUARMState::arm_boot_info to sysemu Date: Mon, 6 Feb 2023 23:34:59 +0100 Message-Id: <20230206223502.25122-9-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230206223502.25122-1-philmd@linaro.org> References: <20230206223502.25122-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::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.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: 1675723015869100001 Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/arm/cpu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 002082eb5b..a574e85b76 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -768,8 +768,8 @@ typedef struct CPUArchState { } sau; =20 void *nvic; - const struct arm_boot_info *boot_info; #if !defined(CONFIG_USER_ONLY) + const struct arm_boot_info *boot_info; /* Store GICv3CPUState to access from this struct */ void *gicv3state; #else /* CONFIG_USER_ONLY */ --=20 2.38.1 From nobody Fri May 17 02:03:39 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=1675723127; cv=none; d=zohomail.com; s=zohoarc; b=jBPfzZsoJUL9dOtorBWdTXOvlNuWhMIvmMDtBpzXkSQlYEY9YnQsY1ZytrtnW081UghVhibVa0D11DfOYuD4H7daLtzlzf++H2g9uOaqnBDw1ERV4auHqpSMMMUth6m0M8QFl0KuSSp0oZX4KPE07y5E+ybPHt3qOYqRASFfztw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675723127; 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=/k7Xuyi4yDhm+JEx9OBf9mhnkAiRR8pR4vzYzacLnP8=; b=iIPwcPzX5zSB+D+xAr/2U+nY0CfvReP6npp9rBUG2U+mjPMNM77nZO4hNZ0QHBDAPLpQ8E2scvMuf+zdjfQyLU4NnFuxPap3GQf/++cN8zQnQcAW7gwtqmSalnnEt7Q05V636ATDLC9PVJeD5X7JpM7Z6maafR2H3K9yci0IO4U= 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 1675723127808330.8988285903422; Mon, 6 Feb 2023 14:38:47 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pPA5w-00023V-NE; Mon, 06 Feb 2023 17:36:23 -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 1pPA5c-0001wD-5t for qemu-devel@nongnu.org; Mon, 06 Feb 2023 17:35:56 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pPA5a-0004Rt-ID for qemu-devel@nongnu.org; Mon, 06 Feb 2023 17:35:55 -0500 Received: by mail-wr1-x42f.google.com with SMTP id o18so11896371wrj.3 for ; Mon, 06 Feb 2023 14:35:54 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id d5-20020adfef85000000b002c3e600d1a8sm4481597wro.95.2023.02.06.14.35.52 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Feb 2023 14:35:53 -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=/k7Xuyi4yDhm+JEx9OBf9mhnkAiRR8pR4vzYzacLnP8=; b=U3eTCcOy6zdmk2vKJvcQTKLuIHvtaW174JDHL80aevYN+nwHs5E+BdMrtJVPqP/EQc OgybLpw+f2wCkx5A+c1I14efpk6ZobychfMRbOlX/0IWex64SpRXhWxqdkA6Jk8/L2aM p8ibcfO/fLS8wWos/Sj/lkYb1YFMIsBy9M7Mw3lXXrnbkweq5lbNnrC/4d/RopkOz+WK sHE5Oe30RL8r+Z9Q30NXD6oT0/klhmR85/LXaTf+3z63Hgr1FCjkaIC5ttgi6r2HTvy6 68xdGOgJncQ1oV8NhK6OY3ADxb88UYZ2Gx2ScGoXSjHFosTrZT1nmK3W3zGWMOZZ6wie 3E7w== 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=/k7Xuyi4yDhm+JEx9OBf9mhnkAiRR8pR4vzYzacLnP8=; b=XrmlnAeNLf+n09ahUry2Jy81sLe0/kPHp83IPBBu0nEKgHGGYxFdpiIrLmZ2LlhJ0c FgqeRVtJoUn9ziRkYBcOOCKRmZ/NZBmmopRT3ACHX4oIi1T6s6w6KPxcUitHpJfoOA8C 0wfk74cny+JLx08Qjtc+WgcUV64caV6twlQLY6oc/LPt/bjN8wtmvayCi/lsu3h22RKU 4nNqqwgF1daLpONaJKitXgovwAW4lwkAPAK0EkicyhVgQ0SYgsFwoFYcJr4Rqvm52480 R/da+2OmHpJ/UdfWMEU1mJ0h23QnhgHWrRMkaYDd1dY0SDBSZwpRlWTxA8FPAUX+f3UH qlCA== X-Gm-Message-State: AO0yUKVBUIbNn6IgHRCTVbfyCfE47FSI+Qi8pzunkkFRZID4X6bzmkIV W/30vh5zWR41OEYkBP9cerboNkcH8meK67Aj X-Google-Smtp-Source: AK7set/M08H/y2VdGazDBS3RCK2ZtHB/AKx6Xgaz0nvCL4dmeZlIzWaXyfOLaG7nz95xdP6nyADlDw== X-Received: by 2002:adf:db88:0:b0:2bf:d776:1c9a with SMTP id u8-20020adfdb88000000b002bfd7761c9amr505199wri.4.1675722953688; Mon, 06 Feb 2023 14:35:53 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Laurent Vivier , Richard Henderson , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 09/11] target/arm: Restrict CPUARMState::nvic to sysemu Date: Mon, 6 Feb 2023 23:35:00 +0100 Message-Id: <20230206223502.25122-10-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230206223502.25122-1-philmd@linaro.org> References: <20230206223502.25122-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::42f; envelope-from=philmd@linaro.org; helo=mail-wr1-x42f.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: 1675723128600100007 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- target/arm/cpu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index a574e85b76..01f9566a1b 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -767,8 +767,8 @@ typedef struct CPUArchState { uint32_t ctrl; } sau; =20 - void *nvic; #if !defined(CONFIG_USER_ONLY) + void *nvic; const struct arm_boot_info *boot_info; /* Store GICv3CPUState to access from this struct */ void *gicv3state; --=20 2.38.1 From nobody Fri May 17 02:03:39 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=1675723119; cv=none; d=zohomail.com; s=zohoarc; b=eHoJ71lv0KpMPYGKVsPNG+ITwkMnEsdgOQBxaR5+7Magos2cf8YAh0Sehha6Uy2wYYI/6iKulXJ6ZQjbFKP/lCiNsNlm6tKduksaUKBrWHTSGQGcR7RIu9b5Fp9pWMu7jAcMe85iTJiaZyGvpZmZwJsdwhT8//3JpXm3QQKmJ/o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675723119; 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=uXew3WIFLBzNY/R9haO5NzeKd4QdCH/e2ycwfYhObHY=; b=gHlvOfAyt+OdNgxjwN+FYAC3EZfB27s62Dn8GjbdgRQoEpAy+pF1J9PWfyhKv5do8Vx67afB6YChwUO3TRp5ahtNBwq9otryNDj9Dn2suLpUMj82FOhMI66gJvPPBmrOy70Zx0ju2VBGjS0jx4efbveD1ZP/16HLzlQsfPVnkio= 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 1675723119955267.3693778569616; Mon, 6 Feb 2023 14:38:39 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pPA6P-0002fC-2N; Mon, 06 Feb 2023 17:36:45 -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 1pPA5k-0001zm-Vo for qemu-devel@nongnu.org; Mon, 06 Feb 2023 17:36:07 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pPA5i-0004Rt-N1 for qemu-devel@nongnu.org; Mon, 06 Feb 2023 17:36:04 -0500 Received: by mail-wr1-x42f.google.com with SMTP id o18so11896551wrj.3 for ; Mon, 06 Feb 2023 14:35:59 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id u17-20020adfdb91000000b002bdd96d88b4sm9937430wri.75.2023.02.06.14.35.58 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Feb 2023 14:35:58 -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=uXew3WIFLBzNY/R9haO5NzeKd4QdCH/e2ycwfYhObHY=; b=ak9v7YHiTVxHsNVl/iltQSCcCrfGeA0snuyBoVt1ceiEmzMt6x9/ky6GwlPPOu3u7I 7z8L/lF4IKks9maHYWw/SP/HIeZDTbpqNFsT4nb5hwGbJizpuQkTqMqAigzq6D3yUenw C/z2GhPSD6t3uqZKapWbCC4qKsYdPAAELv/6Zavq+qAAbs76EVdp9HjZ8qMJmIsG+/WI IcdELmUcuTS9S895mgR3OUxYPMRHCLugx1G4gMFi1OSaOIkG3JNtdNpvZsEdbFxzI8Bk hqpGDylnVCzkxOrAKtEbUOEyGtbNYQyPy4igb/U9OR9cApqApb+fUwHy71DMx1s63jOf NmlA== 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=uXew3WIFLBzNY/R9haO5NzeKd4QdCH/e2ycwfYhObHY=; b=5mgObfFjuoolAoQM41ED+4CwJVB0lUKQFXNk9y1ur8dRr3B+mrO2TlbsfPMOBi1aSu aBg0jDF4FVh2lTbEOrSz5QwShhRpcDukfJSMuQqTB6lIyhwCVXD9ucjO8vTvCA0Ca2uY iWXZvh+OSGKiemcZC1FWN4PeSsbfFyXRBOhw8dFxx82Gj80jeoZyQEqWNKXiM46NmKNG L3IVyW8pn9BWYD4RbTxLrHdK+kZoLr6ZfQGfOmjZDW1Nu4de8uCcJp0miSM3sSwgTC6s GGDQGsla6azCKDBfcGaixKq2MPDOSwZzmyuytX1T4khFZkx3DihZ8Of2z7fZbYg4WFn1 DWOQ== X-Gm-Message-State: AO0yUKVaRXWZgVeXRkfj4ZTUl2TMbnixIYCa4W02DM6Vf1WQmBgDwNJU gmZQu+iOhNa52+CHKKl3Yui1CBjYmq99Yibp X-Google-Smtp-Source: AK7set8DAo/U6HdemeZiZB0x2iJDAizL3/kBR/gG6E61+1rgbbhLuQwcTJ20rPLtTmL2DTyxpVaQsw== X-Received: by 2002:a5d:47cc:0:b0:2c3:be89:7c2a with SMTP id o12-20020a5d47cc000000b002c3be897c2amr13614132wrc.13.1675722959101; Mon, 06 Feb 2023 14:35:59 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Laurent Vivier , Richard Henderson , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 10/11] target/arm: Store CPUARMState::nvic as NVICState* Date: Mon, 6 Feb 2023 23:35:01 +0100 Message-Id: <20230206223502.25122-11-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230206223502.25122-1-philmd@linaro.org> References: <20230206223502.25122-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::42f; envelope-from=philmd@linaro.org; helo=mail-wr1-x42f.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: 1675723120793100001 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 Reviewed-by: Richard Henderson --- hw/intc/armv7m_nvic.c | 38 ++++++++++++----------------------- target/arm/cpu.c | 1 + target/arm/cpu.h | 46 ++++++++++++++++++++++--------------------- target/arm/m_helper.c | 2 +- 4 files changed, 39 insertions(+), 48 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/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 01f9566a1b..9a80819d8d 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]; @@ -768,7 +770,7 @@ typedef struct CPUArchState { } sau; =20 #if !defined(CONFIG_USER_ONLY) - void *nvic; + NVICState *nvic; const struct arm_boot_info *boot_info; /* Store GICv3CPUState to access from this struct */ void *gicv3state; @@ -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 b4964dca8a..25de64c43c 100644 --- a/target/arm/m_helper.c +++ b/target/arm/m_helper.c @@ -1015,7 +1015,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 02:03:39 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=1675723145; cv=none; d=zohomail.com; s=zohoarc; b=kploU05pyOYas/bm0oRBIzNwFO30ZRi3sbtfCugVtlF7vMNwbWO243duJQON672BMhSy7jNrgG/rhfyX7fApqL32+0C8oSW7C5HIn3e2ZFMKpwQpZiuUinf+P9kiVsTLl+PM9eQA6/uQkWJTKLgLFYyH1axTVQuIxDNnltEGSyY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675723145; 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=Th29SQNs7/l87a43ReKMZy6K5gSwY95yoc+dQl25fFo=; b=HXKQqVscvaZclJVPzRrzd2D9SIu3B/IGIokPZMo9F5Z8FFJQEAo89blUHgkSaJ5Ki2id3ef8KpHY1Q4FbNmmyfLZ+WUOtOSvbHT0A4NwamFuSTGlk06xpzqo08xGO+oETqv/NGyvmYghYZv2vuCt2fhQhp7mnbrltHHMbG7sHgU= 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 167572314596547.24396916173691; Mon, 6 Feb 2023 14:39:05 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pPA6O-0002bG-1P; Mon, 06 Feb 2023 17:36:44 -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 1pPA5q-00023R-Qx for qemu-devel@nongnu.org; Mon, 06 Feb 2023 17:36:11 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pPA5n-0004QP-EF for qemu-devel@nongnu.org; Mon, 06 Feb 2023 17:36:09 -0500 Received: by mail-wm1-x333.google.com with SMTP id bg13-20020a05600c3c8d00b003d9712b29d2so11921204wmb.2 for ; Mon, 06 Feb 2023 14:36:07 -0800 (PST) Received: from localhost.localdomain ([185.126.107.38]) by smtp.gmail.com with ESMTPSA id l21-20020a05600c1d1500b003dc59d6f2f8sm13238785wms.17.2023.02.06.14.36.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Feb 2023 14:36:05 -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=Th29SQNs7/l87a43ReKMZy6K5gSwY95yoc+dQl25fFo=; b=UZLAGAHV9ptv26hSJWLRvMGmiMhBXL6bkMNNDsg5323vbcbLf0nTrFG6XCPkhlrB/J Wdarnnonw6ZDtTxnr/MspxQjknz9FFPRLMlPpHr12Yaz4YqLpfua9+wAVgQwrPvNIF0Z 4iCbHG1Q4+0x0cl6enPYDrE8ZIVDsamW4q1qvfHUJfOsQmFev1X5cgB1+Ot2Onj2Hs+P CgbeWmCsP+SrCrtYCgG2Gj7HDsFrbPLaK0s99Lw3Wt5aA1/FRVuSQikzkc6NqsR1iNBp teuFWk2g41vIsI/FRkK28g3GLvwSsUh52H4BBUUa8qyBeHOffTfsaTZPpcae7HBgcqNG 6r3w== 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=Th29SQNs7/l87a43ReKMZy6K5gSwY95yoc+dQl25fFo=; b=xLlW6nsUPFjgzI5+66wRIaHG6nYZdPOgBcMAX614bQeToxHdqDWg38s/qhq+Pzwh7n zaj3Yq01DHpM/4GTLT5t6eFO/z4P8beDCnoCB8VCESpr78fFYguqmjj52ef39MFtpNZH UZ4XA53xM20gY4hcsjLyuCR4+KbhD4AtA8h4cmNQbXdqnwtbf8iLFRWerhFK7BK60ups zIskEuT7WMNZe9xJE9V7OdyZf3x/tf1V0r7+Y8rTP3wBijT4YnHkkpZv/RbWubHP9n27 DAAWABdj+M9MYcZy8uHT9QxhMU5H6i3PeydRHn4Ru6i7MfTVrmBS0KPL8QR7JX9TEODY iRMg== X-Gm-Message-State: AO0yUKXB3r0dztArQEu9GBn0pDrkoaPN6OCXphpeGryjudAQbwfC77yC 0WgwrjmdxNlrAPsckKa8l4O6dmsE9JmHIJkl X-Google-Smtp-Source: AK7set/n5mIn2hs9eZGp8K4QsjQ2pz2yz2KaubQUHuhod7yK/nd4WumjpzAcGfOYq9TynNozPB9g3Q== X-Received: by 2002:a05:600c:160a:b0:3df:ffab:a391 with SMTP id m10-20020a05600c160a00b003dfffaba391mr1076324wmn.24.1675722966382; Mon, 06 Feb 2023 14:36:06 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Laurent Vivier , Richard Henderson , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 11/11] target/arm: Declare CPU <-> NVIC helpers in 'hw/intc/armv7m_nvic.h' Date: Mon, 6 Feb 2023 23:35:02 +0100 Message-Id: <20230206223502.25122-12-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230206223502.25122-1-philmd@linaro.org> References: <20230206223502.25122-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::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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: 1675723147686100001 While dozens of files include "cpu.h", only 3 files require these NVIC helper declarations. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- 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 9a80819d8d..d623afe84a 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 25de64c43c..f94e87e728 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