From patchwork Sat Jan 25 16:05:41 2025 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: 859800 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:18c8:b0:385:e875:8a9e with SMTP id w8csp1321705wrq; Sat, 25 Jan 2025 08:12:59 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVIy26kQrRcOTK+e6JCGOglk5liCbVAaJXFASiJD8Mf4sKCSOTliKsTSOm2r1zULJYi56uztA==@linaro.org X-Google-Smtp-Source: AGHT+IE7E2q235RSYTXFttbpx9Ni15W7bfmzH279iw3syfpxzGYJligenJswdNLYYr4n1H5mzhbi X-Received: by 2002:a05:6214:260b:b0:6d8:92c9:12a0 with SMTP id 6a1803df08f44-6e1b224cc1cmr519042046d6.44.1737821578877; Sat, 25 Jan 2025 08:12:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737821578; cv=none; d=google.com; s=arc-20240605; b=aP8kO4JsLsZtoLwnLPpP30+kcLX5CjcFiCUm82DRV9h26Bb2POozgFbA+QtljM4CeZ N+Dm6bd2DhxNOFNloAkl1UeggHie9YmZcFmcZ9n3W/XwvKuIpDtLJbtvXEKEw3Ydf63j I5K4LROK+m1fYXqmhYdSyFop9c3Czi9S9jRfkH7pS1zUdCkQhwqAkCg2uSvAvm6CX2g1 /hg6D+v7bOIOWBvp/Yci27xo1bOMjdUJGQ2XwEm+MaenFlxV52kT7nQkTj/Ovwx7M2yz fcy/TZxWqQrE+mOtYFhNj7omsgyxT5lTr6exOKdj409qcFLnrtOUTrbwAOJCusNtCkUz sPFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=McaXcSpNynHCA9tSKGj/1Op/r9CMceoElpHx5WUOIrU=; fh=ZXDWg7hKG7Hj19AbRuutTLw+Zvn/B9RsGUUw/YagpFI=; b=lAsWUzKpf0vXcCRnArz9gYAXZQQlCOIInm+f9lxFQWOZKncFU4RIFM4/vSXUWfJrfR Duk9Jn+CHmsUbJJE5YSPpWRLOezZ9sXIuzb6ppQmfK1NIcpxHt9cPXT7h5cUBplayNee mzFoz7qSSihwbujjf2lsAWSD4y4wFngo0nllYyyaX3+bMLIRK4AIyS7AsrUtTMRn2v9P Hb1Yy4+nHw+H+RHmJR7drgwkcgW4G6zXG/KFSUqyLVNS0CmByrlHjG7J57KhYRO4v0mM 9hTSX4QDsUFVPV0072jD4Td3SNU3gEEMYE3po4jxyLqcNftC4egLt8Vg7K3ljyVUATDW qk2g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mmfL5Qy5; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6e20612f634si51478856d6.469.2025.01.25.08.12.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 25 Jan 2025 08:12:58 -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=mmfL5Qy5; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbiiN-0006Sr-VB; Sat, 25 Jan 2025 11:08:56 -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 1tbigZ-0004xR-2h for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:07:05 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tbigW-0000ly-Nn for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:07:02 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-4361f664af5so34746425e9.1 for ; Sat, 25 Jan 2025 08:07:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737821219; x=1738426019; darn=nongnu.org; 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=McaXcSpNynHCA9tSKGj/1Op/r9CMceoElpHx5WUOIrU=; b=mmfL5Qy5chrnB+SXRHGG3XajjavekGTIS/CYQ4xqRIMSwtIDDzVkVC1GvsxXt2ijrJ sI8h1iiPa3F/KNUXvu9a7wdrT+sehQEGwNP7jZ2UZPwmuQJPqLbrPvST+4U3zRwx9N0M CDeFIZqZ6yzOXHBhMl7FK1be10sL3ymuakxC5g6om3H5KZWc/jphYb24xXSWsJ0QY/lP mLBBvlFWaRAFelinwsAUCGspptEYDnpgXMY+GVQ/PZV8a657Xr83wRwoVoa5g0u9q0kh zgu5NKZUlR1GSGJqaY0FLAmnzVZRiE4klzDXg6rYgNtrrghma0w8TPQBsmjDHR7s7wVO gHIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737821219; x=1738426019; 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=McaXcSpNynHCA9tSKGj/1Op/r9CMceoElpHx5WUOIrU=; b=ZRre7hCw33Nw0l9SwoNkpxyh7Z/AYqslmibgXUCPagAr4brcCOhEYWRQwTDfpixcs9 ovu/6T1+ynUEuj18xO9Ix4FKxLXMzzZkOwIcu0YqUeykbYWaR+L0e1S/dL9891ypmBdy B41Q5JANNxH5ZNY8/arBRt+oKS22Ey3G0we/CRvbA+xiUQDcXv/JVsZ6b2AneBoP1BmM /eRAyi/ITifUYLlEkcr37szbBN3JCuBgP2GycxbYOAz3ivV5y4AM0FCzJoYLImPutnNn uFU72EVcmLrOtLP3DIljk0q2oZXK95bQv4qD9M3AxTO3ql6aeUZ03nUnoNQq6zkPY2Ku TuoQ== X-Gm-Message-State: AOJu0YxilQiiosW/lfz5hgh91nucU2fmE2XXLMPr5+7qleqY8Ol80Dpa sZSr5aUexbVTm9as9wSPEoEP2gTphfocEgPTYUDecKTENxdvVddIPEaoSaguKyEevDz4UUnnnQM rs8Y= X-Gm-Gg: ASbGnctAvTmdKrGNKTMKAchhlfpS65Bx5Vi/2MjMKnT437l+QYVw+2brGTec9kKOGka TxjBP5Nleu4Cy0bqiHyp6wmLCO0gsQo8ATBaWIzJoNszk0Rtva/Nv5KEq8o9RFhrpc8lEzXcuO8 wfVaLkSzXwhc55Mf2HmsgOuadB2T5GOwrLwvza6rFWf9Wi0JnYBTXKNz8pOOfCG54pq++HYyjuC xvuhXE8A10yW6s2R+mhUDgsDrW9b4z9ASKZMeo9NV2RhzDzMI0Z7bUTxOr5BSSppH66aZa3/Q7c xXK6r36ipq7wDCSIeyPbSe428ZTBj6J/MqiZ9JVVB2DaUtnCPVICuHskIi4z X-Received: by 2002:a05:600c:46cb:b0:436:1b96:7072 with SMTP id 5b1f17b1804b1-438913bebe7mr327719045e9.5.1737821218155; Sat, 25 Jan 2025 08:06:58 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438bd5082d3sm64038195e9.22.2025.01.25.08.06.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 08:06:57 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= Subject: [PATCH v2 13/24] target/mips: Move has_work() from CPUClass to SysemuCPUOps Date: Sat, 25 Jan 2025 17:05:41 +0100 Message-ID: <20250125160552.20546-14-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125160552.20546-1-philmd@linaro.org> References: <20250125160552.20546-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Move has_work() from CPUClass to SysemuCPUOps and cpu_mips_hw_interrupts_enabled() to system. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- target/mips/internal.h | 4 ++-- target/mips/cpu.c | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/target/mips/internal.h b/target/mips/internal.h index 91c786cff8a..28eb28936ba 100644 --- a/target/mips/internal.h +++ b/target/mips/internal.h @@ -162,8 +162,6 @@ void cpu_mips_store_cause(CPUMIPSState *env, target_ulong val); extern const VMStateDescription vmstate_mips_cpu; -#endif /* !CONFIG_USER_ONLY */ - static inline bool cpu_mips_hw_interrupts_enabled(CPUMIPSState *env) { return (env->CP0_Status & (1 << CP0St_IE)) && @@ -206,6 +204,8 @@ static inline bool cpu_mips_hw_interrupts_pending(CPUMIPSState *env) return r; } +#endif /* !CONFIG_USER_ONLY */ + void msa_reset(CPUMIPSState *env); /* cp0_timer.c */ diff --git a/target/mips/cpu.c b/target/mips/cpu.c index 47cd7cfdcef..0b3ac4e60a3 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -132,6 +132,7 @@ static vaddr mips_cpu_get_pc(CPUState *cs) return cpu->env.active_tc.PC; } +#if !defined(CONFIG_USER_ONLY) static bool mips_cpu_has_work(CPUState *cs) { CPUMIPSState *env = cpu_env(cs); @@ -177,6 +178,7 @@ static bool mips_cpu_has_work(CPUState *cs) } return has_work; } +#endif /* !CONFIG_USER_ONLY */ static int mips_cpu_mmu_index(CPUState *cs, bool ifunc) { @@ -534,6 +536,7 @@ static ObjectClass *mips_cpu_class_by_name(const char *cpu_model) #include "hw/core/sysemu-cpu-ops.h" static const struct SysemuCPUOps mips_sysemu_ops = { + .has_work = mips_cpu_has_work, .get_phys_page_debug = mips_cpu_get_phys_page_debug, .legacy_vmsd = &vmstate_mips_cpu, }; @@ -577,7 +580,6 @@ static void mips_cpu_class_init(ObjectClass *c, void *data) &mcc->parent_phases); cc->class_by_name = mips_cpu_class_by_name; - cc->has_work = mips_cpu_has_work; cc->mmu_index = mips_cpu_mmu_index; cc->dump_state = mips_cpu_dump_state; cc->set_pc = mips_cpu_set_pc;