From patchwork Mon Feb 6 12:17:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 650934 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp2238038pva; Mon, 6 Feb 2023 04:18:01 -0800 (PST) X-Google-Smtp-Source: AK7set9Qh4flZ16h+Z5gjYWXkBXqflvuYvuUjf8g2zjQU+APV00rN7vKjODfDp2QTWI9B6gu4Sle X-Received: by 2002:a05:622a:312:b0:3b7:fafc:73e3 with SMTP id q18-20020a05622a031200b003b7fafc73e3mr35846276qtw.41.1675685881520; Mon, 06 Feb 2023 04:18:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675685881; cv=none; d=google.com; s=arc-20160816; b=N8fsWRF5WQ2lP5WSAzrI0lx/cyd4INTpg8Y2xYUhTh0AlkAbvOXHHrJX4hwwCpiqIT 0Gpzir1RfuN3LVxsNPqvtX/mjGI4wowz384dABOXmIFTdZrPR9qXo/+HnvhKWhZbZ5dK 36nKRxSUfqUyBrZnVf5AGV0JLL/u0OSe0pdnhYWKbrK66ItdGhfpVrOKjqx5C0FkirqJ E1cRNpCPR6B+25AI7I/UQ12mJ+rlmq+z2Vm7c8zSn2hpsoAwWVHRGU3nbSIicghZBueO MXYfRqx+6WscntEgzpKmHGaPtI41fCqeeuknuXIu/Su5gDs6oXLUkowJ7SiXw5C3ayTj 6ItQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=oLH2N/w79VptGJTqWIiiTK47yGtiakTQYhWs+w0Tnzs=; b=dij3YBCsWXspsjZRGVh47OxzLIQqqHROtFweGZyyOA9U08grrSxpr41wFIm28oqIrR RAlaE5beXZiah9A7rdU6bU6bcbUWimijaT6Gk1B+zLLtO2/OccWxBQM1z/q82WrVvJQt WcwYU2bylcp0do+/gHMWmMUqqErtdveQD5PivD8HaumRQFJiS9dHcSzg7tWmMolU9OQF +scteW2jC2XBcJeJTT2Iy58AQ6tsL5H1vHhSnq4hLWXU1ZxIHtK48MLhIG1pVhcTpSTT GT6UhfZDy1BS0Hujo6lbOwRrUP1V7+YAi+rdWqYzwNEHjAQMVTcokVo9OLr6RiCv/LfL HaIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vpTBjOrh; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f126-20020a37d284000000b0071fe890d2fasi7691189qkj.189.2023.02.06.04.18.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 Feb 2023 04:18:01 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vpTBjOrh; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pP0R0-0007LF-JE; Mon, 06 Feb 2023 07:17:22 -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 1pP0Qy-0007GA-Qs for qemu-devel@nongnu.org; Mon, 06 Feb 2023 07:17:20 -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 1pP0Qx-0005lF-7A for qemu-devel@nongnu.org; Mon, 06 Feb 2023 07:17:20 -0500 Received: by mail-wm1-x333.google.com with SMTP id m16-20020a05600c3b1000b003dc4050c94aso8605939wms.4 for ; Mon, 06 Feb 2023 04:17:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=oLH2N/w79VptGJTqWIiiTK47yGtiakTQYhWs+w0Tnzs=; b=vpTBjOrhoP2eho/wxD9qI1tCjBwca/09Ay0iqfQjYvmcmhO73JFKmsrDqk+BN2cW05 qfEs3FcwTCX3a7RAuRHR33lSANEDHVE9HFza6Ko9Rkd4cgPWQTUE9uzgxr2H2FZS7yBR +vLX0XwMc0fWgbAJcp0CynrtTNLORtBYxjYQzWpb0ecAqrxQsrThkcSVJ2QrOc9Vixuc 69lozeg9ZkJvejwI1aOulC7LTQGnSLBxli/p4AhqJ0kaJ5fX9yTNBjSkU4Is+Zz8qa/r kxNjlSx8bk5g980ZJdAcGbgLTB8s8HK23q0J3DEF15G/eY3v15Yi3BiG78ATun42gEKw mfug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=oLH2N/w79VptGJTqWIiiTK47yGtiakTQYhWs+w0Tnzs=; b=ZsfiHAZJXro6NTicsQt9mjXKIVaRTc0tGg2pHn5Gw0cCLJKRwRAzTgNl1+chgtWFP2 4BMhLlb3+vAGb1mEmL+DUGr3lVqtUZ9wJ6v2nqmC0naqZKRDaJ+4dYveDpgHAGvynOfM kZ6IxaYOGerDP0CLSUQGOzn3RSP7nsnv86OBB0ZnJTZpIu/ICUu2TcSxUPt6LArnd/2I twwiVM/ukkv7RREsB4+NXDv0FWN1p3VHcYn3+umMpMiZPQ3xk+WS5tT6ljQPpPH/KLM5 hoJ+am9vUa5/5LRiOM5FpWRSAHAQgwC+CtDLAv/GF4eZr9uKOftW06C1pa+zkJ7MBtm9 KNBg== X-Gm-Message-State: AO0yUKWfyADraZ/g3WB5yA9raqT39ZP1JVR+tgs3tst9W4Yt+6SYBLHR 4yN+LhbMvtnMRYJh/tLomplpx5JIw2hEpryZ X-Received: by 2002:a05:600c:3caa:b0:3da:270b:ba6b with SMTP id bg42-20020a05600c3caa00b003da270bba6bmr20362007wmb.41.1675685837267; Mon, 06 Feb 2023 04:17:17 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id o35-20020a05600c512300b003cffd3c3d6csm11698690wms.12.2023.02.06.04.17.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 Feb 2023 04:17:16 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Peter Maydell , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 0/9] target/arm: Housekeeping around NVIC Date: Mon, 6 Feb 2023 13:17:05 +0100 Message-Id: <20230206121714.85084-1-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Few cleanups while using link properties between CPU/NVIC: - Restrict code to sysemu|useremu or tcg - Simplify ID_PFR1 on useremu - Move NVIC helpersto "hw/intc/armv7m_nvic.h" Something odd occurs when an ARM CPU is realized, the CPU reset handler is called, ending calling armv7m_nvic_neg_prio_requested() on an unrealized NVIC. I kludged by checking whether the NVIC is realized, but this rather looks like a code smell... Philippe Mathieu-Daudé (9): target/arm: Restrict v7-M MMU helpers to sysemu TCG target/arm: Constify ID_PFR1 on user emulation target/arm: Avoid resetting CPUARMState::eabi field target/arm: Restrict CPUARMState::arm_boot_info to sysemu target/arm: Restrict CPUARMState::gicv3state to sysemu target/arm: Restrict CPUARMState::nvic to sysemu and store as NVICState* target/arm: Declare CPU <-> NVIC helpers in 'hw/intc/armv7m_nvic.h' hw/intc/armv7m_nvic: Allow calling neg_prio_requested on unrealized NVIC hw/arm/armv7m: Pass CPU/NVIC using object_property_add_const_link() hw/arm/armv7m.c | 4 +- hw/intc/armv7m_nvic.c | 44 +++++------ include/hw/intc/armv7m_nvic.h | 128 ++++++++++++++++++++++++++++++- target/arm/cpu.c | 8 +- target/arm/cpu.h | 137 ++-------------------------------- target/arm/cpu_tcg.c | 3 + target/arm/helper.c | 14 +++- target/arm/m_helper.c | 9 ++- 8 files changed, 179 insertions(+), 168 deletions(-)