From patchwork Sat Jan 25 17:01:02 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: 13950446 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 96CA6C0218C for ; Sat, 25 Jan 2025 17:02:40 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbjXl-00071L-OK; Sat, 25 Jan 2025 12:02:02 -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 1tbjXN-0006SM-B9 for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:01:47 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tbjXJ-0000Ny-VH for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:01:36 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-436202dd7f6so35237635e9.0 for ; Sat, 25 Jan 2025 09:01:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737824492; x=1738429292; 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=pJfpeIGSlIY2S2DSWTPOeODntCTV2idscj4/VsOkESE=; b=RutOTLh0DLQbhpzYUyhEN5Lb7Tv+DgtEGwJTX7fw/jVQ0ASnm+z9ZyEfItl/ncJFxt nhgZXUAjkSPnA4bGRL9lEjlZ3E5ZhmEP7G9U2TYhuvqYsIQyPd3RuH3EyNFkago9fpB3 l2BPEw4YCAVlldS1jxyM70U3JITshyVxXk7DYUd+cMe0/OLqVLaMevVeh11maoNlqM4V DeNaJ86LGaHh4ZY3hhKw4oFOu2TwlQtf5YL4lgj8XkbdhT9vy6WGRRNCzW5ApT+5N5My UXqBuBAxHJ91igtWqZL64MQPYf4WeAaIGRfnNsW1n23I9jKMnC4QUhF2DZZsnAt427t7 6znQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737824492; x=1738429292; 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=pJfpeIGSlIY2S2DSWTPOeODntCTV2idscj4/VsOkESE=; b=m5u5RZkGSBw47eXGChQ0+GsP21RvC5hyaVoB+/jAvAL9yw51BZrSXXzH4Rbm0Go7xP pmIKYrqEuvYlnp/zygPUmdFGwpU28PKdF/ebXjf1aRXPOM9Gx6yll1lQycUSPnVmwzTS 6eerS7PAqvEa8St2cvnHJxDq34Z8CZXX2BvrGIU5w306hs7w1vphVANA7J51VUPB7yOi SKd0kRZVfNjy9ZczaH5oZVX7S4PU5FwELcCeD/gQ5fISAomZ3byN5R5GIXPMS7WKOTHQ pcM5hCODwf9eKBt46UjsOyHESHn1DVy/M25qW9tj+q2wBgM/SCSX14K0r56vpAU8czyI dpJA== X-Gm-Message-State: AOJu0YxAxRnYo82f9QhdbVYFcRDHzXZOnW0yN/bWVIXIWUR7iNfRtkjB wdy9rJbh8FAtiQczd2D48UJUA1eDKL/Cu1GJEJ8iJBFY7/Fu3PRMr0pqKx1r/kpaq8bU6CsUIdq otcs= X-Gm-Gg: ASbGnctZI8eHmljM8qaX4UTWalljbzbw3SjxnHp9cGkx3+c5xmNTpAK6Jpg3gRE6trq G91C9wRog//vvqVrJtXHpxnztl+IjZ833QfJauy/mUhF0HJkeVHNlzRtPpR/GKjmrslsEt+OHPl 8ssZK+9+Uau4diA+6t5mekXH7BrqcZv19jlTA+dZp0Lgm1jyXO075ZVK9sWY86icQQSgj20XJlB KqxeD4pzRLk0inEVG1WDsJw9g29qeIxGb0Rukfe0lwtb54faS+SYwkINGNfgj8vFR+4fIbmW2P1 rsbO92evM75xnkCUDLZv2KHo3KJMTWg+V7QkN+TuFOtb5RN9Lbvyc98= X-Google-Smtp-Source: AGHT+IEfZJDGMx6G0H3MwsVALGREhLxo5cSNDsxjeFy5MWU+eTJw2nySolKWIiDgGNRIM59db6gZEw== X-Received: by 2002:a5d:6d02:0:b0:385:e1a8:e28e with SMTP id ffacd0b85a97d-38bf56555a0mr33108088f8f.10.1737824491984; Sat, 25 Jan 2025 09:01:31 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a176449sm6084870f8f.11.2025.01.25.09.01.31 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 09:01:31 -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 v3 01/24] cpus: Restrict cpu_has_work() to system emulation Date: Sat, 25 Jan 2025 18:01:02 +0100 Message-ID: <20250125170125.32855-2-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125170125.32855-1-philmd@linaro.org> References: <20250125170125.32855-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org This method is not used on user emulation, because there is always work to do there. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- include/hw/core/cpu.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 2402706c7d9..e094d54949d 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -748,6 +748,20 @@ int cpu_asidx_from_attrs(CPUState *cpu, MemTxAttrs attrs); */ bool cpu_virtio_is_big_endian(CPUState *cpu); +/** + * cpu_has_work: + * @cpu: The vCPU to check. + * + * Checks whether the CPU has work to do. + * + * Returns: %true if the CPU has work, %false otherwise. + */ +static inline bool cpu_has_work(CPUState *cpu) +{ + g_assert(cpu->cc->has_work); + return cpu->cc->has_work(cpu); +} + #endif /* CONFIG_USER_ONLY */ /** @@ -814,20 +828,6 @@ CPUState *cpu_create(const char *typename); */ const char *parse_cpu_option(const char *cpu_option); -/** - * cpu_has_work: - * @cpu: The vCPU to check. - * - * Checks whether the CPU has work to do. - * - * Returns: %true if the CPU has work, %false otherwise. - */ -static inline bool cpu_has_work(CPUState *cpu) -{ - g_assert(cpu->cc->has_work); - return cpu->cc->has_work(cpu); -} - /** * qemu_cpu_is_self: * @cpu: The vCPU to check against. From patchwork Sat Jan 25 17:01:03 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: 13950445 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3F5B1C0218D for ; Sat, 25 Jan 2025 17:02:27 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbjXq-0007Dn-Fz; Sat, 25 Jan 2025 12:02:06 -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 1tbjXR-0006Wd-8z for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:01:50 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tbjXP-0000ON-1O for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:01:40 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-4363dc916ceso26616915e9.0 for ; Sat, 25 Jan 2025 09:01:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737824496; x=1738429296; 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=LnxgPJtNl18qpQlYyJcdV2Lpgdr/I3RQhGnRLNDQ94c=; b=kRgZgjHvtEew7p+tTewGTgswcNCdsZ7DDZ88hrqehDn5/NKf+pR4V1lrjg3F2+6L1e qmdlCrXAbHJOQ8QDq7aDRmJjsyH87dxYjUbsWqMaM8tMIhe0px7wLpf23lR/FiJHdaUL pgYlg8Uh7wXsmoYHH6P2FLN9IdTQmFH4Ej6r9ZgBWUYAMk4cNiBPsjccufRgIQuzF1JS RzfSGGj0ZNSf1doryLwXVMpOjcPLtSgobh3L2GSgSLBxCm1750fT/120ITKx89ATiEYj qOspQGwTabZfgCmEZqKc3FJOpnRyVe8tNkJnjvyDHsVZ5KFNNsGNVrxiiInkGgRhIj7n CyWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737824496; x=1738429296; 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=LnxgPJtNl18qpQlYyJcdV2Lpgdr/I3RQhGnRLNDQ94c=; b=h751+q63hbtt3FZzDteGBW9um6SuyZB575GeAfMss/NHEG5A2/e1XW+NN/+xbtvpYN d5XHO2ipCuuC5u9/Se8zGYrWwSXs4VYQvlP8ZM5MS44ZSq1qnMuM6ko2u1nlLybY6Dfg URCPdR0FE92ErJYCgfZB15dGh1UCU9WwTvGpoRRA9SoLc81no9X5jVwC/jG1JPYapwVC paqaYWBGdL0/YCBkz3moVI4vWO1oTUdEIOFBx+M4CoJxiuMWmWe+mqFhV8BUjfZhYP4E qsfHCkmJYGBTD1KvldunTKiSuOA9pmPbWAm8D/81aCsnuVvZHHf6bK1XAV6omYIRE53n fORA== X-Gm-Message-State: AOJu0Yy0B8oAnnSLYS59mi7ahSr9/j0Nk7Erfa8m1OEZUznk5v+daTr3 LknuUju8tZSeCzpvOfyAvsSPyOBKb/6vlLDz2gjDexTkGCDCSSUw8SEp3SnU7A97vl85QGkksDS d9mE= X-Gm-Gg: ASbGncuyS3v9yyfU/N7JDsliZKpK5qbNJHVQO3s0lFA43PODMiqr1Ub0mr3wHiiCSRn KdpQ+fSPTBnyTrG6myKhPqo0G36eWLBdY6ucU8HssRbgbYDOVEFjWPoI2CfgoiOpI4CTHtAzAKC AMklwx4oGWXPSLo5vtkYqPqTHx5porkI+XrpMyaNoii+aUa33PzVze8Q2iTiYbWqH1pErniV0ZG sHty2C84oqGCRjau4SicB4SpgA/5FhpV1o2R5SfhPI2Z/YBrgDybeMyc1kgnmSF1lOBYNwk/xh5 D6uJkU5bE2+RZyD1d5iemyGlnXIoMH+5iSZg6wkEmnkN8ejXeAq4uWY= X-Google-Smtp-Source: AGHT+IHUAV52JwynhHZ5iI+rOgEvQ4xiYVjH9kn4AGAOOFjcbEPm1XRxlsPqo5KMWkWthDF2yxdypg== X-Received: by 2002:a05:600c:1c14:b0:434:fddf:5c06 with SMTP id 5b1f17b1804b1-438b8841d5amr105040825e9.1.1737824496440; Sat, 25 Jan 2025 09:01:36 -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-438bd4d2c0esm66485425e9.33.2025.01.25.09.01.35 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 09:01:36 -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 v3 02/24] cpus: Un-inline cpu_has_work() Date: Sat, 25 Jan 2025 18:01:03 +0100 Message-ID: <20250125170125.32855-3-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125170125.32855-1-philmd@linaro.org> References: <20250125170125.32855-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org In order to expand cpu_has_work(), un-inline it. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- include/hw/core/cpu.h | 6 +----- hw/core/cpu-system.c | 6 ++++++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index e094d54949d..d64c823e768 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -756,11 +756,7 @@ bool cpu_virtio_is_big_endian(CPUState *cpu); * * Returns: %true if the CPU has work, %false otherwise. */ -static inline bool cpu_has_work(CPUState *cpu) -{ - g_assert(cpu->cc->has_work); - return cpu->cc->has_work(cpu); -} +bool cpu_has_work(CPUState *cpu); #endif /* CONFIG_USER_ONLY */ diff --git a/hw/core/cpu-system.c b/hw/core/cpu-system.c index 37d54d04bf8..16d5efee12d 100644 --- a/hw/core/cpu-system.c +++ b/hw/core/cpu-system.c @@ -23,6 +23,12 @@ #include "exec/tswap.h" #include "hw/core/sysemu-cpu-ops.h" +bool cpu_has_work(CPUState *cpu) +{ + g_assert(cpu->cc->has_work); + return cpu->cc->has_work(cpu); +} + bool cpu_paging_enabled(const CPUState *cpu) { if (cpu->cc->sysemu_ops->get_paging_enabled) { From patchwork Sat Jan 25 17:01:04 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: 13950461 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DBD53C0218D for ; Sat, 25 Jan 2025 17:05:57 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbjXn-00078O-Q9; Sat, 25 Jan 2025 12:02:04 -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 1tbjXU-0006Xn-Fn for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:01:50 -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 1tbjXS-0000P0-Sb for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:01:44 -0500 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-38a25d4b9d4so1671438f8f.0 for ; Sat, 25 Jan 2025 09:01:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737824501; x=1738429301; 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=1YoTq/Kw8BFNJbd5udCtM6rehNhaZvqVSckhQj9fm84=; b=wZy8Owq52mP0TKE0CQlGHjgpraJ2htcoHyJPzXOfMa0W0zyRRN4pxX/NAVDsdeMJ56 0JIH5aMiRyNjH9EU1CsjwdFuEcQuQ4w17wSM49S3IcbLkhd8jxKuv7t0yDDLJB3PCpmP 2EEaU8TXlpfMm/DKbRat7tXra2HWpWZjeiWgW6mt2kFZexBAiBh7F6JjO9kz+rEykTX8 6sNjs0y7ECLV/Ak9paw9FFpvq6iC2g0otCszUVNIav/6pMCiMyLyCCaBOzRgnPF3G6al M5JR3Xv0Hwtn5JrGOBLL+cltH0keQnyh9t936gWbL68KJb8yDBsv9xdzrvDCMLQGz8sM 8VkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737824501; x=1738429301; 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=1YoTq/Kw8BFNJbd5udCtM6rehNhaZvqVSckhQj9fm84=; b=mpfTJ/rNl21/V5rU1ZPvPfoaVrHcK2JEScIKJwWYbkwWQk6S60fJSq7T/vA2vpKF8u DXf0pygaV9HNcJ+fJfEcgI9LTkrUV1OLUdZZ/fBG+9xLqQKh7Scba7dxz+Zg6Afma3eV 1wf7D/IF9WWWeFfuZ/BwHi09T7dDmN3cm2DyhXocr/Xvjf3Vzo4DPQhMZoIJdVq6QF9t dSVToCOkGEhPJZSxv70hkIa3JPTmx7iBGebJMysit9TKtvk/ZJ1pCkR3HvvzqJJ539+q 7pTK8T6fsKpdVxFnhHHclGL3kXTqnhlHFVU8wisElX74gTF/a7E4NitAYjRdkDFP2V0R Z1zg== X-Gm-Message-State: AOJu0YxHCCmd79L4KylI6xDDSY/Jmuunim/Ty22rIyGw/Of6y03Uk9dk kYrp+UkluKVVhfd9rLL8G/ZvtIl1r8iN5rXCVN8hHQWxCHrU5AlwdKVoHZcxUdgk38iPBRn9zXg URug= X-Gm-Gg: ASbGncslgkijGVYcEb2AedeSLqx30a/fvRLG4fZQvw7HHmoxxvPtCufRBLv1b6/05CX uCPwmefqQ612QHf39r83R3hFNf2wi8b0QWeU1x5imIiW6LScWJDYnzuQDVSRRzyw8LzE2OfnslT YBZUHVJbyfe6D0Ys+QI7fRfA7ZHH7NNsElx4XVSOcLsaecCS8iYIpI7MNz7M26HBSsJyrCXCWmG gJy9JIML298eUYFxfO78J/1pPozZl2e1ty0VrNPnJsGJhYNfTmWNvsgmeOW/SnnwfH0Tf09Tzwt k+Rh73vJm5R2Lzl8bX10jsBhtkDxIiHq+8tXuZxy8HTvZZxDT0IOiac= X-Google-Smtp-Source: AGHT+IEWxtSw0zE9JkzzSMQx9HpaTSX6TtJa/alKuGXiX88iK3wWmB/adB9VTe3FozpMVzw4g+eGKw== X-Received: by 2002:a05:6000:1faa:b0:386:1cd3:8a0e with SMTP id ffacd0b85a97d-38bf57c034emr37672164f8f.48.1737824500973; Sat, 25 Jan 2025 09:01:40 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a1bad92sm5991266f8f.61.2025.01.25.09.01.40 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 09:01:40 -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 v3 03/24] cpus: Introduce SysemuCPUOps::has_work() handler Date: Sat, 25 Jan 2025 18:01:04 +0100 Message-ID: <20250125170125.32855-4-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125170125.32855-1-philmd@linaro.org> References: <20250125170125.32855-1-philmd@linaro.org> MIME-Version: 1.0 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, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org SysemuCPUOps::has_work() is similar to CPUClass::has_work(), but only exposed on system emulation. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- include/hw/core/sysemu-cpu-ops.h | 4 ++++ include/hw/core/tcg-cpu-ops.h | 2 +- hw/core/cpu-system.c | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/hw/core/sysemu-cpu-ops.h b/include/hw/core/sysemu-cpu-ops.h index 0df5b058f50..dee8a62ca98 100644 --- a/include/hw/core/sysemu-cpu-ops.h +++ b/include/hw/core/sysemu-cpu-ops.h @@ -16,6 +16,10 @@ * struct SysemuCPUOps: System operations specific to a CPU class */ typedef struct SysemuCPUOps { + /** + * @has_work: Callback for checking if there is work to do. + */ + bool (*has_work)(CPUState *cpu); /** * @get_memory_mapping: Callback for obtaining the memory mappings. */ diff --git a/include/hw/core/tcg-cpu-ops.h b/include/hw/core/tcg-cpu-ops.h index 2e3f1690f12..f60e5303f21 100644 --- a/include/hw/core/tcg-cpu-ops.h +++ b/include/hw/core/tcg-cpu-ops.h @@ -141,7 +141,7 @@ struct TCGCPUOps { * * This method must be provided. If the target does not need to * do anything special for halt, the same function used for its - * CPUClass::has_work method can be used here, as they have the + * SysemuCPUOps::has_work method can be used here, as they have the * same function signature. */ bool (*cpu_exec_halt)(CPUState *cpu); diff --git a/hw/core/cpu-system.c b/hw/core/cpu-system.c index 16d5efee12d..7b16bda2250 100644 --- a/hw/core/cpu-system.c +++ b/hw/core/cpu-system.c @@ -25,6 +25,10 @@ bool cpu_has_work(CPUState *cpu) { + if (cpu->cc->sysemu_ops->has_work) { + return cpu->cc->sysemu_ops->has_work(cpu); + } + g_assert(cpu->cc->has_work); return cpu->cc->has_work(cpu); } From patchwork Sat Jan 25 17:01:05 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: 13950459 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4B099C0218C for ; Sat, 25 Jan 2025 17:05:42 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbjXn-00078K-Ow; Sat, 25 Jan 2025 12:02:04 -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 1tbjXY-0006aQ-Py for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:01:50 -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 1tbjXX-0000PQ-Ar for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:01:48 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-4361c705434so21793705e9.3 for ; Sat, 25 Jan 2025 09:01:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737824505; x=1738429305; 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=hPivNFM2ePYvU+OXN+1pyPQF43zn33Cj2yHAkQlRhv0=; b=VE034kJuU0KdJi/HKmm9P9Nvz5C/Pz8cX2DZQ3gwQxu/VM2aA20Bjoikf7BHveQGF6 0tXPuA7KbZxTA4i8uV4m9rTEGkzFhPnleaI6w+4q1fJVA9pGCsP12qAD/Rx9TwMsZWpL ab37T+FAlycV6rC2uPuwb3JevjNt8MCOzPvrjyiPldg7ZpJbO2DD/lIx3o3JkmtnWl5N nmpipy9evYNaP/QYuO8rXnDL5/eAJgmjZoQzsqQCrzEu7JfJE5hCJyk37tc8aPlE2662 6vb/1Of9zMMmxONu9T81fqJa0m7yofb6VBbKuXh0VzsfcTomumPcEVvdAzqn3Gg4njdg LOYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737824505; x=1738429305; 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=hPivNFM2ePYvU+OXN+1pyPQF43zn33Cj2yHAkQlRhv0=; b=mkVa1D5gw+tPlwRtxxfMhef+v79VDYbokmYxUtL+XkyXcXDkfaC19++PeisqDUMxHn rkl0x4vcXKt1XfYKt+KN/tdUA83QP8eNccprAtCzjNzS90OMMBa3LS++qxw2KzKV6Zn3 U5xU3mjwAG/ls8PGfgzTG3H/KVIBlfEQHarofYJN+/6TBV9Hp3wNoTxZmxq4yvqncKah BpBhgLb3rLBP9isQwoqSFcoFX0yKspFkpxdTLzUJJg15QroVGoAJOwdCRsswWOaLDbMW nShqHgUEzMoN+XTfcuhcGO9wfqxGmD0hm6/SmVSru5AmklKrFT0WjF9OaV6KAXX3btkd vsxQ== X-Gm-Message-State: AOJu0YxXeF0H/37hhPSktJjDrxtKTE/3RV/Xr2V1yfh1vdbPFcvHaWQN X1VyDCTAiXZ/ua1oLC47Fxr3V89KZucLY8fDh2FTMyYGm7lHFley5RIQISFL9TCifze44pcwd13 oWZE= X-Gm-Gg: ASbGncvkUDVhHA+XFPrFPS/8tQ8xrVHM36d/vOqGuWHRiFP5l3nYhETCGBToxuE/UpK S5Ju3z9nU/K9nssGweKEisN6hZbQpfq0IwMM6HZXtIZgbFi7K3yjir2Pnzfntz4zEMQI6t/2yci bCIv9EgVyGacNdB1m8Vzw/M2RrHs4otABe0cA/6j1lb55axfLUfBdwpeBLPBrRrjyi+nZSyt3IB lTRnk77wZ8HvsQIJNXBK0wWxey/iNd0lQ8q47Izib23XCJE5ymV7c+MuDPhTy8JnUbXLEQdl8zE bn3JQ/I1Z/WX0HedCMaw3ASk6X9qThVTbHsviT1FOHgxKy7HE3dlwYA= X-Google-Smtp-Source: AGHT+IFnoYc3M2vSnDVe+amJ0biKu7BVS/elw5Q0ZlX1hddE/60yvPS6YumrP7Uz7KT1dh8aCzzWuw== X-Received: by 2002:a05:600c:4511:b0:434:f871:1b96 with SMTP id 5b1f17b1804b1-438914388e5mr359128085e9.29.1737824505505; Sat, 25 Jan 2025 09:01:45 -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-438bd4fa57csm69991295e9.4.2025.01.25.09.01.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 09:01:45 -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 v3 04/24] target/alpha: Move has_work() from CPUClass to SysemuCPUOps Date: Sat, 25 Jan 2025 18:01:05 +0100 Message-ID: <20250125170125.32855-5-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125170125.32855-1-philmd@linaro.org> References: <20250125170125.32855-1-philmd@linaro.org> MIME-Version: 1.0 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, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- target/alpha/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c index e1b898e5755..83164a694d8 100644 --- a/target/alpha/cpu.c +++ b/target/alpha/cpu.c @@ -63,6 +63,7 @@ static void alpha_restore_state_to_opc(CPUState *cs, } } +#ifndef CONFIG_USER_ONLY static bool alpha_cpu_has_work(CPUState *cs) { /* Here we are checking to see if the CPU should wake up from HALT. @@ -77,6 +78,7 @@ static bool alpha_cpu_has_work(CPUState *cs) | CPU_INTERRUPT_SMP | CPU_INTERRUPT_MCHK); } +#endif /* !CONFIG_USER_ONLY */ static int alpha_cpu_mmu_index(CPUState *cs, bool ifetch) { @@ -216,6 +218,7 @@ static void alpha_cpu_initfn(Object *obj) #include "hw/core/sysemu-cpu-ops.h" static const struct SysemuCPUOps alpha_sysemu_ops = { + .has_work = alpha_cpu_has_work, .get_phys_page_debug = alpha_cpu_get_phys_page_debug, }; #endif @@ -251,7 +254,6 @@ static void alpha_cpu_class_init(ObjectClass *oc, void *data) &acc->parent_realize); cc->class_by_name = alpha_cpu_class_by_name; - cc->has_work = alpha_cpu_has_work; cc->mmu_index = alpha_cpu_mmu_index; cc->dump_state = alpha_cpu_dump_state; cc->set_pc = alpha_cpu_set_pc; From patchwork Sat Jan 25 17:01:06 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: 13950449 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DBBF2C0218E for ; Sat, 25 Jan 2025 17:03:18 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbjY0-0007IZ-NK; Sat, 25 Jan 2025 12:02:18 -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 1tbjXe-0006d8-0K for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:01:55 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tbjXc-0000Pu-HO for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:01:53 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-43618283d48so21877245e9.1 for ; Sat, 25 Jan 2025 09:01:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737824511; x=1738429311; 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=hlhipGgHKI5N0qn8K1o15KvLAOg1D9rjFfwCNaRH9Tg=; b=hr6Rz8tuLVfDG6ZpyODy2j9ESmVfLqT0yKiFjTLLPgFXC9rTnH5x/GRmOkIVhKfQuB fK0e1TiskP+AofQbitYIp8m5wti7ouMpzVup+fGs4RDsOMayB0nuPWMSuccgBZAAmlbM Ln4QnHIF1nlzU8VHETvGERLOwxzDobK4ixgGJS3g6k1iqocOOheGy7IUvK5cutsEnU7p Zv1J/bld+dwV28tY3sYj8pxgWtklGkD5XbBoNDmXp4jmRyYOfj9qSJzXXq1592I/Acsh rgYM3NqhDVMmkByt9JoPGqj5KQuWzF7P7rXLX951fGByperJ+OA49iW6Lne4eK9M1EGY Bq1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737824511; x=1738429311; 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=hlhipGgHKI5N0qn8K1o15KvLAOg1D9rjFfwCNaRH9Tg=; b=eILC25rWmviawmfmMQvQ0bnPS2XfoqOcKPjDnFmo0jZODrcM1j5v80dwohg2Oiv0+J kei+LXWNyzM2/3GFSYpZauW381q35uQaVLCaxEhJ0CoduPUpNa8FQ3PdwTRzw0J+f+if 52W3dnilbbC6KuPLp18uDB8wVFmzRNXQdn+PRvi4FHLp17nQXcD5z+PBi7AqmdU7/izu Z9sN69vEdRt9peFRK5P0ERHh9NVxIWsd2obM1madLRLRTe76XjOg2UyIYiLYO1F3Wv2U WqHdLDy6uHnW0WfZXJQUvPM3KC3HKaruJiEVvg4A2UuIDGwSbw2LSYmSjNrS9ynG6dq9 vE4g== X-Gm-Message-State: AOJu0YwzXkVOQkF48RvF15EyQ5SoYKvLM1hDGVg/0KdbdNBci0gxg/iy VjYG1YkVYsOQTSnCNXXE1lZHqjV3qz5vkY2vjyVj94rCcBDIft53bnmMph8d1yqtYtvuFurYTSL dFBw= X-Gm-Gg: ASbGncuugKBwugZdezrxwR5o739R1Auk3wfptA9P4CnpQvU+EdDnyXLzLkDbEzCWcBD wcLvuzMucLA4ZU4tVgyfLd0zI3o/INXPINho61lTMIbFC2EeuPkG1nToiLqiKlQzP3y5Nz78D4/ CDKjmG4WwuaSJTANdvH+Mo20+XXS03Ugirv6AQgOc41r7PJTp3VTLoFtHTLigXvUIlfBr795AP3 r7DDR0fHKxr+XhE5Vx4KFaX5+5Ny9h0/DLHXKel5bKQ6ixbUMEbO6yhEnbRfDkCeEAcJSxCHrtD 4B1nt4xArgyiVrEWIk+Y+deSOuOjBvnzXF3lC9sM/4gp9DxnwIGEj7Mu5g5FBnrf0w== X-Google-Smtp-Source: AGHT+IEf2NKsj8zOnsCZFWI37fq2kOCafRzQbgx+Nuf5k0Cmo2DUwWLvcs8jsT47wYuAkXvvmwDlmQ== X-Received: by 2002:a05:600c:384a:b0:431:6153:a258 with SMTP id 5b1f17b1804b1-438913db2c3mr342701525e9.13.1737824510730; Sat, 25 Jan 2025 09:01:50 -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-438bd502007sm66229665e9.14.2025.01.25.09.01.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 09:01:50 -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 v3 05/24] target/arm: Move has_work() from CPUClass to SysemuCPUOps Date: Sat, 25 Jan 2025 18:01:06 +0100 Message-ID: <20250125170125.32855-6-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125170125.32855-1-philmd@linaro.org> References: <20250125170125.32855-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- target/arm/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 048b825a006..322c95038d5 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -123,6 +123,7 @@ void arm_restore_state_to_opc(CPUState *cs, } #endif /* CONFIG_TCG */ +#ifndef CONFIG_USER_ONLY /* * With SCTLR_ELx.NMI == 0, IRQ with Superpriority is masked identically with * IRQ without Superpriority. Moreover, if the GIC is configured so that @@ -141,6 +142,7 @@ static bool arm_cpu_has_work(CPUState *cs) | CPU_INTERRUPT_VFIQ | CPU_INTERRUPT_VIRQ | CPU_INTERRUPT_VSERR | CPU_INTERRUPT_EXITTB); } +#endif /* !CONFIG_USER_ONLY */ static int arm_cpu_mmu_index(CPUState *cs, bool ifetch) { @@ -2671,6 +2673,7 @@ static const gchar *arm_gdb_arch_name(CPUState *cs) #include "hw/core/sysemu-cpu-ops.h" static const struct SysemuCPUOps arm_sysemu_ops = { + .has_work = arm_cpu_has_work, .get_phys_page_attrs_debug = arm_cpu_get_phys_page_attrs_debug, .asidx_from_attrs = arm_asidx_from_attrs, .write_elf32_note = arm_cpu_write_elf32_note, @@ -2721,7 +2724,6 @@ static void arm_cpu_class_init(ObjectClass *oc, void *data) &acc->parent_phases); cc->class_by_name = arm_cpu_class_by_name; - cc->has_work = arm_cpu_has_work; cc->mmu_index = arm_cpu_mmu_index; cc->dump_state = arm_cpu_dump_state; cc->set_pc = arm_cpu_set_pc; From patchwork Sat Jan 25 17:01:07 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: 13950465 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 863E2C0218C for ; Sat, 25 Jan 2025 17:07:29 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbjYD-0007co-D0; Sat, 25 Jan 2025 12:02:29 -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 1tbjXj-0006pJ-Jl for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:01:59 -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 1tbjXi-0000Qg-18 for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:01:59 -0500 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-38a88ba968aso3056584f8f.3 for ; Sat, 25 Jan 2025 09:01:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737824516; x=1738429316; 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=7GbKJhiOZPCKm4Y+qVPyi/qaA7c9EbLbN3OgEPNHS5s=; b=e1Tc8tNoOTeCnd/u9/HFJDTsybTDnHn/yyGJbMHwFb+lNdKPUKWcAC3bCvfuoxldZ4 aJiZK3JaLwFDBu8McLN/YsJAhFV/HM8OTZPa7h4ZsOvvxPUned4IF56KD3YMRwTIObk/ R3O/cvPHPE8x1znH5BN/TY69luo2/rt7+wtot+ues91YaUKUitFnMguJ9mR7UdsNEl6H Uey+ehrV9O8nG1me9bZvBBKRza8uBFkB0xUiAVdWR4Dejg7Sd5PtFLR+3P64O4nbHNWY T86fpKADdcGUCIWI+7KbpJQSfNL3ETtkYrlxuU1z1dMKdqHGQqOAvFM2qmqh83pObdQ+ 8X9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737824516; x=1738429316; 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=7GbKJhiOZPCKm4Y+qVPyi/qaA7c9EbLbN3OgEPNHS5s=; b=vEU+Nkp0vSKL8wfpBWT1R4pmelq5dxpZO2MTpih01hfA/5UYW+Son9GQbGRFA52vTd VufKXXmvi5FKEZ9pdknR+jY/Sjbxow/fEfYB0nUZNRAYCWxuJoBwZl9rWNIN4ZPz1gH5 c78t7ZYpNS1bWse3PLPxJp3lsnr3HjAMVbx9pLXvVuFsH8wCAAu3n3gUfqqD5NQ+Ku+A fZ2ssbicnnz2Ot4DJMKftpFjkiWnI11MxYuw444Vz09NCZx34RNk1p7w62lmMD7ddL+r 3gj82Mg/g0Si8QWzTJfolbjWhRQopQT8qqlAs2dW4nfEUdEUPxma+gKmOrFwppkhLID/ bZ4w== X-Gm-Message-State: AOJu0YwZSQzw7ddukdE1rG87iUn2bjXeRusDnrv0RrpLw2NY5YL/2RXN Sw2/Mhu6tRGco09iECs/QEB1OmRgzOfR2Ck3h+rH2kjiwOHN9HYTBaH2ByygV91EuUrvP2/u1Nt NlrM= X-Gm-Gg: ASbGncuNQldbt1YhZ9Bd96kn40vTPl7uY5GAo8QUracxXvECFq/cBMzlNg0ZhafoZ2o Aj0EPxrxRSDftn3I/B5jQnq/RYon7/DUwdUkM7Rla19ALXl8YxP0gZq4RXNegK6/cDJ8hvkXwGI XBMf217ZfFB8FJ8qknyfwcPlJCgDukWSKETIHEF8CjZTkwZW4wRygnmCM2w1k+u36aVzGGEE07+ lesbn+3pXbHs96Y/QaQ2UWGvkHIa16fGCm9xdC6zFqLfDDBlLNFWW0jBZGpqOPkOgVBduZvmxMM nsxK5+N95+cGnlbmCGKKakdLHq/6YMkjQq+xHZGIW8iJPH2eZM+Pj1g= X-Google-Smtp-Source: AGHT+IFI1/dNfB2zz/1zhMIHM17h8eY3fXVfhA6e4qvV60L9QiB5SP9SZb5JpvoG5y/U4mB7x3rgAA== X-Received: by 2002:a5d:6d0c:0:b0:385:e88a:7037 with SMTP id ffacd0b85a97d-38bf564966fmr33455673f8f.6.1737824516047; Sat, 25 Jan 2025 09:01:56 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a188d5dsm6196482f8f.55.2025.01.25.09.01.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 09:01:54 -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 v3 06/24] target/avr: Move has_work() from CPUClass to SysemuCPUOps Date: Sat, 25 Jan 2025 18:01:07 +0100 Message-ID: <20250125170125.32855-7-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125170125.32855-1-philmd@linaro.org> References: <20250125170125.32855-1-philmd@linaro.org> MIME-Version: 1.0 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, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- target/avr/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/avr/cpu.c b/target/avr/cpu.c index 8a126ff3222..8712813f3e2 100644 --- a/target/avr/cpu.c +++ b/target/avr/cpu.c @@ -200,6 +200,7 @@ static void avr_cpu_dump_state(CPUState *cs, FILE *f, int flags) #include "hw/core/sysemu-cpu-ops.h" static const struct SysemuCPUOps avr_sysemu_ops = { + .has_work = avr_cpu_has_work, .get_phys_page_debug = avr_cpu_get_phys_page_debug, }; @@ -232,7 +233,6 @@ static void avr_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = avr_cpu_class_by_name; - cc->has_work = avr_cpu_has_work; cc->mmu_index = avr_cpu_mmu_index; cc->dump_state = avr_cpu_dump_state; cc->set_pc = avr_cpu_set_pc; From patchwork Sat Jan 25 17:01:08 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: 13950453 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 25EC0C0218C for ; Sat, 25 Jan 2025 17:04:38 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbjYH-0007lm-AA; Sat, 25 Jan 2025 12:02:33 -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 1tbjXo-0007BC-Im for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:02:04 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tbjXn-0000S0-2e for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:02:04 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-436345cc17bso21975075e9.0 for ; Sat, 25 Jan 2025 09:02:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737824521; x=1738429321; 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=OeHo9c/VM1KSl2EsYkHb7Xalf2iVdr+8YiL4SXj3SsQ=; b=VFmYUg38jmF1TBUogO9Xxe/A4h3xM4IWJXlSsauLI2mOg04DA9jhLPA0LeDDArj/sJ EPLyJUar/HsmYBmb2BUHDC+1iu5/esXMNottn6bVNAkAARTIuEu8CStkb1C3TkInoiw+ OUGzW8cbgTVQI2CzPXu6W8sRy+o81Qp3z8bwtp3VuWs9EaF7xERaSPVW+/3VYglSseib WwFmHKlU6xcM9hQFNoljcQbz58RabZ2L/PEq5f8FNgphyffxtiH38g4dMYGHMgIQIQ0r 3+771QHNuXT+leNSxB5j6ykNVHEW4HtfZgmnCRcYwtODzEc7LGGDJpfE/T4ZkA5IgbAk eDhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737824521; x=1738429321; 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=OeHo9c/VM1KSl2EsYkHb7Xalf2iVdr+8YiL4SXj3SsQ=; b=RxsDpYG3ElvBuBIg/eh7lolUzWu0sm/TmuzBsURrcqcIPoB+MxwCQz+f9Max9ygAAi aOw1ZzZ3UBZU0Qyslh/xwV/LUNoBsSctJHnf5zr6dAWNT7ju84le0p1kB1Q8YrFK5/by L/TuMdEKMsK0Nf455t4ZW0N3QdccbSuGbzwJvxCJrH8Hybl/wAYYix64L9HPTxdTnfLs AvhgkqKZe3Nhqcwx7ypIcr7aA+zM+OduOZ3Blok6ISC1lc+I0csHJ7KkhkLZgQgA9oY2 2RHqG3MacQduZP+0nzvCqRd1+fweeUZOyr32z8g+EuODXe/ePiX0+fAEAjIzsGpt1FJV xZ4A== X-Gm-Message-State: AOJu0YzFtJWW7q3IhGDEgdYNYoRBREFkQa1KwKlMmgYZw4tw9ZnF1CCF JYx7bvci+vIWV7EEQYjOZKjjPOQIqvqsQ5WG5+K2gb+d+jNOeENQfNYJRBhjx2DmKpz5ateqJQA mqRE= X-Gm-Gg: ASbGncvKQUU2Q2yRb6HGD4Yl4bcbIp/YHcpbOJmmOIH3mMk05XZn9eKCQGyXNJj2jTu Uhj8rWoDBjtI0UZUtl/DF+NqaFIrGbQ/Wt/lhZ1Thsn0A8oQztF2RLSGgjDWSU/bF2RRe2GcFb7 rHxG90rR/EdaqXMCQY5XnvkLEQJfL9scllbRLhgf9NabEEwvZ0kTffvqyFCKQrwV6yLP7QWN5nN AaHrk0ztdehIu1PId/XP7tPJHtEspmmexzEjd2oKUZqY5U4P3sxjX9DxuPlxClGGGjBE3G0m9To c3lnUGQTDJC/S2gBQB6/HjAIRLqLzpPqbizCTzw0GBEIdf1Q9skEpEU= X-Google-Smtp-Source: AGHT+IGNU5OAXU7/y+YME9zagO14ZjDoMpuWCj1GmFsZ8mnfu8ywQLxH3/47Wa1FmMHzYn5nJxBfng== X-Received: by 2002:a05:600c:3593:b0:431:55c1:f440 with SMTP id 5b1f17b1804b1-4389144eea8mr387781635e9.30.1737824521412; Sat, 25 Jan 2025 09:02:01 -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-438b16ff48esm93486685e9.0.2025.01.25.09.01.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 09:02:00 -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?= , Brian Cain Subject: [PATCH v3 07/24] target/hexagon: Remove CPUClass:has_work() handler Date: Sat, 25 Jan 2025 18:01:08 +0100 Message-ID: <20250125170125.32855-8-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125170125.32855-1-philmd@linaro.org> References: <20250125170125.32855-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Remove as unreachable code. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Brian Cain --- target/hexagon/cpu.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/target/hexagon/cpu.c b/target/hexagon/cpu.c index 0b7fc98f6ce..f77e305d611 100644 --- a/target/hexagon/cpu.c +++ b/target/hexagon/cpu.c @@ -262,11 +262,6 @@ static void hexagon_cpu_synchronize_from_tb(CPUState *cs, cpu_env(cs)->gpr[HEX_REG_PC] = tb->pc; } -static bool hexagon_cpu_has_work(CPUState *cs) -{ - return true; -} - static void hexagon_restore_state_to_opc(CPUState *cs, const TranslationBlock *tb, const uint64_t *data) @@ -345,7 +340,6 @@ static void hexagon_cpu_class_init(ObjectClass *c, void *data) &mcc->parent_phases); cc->class_by_name = hexagon_cpu_class_by_name; - cc->has_work = hexagon_cpu_has_work; cc->dump_state = hexagon_dump_state; cc->set_pc = hexagon_cpu_set_pc; cc->get_pc = hexagon_cpu_get_pc; From patchwork Sat Jan 25 17:01:09 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: 13950454 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8F135C0218F for ; Sat, 25 Jan 2025 17:04:38 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbjYD-0007dd-Dw; Sat, 25 Jan 2025 12:02:29 -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 1tbjXt-0007JP-HD for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:02:14 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tbjXs-0000T1-1i for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:02:09 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-43618283d48so21877965e9.1 for ; Sat, 25 Jan 2025 09:02:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737824526; x=1738429326; 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=QmGm+j3d/J7g6/EQrq3KxGWM+Wnw1Wpe1ViwwNVT0iA=; b=v/Zyj3jTbCsDKDzOfkzaoqUgRVOKkSLE6rmXrfJJBQYwZ9LfO2ZiLb0vRZoynvt7xZ ZtPiEkDi7g7zfRN6wRLAb8tkm+JP4cQY+X4BuVl26/F8UYJe5/O6d01VCPLEYAWmtzv2 JjiT9AE+WTSwI4hAY5OzoLac7vIvV5QIDbkpeBYQkjRpmMASOpBhyAC6kXuCjkqBsePn fXzTWRL3DdvR+FizQsIlWguU4lnl48PMiFdmO9sap2Jd09TYlQQkfpDf4co0PKMj/mmA YvUOBSzWrpDHStNHsTQLRyCtUs+1ptOzv0vTGG9GZ4urz9ZIFn7kwe0zrM6tvT0Wc8g0 uMeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737824526; x=1738429326; 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=QmGm+j3d/J7g6/EQrq3KxGWM+Wnw1Wpe1ViwwNVT0iA=; b=tqbCJASGiEkkm6D6dFjSXIkxRRBZ9nWC3P1cluA9gL8UiQhhbRStf2jkZjM/JEFtz2 Z51GDvBUZLeDsvZ7E2nXBQpJCc44TY6cFp/nHUl2A1BnY56Ls42eOHb4jfSWfqkHym44 hpzk1YI6xUWKLJU+py1kr0T+q+lFi4ahZ3pmZEC7peTrgymLvsV/MeYa6co90UauRM/o a4Iud+Y6A/yj7I3RRhvadjy6oURFsVL2iPVzAN3c2sJ86uVmymW7U6C+HZDqrRMtKldo e21VThACojbrSAIeBLQzMftuEjYxCcyxezI1zQVJeeiC7XQ7rGKIWhsrvVFkQx4scC/N 7MfA== X-Gm-Message-State: AOJu0Yy+ET/fOHktQbk+gr3bWKNI3SW7x37Pf+RuWGRTyBCOdw0pbSW/ jLF2eNLtfD29LRK45/aTW5pE5yQAf7DOVP+7ZMS21CoB+ipowas5+/jsRL/5AhX9952k3rvHxoD 29Ao= X-Gm-Gg: ASbGnctekY4S7tkrcUHD75QWthg0+2EY7wZ7HNAiGvSq4DOnCJq4EtquOqjs5sma6Mr YY9soQWagyJ0WB70p35etu62LsStFI3EEtOuiTWcwpzxe2tuwuI7uLz5rpduex+CNwB6VbE9I+y DP7EcgNRMmCF7QMdBhc6pJ8vG2jA5UhwEc0+5MQvSyHZfwSt4/Cj+UZfDlFrsejGAqi/6hSNABR f//Wq6VIf/f8u+RuF0NfvFJ/dq9jNLpE9tvJWRjfOuUKq1STY0bK9KPPvWZalxXEVi9K/yjEF6x pv6EKbemz2j539+x6EcLTfL3o4b/Qy6rfevz4y94uwJWrZeOu3dxPo4= X-Google-Smtp-Source: AGHT+IHBxqlKPDDteW7e3O5pf1RUK1zajnEWSfOy34V2nr0deHId3Zs3363xPjCKhXD0uoz14Pq3OQ== X-Received: by 2002:adf:f584:0:b0:38b:f3f4:57af with SMTP id ffacd0b85a97d-38bf57b4090mr31055140f8f.35.1737824526020; Sat, 25 Jan 2025 09:02:06 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a17d6e2sm5962579f8f.23.2025.01.25.09.02.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 09:02:05 -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 v3 08/24] target/hppa: Move has_work() from CPUClass to SysemuCPUOps Date: Sat, 25 Jan 2025 18:01:09 +0100 Message-ID: <20250125170125.32855-9-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125170125.32855-1-philmd@linaro.org> References: <20250125170125.32855-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- target/hppa/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index b0bc9d35e4c..d5a58a03cbb 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -125,10 +125,12 @@ static void hppa_restore_state_to_opc(CPUState *cs, env->psw_n = 0; } +#ifndef CONFIG_USER_ONLY static bool hppa_cpu_has_work(CPUState *cs) { return cs->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_NMI); } +#endif /* !CONFIG_USER_ONLY */ static int hppa_cpu_mmu_index(CPUState *cs, bool ifetch) { @@ -231,6 +233,7 @@ static ObjectClass *hppa_cpu_class_by_name(const char *cpu_model) #include "hw/core/sysemu-cpu-ops.h" static const struct SysemuCPUOps hppa_sysemu_ops = { + .has_work = hppa_cpu_has_work, .get_phys_page_debug = hppa_cpu_get_phys_page_debug, }; #endif @@ -267,7 +270,6 @@ static void hppa_cpu_class_init(ObjectClass *oc, void *data) &acc->parent_phases); cc->class_by_name = hppa_cpu_class_by_name; - cc->has_work = hppa_cpu_has_work; cc->mmu_index = hppa_cpu_mmu_index; cc->dump_state = hppa_cpu_dump_state; cc->set_pc = hppa_cpu_set_pc; From patchwork Sat Jan 25 17:01:10 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: 13950455 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4D259C0218C for ; Sat, 25 Jan 2025 17:05:06 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbjYF-0007jT-Bp; Sat, 25 Jan 2025 12:02:31 -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 1tbjXz-0007Ld-Ig for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:02:16 -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 1tbjXx-0000U8-VF for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:02:15 -0500 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-38634c35129so2799435f8f.3 for ; Sat, 25 Jan 2025 09:02:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737824532; x=1738429332; 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=SFxXNpC5yVfbLd+sXWLwj9ZcwKFDj0iGBJJhc1kZZeQ=; b=TKztmODiVcQDk0CNVWfLKxXA5jb137SdOmHrZduqjKQ5uO1BfmLylYj2nyPmSx7NgT /YIelJeW9B6NhEAFQ2wvbw/+P/fBNX+kXL/+S216Iuojo9QqsNTWZm9OPW3331Z36j6D dDvCdReirJzOBxEAqlaLqQz3VLgTVklDCDq73Cr6k4UZGBlCSFOt+IK289eebi0MMdIy 1xOipwsUeB6X/KKg3l/mKqY6gg90dzQhOnrtnR8dtMfVgV4faZ7T0U1e98df1x3VnihW o8ilsxNQwRRzFznl2QRGJ9bJqLe3jRrL0O0S466qJS5fJ4NQ6qbF2+ggxXIV8/pKrchR aTjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737824532; x=1738429332; 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=SFxXNpC5yVfbLd+sXWLwj9ZcwKFDj0iGBJJhc1kZZeQ=; b=kaBxfbKTrtBXmQZ1u82l3Rw8Gi4Vnprzg+GWuPLJg7HshcZyuhcXUq2cc2jFbdAayC D7zHO3nXrBlkJJjyRVkJ8DbG9qxd+6CzJ23Bi9Xp5bFzFax7ooVo2RLEnfIU7u/D78x8 2WzNwNvwfhN73Li8d+XJWmmsoqLIV/UX9/5KSmqeMUBblHCrz7AYX2QbEDzQV+pC6ugW hIvf0QZm4kEpIDyvT007BrrLrqjDl1pYs2DsjLITCk9JDGLwOT0xgk9NWRsmvVbH9Y/s cbxNJlUWvwiE/lLxRU5IyMM+cmsETTbDvZL+rF+LHA77Ar4bXpA9Q6XF5xynoj6LYzXl JSog== X-Gm-Message-State: AOJu0YwTt7gXXI3JeZtVGox9jcy/o7lLD4G8D98p7cgpJnTuz+zi4uwq xhL8MwLDyjCZtyu00dY6MCxZbJn4xSGd21CKRCGy2U9SWoL1FMz4BbFsnpiOg+pen38GrwEw94P INuQ= X-Gm-Gg: ASbGncsm88TTBm9TaBnlsWXpqv55uCuXxkcSw56g+mSiyM7pucyDOpiERWo9q45uzvJ ZFCm9c1i6vvl4JoXFPVPQWr0VXxm7t8mwrHcbZiMPqbOlX0zad0GDwFor27X+x8tqIwkC794aJY yj4oDhztvIVuGzxbAGrQwBt8DxvZrDC56RJJlr4IZ3H3XF5W3jRrXOn8udalzUrQN4PJZo+fQC6 kro5XpGLsVJO2g4BZPMenPkTAEOS1UKNoqNLc4Q+nj0fz+ZweuqJDPir/trjd99g6iuzyE8y/fr anN40tzRdKFAgCbOm8x9V5KtpjrQNKgaF88c7hLZNd+otnXnyLK24PI= X-Google-Smtp-Source: AGHT+IFFGkIfqh2cMcDbWztbBHQXitzwJE+gpZkJs7ecNISsRijiSGAOSTdd2+U0OL1Grz/3K2EarQ== X-Received: by 2002:a05:6000:156c:b0:385:eb85:f111 with SMTP id ffacd0b85a97d-38bf577f703mr38489428f8f.14.1737824530481; Sat, 25 Jan 2025 09:02:10 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a1bb057sm6050952f8f.62.2025.01.25.09.02.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 09:02:10 -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 v3 09/24] target/i386: Move has_work() from CPUClass to SysemuCPUOps Date: Sat, 25 Jan 2025 18:01:10 +0100 Message-ID: <20250125170125.32855-10-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125170125.32855-1-philmd@linaro.org> References: <20250125170125.32855-1-philmd@linaro.org> MIME-Version: 1.0 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, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Move has_work() from CPUClass to SysemuCPUOps, restrict x86_cpu_pending_interrupt() to system. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- target/i386/cpu.h | 4 ++-- target/i386/cpu.c | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/target/i386/cpu.h b/target/i386/cpu.h index b26e25ba15e..869b8598cd5 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -2289,8 +2289,6 @@ struct X86CPUClass { extern const VMStateDescription vmstate_x86_cpu; #endif -int x86_cpu_pending_interrupt(CPUState *cs, int interrupt_request); - int x86_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cpu, int cpuid, DumpState *s); int x86_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cpu, @@ -2313,6 +2311,8 @@ void x86_cpu_list(void); int cpu_x86_support_mca_broadcast(CPUX86State *env); #ifndef CONFIG_USER_ONLY +int x86_cpu_pending_interrupt(CPUState *cs, int interrupt_request); + hwaddr x86_cpu_get_phys_page_attrs_debug(CPUState *cpu, vaddr addr, MemTxAttrs *attrs); int cpu_get_pic_interrupt(CPUX86State *s); diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 1b9c11022c4..51faba4e0b4 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -8256,16 +8256,15 @@ static vaddr x86_cpu_get_pc(CPUState *cs) return cpu->env.eip + cpu->env.segs[R_CS].base; } +#if !defined(CONFIG_USER_ONLY) int x86_cpu_pending_interrupt(CPUState *cs, int interrupt_request) { X86CPU *cpu = X86_CPU(cs); CPUX86State *env = &cpu->env; -#if !defined(CONFIG_USER_ONLY) if (interrupt_request & CPU_INTERRUPT_POLL) { return CPU_INTERRUPT_POLL; } -#endif if (interrupt_request & CPU_INTERRUPT_SIPI) { return CPU_INTERRUPT_SIPI; } @@ -8286,14 +8285,12 @@ int x86_cpu_pending_interrupt(CPUState *cs, int interrupt_request) (env->eflags & IF_MASK && !(env->hflags & HF_INHIBIT_IRQ_MASK))))) { return CPU_INTERRUPT_HARD; -#if !defined(CONFIG_USER_ONLY) } else if (env->hflags2 & HF2_VGIF_MASK) { if((interrupt_request & CPU_INTERRUPT_VIRQ) && (env->eflags & IF_MASK) && !(env->hflags & HF_INHIBIT_IRQ_MASK)) { return CPU_INTERRUPT_VIRQ; } -#endif } } @@ -8304,6 +8301,7 @@ static bool x86_cpu_has_work(CPUState *cs) { return x86_cpu_pending_interrupt(cs, cs->interrupt_request) != 0; } +#endif /* !CONFIG_USER_ONLY */ int x86_mmu_index_pl(CPUX86State *env, unsigned pl) { @@ -8544,6 +8542,7 @@ static const Property x86_cpu_properties[] = { #include "hw/core/sysemu-cpu-ops.h" static const struct SysemuCPUOps i386_sysemu_ops = { + .has_work = x86_cpu_has_work, .get_memory_mapping = x86_cpu_get_memory_mapping, .get_paging_enabled = x86_cpu_get_paging_enabled, .get_phys_page_attrs_debug = x86_cpu_get_phys_page_attrs_debug, @@ -8577,7 +8576,6 @@ static void x86_cpu_common_class_init(ObjectClass *oc, void *data) cc->class_by_name = x86_cpu_class_by_name; cc->parse_features = x86_cpu_parse_featurestr; - cc->has_work = x86_cpu_has_work; cc->mmu_index = x86_cpu_mmu_index; cc->dump_state = x86_cpu_dump_state; cc->set_pc = x86_cpu_set_pc; From patchwork Sat Jan 25 17:01:11 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: 13950458 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7C50CC0218C for ; Sat, 25 Jan 2025 17:05:28 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbjYF-0007jJ-BD; Sat, 25 Jan 2025 12:02:31 -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 1tbjY3-0007Ns-0a for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:02:22 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tbjY1-0000Ub-2D for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:02:18 -0500 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-38633b5dbcfso3546573f8f.2 for ; Sat, 25 Jan 2025 09:02:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737824535; x=1738429335; 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=srYqpBi+i1JHdcQoMXjqQayhwRKKfnrZUrD1yEs/h/w=; b=H4P+IGCYykG0iClof5eIR9TPZIMz5MZD5+P6gdixBeKm0FeMrlg1lQCR2rl2yuHzQv LbiphyFBGK3xV/A35+QJuUCg9kB9P88HPE1QuKNpGBDbTCKZgy/mhBRvW1UUUMIkELLO SR3/+88PrjtJ2jhKGcMVPaYwnio4ABesdr83I1h79oB/BBWgXBSPafwX+he4Q4ENtWJq chN9nAjOGekZZV9F5daV04fGG9SajCn/DrcmwRfSDcMzdmYyxhJIbLQzKzRnYEXzgXtL Y5iwFWbr1AIOzUylrgC/axzbfx90voaTiWXYgRF6fXTzs1/GcQ9GkdLYxZ0MFvKCVJAn F1cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737824535; x=1738429335; 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=srYqpBi+i1JHdcQoMXjqQayhwRKKfnrZUrD1yEs/h/w=; b=hLDZm6LWfWKa8p5N1Z+8paUCP9AgGkbVyXUp2pyYdJ6a7YawCJ/uv/fb6mA8z9Z9su KqCTTQBWtCR3FidXb1TtOUGdwfN6PT5/7ZV4ln6U5vCFgznRPf0AVB5JR+93yTDphjTh YpJEzmd0726ZSL4drXigsf3J+LRrLOeuQE4cK5lrk1BOCQ/QPfhAftvunUr6LaNuYshp zGswmQ9HD28m4JVmDecYMRoHHWHGFsqg42M1WD8WeZb+2nKdZ89eFaCAfzYyx0zXd07G an97CHe3j3YfjnC4MjOzj0LqzKLYJv4WdY4hcJS5bBXNGx1X1Xa9tzqY2rBMRGBk/eT+ 61+A== X-Gm-Message-State: AOJu0YzXPMajjiL+EtQd/nz1LYvqgRitepnNqfWUMbBLfNQyQz7SDNtp dZKg/VwBHtVHAdbSqosTllSh3Hudkar1K3shNaOsZnDhhuftEsxk4pP2w1AnS0SAzqDq8Xv/h9F vsTY= X-Gm-Gg: ASbGncvlvEBa87H01iRFSScN4FbP/mIphbyS0CNh/4CNPmOiabS3ju7xXhKWk4W2/wS 4lXzY2e1XMyPmwisqoeE8n9F5awD1X3G8kpcxge41IUa+heMdluRyGT17dKkbp2wlDrqxuSeyLs K+hRw2f71Vz1cg2VrRXlwreZENcRJGphv1NYis17sw08zIiJ7862NK9hEZQW8J+rlwSof291N+j lQTn8kTp1Uaimcc17EV24cyZ3a5Zmzb7GncAzC9FkTxmsHRRiaq9ngH7N4fBQsG1nPr+UUag7Sc JpHTNi0wfsrGWuQGSfKCYF+8kqR5R8/Q7w0kgiNT01T+2d1wSrjixz4= X-Google-Smtp-Source: AGHT+IFwA5bZR17+i0WU35oIAB1ENpa8jYp88hCa1KAuZoPxhtuXvqPZ2pWw0r1ukuIgzQsM2MUPiw== X-Received: by 2002:a5d:648a:0:b0:385:fb8d:865b with SMTP id ffacd0b85a97d-38bf57be4a2mr37231545f8f.48.1737824535020; Sat, 25 Jan 2025 09:02:15 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a188689sm5983635f8f.48.2025.01.25.09.02.14 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 09:02:14 -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 v3 10/24] target/loongarch: Move has_work() from CPUClass to SysemuCPUOps Date: Sat, 25 Jan 2025 18:01:11 +0100 Message-ID: <20250125170125.32855-11-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125170125.32855-1-philmd@linaro.org> References: <20250125170125.32855-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-x42d.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- target/loongarch/cpu.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c index d611a604704..20aba0e1fff 100644 --- a/target/loongarch/cpu.c +++ b/target/loongarch/cpu.c @@ -349,11 +349,9 @@ static void loongarch_restore_state_to_opc(CPUState *cs, } #endif /* CONFIG_TCG */ +#ifndef CONFIG_USER_ONLY static bool loongarch_cpu_has_work(CPUState *cs) { -#ifdef CONFIG_USER_ONLY - return true; -#else bool has_work = false; if ((cs->interrupt_request & CPU_INTERRUPT_HARD) && @@ -362,8 +360,8 @@ static bool loongarch_cpu_has_work(CPUState *cs) } return has_work; -#endif } +#endif /* !CONFIG_USER_ONLY */ static int loongarch_cpu_mmu_index(CPUState *cs, bool ifetch) { @@ -835,6 +833,7 @@ static const TCGCPUOps loongarch_tcg_ops = { #include "hw/core/sysemu-cpu-ops.h" static const struct SysemuCPUOps loongarch_sysemu_ops = { + .has_work = loongarch_cpu_has_work, .write_elf64_note = loongarch_cpu_write_elf64_note, .get_phys_page_debug = loongarch_cpu_get_phys_page_debug, }; @@ -860,7 +859,6 @@ static void loongarch_cpu_class_init(ObjectClass *c, void *data) &lacc->parent_phases); cc->class_by_name = loongarch_cpu_class_by_name; - cc->has_work = loongarch_cpu_has_work; cc->mmu_index = loongarch_cpu_mmu_index; cc->dump_state = loongarch_cpu_dump_state; cc->set_pc = loongarch_cpu_set_pc; From patchwork Sat Jan 25 17:01:12 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: 13950463 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6142DC0218C for ; Sat, 25 Jan 2025 17:06:49 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbjYG-0007l4-Sh; Sat, 25 Jan 2025 12:02:32 -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 1tbjY7-0007Tc-VN for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:02:25 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tbjY6-0000VM-E3 for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:02:23 -0500 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-385f06d0c8eso1719390f8f.0 for ; Sat, 25 Jan 2025 09:02:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737824539; x=1738429339; 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=yoQ5t8eM4wCpvT97M9dMQOs6qSsBVPtoxCHVU1aZxhE=; b=D89+wa1yb8lhJLBtHip/MtXMZJXqXqqZbtfXl4+7Lt05+U7bwzKObVf73yXSosj3LN 3UafjpJxwfc48AwSl2X0aGX6EfmDjUhf0r+EtsHixR45vAEOLyeeZb0j7rrK7Rm4xrVY rajjUPsCyiaepy2k9IXdQdR3703OGSTXSt34BtYgygmRptp54FlfAk0POEzMFviKkgOD kUT1gQAKE5J9lGSRGK5JqUp1FHl90LQgGqJBJAozM+z4i7JmsOy3kEfIaq4JQhasSEOl pfJAzq/d3OVhxye6KI55e+5AG9hMY8PXvJ745sThZdRFPr95xZVAWS4waw4qvYe8CDYs aPYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737824539; x=1738429339; 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=yoQ5t8eM4wCpvT97M9dMQOs6qSsBVPtoxCHVU1aZxhE=; b=TYXNgR9VG9b22UD6Ro1b3bfrCAo7Mg68xmXR54HuC1NjM3PGAvlssWu4RxfzmdiWmf cHD/jFwfJWdsZ87wllg24TiKVA2KQkN3kk+PGuS2qeN54P5FENtbw5mL3FF0X8sO3o7B 3DH710PakWxGM7rCPzCyKAK2DLxIxvrQZ0xasYXLkOmnZSCQ392+mYlknorIkNNY0ih9 Gd1SsFQj5l4D66EB6rhx+6UqOuDViEnaNS4mai51Iqz7VnXjvnXFMbwxPZlrGVoxDlsS bUATWzCaqW4SJ6xLxgNla4lRJKIpqxIBCAHPJKGMf1VjdKZ5DE/e7qaB4Wn2hvuuT+tU gM3Q== X-Gm-Message-State: AOJu0Yw16CpOR8M4nVr2MvdiGOjGT7jS8PCYlW6rxY5qMShtI0lTAg2E UDDBT/23vL2TiSZ+dzIs9OttRAM+rWuXAuyNP+sZ0oMYaCWJA9ePKBfg3So0dRgNdbIBJ/m3hz8 HTNU= X-Gm-Gg: ASbGncteSQDVXXcpgYx93sNxJkgtfF6itRcDoPo49zOgFJ5wrn0P4GX0B3tTfmZW++H kwppeUeWF5OwTFx2r+fwqNUYVW9QP/UexTf+ix94xYBuqD6MHGnDgmuDpn/78Fb5rsikq/VNHmz Ax6ibJgI6Tbx42yECW4Z7NucbjtkdGKmY7nbNdv2OlLYWQ5LmgI7okT4EV0+qC7pvRUubmr9qF9 a85sdGJ1aVjL7oX7NxVqDPu47+ut+/lmWsiPLlhXNNVlxVYFEzUoUpFpxMqYTQKMbk9TXyJiUHx m4+Vtz0Ro7uqhEnYC6pMc6WIzRoZU5sAtBH3Nxi04WfAusPPFXfxmV8= X-Google-Smtp-Source: AGHT+IHzKcFNJPqwig4S8ifkQ1YTvx+5fHQoFPfZM+cZ1RBxsw1CK7P8rChQn+MKTN1dw753y3eI/w== X-Received: by 2002:a05:6000:1864:b0:386:3328:6106 with SMTP id ffacd0b85a97d-38bf59e199cmr37773444f8f.35.1737824539518; Sat, 25 Jan 2025 09:02:19 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a17650esm6046557f8f.12.2025.01.25.09.02.18 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 09:02:19 -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 v3 11/24] target/m68k: Move has_work() from CPUClass to SysemuCPUOps Date: Sat, 25 Jan 2025 18:01:12 +0100 Message-ID: <20250125170125.32855-12-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125170125.32855-1-philmd@linaro.org> References: <20250125170125.32855-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=philmd@linaro.org; helo=mail-wr1-x42c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- target/m68k/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/m68k/cpu.c b/target/m68k/cpu.c index 41dfdf58045..eb7fb4f7e4c 100644 --- a/target/m68k/cpu.c +++ b/target/m68k/cpu.c @@ -51,10 +51,12 @@ static void m68k_restore_state_to_opc(CPUState *cs, } } +#ifndef CONFIG_USER_ONLY static bool m68k_cpu_has_work(CPUState *cs) { return cs->interrupt_request & CPU_INTERRUPT_HARD; } +#endif /* !CONFIG_USER_ONLY */ static int m68k_cpu_mmu_index(CPUState *cs, bool ifetch) { @@ -543,6 +545,7 @@ static const VMStateDescription vmstate_m68k_cpu = { #include "hw/core/sysemu-cpu-ops.h" static const struct SysemuCPUOps m68k_sysemu_ops = { + .has_work = m68k_cpu_has_work, .get_phys_page_debug = m68k_cpu_get_phys_page_debug, }; #endif /* !CONFIG_USER_ONLY */ @@ -576,7 +579,6 @@ static void m68k_cpu_class_init(ObjectClass *c, void *data) &mcc->parent_phases); cc->class_by_name = m68k_cpu_class_by_name; - cc->has_work = m68k_cpu_has_work; cc->mmu_index = m68k_cpu_mmu_index; cc->dump_state = m68k_cpu_dump_state; cc->set_pc = m68k_cpu_set_pc; From patchwork Sat Jan 25 17:01:13 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: 13950448 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6D5D7C0218D for ; Sat, 25 Jan 2025 17:03:18 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbjYH-0007mA-TJ; Sat, 25 Jan 2025 12:02:33 -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 1tbjYB-0007bT-MI for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:02:28 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tbjY9-0000Vz-TD for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:02:27 -0500 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-385e27c75f4so2749609f8f.2 for ; Sat, 25 Jan 2025 09:02:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737824544; x=1738429344; 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=MxDvorJyhEvTzUUQpDwPeiHnLMk9jCN8DN75q+YWX5k=; b=yaxoYgbcLrG0AbeBuB/uydvM3QT0JXCyXgZG/CaQaE9tyXTEkYLNTiKtHR24ejkkGC tPmkxSctOdWSnGi99v5Sl90iL0J+8gwtxvJR0SNjNqJT8dezqpGnGNaUs2G363kYwTWK HGASgW/UZVsz+DnXEFIhcZBZIwB+ncJrZ9kqgrpFmbnUHi/dJ5VulSwZRuBVdTi9Z85U gAoTz99L/vU0UfBwKuSijAiyEiNLFOJVn+97ydIqi/je7qdDtxxoRS84k8blzkoNTlpr 3DQ1/ogzCt/0ekAzgbO9BLT6hLn8CGxVXtWD07Ansrn3hNcWQu6XLYBHChBpufA+H9OV qSrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737824544; x=1738429344; 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=MxDvorJyhEvTzUUQpDwPeiHnLMk9jCN8DN75q+YWX5k=; b=mBGTh6Et8D+uZ3I0oiJPGPk7L8mYaOTuuO0X6wzWufKadGGqGI5Mw0TT9j/m992B/X 4SjQNUhkEOxHlvkywpNjkecxo4sJE7p7UUPDREer3J7ODFlARHwhTAuIfgLEmdodp/Ea Y4VMIqELR3DIIMmMayMXBN+CF302ISXPeJImNjtGo9Syn2i1VYLNKd3WDjUF2I2yDkSp bVyfGdvLbC+/T/me2BlImdpONISbumGKO2XmDysUAXNEW1gFkdFEWZ1SO96UIso9C4Oy bVqxdX+DYtwKrRXr0EcTxFL2EjgOJGUaYxT3nANz1MFeDfJUo0giNx9EVm1GZG5XPnMm ag4w== X-Gm-Message-State: AOJu0YzzE1DgRhtVg+lSfi4ctt36px8z6jSDTZh60XbHRxfj1tkgr2u/ pflyQ8ULTvqLCVsGBqagQoenAid4n5SCiBaML294wEgWv9Th/fI+HzeIqkw74yKrltTv6fbpoED tjrI= X-Gm-Gg: ASbGncsnre4qh9eqjzJb5/derAQSB/pH5ErwNHdC59NY556q/ZqGBfs+CN1L8lCNGew Uf1+ZhtEYqDAdEAveD5Yy6cCymvSvJ5fSFxsbHZ3Z+GUrRwW67l4mxOQzdUWSfPHSiWuqbaFxBo e1WAy20Ygkn0g1KCYMo4n3ZJ8WhhaEI+ym8Kn6Yv9yTVBYliMlGU7b6AuNnl8fxUnr3JpU2ISG5 cBygjhWj78TRMoDEr6lyM9qId8B1uNXW0rlFGd0UlMRp0zPOA30rYqYs3BCvh2O9H1Sx53cai76 RGMNWsbKaIg40HbHrg3mi6Y28AdRGkWT9wXnx7xa7sVJd5YExecBMbY= X-Google-Smtp-Source: AGHT+IElU3CmoHgm6P5E4R/D/n5GJND2j0ODrU6aU+H0VQ2gs/t9JMYn/cjJiTgLHBIEnHNaCaXVJA== X-Received: by 2002:a5d:5f8c:0:b0:38a:873f:e31f with SMTP id ffacd0b85a97d-38bf5677ca4mr29730759f8f.1.1737824544092; Sat, 25 Jan 2025 09:02:24 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a1baf3esm6103844f8f.75.2025.01.25.09.02.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 09:02:23 -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 v3 12/24] target/microblaze: Move has_work() from CPUClass to SysemuCPUOps Date: Sat, 25 Jan 2025 18:01:13 +0100 Message-ID: <20250125170125.32855-13-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125170125.32855-1-philmd@linaro.org> References: <20250125170125.32855-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- target/microblaze/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index f114789abd8..7a90cb3016b 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c @@ -115,10 +115,12 @@ static void mb_restore_state_to_opc(CPUState *cs, cpu->env.iflags = data[1]; } +#ifndef CONFIG_USER_ONLY static bool mb_cpu_has_work(CPUState *cs) { return cs->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_NMI); } +#endif /* !CONFIG_USER_ONLY */ static int mb_cpu_mmu_index(CPUState *cs, bool ifetch) { @@ -415,6 +417,7 @@ static ObjectClass *mb_cpu_class_by_name(const char *cpu_model) #include "hw/core/sysemu-cpu-ops.h" static const struct SysemuCPUOps mb_sysemu_ops = { + .has_work = mb_cpu_has_work, .get_phys_page_attrs_debug = mb_cpu_get_phys_page_attrs_debug, }; #endif @@ -450,7 +453,6 @@ static void mb_cpu_class_init(ObjectClass *oc, void *data) &mcc->parent_phases); cc->class_by_name = mb_cpu_class_by_name; - cc->has_work = mb_cpu_has_work; cc->mmu_index = mb_cpu_mmu_index; cc->dump_state = mb_cpu_dump_state; cc->set_pc = mb_cpu_set_pc; From patchwork Sat Jan 25 17:01:14 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: 13950450 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B1348C0218C for ; Sat, 25 Jan 2025 17:03:28 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbjYL-0007pm-EX; Sat, 25 Jan 2025 12:02:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tbjYH-0007mD-Fr for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:02:33 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tbjYF-0000Wj-V5 for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:02:33 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-43618283d48so21879285e9.1 for ; Sat, 25 Jan 2025 09:02:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737824550; x=1738429350; 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=VCQwHzafaYDHpNHTUSNhEO/n12VvMKZC/l+XP9b0XJ6H+Y2CK56yctjgx9MqUph5Kx oHU48Xq9AVgS1oa3s0YM/tnKLgBrRaTAy0Uyq+63zwSH+prS+OFIaBqwEPgUcEHlXfyC 8jPdKK8fcYhNv2oNQG4G5rOiezGHt/bHbbtnVK0utDG3rFXmXqUTEZcf66H7bEHvJbif mbLgeY2dIJUeIIx4U2L6DcEBc/Xq8CBBvYK0lMabAS7CYKAlGEtcIVym+yWHLroaYyKz SQhF4LrQxyZjNOa8NcHhtaT37MT+nazWRh7rTHNPZJ+wWA+bcDZHebD5zV5/eNAuSUJY mraA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737824550; x=1738429350; 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=Y8ghy+YfYJumrs53tBJF5BpDKO3237guXJp5Oa+SF1aryq3f3z4xD5dK/YEt7sLqPe iRT0Ujo2TExi0UmFy0ggsuGA6nh7vqtJjjAPH9/LNWdS3u12uSi4OFzcAkSESGztM+rm K86SBUWmkEBHvIMXmNlccXrnWHxxH8rmtGi9EFWWfSqMrsvt3z98lzwsjzjv8dp7rDvX 5pviwdIxYr94cMSAAHWVS3N9cKClCslCuawHhhYu919ihmirgtCr6lZ9o4y4sXJknxlN 3ZRfWRWxHtvZTXTrLaOXnLr3uhcMIJz2oLkcQCsnZPa9LXJRlTCEc/9ZPlEP6h2odvk4 eC9w== X-Gm-Message-State: AOJu0YyJWeOVKURv85edpuwYctOfPQzFnShN8pbtjhUBgk/YONXx9Ml1 AFWQ7O8AwRkvlxheKwsHR+UPtpdBfmRPeviXEwOikwmA2WklGHyoUPhdEgetlJSUqUcB41EJ+Mx W6dQ= X-Gm-Gg: ASbGncuhgFB5VI+eysqnX+D3fylegSDVT13XYTwVm8AEEyZGJ3bj6AgNgoN1OgtVuzR LlQZxAZVLsh7Q/igZLORZiz3dgA4MtdLUVPCVp4RegJ3t6PZh6sB0zxTetWgagzNoWkbIf0WzhY l8MAyWjG17S80WRmlS86nNtBIh9MDwb+BwY7OM9cAZxeTfPm1ibIzogLgHRi7xzUETzJ/bjgsdo 6cVkCzg03Bnm7FjYb1TSx8a2KcA0hbaT8PN/Qo0+77xyNWGFzwjKjycIkkuwNUBMJPaPzOkk/CU 4O28IOuiuP6/7IW0ph4IKgMjd5+oKL9Y4jNXrln5Jn8Bj3ceayaF1gg= X-Google-Smtp-Source: AGHT+IELqiZt4FNKXNQuvZhe/3Eh5kIG7eMyhRNf1ubzfCoYuTwqKy/mnOy6rkLUq8FTSSG1Uc4UYg== X-Received: by 2002:a05:600c:3593:b0:431:55c1:f440 with SMTP id 5b1f17b1804b1-4389144eea8mr387806845e9.30.1737824550049; Sat, 25 Jan 2025 09:02:30 -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-438bd502007sm66246515e9.14.2025.01.25.09.02.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 09:02:28 -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 v3 13/24] target/mips: Move has_work() from CPUClass to SysemuCPUOps Date: Sat, 25 Jan 2025 18:01:14 +0100 Message-ID: <20250125170125.32855-14-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125170125.32855-1-philmd@linaro.org> References: <20250125170125.32855-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.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; From patchwork Sat Jan 25 17:01:15 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: 13950447 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 68FA1C0218C for ; Sat, 25 Jan 2025 17:03:16 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbjYT-0008RR-9X; Sat, 25 Jan 2025 12:02: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 1tbjYN-00089I-5M for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:02:39 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tbjYL-0000Xc-Ee for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:02:38 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-4361b0ec57aso32544395e9.0 for ; Sat, 25 Jan 2025 09:02:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737824555; x=1738429355; 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=XVxLloB16KKQ3LatAF3/z7GPltBurV7JlIRTNmwrSfY=; b=pF6NQVrEjmJWMYhLYO/5CTEhhS9dbHjw7hdsZ/jK5GIrSLgYrm41cKcJ5oy6fDIq/g 7txYtRYYVplilf8Z8JIAgWvPcW8SZPwKzWiaHnXCRkudxyh9XVyUcK55rAJCBjDDnM+n Xq8ghcnqDZAFrazWT2VAG2otGBVqA3HZaivsMKCrCV11LbCpovN0XMmejUkP8gNiSOsu NklL/EkobxLHdrxmF4bOPMWbQy0AZyl7BoyWHm7N4rEE4ng2w0qMMpSpY9IQItec9zOy YSRPn29TIuvvoaSogYaRhpEAJ+xYYhuvQ+sLEVxyFbAstg4gM3GMBm0dx4VRygC6VPHv n7zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737824555; x=1738429355; 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=XVxLloB16KKQ3LatAF3/z7GPltBurV7JlIRTNmwrSfY=; b=Dhq771lJs/lOncsqzgJSKz6eacEJ/OUsY6WdrL8kIcLhMMq4l0xkmTGp/2rkD+XUqC QMh4efo9zHZsJJWZU6Auek3blM7r5BqyYKISiOY8J3fqsz1tkgWlsknJ9vflv+3miTlt ckA1z94FVrK+MxsmC+GVH1HyMbYEiMqjyfcAW5Wbn3+HRKjJH6O324xRWvv59J3hA7Md pCgP+bW5APmWScE6uuf8GMW105iXDyxDXu3m6rR5Fx98I9bJ7wyRa1kJxBmMhSTV10VN k8hk87YFDjTWrxUA/PU68Xfrc50NCVUM4p3mXgFodMYcT916qszWuKcPlT7r/fsyz3+J shoQ== X-Gm-Message-State: AOJu0YzyEgnUKNC0H6R1TLGVVt6HTb/5vw5gtwMw3NcKDjZtU/NIgTIe GWaD4QSm8vxnq02G0gE8/MYISFWVxlEnmYA1sWMfw14c1SK4ZsWdoMZcFsP8wSLHPrVdBHwPcp+ i04k= X-Gm-Gg: ASbGncte9nMsHqBSscGq47nUbiqvrdnqsxPUtsCohG9V9axZyYcGlLkbvioW+dGR/pX zR0hyrCR3khuGBubK5eXD2YCKJZ8tzjlrLjvCZnKHRRt1fBsUQTc1ln2IMKVxvm1diBL6W3EZ3Q ODybMb4WunCXbVTZXfU+J9PUZsKULnYqOfrh4UPPByxO6c0wdlhJPL1x5GmRFCuSzaitA2iZRFi IbkyJT8sptNKmI9+363allI3uqa1n9jlk+JqkfSQ5QL8k+iz9URlxc7kDhCvf/9Usl83/nH+XrG WuUrVqSrBNp15w5z8pldTTmiYYpESZiJDd+4IWCGw3wrdIDie4a1vs0= X-Google-Smtp-Source: AGHT+IFHv9P+hZykbbF3UVucvoWmc7m5hFjlui6LVmFOyARfCuo1p4Bc3l3SVA0TfrHfkFB8AKEurA== X-Received: by 2002:a05:600c:468e:b0:436:5165:f1ec with SMTP id 5b1f17b1804b1-4389143145bmr337588915e9.30.1737824555606; Sat, 25 Jan 2025 09:02:35 -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-438bd47f120sm68574425e9.2.2025.01.25.09.02.34 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 09:02:34 -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 v3 14/24] target/openrisc: Move has_work() from CPUClass to SysemuCPUOps Date: Sat, 25 Jan 2025 18:01:15 +0100 Message-ID: <20250125170125.32855-15-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125170125.32855-1-philmd@linaro.org> References: <20250125170125.32855-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- target/openrisc/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/openrisc/cpu.c b/target/openrisc/cpu.c index b7bab0d7abf..5d80c4aa9ac 100644 --- a/target/openrisc/cpu.c +++ b/target/openrisc/cpu.c @@ -63,11 +63,13 @@ static void openrisc_restore_state_to_opc(CPUState *cs, } } +#ifndef CONFIG_USER_ONLY static bool openrisc_cpu_has_work(CPUState *cs) { return cs->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_TIMER); } +#endif /* !CONFIG_USER_ONLY */ static int openrisc_cpu_mmu_index(CPUState *cs, bool ifetch) { @@ -228,6 +230,7 @@ static void openrisc_any_initfn(Object *obj) #include "hw/core/sysemu-cpu-ops.h" static const struct SysemuCPUOps openrisc_sysemu_ops = { + .has_work = openrisc_cpu_has_work, .get_phys_page_debug = openrisc_cpu_get_phys_page_debug, }; #endif @@ -261,7 +264,6 @@ static void openrisc_cpu_class_init(ObjectClass *oc, void *data) &occ->parent_phases); cc->class_by_name = openrisc_cpu_class_by_name; - cc->has_work = openrisc_cpu_has_work; cc->mmu_index = openrisc_cpu_mmu_index; cc->dump_state = openrisc_cpu_dump_state; cc->set_pc = openrisc_cpu_set_pc; From patchwork Sat Jan 25 17:01:16 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: 13950457 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9B215C0218D for ; Sat, 25 Jan 2025 17:05:16 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbjYZ-0000SU-JF; Sat, 25 Jan 2025 12:02:51 -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 1tbjYS-0008Rk-Sj for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:02:45 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tbjYQ-0000Y6-P3 for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:02:44 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-43675b1155bso34956635e9.2 for ; Sat, 25 Jan 2025 09:02:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737824560; x=1738429360; 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=ZVfXoDh+6S/jYxx141Eb2tmPZau06sCtOP0dQkqathI=; b=v96M/93Eomx9cfgh21DsjnTTuiTReirZMmfzeFEIBjuyApic/MLSBoQd9QLsXFRmP0 4Tm7mOfRCbS08zKNv9ew8NxyhW0TW0UuNxXmhzISyGJHXC6eHpNREYwd2u614Nf8bRZ4 TB9g1RMZNJAND3WPb6eE1xxd/xdzgoxkJpNBdOWlb1ag5sP/LlsKwpxHobHZ8c+t4X2m cgIj6RCyVMxWSuWgERSRopblLb4AQ3Ok5KzhGn0EhvgJ+tAVd9L/np7qTDPRvhqjxF7r gRdP95m8FOMgcwtyJGA/PJNNJEfzPk1qBLEV57qRPcNY98677rsW12krEtJOJpejAiuT Ns+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737824560; x=1738429360; 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=ZVfXoDh+6S/jYxx141Eb2tmPZau06sCtOP0dQkqathI=; b=uxb3B3qwW1QVL4kjQGexG86jZo4DBshmpqdF/cW0IgOUNYGEpXyzckJWehtEJ7AABJ 3N13r7s2r2eyfqCJVcp/BdQcOU3y9a6gSt+iVCxJwOx9vexYzGL8hOOSSe8u92sdCrie iAR13p/zEBxuiCqYC1nmrUcnbE3N93X0dkqHrY04gdT456aXin81u3FYVBvRU6F9FAhF jqHJxtMdDzpAWiXQ6wSUZ/j6Gs8jmAY8orzqLGX8SMOlTzulAKP3tk/wf2B4gEpG+9w/ oxa8OyudKPMobfXt6ttYOz/ps8FnOBB0lzbZfAMRpduTvORwljk315s8+aU6Z8V1CFrh AoBQ== X-Gm-Message-State: AOJu0Yz8a1rL7goeaJRrvbE6MGjoB1E4oaykt3VXT87BJ1hdZ1kIDmIF +nyXEnPtFV+D88HswQB9BuEbV/71IJwtsDrbhApq4f05zY0SCow99dOgwuP0zrD4J0WlcfJKght kk78= X-Gm-Gg: ASbGnct1GvBcAUOqn4H7jQwHLPugj7AIiEg1hGmpVrn0gqYIP08ET+UrdHKUSR51p5I EWdq27Dj2mIBsDBrDHBbLo9vO+SgHYp7VVNLcIDICTFukLJ3UvxMnHwAyAqbjQWhNaS3cGt8Ui/ vQ/w5yEtTNAL8+szLo8uNBjLDS5DX5lPPC4IeScyo0ujbr3J/pPacESXJ/exxHfrQBN7kddJ44P UVV00fxAwEHLRufBILPnlm4BF5KJFoePnbEE8XmrfWSioz0Cs0X9JFMjp5PJeddjUANbRbxO8IW +NxBPJdOaGBbEr+rMrJl91BMORVgc1fG08aDSz1XPM/mgaRMx4Jdz0s= X-Google-Smtp-Source: AGHT+IEl6E4DF+gzk+WjAQZCYxxGc9gj0CROOdJ/Xi0h+oxmZQI1XCyPxfJqp1kkM2GyiDSUkKtG+g== X-Received: by 2002:a5d:6d86:0:b0:38b:d7d2:12f6 with SMTP id ffacd0b85a97d-38bf5655264mr31626626f8f.2.1737824560275; Sat, 25 Jan 2025 09:02:40 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a1764c8sm5907359f8f.3.2025.01.25.09.02.39 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 09:02:39 -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 v3 15/24] target/ppc: Move has_work() from CPUClass to SysemuCPUOps Date: Sat, 25 Jan 2025 18:01:16 +0100 Message-ID: <20250125170125.32855-16-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125170125.32855-1-philmd@linaro.org> References: <20250125170125.32855-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- target/ppc/cpu_init.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index c05c2dc42dc..081fb5bd343 100644 --- a/target/ppc/cpu_init.c +++ b/target/ppc/cpu_init.c @@ -7177,10 +7177,12 @@ static void ppc_restore_state_to_opc(CPUState *cs, } #endif /* CONFIG_TCG */ +#ifndef CONFIG_USER_ONLY static bool ppc_cpu_has_work(CPUState *cs) { return cs->interrupt_request & CPU_INTERRUPT_HARD; } +#endif /* !CONFIG_USER_ONLY */ static int ppc_cpu_mmu_index(CPUState *cs, bool ifetch) { @@ -7418,6 +7420,7 @@ static void ppc_disas_set_info(CPUState *cs, disassemble_info *info) #include "hw/core/sysemu-cpu-ops.h" static const struct SysemuCPUOps ppc_sysemu_ops = { + .has_work = ppc_cpu_has_work, .get_phys_page_debug = ppc_cpu_get_phys_page_debug, .write_elf32_note = ppc32_cpu_write_elf32_note, .write_elf64_note = ppc64_cpu_write_elf64_note, @@ -7469,7 +7472,6 @@ static void ppc_cpu_class_init(ObjectClass *oc, void *data) &pcc->parent_phases); cc->class_by_name = ppc_cpu_class_by_name; - cc->has_work = ppc_cpu_has_work; cc->mmu_index = ppc_cpu_mmu_index; cc->dump_state = ppc_cpu_dump_state; cc->set_pc = ppc_cpu_set_pc; From patchwork Sat Jan 25 17:01:17 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: 13950466 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D0732C0218C for ; Sat, 25 Jan 2025 17:07:31 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbjZD-0001G6-Hb; Sat, 25 Jan 2025 12:03:32 -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 1tbjYW-0000IZ-IR for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:02:48 -0500 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tbjYU-0000Yp-Rg for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:02:48 -0500 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-38be3bfb045so2823108f8f.0 for ; Sat, 25 Jan 2025 09:02:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737824565; x=1738429365; 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=HrE30xT1EmuXt0tg0kaHmGrX7iIi1CpOMZL7K4RG6J8=; b=vjNJXPia0PUsFanBpDmNz+UZKsSYPHKz9tMycJahgLJwn50yPOeuR/RPegF4zWzsyu 1TRVwtKTonjZbYrCJvh+N3bxOhEb74g/bVdbFjmGcreHeaf7PKijJ8riqiBE9bHP6+sp updK4CX+X3PZVeY7PMSi2MWa004N/bbgbuRvOSBUAC1L7NBxpNoU/3jsQLIEDd/YiObO i9mio596nmoLYCKI4Rtk4IOXYYvizDd/OpWKGHdSOXpMJtxHXGi7ceiJTbfHhLimsurg SYIUNi1EN608wMSd6g75PxSC/nM223b+46c23GOe0frghu3xo7ZhRFYTzjxs879+pPXq 8P+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737824565; x=1738429365; 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=HrE30xT1EmuXt0tg0kaHmGrX7iIi1CpOMZL7K4RG6J8=; b=saIoNxEHBbShTPF+msgQ3wNgQyJdds2bATNazscdL8xhj6yzEnojh6kLLyIxMn3zVF K11Lw2gWkh+PWfx8jBD9bNeeWCBjyyIihbspZ5CuZdwinUFUXY0HUUrRekpU01c6dh37 13hkslcx/J2RGovmTVjAMuTigRks3iysH17DM0PqomO+oorHSM11Yz8UxBhBc3xFxT1m j8F8F5KqULTtni5l8XzIgApFkgvL7IxwZ1GBtQtscQOxrgeM4f/JR3MlhBRucDPBcI8J SXXyCWhBZ+HAzCv7tFHHjMk2wPoLDg62cnzNZudwYjlPEOQXhTHNP8lIUZwMz/dx982J 3isw== X-Gm-Message-State: AOJu0YyDDGwOr9PNH4wejNpfOp7ke0HjqPH62ESjqzvga4iiQhBImFh4 u2dZHxCxQJlsOq6BdiQHkKxeWb1us69Flm2x7REvHZbjdFiTxyPgrddtgduUYyiaBpWwFiRNJa9 2fMY= X-Gm-Gg: ASbGncvA6WFrexan18XBXVYMkwRlS9IHvXuYwM57TBukCX5uq02NSRhGsuxnsgI65Uj cKASC3wWdgXeozWQqHOwsoD4pL+96ZiiyHqqaSavxiVJWRVZR7T0wN3zW8jqp4h6HWFBnKvyHRj VRj8HARVl2EFy7HLkSKpFnzAUHm7LZmzAQBeWrjIXmFOhEIu/DxYZ7SJ2n/ntUSZejES/JppMrw IRmMBkiHwvfin54L55jr2UhGhStqAE8t+EjKYikbIxTwHcG7/Q50Cu74resGJeZ039H6k8SRtu6 2GJ7vCu1RXe2qXHhRw95HmV204Yo7sJ6jZ9HZPIxO4XJNQ1R8HJ6nV8= X-Google-Smtp-Source: AGHT+IGNlyMXuaDnUDXdIELsE09/c/dVV0EjyQ3SCl8iTpsNtU2qcoEuigRn83q15WyThjIkwbVgaw== X-Received: by 2002:a05:6000:d09:b0:38a:88d0:1c9c with SMTP id ffacd0b85a97d-38c22275430mr9605028f8f.17.1737824564866; Sat, 25 Jan 2025 09:02:44 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a1c4199sm5861138f8f.89.2025.01.25.09.02.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 09:02:44 -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?= , qemu-riscv@nongnu.org Subject: [PATCH v3 16/24] target/riscv: Move has_work() from CPUClass to SysemuCPUOps Date: Sat, 25 Jan 2025 18:01:17 +0100 Message-ID: <20250125170125.32855-17-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125170125.32855-1-philmd@linaro.org> References: <20250125170125.32855-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=philmd@linaro.org; helo=mail-wr1-x42e.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=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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- Cc: qemu-riscv@nongnu.org --- target/riscv/internals.h | 4 +++- target/riscv/cpu.c | 8 +++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/target/riscv/internals.h b/target/riscv/internals.h index 67291933f84..213aff31d85 100644 --- a/target/riscv/internals.h +++ b/target/riscv/internals.h @@ -142,8 +142,10 @@ static inline float16 check_nanbox_h(CPURISCVState *env, uint64_t f) } } -/* Our implementation of CPUClass::has_work */ +#ifndef CONFIG_USER_ONLY +/* Our implementation of SysemuCPUOps::has_work */ bool riscv_cpu_has_work(CPUState *cs); +#endif /* Zjpm addr masking routine */ static inline target_ulong adjust_addr_body(CPURISCVState *env, diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 3d4bd157d2c..4a7e02d9a99 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -1010,9 +1010,9 @@ static vaddr riscv_cpu_get_pc(CPUState *cs) return env->pc; } +#ifndef CONFIG_USER_ONLY bool riscv_cpu_has_work(CPUState *cs) { -#ifndef CONFIG_USER_ONLY RISCVCPU *cpu = RISCV_CPU(cs); CPURISCVState *env = &cpu->env; /* @@ -1022,10 +1022,8 @@ bool riscv_cpu_has_work(CPUState *cs) return riscv_cpu_all_pending(env) != 0 || riscv_cpu_sirq_pending(env) != RISCV_EXCP_NONE || riscv_cpu_vsirq_pending(env) != RISCV_EXCP_NONE; -#else - return true; -#endif } +#endif /* !CONFIG_USER_ONLY */ static int riscv_cpu_mmu_index(CPUState *cs, bool ifetch) { @@ -2912,6 +2910,7 @@ static int64_t riscv_get_arch_id(CPUState *cs) #include "hw/core/sysemu-cpu-ops.h" static const struct SysemuCPUOps riscv_sysemu_ops = { + .has_work = riscv_cpu_has_work, .get_phys_page_debug = riscv_cpu_get_phys_page_debug, .write_elf64_note = riscv_cpu_write_elf64_note, .write_elf32_note = riscv_cpu_write_elf32_note, @@ -2933,7 +2932,6 @@ static void riscv_cpu_common_class_init(ObjectClass *c, void *data) &mcc->parent_phases); cc->class_by_name = riscv_cpu_class_by_name; - cc->has_work = riscv_cpu_has_work; cc->mmu_index = riscv_cpu_mmu_index; cc->dump_state = riscv_cpu_dump_state; cc->set_pc = riscv_cpu_set_pc; From patchwork Sat Jan 25 17:01:18 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: 13950451 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 99476C0218C for ; Sat, 25 Jan 2025 17:04:00 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbjYz-00014s-9G; Sat, 25 Jan 2025 12:03:18 -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 1tbjYc-0000fB-Bd for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:03:05 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tbjYa-0000ZU-Rr for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:02:54 -0500 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-4363dc916ceso26620145e9.0 for ; Sat, 25 Jan 2025 09:02:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737824571; x=1738429371; 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=jJ0qtgTntar3QVC5dx8kSZPa0KtS/nd9q7NwrkDQJ3Y=; b=jeIIqwa6s7kzfbzx/TlpELFAHWoZwjPZ3BWj8CH6pnzAm2Jqz1cr/BSNF0y95p9Zmj MfnWQulrjyDLlr7oZghRrgUFvkC3qZ5JKL7EoKaGHsxVdO72iWLxvLjpqYP7Kge0FJ3W r332UjQk3VFzECFqJkMi3ofF+lwnQHiEd1Xoat3T9Jle0wSxa99yVnMzNjQmtaNoDHfW HycYz/17EYqQIBatJGYjU88ciV2DK0eIbAVGZhZ9Yba5RPfLwHRVn1XRmqCqEKnA5exf ociRJAldYRknkTC8ZX1XOWdPllT2Turhr5bymawEluMaFSLnihp9s64BJXYlkqMoJ15J QTJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737824571; x=1738429371; 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=jJ0qtgTntar3QVC5dx8kSZPa0KtS/nd9q7NwrkDQJ3Y=; b=QmcaQ/M/1EEPtXvTdB8aQyTo880hbvD0MwzmDiFWYgP2LylXGYoRq0tkY76FO3mDnY GZ7VjFMxnRdoNNT1mQwZxTk7HngTWNbr22sSHTlo6f+W1XvBQ1Q/ETLaQDt4q5yA0Yuf I5Mwnb33Nb7UkKLMhBil97D+6IPhMuOqaG9v9xZb3cUJ0LeMnDgX5z3HmwEIbzmEq84E pPvgcMCQDoJIDDreLj8pWnBkqP5hn7aOgYeDu7g3ttqp+7i+yKJP9os48YSQZuL8Vmq3 P9DyTxRPThp7Zc0EFsxlu2IRPAw2PS59DTJ45MTM4FixEI4AphRKPnQeoB4beroZsLHK hetQ== X-Gm-Message-State: AOJu0Yzz+g9ftGkr90CPrjDCS+EMD1k8Ee9uVQdJhEW5V/DWvZHXeCjS qlqgZCZCdnLE9cKQohwhB/+2dkVW57+aUe46VlS5ZuVMFApPf7gD+oPOP1TaiBt0QUQUoy3HmJZ SB4o= X-Gm-Gg: ASbGncvjfJsLt56wSGSVen0YvaGG+5Ygx2OntjQn9zMZziDOyrrPrNS1YYk9o7LXquV GaIpns7oUPdVIry+SrCdO1kG2bSjGr/6TnK2PWac/0GYgFnnmiwQ4kfsf6AYhKv9lec75x7U4WV 9olewLWRvR7VGj9+KpF+p+tnJqoSxeFPE4rE5D9QHlC8TNfcG4e8XsE+A863uE3Tz3YPuOESeGl nYo2cEr26IbZXz+NFQuk/dtNLw7QLX/1cffXzcM6lXDLxZVeUKAkvyEiWSU26Q2dAQUQBTBs4wx +sOiDV8ZdPd0tmQb6jQTGPD9o3olFOpvQ6HgaiT7n/659hjnWaBjH0Q= X-Google-Smtp-Source: AGHT+IEv3Hzt/kTZI8gbmwC3Ks01IT10ixTeOhpPeNaRHP4VYTWkCqP1WpzyXJMc5CdLtXAbedgA1w== X-Received: by 2002:a05:600c:3c85:b0:434:f3d8:62db with SMTP id 5b1f17b1804b1-438b8841d2cmr112892245e9.2.1737824570910; Sat, 25 Jan 2025 09:02:50 -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-438bd485007sm67899905e9.12.2025.01.25.09.02.48 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 09:02:49 -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 v3 17/24] target/rx: Move has_work() from CPUClass to SysemuCPUOps Date: Sat, 25 Jan 2025 18:01:18 +0100 Message-ID: <20250125170125.32855-18-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125170125.32855-1-philmd@linaro.org> References: <20250125170125.32855-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- target/rx/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/rx/cpu.c b/target/rx/cpu.c index aa310bd6144..79b95090e7a 100644 --- a/target/rx/cpu.c +++ b/target/rx/cpu.c @@ -187,6 +187,7 @@ static void rx_cpu_init(Object *obj) #include "hw/core/sysemu-cpu-ops.h" static const struct SysemuCPUOps rx_sysemu_ops = { + .has_work = rx_cpu_has_work, .get_phys_page_debug = rx_cpu_get_phys_page_debug, }; @@ -217,7 +218,6 @@ static void rx_cpu_class_init(ObjectClass *klass, void *data) &rcc->parent_phases); cc->class_by_name = rx_cpu_class_by_name; - cc->has_work = rx_cpu_has_work; cc->mmu_index = riscv_cpu_mmu_index; cc->dump_state = rx_cpu_dump_state; cc->set_pc = rx_cpu_set_pc; From patchwork Sat Jan 25 17:01:19 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: 13950456 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 22829C0218D for ; Sat, 25 Jan 2025 17:05:07 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbja5-00028W-Ja; Sat, 25 Jan 2025 12:04:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tbjYi-0000fg-Ci for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:03:12 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tbjYg-0000aI-Ni for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:03:00 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-4363ae65100so33565665e9.0 for ; Sat, 25 Jan 2025 09:02:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737824576; x=1738429376; 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=WDsGnhplkgqT/f4agy456szrFVjRVVohKrpBFsRKCFM=; b=lRwvMzNAa1yYJeVXu7dU3OYi4z2SSUAiWQG4n89ZlywwfGiLYb6XdG1HdC+ZG9Gg+b xp49JrCw86Qb6BlCRa6CzGTQA5NoaybM9nEDKYOJsughNX9FbBwjcB3yT10lMbf7eIIv yOqdUTyVkaLdSl+KORqxHPmJnLm7M6W8s4Mh6spJ1Aqz6F5kqVywm1OMrE+60UO1m9LS QFo9/uyWwbkNMXIv8XUBSORLjtSKgw8lgs5uywUpNr0kPxOdLVJaOgy5tXlqVQ6gFkAQ f3WBCJnJywUpyOkGIrP58HNr1qDYTYTn3xJ6MLs7+H6KqMFAbnZ5DtJsi0kw0eMTX17v nl/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737824576; x=1738429376; 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=WDsGnhplkgqT/f4agy456szrFVjRVVohKrpBFsRKCFM=; b=o00eEQGHCqYj40QIWbNaopANeqGFPotxKOI+Wvd6/hxM1n6gUQ6SEL18qSSpTKuwh5 lj02JefS7GqKsQadShBjc4p5u9Cq3MzrG8w3T97mGa0VPrvhXyqmga1pEuUU5mVuSmKt Ul8a9r3DsG7uvoDNkV7bTuZ6TVXpp5tN4JuHTkZKkhG809tFTvPKCjJE69wWifikk6Ww b9n8tEZvic6SVVuiGwww3xxoA4aPV+QSNVkUEEJ3gFqx/mvA5ACh5x7kuwILtn08H5Ls 4n4cRIcgOW7xmWRKs7wfmHhtGGjjbVl+LdIzGVS3Rj/7//uN4HjRw5C/ECNGMQU68j2l QXjw== X-Gm-Message-State: AOJu0Yw72GSaZAWj/LgXpzRQIO7cBUIFQjO/bKwmtYCzlifm3KlPmFcS hOPf5oqf3dkVY0fcryGT3I8zAH5OTpH9Q9tbXpRjBRlOGDvBCrJawvgRWjFaQXRAnN6kYyGLIOc /mus= X-Gm-Gg: ASbGnct06rVgVsqOVUUO8pDalcBs6VPqyQ4YyLQIwegVNNhmIJK0q80jQ7dAVOny/PC DO0HzDy9+/21zp4f6c/dotU0epmIiKyhdB2EuVhR623xe7JVlFJzyplV8Lb4J53u1BvMXuAo6F0 n0kmOyNJqGzuiw5MkvpsyM8b/r52UNCcq+f+q23JCHFmb80OtQccb3eCeit7WxkRT4E0d11sPeu ssCWL8OlvyaPh/CcNiS5kVGdDrB8hKKBiGwFF1PSl+0fj+/9eeOcU2CGrYIRN9yJc9oxnympeEt ulhLDEZxpytrRPdEbjkpcf8/32YUAZY53hsi/jCpfVv5Oya1u/9w670= X-Google-Smtp-Source: AGHT+IHoqC6w0VYGsRgbrHQNSwaFRUCZRo78cWxL/EqZYxSxHuedeANvp5/IkPSOfrlPwIQYVZW7mQ== X-Received: by 2002:a05:600c:1d20:b0:434:a781:f5d9 with SMTP id 5b1f17b1804b1-438913e1b1fmr389270175e9.11.1737824576219; Sat, 25 Jan 2025 09:02:56 -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-438bd4a283csm67871755e9.0.2025.01.25.09.02.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 09:02:55 -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 v3 18/24] target/s390x: Restrict I/O handler installers to system emulation Date: Sat, 25 Jan 2025 18:01:19 +0100 Message-ID: <20250125170125.32855-19-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125170125.32855-1-philmd@linaro.org> References: <20250125170125.32855-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- target/s390x/s390x-internal.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/s390x/s390x-internal.h b/target/s390x/s390x-internal.h index a750e7a343a..6e2c98de97a 100644 --- a/target/s390x/s390x-internal.h +++ b/target/s390x/s390x-internal.h @@ -356,6 +356,7 @@ void cpu_inject_stop(S390CPU *cpu); /* ioinst.c */ +#ifndef CONFIG_USER_ONLY void ioinst_handle_xsch(S390CPU *cpu, uint64_t reg1, uintptr_t ra); void ioinst_handle_csch(S390CPU *cpu, uint64_t reg1, uintptr_t ra); void ioinst_handle_hsch(S390CPU *cpu, uint64_t reg1, uintptr_t ra); @@ -373,6 +374,7 @@ void ioinst_handle_schm(S390CPU *cpu, uint64_t reg1, uint64_t reg2, void ioinst_handle_rsch(S390CPU *cpu, uint64_t reg1, uintptr_t ra); void ioinst_handle_rchp(S390CPU *cpu, uint64_t reg1, uintptr_t ra); void ioinst_handle_sal(S390CPU *cpu, uint64_t reg1, uintptr_t ra); +#endif /* CONFIG_USER_ONLY */ /* mem_helper.c */ From patchwork Sat Jan 25 17:01:20 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: 13950460 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9F661C0218C for ; Sat, 25 Jan 2025 17:05:44 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbjZb-0001e0-FJ; Sat, 25 Jan 2025 12:03:59 -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 1tbjYn-0000ft-Ep for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:03:12 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tbjYl-0000b5-QA for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:03:05 -0500 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-385ef8b64b3so2665965f8f.0 for ; Sat, 25 Jan 2025 09:03:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737824581; x=1738429381; 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=uvyBSQXbzbGPZHAiCl001qEBhi2s4blv2wiDqu84MNg=; b=HOm2qYCiAxmpTOwVpfwkws28aLajeLESxXpkP/xqbG3BXEl13EZy5KPncH+onofTUC 0LROrj9mZc88yj0I/tDGLoQf/sFuENaiMeoKtcbcclzfGYFDzz7pH56VAU11VY6IiH+B VwX7QraChTqSt2/x27eC/BF3XfLr4oiZcjuzG7pQZYr6UFRsjkKpHGQRHNvSb0AS0Dqc 1e42A8QNiWeOD/iqIZW2ZG2YyzTM0ZdZEQoSsd10wWnxfb5kmPSGK6JXAgYucvxlKaXa ReXPLerK83TtXpG0SvwMjWBUOaxXwyrs3KYcYypbDWc6AN9Dv1bqD0NOkTKmCMx6Xv9g z72Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737824581; x=1738429381; 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=uvyBSQXbzbGPZHAiCl001qEBhi2s4blv2wiDqu84MNg=; b=h3eL21V7uXJvGMIx9D3Mb+NIyKIq0x3T2DK/lscvmsvKvHB7/D6DwCbt2d2HOJYsKM 1yxavG1UUVUirPWyPIEQNhsYDIrbIBIXdgTPXM2rvDqcVbZHNu1OEyfpz1dWxuJwVn9C M/oJnHfV8c/GZmDiXbMWfIXi4x7JSpGGe2CYdEsNdmzUDthslaUQe8aJmE0Ho5OX9Ifc TmJ4FoAmyooS+pC7B5jqLnBN5AKwvZhFtI73eI8fcZe4ajHX0bXgr3JmAyuoP5+iYQaa dERXV5cWK6Bu6HF2AdtR0sQDRRhmQlPEIwgfY/Te3HwJAp1l60oKQNBSvqooVlFxVeD0 7/eg== X-Gm-Message-State: AOJu0Yy7LLbGtymeELA4dJbDGnTqMH5huL6T/gaIoS8mrpaiEMEgK/AU nPj0g/zR5uXw82Eccnar8sYQSvpzkbMaDP0NEnY1QsC5uJPrNSWwglL+N1/ikhm1+xKCVmG6g8H NAhI= X-Gm-Gg: ASbGncvJHwg4OByCwqsLZ2zuYLg/wLR1KC6lAnzu3XRlgCCltnVAJbW8gi5/HdsfM76 6q9hcce4Mqazy3ZJmZXIvztVz4rHLxVnwvGyAtK585nhkiynecabQdmQQhz16budzgJUuIFuS73 54Gc7a3m46J74iVyPDO+xZcfj+f9n2Ja9P5RR4NlLS1pnQfEaSz9GfzqeTT8H1uWEWzf5CCogG8 bE4V+cUYPmSGHqVgs4FhJGE4qKWSZB88PLoNVTejd1m4b9A0/7WmnztndJHDDckbWi9Xtj4XUvt ubEozWC3mfL6z4ESs600oTjd+8XjEFNe6o6bcrU9J26DlQVOXYgRgUY= X-Google-Smtp-Source: AGHT+IERcn3a2w2VcHtqbWpaueeYYBpRN2wC2JxtowLbxUdYbHpWrwHilojTmjoFNKVopT2UJL8jzA== X-Received: by 2002:a05:6000:1548:b0:38a:624b:e7fe with SMTP id ffacd0b85a97d-38bf5655d9fmr28413797f8f.7.1737824581494; Sat, 25 Jan 2025 09:03:01 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a188c33sm6106598f8f.53.2025.01.25.09.03.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 09:03:00 -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 v3 19/24] target/s390x: Move has_work() from CPUClass to SysemuCPUOps Date: Sat, 25 Jan 2025 18:01:20 +0100 Message-ID: <20250125170125.32855-20-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125170125.32855-1-philmd@linaro.org> References: <20250125170125.32855-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=philmd@linaro.org; helo=mail-wr1-x434.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Move has_work() from CPUClass to SysemuCPUOps, move s390_cpu_has_work() to cpu-system.c so it is only build for system emulation binaries, restrict functions not used anymore on user emulation in interrupt.c. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- target/s390x/s390x-internal.h | 3 +++ target/s390x/cpu-system.c | 18 ++++++++++++++++++ target/s390x/cpu.c | 18 ------------------ target/s390x/interrupt.c | 8 ++------ 4 files changed, 23 insertions(+), 24 deletions(-) diff --git a/target/s390x/s390x-internal.h b/target/s390x/s390x-internal.h index 6e2c98de97a..a4ba6227ab4 100644 --- a/target/s390x/s390x-internal.h +++ b/target/s390x/s390x-internal.h @@ -245,6 +245,7 @@ bool s390_cpu_system_realize(DeviceState *dev, Error **errp); void s390_cpu_finalize(Object *obj); void s390_cpu_system_class_init(CPUClass *cc); void s390_cpu_machine_reset_cb(void *opaque); +bool s390_cpu_has_work(CPUState *cs); #else static inline unsigned int s390_cpu_halt(S390CPU *cpu) @@ -341,6 +342,7 @@ void cpu_unmap_lowcore(LowCore *lowcore); /* interrupt.c */ void trigger_pgm_exception(CPUS390XState *env, uint32_t code); +#ifndef CONFIG_USER_ONLY void cpu_inject_clock_comparator(S390CPU *cpu); void cpu_inject_cpu_timer(S390CPU *cpu); void cpu_inject_emergency_signal(S390CPU *cpu, uint16_t src_cpu_addr); @@ -353,6 +355,7 @@ bool s390_cpu_has_restart_int(S390CPU *cpu); bool s390_cpu_has_stop_int(S390CPU *cpu); void cpu_inject_restart(S390CPU *cpu); void cpu_inject_stop(S390CPU *cpu); +#endif /* CONFIG_USER_ONLY */ /* ioinst.c */ diff --git a/target/s390x/cpu-system.c b/target/s390x/cpu-system.c index e9f8e7cc72f..9b380e343c2 100644 --- a/target/s390x/cpu-system.c +++ b/target/s390x/cpu-system.c @@ -39,6 +39,23 @@ #include "system/tcg.h" #include "hw/core/sysemu-cpu-ops.h" +bool s390_cpu_has_work(CPUState *cs) +{ + S390CPU *cpu = S390_CPU(cs); + + /* STOPPED cpus can never wake up */ + if (s390_cpu_get_state(cpu) != S390_CPU_STATE_LOAD && + s390_cpu_get_state(cpu) != S390_CPU_STATE_OPERATING) { + return false; + } + + if (!(cs->interrupt_request & CPU_INTERRUPT_HARD)) { + return false; + } + + return s390_cpu_has_int(cpu); +} + /* S390CPUClass::load_normal() */ static void s390_cpu_load_normal(CPUState *s) { @@ -158,6 +175,7 @@ void s390_cpu_finalize(Object *obj) } static const struct SysemuCPUOps s390_sysemu_ops = { + .has_work = s390_cpu_has_work, .get_phys_page_debug = s390_cpu_get_phys_page_debug, .get_crash_info = s390_cpu_get_crash_info, .write_elf64_note = s390_cpu_write_elf64_note, diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index 97d41c23de7..eb2c6650989 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -126,23 +126,6 @@ static vaddr s390_cpu_get_pc(CPUState *cs) return cpu->env.psw.addr; } -static bool s390_cpu_has_work(CPUState *cs) -{ - S390CPU *cpu = S390_CPU(cs); - - /* STOPPED cpus can never wake up */ - if (s390_cpu_get_state(cpu) != S390_CPU_STATE_LOAD && - s390_cpu_get_state(cpu) != S390_CPU_STATE_OPERATING) { - return false; - } - - if (!(cs->interrupt_request & CPU_INTERRUPT_HARD)) { - return false; - } - - return s390_cpu_has_int(cpu); -} - static int s390x_cpu_mmu_index(CPUState *cs, bool ifetch) { return s390x_env_mmu_index(cpu_env(cs), ifetch); @@ -394,7 +377,6 @@ static void s390_cpu_class_init(ObjectClass *oc, void *data) &scc->parent_phases); cc->class_by_name = s390_cpu_class_by_name, - cc->has_work = s390_cpu_has_work; cc->mmu_index = s390x_cpu_mmu_index; cc->dump_state = s390_cpu_dump_state; cc->query_cpu_fast = s390_query_cpu_fast; diff --git a/target/s390x/interrupt.c b/target/s390x/interrupt.c index d68d8955b1a..4ae6e2ddeaa 100644 --- a/target/s390x/interrupt.c +++ b/target/s390x/interrupt.c @@ -30,6 +30,7 @@ void trigger_pgm_exception(CPUS390XState *env, uint32_t code) /* env->int_pgm_ilen is already set, or will be set during unwinding */ } +#if !defined(CONFIG_USER_ONLY) void s390_program_interrupt(CPUS390XState *env, uint32_t code, uintptr_t ra) { if (kvm_enabled()) { @@ -41,7 +42,6 @@ void s390_program_interrupt(CPUS390XState *env, uint32_t code, uintptr_t ra) } } -#if !defined(CONFIG_USER_ONLY) void cpu_inject_clock_comparator(S390CPU *cpu) { CPUS390XState *env = &cpu->env; @@ -225,11 +225,9 @@ bool s390_cpu_has_stop_int(S390CPU *cpu) return env->pending_int & INTERRUPT_STOP; } -#endif bool s390_cpu_has_int(S390CPU *cpu) { -#ifndef CONFIG_USER_ONLY if (!tcg_enabled()) { return false; } @@ -238,7 +236,5 @@ bool s390_cpu_has_int(S390CPU *cpu) s390_cpu_has_io_int(cpu) || s390_cpu_has_restart_int(cpu) || s390_cpu_has_stop_int(cpu); -#else - return false; -#endif } +#endif /* !CONFIG_USER_ONLY */ From patchwork Sat Jan 25 17:01:21 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: 13950452 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4C433C0218D for ; Sat, 25 Jan 2025 17:04:38 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbja0-00025j-Gj; Sat, 25 Jan 2025 12:04:21 -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 1tbjYr-0000gg-S6 for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:03:13 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tbjYq-0000bi-Ft for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:03:09 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-4363ae65100so33566465e9.0 for ; Sat, 25 Jan 2025 09:03:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737824587; x=1738429387; 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=vwxPouX1MPfj+qZCG+Ip7+cwlRNTkTH48zQoUyHbOFI=; b=KDEzypIcXrdoCIYcpCPP6yYxhl1MT7p9KxqvgOsHpzd9eJG4njXzq5VidXys2KL6Yq EooTy+pmkOd7OCDDBVQmhnpIF8o4hRG1iTH8X2fJxm4e5TDR+kOUWF/sKjWLl5lBtqYn aIqMiVifgOt45viUePBzs0yEYF1dE/WAvmlbZ979yZG9JOpgATwthgo8enkk8od9JYrM 6PJjFMHUoAF5w9x+GAsV7CvCx7bWHZkI/EsaVlTGnTk5rSFwulKfkAlPh7uELQGH2XeJ jyztagl7X5jO7ghFbheUECdut6QvfZIWCcZ5LBgws29kEM/f/9ADw/cPaVQUyMeEW35L XdOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737824587; x=1738429387; 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=vwxPouX1MPfj+qZCG+Ip7+cwlRNTkTH48zQoUyHbOFI=; b=wJtrFsQPk41MHn0sfMHIOSplgbZilp2u5DYVZXsJl0A4D9beVAR6JTR/AsuSfgVLn7 ZQ++CewR4lGQVT53e6iRTZgOxDGe58do5AwWTqZMFgh9fZmM2PNz9LE5Az62BWijzU8i wJ4p1/lDTSuZeuvNVckiQ3HvxTm300ZfDWbBznHCy4LJJX5j+pRVaT3qzFrTU5tpBR/8 o727OH2gHmavIVRVtdOOOtro9oIpGQF8fr3ta9PFLC+ldMGjkpd/cAqduB2lcLPRCPy3 y6wpY73K2+OXULQgDmgNu3gPiX6gf4niDRgm9ZRswpu3kFMsUX76xybrHS9ewMmoXjFB 4L9Q== X-Gm-Message-State: AOJu0YyBmb3LELvnUjTLpSo3rLocrZK8cKSqzIFlDV4ffmYpHl0Rqs/d G9KbPknBzX1UHAi/YgE4s6PalLUqmFExh852n04IKgQC8qVEKQ91Qb1xxkyVfLAA9MPJIvzuNCe J+pw= X-Gm-Gg: ASbGncu5Dm6s3//Pjgtr9lHXZkuVYPlQLWe8AkofkBcu8R97fktuEWcOX0Zm1MhLiEq OJnwaN1VsTJsWCk5Fs3fyz1DpO2c6oKOEQN62oujxJyotyOPnp2BnkAdjUMb2aS/R1fz3HUXGHF zT0HdRMJoX6jVGrg4OLCWmBzC1XKtKycKk+LEaJSrXsVjog3xI3wvBkvGQB5LlderHILYY4KV6V wB7MzOx13SpbPgeT/HKUumJv21/g38lnfxqxHpxb3lvATj5DbjsJfx2AWRrlT+sv0AVSnLCcnDX /31mlvoVO6ebEtudCBKwJ74V/56vHBH2Ol4s79/3/vZ7iZEel4FOisI= X-Google-Smtp-Source: AGHT+IHFBz6zGckxsY2quSxGcS6859Z+cQ6pBzEFu5wft7n93wdqwbHJFtGsb9cyytYxfM4MbE2y0g== X-Received: by 2002:a05:600c:8712:b0:434:a802:e9a6 with SMTP id 5b1f17b1804b1-438913ce0b7mr350273185e9.7.1737824586746; Sat, 25 Jan 2025 09:03:06 -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-438bd507dc9sm67320765e9.19.2025.01.25.09.03.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 09:03:05 -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 v3 20/24] target/sh4: Move has_work() from CPUClass to SysemuCPUOps Date: Sat, 25 Jan 2025 18:01:21 +0100 Message-ID: <20250125170125.32855-21-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125170125.32855-1-philmd@linaro.org> References: <20250125170125.32855-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- target/sh4/cpu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c index 24a22724c61..80a66e1f1d6 100644 --- a/target/sh4/cpu.c +++ b/target/sh4/cpu.c @@ -82,12 +82,12 @@ static bool superh_io_recompile_replay_branch(CPUState *cs, } return false; } -#endif static bool superh_cpu_has_work(CPUState *cs) { return cs->interrupt_request & CPU_INTERRUPT_HARD; } +#endif /* !CONFIG_USER_ONLY */ static int sh4_cpu_mmu_index(CPUState *cs, bool ifetch) { @@ -243,6 +243,7 @@ static const VMStateDescription vmstate_sh_cpu = { #include "hw/core/sysemu-cpu-ops.h" static const struct SysemuCPUOps sh4_sysemu_ops = { + .has_work = superh_cpu_has_work, .get_phys_page_debug = superh_cpu_get_phys_page_debug, }; #endif @@ -279,7 +280,6 @@ static void superh_cpu_class_init(ObjectClass *oc, void *data) &scc->parent_phases); cc->class_by_name = superh_cpu_class_by_name; - cc->has_work = superh_cpu_has_work; cc->mmu_index = sh4_cpu_mmu_index; cc->dump_state = superh_cpu_dump_state; cc->set_pc = superh_cpu_set_pc; From patchwork Sat Jan 25 17:01:22 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: 13950462 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C88ABC0218C for ; Sat, 25 Jan 2025 17:06:20 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbja1-000275-T4; Sat, 25 Jan 2025 12:04: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 1tbjYx-0000xT-LS for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:03:15 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tbjYv-0000cG-VV for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:03:15 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-43618283d48so21881595e9.1 for ; Sat, 25 Jan 2025 09:03:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737824592; x=1738429392; 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=wNzeIykutuJ1S2XsFr1DnQpgi/RVEgAeGStb8yeCtY8=; b=nuh0g/kNJ2xzsMnfmBWbxC3rPkpxT/BcPca5FxGH3Edzn54r56S88Wy7nEQNwRQV3Y WQjEUZGWZUMiog1AxlJMxi3XTJUHFEgU8qGFYrs3/k/OjSTBupbqcfE6Zzh5wWQoA9I/ wu86gmJSG9Z7LTNGMP1SvBMbCq8schHluC1SnTEUaDNFlSFl8hiz11yaLB+UDlum5k4+ QvArMLpWOD4Yz12JNwhFKIAo3epbx1+ynhphTSpoy5++dSE3EdUT3gs0WQ+JgKwd8ZsT vLWh4+NYezpIMtVxBEUcstNNdU7hQeg+hwecQDrHE634ty/TY82+Exxdbeci29UWVHTP 5hPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737824592; x=1738429392; 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=wNzeIykutuJ1S2XsFr1DnQpgi/RVEgAeGStb8yeCtY8=; b=DZ/75B+wURV7jR04H1h90WNTMzn/7jv7MCcSCMiak0CTug/uxtbGfxH5oWlSVowZXD 0pXIx9vsQwSjno7Eusvd+hOqChjPs04GhUbSmvufq8f9xIGlR3d1LYDMDortPeMosWMX p4t+bbAHic4K4bZiTssPII7dk3OXuqwvQi+z559H1/Njl+oPc53AU84kgN7QdBJfLDpn bDgU+Fwnjlm7l8WwOgUin/kqRUjaIGfH8+5NvbFUZ2iT5XzBeX6g6q669q+5+VdbA/1d oxPnVyUg9LgS3DeNQI6qmSO76nOmYq/rfsaP0Xmj5DxfIvWIk3eJN/8qBQDQMUvqXkeH 39xg== X-Gm-Message-State: AOJu0YyX5NwH7sFNnLIxzQN7jo7FCb5yLnd/kKPA63YZxbPiycnsCP+M bW5DK1dg+qoAg4xMdlNtiTd8nxx6ObpTm+hwS1Q0lz+kndVKdUPTgh1Gp9mdlBgHqsNwdTJ9zBj CGlQ= X-Gm-Gg: ASbGncvAKfdfQNpxmjymWd46WsjDXXfJZUNwtzvnx9uVHI9l/mfyI/3Wco+jXbKF0q7 LTe/f10NhMqL+sXaIrFSPWZGjvjcg31PUkqk1Pq3UOdjMHW9S6XJ/UbTNMK6uPgZOfXzXtBhx8D iyOVOXKgkXHwf4cZ7QktBUifS2SJjBCMgjaSq0xWO7eeKX3PGBb+ibBCDxBYx0Mixb+qidOCXLD teg4M+ZKk8IXPcN2yGhj5XX/JS5NGHHkTgiQRz3DgIkzoC8vukLSbAg0rB41R4CL5GyQXhb+g6V OmReZkfiymIjp7VcDpjO14OlDfLjtENv0kPh6iFfK8fRMk6ztlveW48= X-Google-Smtp-Source: AGHT+IG6C5FVjJO3taUHiZaJ0M2z3Ygvj2xrDOGGUI75F6jQ086TAhu/Q2MFm7/NxuecWidK/yL9bQ== X-Received: by 2002:a05:600c:1da8:b0:434:a711:ace4 with SMTP id 5b1f17b1804b1-4389eca3ca1mr338915585e9.17.1737824592051; Sat, 25 Jan 2025 09:03:12 -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-438bd5732edsm65694935e9.36.2025.01.25.09.03.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 09:03:10 -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 v3 21/24] target/sparc: Move has_work() from CPUClass to SysemuCPUOps Date: Sat, 25 Jan 2025 18:01:22 +0100 Message-ID: <20250125170125.32855-22-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125170125.32855-1-philmd@linaro.org> References: <20250125170125.32855-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- target/sparc/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index fbd38ec334a..94e807f9f84 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -776,11 +776,13 @@ static void sparc_restore_state_to_opc(CPUState *cs, } } +#ifndef CONFIG_USER_ONLY static bool sparc_cpu_has_work(CPUState *cs) { return (cs->interrupt_request & CPU_INTERRUPT_HARD) && cpu_interrupts_enabled(cpu_env(cs)); } +#endif /* !CONFIG_USER_ONLY */ static int sparc_cpu_mmu_index(CPUState *cs, bool ifetch) { @@ -986,6 +988,7 @@ static const Property sparc_cpu_properties[] = { #include "hw/core/sysemu-cpu-ops.h" static const struct SysemuCPUOps sparc_sysemu_ops = { + .has_work = sparc_cpu_has_work, .get_phys_page_debug = sparc_cpu_get_phys_page_debug, .legacy_vmsd = &vmstate_sparc_cpu, }; @@ -1027,7 +1030,6 @@ static void sparc_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = sparc_cpu_class_by_name; cc->parse_features = sparc_cpu_parse_features; - cc->has_work = sparc_cpu_has_work; cc->mmu_index = sparc_cpu_mmu_index; cc->dump_state = sparc_cpu_dump_state; #if !defined(TARGET_SPARC64) && !defined(CONFIG_USER_ONLY) From patchwork Sat Jan 25 17:01:23 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: 13950468 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8490DC0218C for ; Sat, 25 Jan 2025 17:07:37 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbjaP-0002fq-3A; Sat, 25 Jan 2025 12:04: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 1tbjZ8-0001Kp-6J for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:03:28 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tbjZ6-0000d2-IM for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:03:25 -0500 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-385e06af753so1663991f8f.2 for ; Sat, 25 Jan 2025 09:03:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737824596; x=1738429396; 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=UZ8BDmUkV3T9ZQW07wpYEtUOuZG1AGKnmguq5EirG8g=; b=daTNnmdrWymOI3a4ufZq3/YE/70jdcWkWpnKOA1oKerB7syhRZlwgJ592ngJ4sGHSd EyeJlnXBfkp58wsrqgDa3MmwlwoC6YG1hZnfztCb9xFUZm5l/Win/E2AQB3fdFHJikFD Oo5WAPEZaVC4iYTYbNYmIJJDQA3YdAkRH7jyGFZ72msUjsSJ8e5yJXH1gAjchJrbKblW QgwznaQ6TQsu9YZOa8PP9DNm+FlaLlIHtqavOSurp24vxLrNyjhfOtyWFHaIgCOSvbh+ kyItlRIZNn9gi4oQRHYZL1Oi7Z2CTgBr8l07jdYDM/fwl/tN+T1gXIEKNQSJHJETnxUA uG8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737824596; x=1738429396; 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=UZ8BDmUkV3T9ZQW07wpYEtUOuZG1AGKnmguq5EirG8g=; b=JbBxSsxbAo5ujqC0I7Bq21wB8COnqq8SSL6WxQ5e9ijW7AckVkahGWPydp7gdgUbCx 35OeBURV4W24SJNsHkNMdnbcKQnusDH5yKQPo+eJxCgw2ImmBF9qHxYFVji/bBTTf70l 0T/kFvdRzTajfu7GywuXYrMt6eLCDoKZdiAEKL8bJY8siD+wosWYCRJMZXfL3tb+dU8n kvNf+WLSUrJfX1H2C4Na+BMdt4gKGN4qs8W10t671mYoPgNi5w78ofmZdYM3sM1v67yf VT+RT9wyAfj1rt3RireLKBr/+99Tzr8xtkKWh8euXnXxyUrZ/a0DwZ32mbfPQJGVCE0A F8Dg== X-Gm-Message-State: AOJu0YzH6r3rd0T91ZrcNnm1x2v7L9D/h9fD+ASx5PLquwzBOy0X9evM wVFkaHSH/h2XbRHUx0hAc7PSY2v5uVsPXK1niKafxxDgAKOWaXA+E+OwQu83hoHMf46LJMf9yZl ZjK4= X-Gm-Gg: ASbGncuQBp+QJCOYey4sOTaz5xG/R2IRnfXQaJphda9fxovMI8Zi9TsNQOLiHIj8BZr p+eMqaTOK4Q7gINOSX/s5YoH1QcKRWKyaXWG2m6PMl2E2SlQ95TkFYywnmWBCerv/QvpTyEGCE0 9tqZI6oMBukLvAD0DPDhry/BFF+BCrXeBFDLu40Lm03mm36x4bCWYHYUZdVTmLE3sArP6xfDpON XFCqM3D1AdTJL32xMYAIVhC7cF4HVYK/wuAdGczYU87R1lPl288O/EF1R6cfqYimMr5NAY04RjU wGsM9+OaiVjmXtRmGsUhA9MkzZd4PYzkRddex1/db9o4yeBspHAPepkCG8lwkCCwcw== X-Google-Smtp-Source: AGHT+IE48i6Bsk0bhd/YTaWz6+JrmmJLB1KFdVbHgndtEAI1v8DNT/fmollC/FqLtkBPLnLnA0oLGw== X-Received: by 2002:a05:6000:4008:b0:38a:624b:e37b with SMTP id ffacd0b85a97d-38bf57b642dmr29881098f8f.53.1737824596562; Sat, 25 Jan 2025 09:03:16 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a17633dsm6057072f8f.15.2025.01.25.09.03.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 09:03:16 -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 v3 22/24] target/tricore: Move has_work() from CPUClass to SysemuCPUOps Date: Sat, 25 Jan 2025 18:01:23 +0100 Message-ID: <20250125170125.32855-23-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125170125.32855-1-philmd@linaro.org> References: <20250125170125.32855-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=philmd@linaro.org; helo=mail-wr1-x432.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- target/tricore/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/tricore/cpu.c b/target/tricore/cpu.c index 95202fadbfd..e4f95876efd 100644 --- a/target/tricore/cpu.c +++ b/target/tricore/cpu.c @@ -165,6 +165,7 @@ static bool tricore_cpu_exec_interrupt(CPUState *cs, int interrupt_request) #include "hw/core/sysemu-cpu-ops.h" static const struct SysemuCPUOps tricore_sysemu_ops = { + .has_work = tricore_cpu_has_work, .get_phys_page_debug = tricore_cpu_get_phys_page_debug, }; @@ -193,7 +194,6 @@ static void tricore_cpu_class_init(ObjectClass *c, void *data) resettable_class_set_parent_phases(rc, NULL, tricore_cpu_reset_hold, NULL, &mcc->parent_phases); cc->class_by_name = tricore_cpu_class_by_name; - cc->has_work = tricore_cpu_has_work; cc->mmu_index = tricore_cpu_mmu_index; cc->gdb_read_register = tricore_cpu_gdb_read_register; From patchwork Sat Jan 25 17:01:24 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: 13950464 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B50C6C0218D for ; Sat, 25 Jan 2025 17:07:27 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbjaO-0002dB-Mt; Sat, 25 Jan 2025 12:04: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 1tbjZ8-0001LT-8Z for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:03:28 -0500 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tbjZ6-0000dO-Ia for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:03:25 -0500 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-385e1fcb0e1so1511657f8f.2 for ; Sat, 25 Jan 2025 09:03:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737824602; x=1738429402; 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=0UoGE6unHTvdGpTVXrJG1+71hPq/Dfx21A2EoHEuKVI=; b=rHJKJoCAVg5Rbx2yswL0xGHxg5CxDn36g3kXFPxPCenmJPX4gotKOmmLtzjo1X0+sw /Jc7SJ8lm274ku09Zb1rWYf4c+ZTz000yjktWH7RDXloUyO2WtSI9BMLe43gTbzisS2L GRhkhXpNjuez2QTFcOmP/bTMXzu4OOV4qnkprFPpvFgTWJSEolP2ZWG2BTa4e6QbTcUY 57Av3taKdJsyefBMkdYgW7maEqtLtOxG5VmDGWvhUq9le/khWcyza32KusJZR2tvAYLY 1ImvXVgKsdMMZH9Uq8HxilaFZgP4LCeZEGBT5zibI0CVc+18GrOkpJtjrBSw7f7A3XtZ SXEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737824602; x=1738429402; 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=0UoGE6unHTvdGpTVXrJG1+71hPq/Dfx21A2EoHEuKVI=; b=fVGA/b27BH2/6rQTKuiNGXnOUz2ESHR4YKs8nWjStU3SShF8d6YFG51Q47Bq+i7sbu ZJPYV7hqDoc4ZKKI1hYiMjHwZWe36UaeOeOlRoLmfZtKjiM9oiqTh+Bkj8L4ExRzRLVJ 3Jfsk6U/9M3I3X+3LAuOAgJs/DIjn+hfGpzRgDzM9xCBxyNCB+rVdzPO3Tzqt6KB1Kpd B8Oogi9Jq19mGmueb8OO6eImvWvvgUyk37K2ybtBM2DxeAj3XL1mYK43DNgWNxYgnKzc wHdeeeS+poYzFQOlfRkmsNTuRb9hvlU6z1VIgJhvdTjy8bKUnQfZFhR0ijks7Jv7bDmx Y3dA== X-Gm-Message-State: AOJu0YzyVSyHK56J/sknkQ3uFedXbxzfUfawPigTT5TheB6tM2jKr+l7 n/2gSUgtwmIL24rmLgGLXJpb7O1og3sqDsaudqa30Qgo4OLADSKxBDU6mvfLFPHqAj0ivcjFlt2 7bns= X-Gm-Gg: ASbGncvz4wN5GgKqAi2I+B2BTXsK6g7AJ/FIRLJIvVJrIT44ywS4YYqcwnCTst1ixkT IgAuBrhGvluZ2pYRxc2vUXaTyeqVZnF2o2AbMZfAknRjpUHki6Ge9K7wswzMnz7EXwYB1YCUm8+ ly2iCVXyoUKqr883Rj+unsaPXCuRr/v7P8yUrev7JgB4hUYfDud0djqa4YPas5MzH/9usFDv4G8 GWFM2lR44E5P/4wg3aSVHcv8aWYlqfpZ6Dwob4SeYXqjj68PSgIMy9IpVS2NfRomqv/lioQCuLD gt+trvOGUqf+u7tDLolsLkkFRabrHnjiabr7oFikmrQSgvnwlRimE5A= X-Google-Smtp-Source: AGHT+IEInYJsTGlqV2iykNYhg8sbEQVCROB5r5O0Df5tsbMDKfC5jiZtoHru7+z0OcLyTcSxWGuHPg== X-Received: by 2002:a5d:4007:0:b0:38a:888c:7dec with SMTP id ffacd0b85a97d-38bf5675e61mr29143662f8f.28.1737824601802; Sat, 25 Jan 2025 09:03:21 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a1bb040sm6018422f8f.67.2025.01.25.09.03.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 09:03:20 -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 v3 23/24] target/xtensa: Move has_work() from CPUClass to SysemuCPUOps Date: Sat, 25 Jan 2025 18:01:24 +0100 Message-ID: <20250125170125.32855-24-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125170125.32855-1-philmd@linaro.org> References: <20250125170125.32855-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=philmd@linaro.org; helo=mail-wr1-x435.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Move has_work() from CPUClass to SysemuCPUOps, simplifying xtensa_cpu_has_work() by directly using CPU env. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- target/xtensa/cpu.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index 4eb699d1f45..c5d7682f4bf 100644 --- a/target/xtensa/cpu.c +++ b/target/xtensa/cpu.c @@ -63,16 +63,14 @@ static void xtensa_restore_state_to_opc(CPUState *cs, cpu->env.pc = data[0]; } +#ifndef CONFIG_USER_ONLY static bool xtensa_cpu_has_work(CPUState *cs) { -#ifndef CONFIG_USER_ONLY - XtensaCPU *cpu = XTENSA_CPU(cs); + CPUXtensaState *env = cpu_env(cs); - return !cpu->env.runstall && cpu->env.pending_irq_level; -#else - return true; -#endif + return !env->runstall && env->pending_irq_level; } +#endif /* !CONFIG_USER_ONLY */ static int xtensa_cpu_mmu_index(CPUState *cs, bool ifetch) { @@ -224,6 +222,7 @@ static const VMStateDescription vmstate_xtensa_cpu = { #include "hw/core/sysemu-cpu-ops.h" static const struct SysemuCPUOps xtensa_sysemu_ops = { + .has_work = xtensa_cpu_has_work, .get_phys_page_debug = xtensa_cpu_get_phys_page_debug, }; #endif @@ -261,7 +260,6 @@ static void xtensa_cpu_class_init(ObjectClass *oc, void *data) &xcc->parent_phases); cc->class_by_name = xtensa_cpu_class_by_name; - cc->has_work = xtensa_cpu_has_work; cc->mmu_index = xtensa_cpu_mmu_index; cc->dump_state = xtensa_cpu_dump_state; cc->set_pc = xtensa_cpu_set_pc; From patchwork Sat Jan 25 17:01:25 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: 13950467 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BD3ADC0218E for ; Sat, 25 Jan 2025 17:07:33 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbjaO-0002c7-B7; Sat, 25 Jan 2025 12:04: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 1tbjZC-0001Oe-AC for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:03:32 -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 1tbjZA-0000e1-8E for qemu-devel@nongnu.org; Sat, 25 Jan 2025 12:03:29 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-4361e89b6daso19837935e9.3 for ; Sat, 25 Jan 2025 09:03:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737824606; x=1738429406; 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=Rdb0ypEDsi4ZAVccAGxZ8eIstaDxtSjHIYFijJWmmFk=; b=gZN9ro+aReynZHixvB9jO1ExtoYZBPAhnne97zNXiTCY9OrZ3py1Sb0wsdk8uV3SeV lp6EElrAkqpbZRpff6NcAv/7WfjbbaFilnMpWCDJjSeNGVq6xKOG9b4iUc9N+ZowRpfF nNjuOtpeyXFX5dBWNbiKu2F4K6oz+CEfTNjwhBtjljJIl0ImHd8As+FK7DoT60OcmJ+b 2piTUhG4CQXwlcG3KQLUISI4zyY+5f1e5WCl8ey+PbByPDCyZ7oteQPZ+JyNcITmD0K4 hU1oV7ex4x5RI3deucWWtwncyRsSEYyIMIFXWQQ+7X5JZeUj+sGxZPclgAoyRB1eDlGy lTKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737824606; x=1738429406; 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=Rdb0ypEDsi4ZAVccAGxZ8eIstaDxtSjHIYFijJWmmFk=; b=ukogzRxZ4zWlaMutYj+u1uDx4wA8CwTazcqUXYxeRIDyookIpIqCP/BTEGBTH6+In7 vD8N5O+nTGrz11FLuQz17IQtTXkl+eSOmoduB1E1ZyzHgO4vl1hojGb7dolgJ+WIz3G/ qXmESwzbwetxczQa3bkipnpjLn0lhCOSLwFZJPTXp4z/ngSK39237DFj9C06jKhH5WVv bs9EYGEIj/r8TwcwUtOhLYRbXNGXxXZNGQkaR+Mp8rxNDoZKvCNxyagTk88tQD/DH7dn bX/TLBoRuqrBuDeO355cW8zLcisvJG3bBcjGCudYMHn5+e1MKQy+WagMkW9H6/PRiPVh tZtQ== X-Gm-Message-State: AOJu0YxupJIJOEF1kT8rxTW+5ZjlNeM7UfrzZ62KTis9zjboO8CM5Lf3 YaOiHAteknPJPa5/SMO0aYMPkOQiQQZLYrIgu8W9Bl9Qd27Q5kpCV3NXRXe4opX5S5gYnSYUx/5 ZuII= X-Gm-Gg: ASbGncuT+i4+BTFQu6i+Fz+UvU4W5Rw6MSTwtGvuQlhhkmleh2pV4bSerpcxW8KW5TS C9bi5o1i6SEuTM75MzOXqhhOTHhtOajfsbv7B4LylmQhaL8mryuei36nURPZVfmQ0irjtOMNqK0 IeSngfeF//E7t1W2NNkrkyUC8dYCAN7T9+OWCyX+U71zV/dZ8Vq0P1RC4vuxfGmIILusr4qg5hD N6gWgiP71d5by2+c/7mQe8l6nhqdJ/eTqxur6iSRFfRkBd33rrgTRwvoOZwUlRC7LaxNz1zOSU6 8tPwayIEMZdyOCM2w2yHDNdGaNX+IxpUFamIuuaa8h6wo1clRN2PgKU= X-Google-Smtp-Source: AGHT+IHufRuDMzWIND9qAvZ+/yVS47S6POZn6N0YcOAXn0EO9klK345dLDz9u5aM+yL+2pUVstmmwg== X-Received: by 2002:a05:600c:34d0:b0:434:fbda:1f44 with SMTP id 5b1f17b1804b1-4389142e805mr294675485e9.19.1737824606342; Sat, 25 Jan 2025 09:03:26 -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-438bd54c0ecsm67553925e9.30.2025.01.25.09.03.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 09:03:25 -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 v3 24/24] cpus: Remove CPUClass::has_work() handler Date: Sat, 25 Jan 2025 18:01:25 +0100 Message-ID: <20250125170125.32855-25-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125170125.32855-1-philmd@linaro.org> References: <20250125170125.32855-1-philmd@linaro.org> 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, 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org All handlers have been converted to SysemuCPUOps::has_work(). Remove CPUClass::has_work along with cpu_common_has_work() and simplify cpu_has_work(), making SysemuCPUOps::has_work handler mandatory. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 3 +-- include/hw/core/sysemu-cpu-ops.h | 2 +- cpu-target.c | 8 ++++++++ hw/core/cpu-common.c | 12 ++++++------ hw/core/cpu-system.c | 7 +------ 5 files changed, 17 insertions(+), 15 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index d64c823e768..42795f12290 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -104,7 +104,6 @@ struct SysemuCPUOps; * instantiatable CPU type. * @parse_features: Callback to parse command line arguments. * @reset_dump_flags: #CPUDumpFlags to use for reset logging. - * @has_work: Callback for checking if there is work to do. * @mmu_index: Callback for choosing softmmu mmu index; * may be used internally by memory_rw_debug without TCG. * @memory_rw_debug: Callback for GDB memory access. @@ -151,7 +150,6 @@ struct CPUClass { ObjectClass *(*class_by_name)(const char *cpu_model); void (*parse_features)(const char *typename, char *str, Error **errp); - bool (*has_work)(CPUState *cpu); int (*mmu_index)(CPUState *cpu, bool ifetch); int (*memory_rw_debug)(CPUState *cpu, vaddr addr, uint8_t *buf, int len, bool is_write); @@ -1154,6 +1152,7 @@ G_NORETURN void cpu_abort(CPUState *cpu, const char *fmt, ...) /* $(top_srcdir)/cpu.c */ void cpu_class_init_props(DeviceClass *dc); +void cpu_exec_class_post_init(CPUClass *cc, void *data); void cpu_exec_initfn(CPUState *cpu); bool cpu_exec_realizefn(CPUState *cpu, Error **errp); void cpu_exec_unrealizefn(CPUState *cpu); diff --git a/include/hw/core/sysemu-cpu-ops.h b/include/hw/core/sysemu-cpu-ops.h index dee8a62ca98..877892373f9 100644 --- a/include/hw/core/sysemu-cpu-ops.h +++ b/include/hw/core/sysemu-cpu-ops.h @@ -19,7 +19,7 @@ typedef struct SysemuCPUOps { /** * @has_work: Callback for checking if there is work to do. */ - bool (*has_work)(CPUState *cpu); + bool (*has_work)(CPUState *cpu); /* MANDATORY NON-NULL */ /** * @get_memory_mapping: Callback for obtaining the memory mappings. */ diff --git a/cpu-target.c b/cpu-target.c index 98e9e7cc4a1..778f622b07a 100644 --- a/cpu-target.c +++ b/cpu-target.c @@ -230,6 +230,14 @@ void cpu_class_init_props(DeviceClass *dc) device_class_set_props(dc, cpu_common_props); } +void cpu_exec_class_post_init(CPUClass *cc, void *data) +{ +#ifndef CONFIG_USER_ONLY + /* Check mandatory SysemuCPUOps handlers */ + g_assert(cc->sysemu_ops->has_work); +#endif +} + void cpu_exec_initfn(CPUState *cpu) { cpu->as = NULL; diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index 886aa793c04..eae621f942f 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -134,11 +134,6 @@ static void cpu_common_reset_hold(Object *obj, ResetType type) cpu_exec_reset_hold(cpu); } -static bool cpu_common_has_work(CPUState *cs) -{ - return false; -} - ObjectClass *cpu_class_by_name(const char *typename, const char *cpu_model) { ObjectClass *oc; @@ -304,7 +299,6 @@ static void cpu_common_class_init(ObjectClass *klass, void *data) k->parse_features = cpu_common_parse_features; k->get_arch_id = cpu_common_get_arch_id; - k->has_work = cpu_common_has_work; k->gdb_read_register = cpu_common_gdb_read_register; k->gdb_write_register = cpu_common_gdb_write_register; set_bit(DEVICE_CATEGORY_CPU, dc->categories); @@ -319,6 +313,11 @@ static void cpu_common_class_init(ObjectClass *klass, void *data) dc->user_creatable = false; } +static void cpu_common_post_class_init(ObjectClass *klass, void *data) +{ + cpu_exec_class_post_init(CPU_CLASS(klass), data); +} + static const TypeInfo cpu_type_info = { .name = TYPE_CPU, .parent = TYPE_DEVICE, @@ -328,6 +327,7 @@ static const TypeInfo cpu_type_info = { .abstract = true, .class_size = sizeof(CPUClass), .class_init = cpu_common_class_init, + .class_post_init = cpu_common_post_class_init, }; static void cpu_register_types(void) diff --git a/hw/core/cpu-system.c b/hw/core/cpu-system.c index 7b16bda2250..32d09757169 100644 --- a/hw/core/cpu-system.c +++ b/hw/core/cpu-system.c @@ -25,12 +25,7 @@ bool cpu_has_work(CPUState *cpu) { - if (cpu->cc->sysemu_ops->has_work) { - return cpu->cc->sysemu_ops->has_work(cpu); - } - - g_assert(cpu->cc->has_work); - return cpu->cc->has_work(cpu); + return cpu->cc->sysemu_ops->has_work(cpu); } bool cpu_paging_enabled(const CPUState *cpu)