From patchwork Sat Jan 25 16:05:29 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: 13950410 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 4914EC0218D for ; Sat, 25 Jan 2025 16:07:54 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbiff-0004Ey-GC; Sat, 25 Jan 2025 11:06:07 -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 1tbifc-0004EH-Hq for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:06:04 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tbifa-0000Xm-1h for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:06:04 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-4362bae4d7dso21563615e9.1 for ; Sat, 25 Jan 2025 08:06:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737821160; x=1738425960; 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=m5g5vPUvVTU28PO/rNOWnQpYVJ7Q9IWKRaYO280B1Bxu3bImx2uUUF/R6FNc1lfR6y cPb0o7nIA2CObw3GmDKuG5xXemI7aKQVn/2c5IQASlPNbz/1K9v9rfkn6jP//HlzJXsE Q38iuDjQOV2H8MTNkwv0Y98GBtcALa+X92QybBvjESMvKh6dfo/IzGntDz/R70B/eScw g0ggOQ1Owq6F+OvqgN2R22pPiVkI/gnIrWtmHAWctStH/wYEdlqYIozRgtc4PLHAGvIN O/LJaJ9hJ7OZsUkPm0M8eFM2sWzrddhX9wUctvMrmKXsuMcJTufl/BlnnGSQQjX0eyeo HJBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737821160; x=1738425960; 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=dVVXjWbqBMUCZdqvI5bquXsMDsPLFI60Ufv296NzoC0tjPDyXswSnmDypYLL+mm6zA Nng4tK1qDGu8xRYCACwpsRWTULy2UJrL2+0GDYczkoEHtbuQQOS8nV46M1DkjNgQ5DF+ +n5+6ztx/D7Aa/RkYvq8X6gzqtapYXn6fLfDSo5CifXNPGo1qditDELLByKHmgo3w3tf OXFBFjkGmVlppHgqoheecqUiJlGDDY/fGwLEqC5cbm93JfZ7PkvGvTKpcnm/Ver6In06 ipdssUoNRLdsT3VLIsdoEspKhu0V3pMFNW8Sq9NpFH9ripj62RAe3V+PBAr2SzW8nSze j6Dg== X-Gm-Message-State: AOJu0YwC3HUy+0ivqswMeP+RswHonQrTwGOWu4ewG0fHLjhm1BE6mj0Q 4zhfZt0TFpDjeZ7L2fDjLC15pXcub6bp1NwJO1kfmoDKO+m/t25bdCRkX4hhwz20ozEIlNzAWr/ 41X8= X-Gm-Gg: ASbGncug6CT1y/mVdb/FrCka5ukUW3ymoBZE+rp5Z/pkdexn8DY9Z1KjJ5wjKkiIvMM qIPd0UOlS7zxhWNcadoS21BWgNgthaBZD0V9u8OIC+z0gjECyjrl023i0z9QjDLroNJe0Bx05rI +AJVKsjqpHZOAaFUoYTcu6YfJuSBE5GPVP6HBRP3/dAO753zNT0tTv0dce5FwEWSLVyVtLjmrjr 1J8x9NY0PwuAig9tJ7qdjG5Gj8J+Y2I1LU8iRoEwmoTk/YmAzmFmWmsUdc1BgOPlB2ZFTkdx5Yc +dA7fX3U8ZMQ4OSvGBXzI3Ca2+x0nH2wD6YH79vRL+EOZvWuCXwsiVo8YRocWwVVs3UIsPE= X-Google-Smtp-Source: AGHT+IHAk1+UZkrJv7uDCSyFTymU5qzz37rS87JjJUVKhZT2JFbsaXkTcYMpM2DbMN7Z9CSMF0IsUQ== X-Received: by 2002:a05:600c:4f42:b0:434:fa55:eb56 with SMTP id 5b1f17b1804b1-438913cf805mr337515805e9.7.1737821160078; Sat, 25 Jan 2025 08:06:00 -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-38c2a1c3c8csm6008399f8f.90.2025.01.25.08.05.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 08:05:59 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= Subject: [PATCH v2 01/24] cpus: Restrict cpu_has_work() to system emulation Date: Sat, 25 Jan 2025 17:05:29 +0100 Message-ID: <20250125160552.20546-2-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125160552.20546-1-philmd@linaro.org> References: <20250125160552.20546-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, 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 16:05:30 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: 13950407 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 4E446C0218C for ; Sat, 25 Jan 2025 16:06:48 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbifi-0004G5-Kr; Sat, 25 Jan 2025 11:06:10 -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 1tbifg-0004FV-K1 for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:06:08 -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 1tbife-0000ZF-MV for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:06:08 -0500 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-43625c4a50dso19813095e9.0 for ; Sat, 25 Jan 2025 08:06:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737821165; x=1738425965; 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=L+ynEg59YTATX2djMwimpEAgxBPjEmIWqOBEnQyCEGf5EVnQRXxcmUyI8jl0EES8mn g18FKF6Pe0f6BaBGM8VW+30ZuNYun+79Urcbf/I0mvIn3DOL8GQicTUSXQS55F09lell NXmmjuouCqoqDx+bXkxHP3gC9ptfNQQoPXMVS7OjlMPMtrh2fLkoHy1i6H2SkHjFxJSE s+ePEKJa5Zxcq3jU1+J+TibUiKOUqUBugpBdw4KrEFpw/wefn5Wb5pn8jImk54UbMAQR 9cJ6nNqu6vVFanr5ADNHJ7eSXWNGq5jW6oxFZmM+sIt0+dlQ625kwawybvBjrxeUr4+S 0keA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737821165; x=1738425965; 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=hKDAth9BrEj7mNPy9nI1m2tSi88J74DtW7026VrmKoUoR8FOitEB3lZk9N7JYzextO iIm56pC2qu2XlkTwzvNzS3Oa7MAApPhbKI/A8zvxHKS9cJJZmGdmefgxfVzMMYeEljjZ lI2NB68njmqTAojLAfvvITqEkaCFKzi6amJCnNnaODMNUGOLJaxTbH/+k9c5PPIbPDka 3ptF3tplKuxhJBOiPJtpn3qg0XlIORq8g0rEAkWthUS3L6Gx1fiep1QeJLpzNJROwYOd +eHlgnlMPezVQDEKCxv628swl6KzVz94V1TlENPtmqQinlZIT+RCIy1JNLZ7LVP2gdzx 8eDw== X-Gm-Message-State: AOJu0Yz4VAwobDxd6keZzNoGF8yFnOU5oPdTjvKEFigYUV9IeWSwL45/ QFmReg4rNn0iq02MMXYwmArPYTNuZulyWKv5VHrpJKdlvZy1mOoHnlXeolkKbdoM5ZmLIOel1Ln OZc8= X-Gm-Gg: ASbGncukV2U9YCl6eP2wW8ORWAygSxNc0ZPeYr87imHjSOGm5j9Qg/mzKN2wjpEKy60 c/OCg/1VnaogUojAv3MxMf1Bq0h2D1/V2vunbR+Hzwppk+0uUhYDqsR7B+b6dj1x2d6eoAC1sKE xKXnXmsrQMjVBjyqNM9bszGlGZuvQb1Z+wUBN3MdfgBNYv3RqBS4FTtsVc1f77apyIHXQaJiXq6 InkP+nf8ETsuH8Gs/Wm+Mn3LK/I8wnosclcYvW+awN+sV2t24ifZcUZ2E+setcT4hO+FhzJumMy wNDRpppRkZ2164qrKCGKUC08rMRs0F7hXWaRvSfPSiIxCG5P1aFysiVNd/8S X-Google-Smtp-Source: AGHT+IHulbjfJra9BA5XAoqH3yZculUe+FioSiRYi/YhQqd5pcfvCZTOlnSq+AeeVFwkh8hZAwU1DQ== X-Received: by 2002:a5d:620f:0:b0:38b:d765:7027 with SMTP id ffacd0b85a97d-38bf57a2675mr24349477f8f.41.1737821164688; Sat, 25 Jan 2025 08:06:04 -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-38c2a17d7bfsm5942195f8f.35.2025.01.25.08.06.03 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 08:06:04 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= Subject: [PATCH v2 02/24] cpus: Un-inline cpu_has_work() Date: Sat, 25 Jan 2025 17:05:30 +0100 Message-ID: <20250125160552.20546-3-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125160552.20546-1-philmd@linaro.org> References: <20250125160552.20546-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::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 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 16:05:31 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: 13950414 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 D00A9C0218C for ; Sat, 25 Jan 2025 16:08:46 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbifo-0004IQ-UV; Sat, 25 Jan 2025 11:06:16 -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 1tbifm-0004I7-F4 for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:06:14 -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 1tbifk-0000c1-SW for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:06:14 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-4361b0ec57aso32235675e9.0 for ; Sat, 25 Jan 2025 08:06:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737821170; x=1738425970; 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=wMDHUySxNc/jdwJQSdsfaazG08wfO4dBlH28e33m/Q24uh2ySJGVL/Es3a8/zxfHl+ sOYAtY70BgYCz8vcozlI7KUpnnds7LKaYEqbiC02ljK0lil80ugJpcIdqT5ptdvUmWvU VQNhntcKi/J2yNIvEYLvUOzEIx1ovMp+9Ct8N9FANJjgGXtquv/yb9DZUURNa1T/sHVp A3URdZbAE3tqYMBkc0RT9ZNrI1zvBUp/Xnq5sLn5KUTGa3ePDkQYzy5qdBMJGXnNosve K7F98VDqIW+K3OYYXJqmrMpdMttN/o3Za/1dgefoKDcOdgXJXDnsOJlww+iVAbQCNjds yAiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737821170; x=1738425970; 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=Rpeu9mkxxcED5jGQaKCY1GT39neITJANujSKy4yI6BkBst+FVFLkSZ0qdaON+yzQmH +nrR3smrLauqDla26LvL9UQlB843goeQhDddjEeRGh7oSbWIO0+5PdvGZFCizjzz8ywP ZW8Z1ZfVJ7Wz66Q77wdN3wJbpzP0QP4b76AOqo8J12RD8+uRjsfvPNap3z+v8Y5ThWnq NIA8jsX+YYkdbaH7qFZWDlL1pKfoTA7SMaIEjgQaiET9l5jeT2PCkAEL1XdZDsz8+O6w SuYuZrMsjeC9QibSuMc5WSAVdfy76rV0opIxOXa3stjKxU1StVH/o2PuJq/ppJdv8NXy msiw== X-Gm-Message-State: AOJu0YxcnWpuUg3KqM9hVu+dsMbrGVwGCsp4KAGAOJeKBFtYh9QCzGap dIcfKcRpSWBJeguLNpojrRaZr0mTOIsKykwYQZdutZcC6MOhY0ulz3HZoWgZY2scDFEpK7KVNep EYT4= X-Gm-Gg: ASbGnctshzzWMakCGWEnlLLIkxRizZmLPBZ8nutWvIzBZspx3QQFiAa3VsD+vIEvgVH kdLmJbqe9eSTGidFDgKxscRS/MdHPgUAbWgjb05UUTfOz96EUmuvmSzo5skxzKL7Z9U9vYGts62 NZDLubseSfdBae+nPasxZExShzos5IWHT4y25bbfT0GGwZmatm10hXxF0KlBNFtObhrWddB6/rE XM+q73z+saxDBAv87CpTcPGchDTKkpqPTTIbfS4DhYtqoH4N45Ji6aloiXAuv9fJU140ONtLxyN 1iEHF083ic2VtIaLxqV3LzGiwnOQitI6+f0RSaSE9s+AAvByD7wn07mqXPGd X-Google-Smtp-Source: AGHT+IFq7hqygNk4iEUDU8X67GVCsaQ4kRPaRr3yMIVEjjtDJXqKhU3bVpcjZV7Lan+5bsV8KmeHcA== X-Received: by 2002:a05:600c:3acd:b0:438:c18c:5ad8 with SMTP id 5b1f17b1804b1-438c18c5b00mr44668995e9.31.1737821170008; Sat, 25 Jan 2025 08:06: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 5b1f17b1804b1-438bd54c0ecsm66090525e9.30.2025.01.25.08.06.08 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 08:06:08 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= Subject: [PATCH v2 03/24] cpus: Introduce SysemuCPUOps::has_work() handler Date: Sat, 25 Jan 2025 17:05:31 +0100 Message-ID: <20250125160552.20546-4-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125160552.20546-1-philmd@linaro.org> References: <20250125160552.20546-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::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 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 16:05:32 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: 13950437 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 83931C0218F for ; Sat, 25 Jan 2025 16:13:47 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbifx-0004LL-Fb; Sat, 25 Jan 2025 11:06:25 -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 1tbifr-0004JH-2z for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:06:19 -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 1tbifp-0000f8-MG for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:06:18 -0500 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-436a39e4891so20456975e9.1 for ; Sat, 25 Jan 2025 08:06:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737821175; x=1738425975; 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=Xq+BWhOCwMZaw1JyL/tFh306SX1UqZZ6z6FArA2Dc4anZtbx+Dt3XIENL0ovS/oBdq tAwdqiQE/kQ3taaktRdNuHUIjpJn0aguvLb4NZ1zhslUi4eXaHt4UbPZqUL6NFcCPg7o PqzbJ6pm+bI9xSPPMCONsMheEcuCYOEp2TdhuDcPkLbxADUnzMw8/tPiF/EtqpIwEiPD DsWnUCSNDp/19UBujNU86yVwA5eEJgwnFa20xg9nvuiIqCDW3afEJtsjpVFsMNaJPTvQ zhcVybG5KvCax54/UVW1KNluEhQ8YPZ++rimX33dZJTvMFkiMfESIWHdzbSWOoaB8YDa v77g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737821175; x=1738425975; 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=F7x1nm6zIQ8PMFMjVLyBAA+ag/jQY27ypO6u685PlOE+RSEVK+refC/uOlY2dPEhPx 3bqzdxGv/RXS17ImRbsuBCjV4XbMEouAwE/imYc5/TURDcWPBi43tIHLPT7pyZVclQfC ds+lNXAKUv7B/8sqO/ty2S/S/WN20zT6man7XvaiRddANp6CWzKdaLT4QlQR/3jxazzD SQW12x6D498N32xA8d+54e44q3xzlMdAcXJ0rqOX1DkJM8WAfhQ768ZdQS3duMyLRtNV ETmzB3vAixsFF34EP37is6W2RdloDx5dWGFhahBovSZOZwqJQCabA+Qv3tQeTyPwPt9K sIsg== X-Gm-Message-State: AOJu0YzmpF94Cjb1Y7v1YWsbplwAQ+s6YoJckRJ3SI+7ytAKO3p9dB1O XiAyfHSfaAhItzTvO1z5Ie5qXXe9qw2u5zf2mcO0tFlYQ9arG7tdHwudRQEHRbcrGFv3EXRRexZ TOC4= X-Gm-Gg: ASbGncvAHcZzxmNROvgNWGyjD3WB5PjpqpKql9sNDIFLjgImH7dpfaOXfCmFBFM1QRJ FkYyYw0EkOznAiw0tv/OUbRLFKwyfW7Yq5Fa3dFbtVZhYf20u+XYU0WUnEKas8QZ03QRCxrRVRX bvIWvhpNXg0rsYMeHIDK9XvFJzKMXIbb/j+FRhui8YEz8n9UTrqJs9bO0MF8SoP4PgUi5/qOLJP tIEAPnYq+MhQFQIcB2F10dRYpenBjB1v0xUTUYCsJIdbHFfHGmRu9qaUZ+gN8UZP5NUNwMieawC ZiQmPEmFZT5YyiaA5C5d1kRcblFwYCPYc/+IqSDCIWLow0ut7U41YK8ggRQ/ X-Google-Smtp-Source: AGHT+IEljwQbeuWc+vLY6KrKP6VzDgxDZPTT4hDjdmtofqxzeSeNFpEN7ghjw8uX807tlYjOQJ9XEw== X-Received: by 2002:a05:600c:a09:b0:435:9ed3:5688 with SMTP id 5b1f17b1804b1-438913f86dcmr329807905e9.18.1737821175312; Sat, 25 Jan 2025 08:06: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 5b1f17b1804b1-438bd4d2a82sm65125815e9.36.2025.01.25.08.06.13 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 08:06: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 v2 04/24] target/alpha: Move has_work() from CPUClass to SysemuCPUOps Date: Sat, 25 Jan 2025 17:05:32 +0100 Message-ID: <20250125160552.20546-5-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125160552.20546-1-philmd@linaro.org> References: <20250125160552.20546-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::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/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 16:05:33 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: 13950429 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 875ECC0218D for ; Sat, 25 Jan 2025 16:12:41 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbig7-0004OS-3h; Sat, 25 Jan 2025 11:06:36 -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 1tbifw-0004LN-Cb for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:06:24 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tbifu-0000hG-SK for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:06:24 -0500 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-436326dcb1cso20548555e9.0 for ; Sat, 25 Jan 2025 08:06:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737821180; x=1738425980; 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=uRMvEuBwpKb9qKh5ecteLWRakajXOqgvTH6Ofg17ofOlXKU9yMHa+HKLznQa5ehWaL lZsBybt5EWNShIGObBpiQ7xxMY+ESbejO/EuzUF4jsnf1QP0xiPQ7ltT//nggzCrQttQ klvMDuEmP4moIzIEAxw2ju9fwNKkRxnVwtoX1iJmG1e4qbqsm0KtqyHsni6KykvpCvIv Qn+u9Fmrdh5loMf6TSIpJgL21pJAs4Ymqm4Pot4IioKBgw8W1VrJVi0Fw2orzsg4KthY 5x+OInU96mlceJgmeTRc5/V1xze2PS30XYDoar/AbJTOlUCCFxHYmu6Ud8fPqSkF5aJe BHRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737821180; x=1738425980; 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=tm/46D2B9O1ypCgzPi6aW+0oOmZUEl4l8CzBPW8VTNfbUATe36k+WYl8Lha/LJ5x3i eA+ENUZjHbhKDCmRUHTPQZm5WPx7j30Tu2N9+uouEmdwV9HK/JHM+edhP1NBlEDp1MzS f1agCOt62yVDrY5DmziBeslHlHT3J6oWh4RuADQiR4XxuL0yN4iv+NWSq/L7FcVcRofF CksYK9iJmgKllzRaNqtohiGYXm3Ro5vfJWt/uxxAtDZ61dk7slZ+pFnZ1F3udGLxTrHP B44PsmOpkdh84CSAuLEDnz3OLzaBrYiRA4+TjyIWMJC51ieqEL/22qI6EYy4oQhLEsSM 8hkg== X-Gm-Message-State: AOJu0YxUft+9bpzUQvDUse5pPhE3Qose0JKDRoJ5/uEJY7opBg1MjH73 QD35WEcuiM4ILEPwkB6WuteDNp+/7IMGpamLnpZkMPaF3WAMa0O2YN8jaqXeWHi3bTHLt6l3Mvz mj00= X-Gm-Gg: ASbGncucQZBgTKMmH4AEpayybn6zWxTSEEYq9paWNzyWup7cx2gl7t9eHmBpFpNOCos TqcTeKjFNwpks1u4bQ1+ugD1Bb+WIVRU1ldgc5Ld6/U0t7pBSQReJ7pADnhbuLqmaiQmN4lBfZ/ u+BWMKk4PftpL51PLCQZHNOmoTG6NzIW+RDvJxPSKN4FwjA2l71EVCwiSqPXHaF9g9gZtA/fGKy lYrInc4iVfMtqwCfGC5TD5MayAgX0Q30ZJTIHJgliN+JRNN4jKUViadv6nMEPEbxS8zBDpUjdO0 c4sTLWnvubpKqGN6rhsrRiXXwVmTOP6zR6SEdizqL+WsDI2GRQi2XG0d7iVZ X-Google-Smtp-Source: AGHT+IEnLIsGd10DavwQAxzAjrn67xOsO/BHm6h3+Q5PA2j6IvFcQFS89ljG5R89xegJ/0J75ENPwA== X-Received: by 2002:a05:600c:5486:b0:436:51bb:7a52 with SMTP id 5b1f17b1804b1-438913c9c93mr329979235e9.7.1737821180586; Sat, 25 Jan 2025 08:06:20 -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-438bd4fa479sm66599865e9.5.2025.01.25.08.06.19 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 08:06: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 v2 05/24] target/arm: Move has_work() from CPUClass to SysemuCPUOps Date: Sat, 25 Jan 2025 17:05:33 +0100 Message-ID: <20250125160552.20546-6-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125160552.20546-1-philmd@linaro.org> References: <20250125160552.20546-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, 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 16:05:34 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: 13950409 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 23158C0218C for ; Sat, 25 Jan 2025 16:07:39 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbigD-0004RP-R3; Sat, 25 Jan 2025 11:06:41 -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 1tbig2-0004Nx-Jd for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:06:31 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tbig1-0000j8-1L for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:06:30 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-4361f65ca01so32098545e9.1 for ; Sat, 25 Jan 2025 08:06:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737821186; x=1738425986; 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=CeHlvQOyl+3+ThFv2AqMEw1mSUY6S33lbTQH0y2CMHJ82OfImqqM41ymOOiLyFIsXf LFqEOJhffLEtWPiFeDs+aMDvUyBNSPd4mXISnt46lG/96pQmexCoVtXBR99+czv6YJ4F 8yTxML1fc0+ZRKm6YYS0NRUWix5nyfNwWsoP/+BKhID7mb9BhoJRWdpHSvsm6tcGANeA CY5GOEGwrCBPkPaAhiG8gtAqXPRBq7/a354C9bNSaYiEobUgtAam7N2o59KCUrrDRdy6 geeYYJWS5vm3rUgeFOHtBksEuzWaZhzPUiwZqxgzoXfhtx0gYn/r4PSa9zmx0rkNaG/o mmew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737821186; x=1738425986; 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=AuGO5gLEvgE+coRimCyoYo2kBEvSMTOy6RTOs8UkbADCdQxRMYTh4//u2nIz1JQjtO +4tADs3QMhbmPlpXbPfqQ3GfcA4ceQSzfTGY7a1ANftLy5dn6dPAFBD7L29JWzQ31QvJ DO8T6uShkxtxXFY0Tng5CDMVVtwwWcdEimTx39dvoSd7sUJdQWijXUwYRHUZJj7h4CFe YrnZAcZGAqdAWtMct2jDdc9oKGodbu1AEG5xx0v5UmHsn3L7swSDqgvpLSTRFghOpkSO MncNMeDqVSLv1+EcXbwFc09IgjZuK8+cLjqvgAquuVTgjc3Sh/ORzuipjdHnA6tjBHiy e3nA== X-Gm-Message-State: AOJu0YwSA6qbhIrlXpLVgLZJq2DWtZzm4RN2PHrGHkZYPDMwoMYaRI37 Vw/OeOP+4cA78MuizKvwLNlGxAJ/i8ZVD1wFg1XK3N8D4iQCRkO/SPMcZ3wnlWMoCYBjwCRAikk CjaM= X-Gm-Gg: ASbGncu/z28zX/ypsZ3TVc6Wgb/LgqwZQj3spOg6BjrFRsG3Z8dc/jjrYK1QaCHjCxp 1p4FzSFS+FYT2nXYalqjH0+GK1lqptqrHuszasxjEtjERBol0KATKi4PXEYoOMN+UsalnHc5jyv Hz0vYhnlNE5X0pV03IfdSBUBJLcYtBe3BrOz43eaLtc/80JqtdNGriOWWHb2icIets9gKU8BvuE hLlM8YaxhqQ3CNbpo3akv/qLXAynLEQClTR1MQBOyvMnAQcev+RlLItf3w7H8Wc3rgTwchf7CK0 huxE3+eejpd1Zka3B7HQxladIDIqV7SnUuOqp/RcJU2kxhHtY3iNRrt6AWi667vcN9OdFzM= X-Google-Smtp-Source: AGHT+IF+onhQwhRyGv3ObT/uHizq6exWzIsKvQcyAnQtFEDnHtS+igSz1tJzUBwrm/Ks/q2fUb/EPg== X-Received: by 2002:a05:600c:3544:b0:434:a781:f5e2 with SMTP id 5b1f17b1804b1-438913cabedmr292044925e9.8.1737821185793; Sat, 25 Jan 2025 08:06:25 -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-438bd4b99dfsm66040915e9.26.2025.01.25.08.06.24 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 08:06:24 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= Subject: [PATCH v2 06/24] target/avr: Move has_work() from CPUClass to SysemuCPUOps Date: Sat, 25 Jan 2025 17:05:34 +0100 Message-ID: <20250125160552.20546-7-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125160552.20546-1-philmd@linaro.org> References: <20250125160552.20546-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, 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 16:05:35 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: 13950421 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 746D2C0218C for ; Sat, 25 Jan 2025 16:09:57 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbigD-0004RN-H7; Sat, 25 Jan 2025 11:06:41 -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 1tbig6-0004PC-On for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:06:35 -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 1tbig5-0000jg-5e for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:06:34 -0500 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-385ddcfc97bso2715271f8f.1 for ; Sat, 25 Jan 2025 08:06:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737821190; x=1738425990; 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=d5mAn1bKVEbkwp4kPu97gdgc74BRWXSef3QQnCmvgEngAhxr/pCeEyCjd1a54faaWy JHRELIqKowjE0f0ELqF1JqVpb0nbkdbwVGAr37yXybAPIDpgrBDboU/3z7TRzKtZ7jBu 4JbI9AMwt45iYVbjv5o4JxnmzCDFqPB75b+6z95hHgtst2T+5S7VVrLhaRD2hiaW8s3F SNnytA/mbz421QcE4aeRzYZXtMe75M15TYI0s0yvMfhzpvAyn1iPWnDRENiWyKTd4MpU OxVISO9H4slJSLIO57+mi8an8MFG2OeaksQ7qCOG2GDy6J5FXCl6o6Kn7aLFuFXqiKyG TDUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737821190; x=1738425990; 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=eNUTGbaAQ/SzLyyXhdse5QKc6dUOQ4NoyQ1xZ97VgJbdxH/BHdBI3Rtfnci5Fly2mE CgBqsvE6M88JFWKjBoq2g5IJReBcbRt5oxROwPpJ8thwvTI/EJUhRN7bvy07LDLvspAp /ktJ34oboy8kTTHqeBB6MP6IdRz6CMRhLmnjvM8s+3HLzrGfOe2mTgBiNUc9Qz/8/pVc t9zdLYoYduZfdiwppUKI6ROhcVfzMtdbwGbLc2Rze8dBabJtFaCDpq9+qW8s4ThH5Hfa 5e+/tp5r64mcBUjdIsRKvolN8IlZfOJPn0N0CI8Xv9YIADO+LbuSA2qHATzSJD5qCGlw 3Y0g== X-Gm-Message-State: AOJu0YxrEk3kdKeFlarz7YduZQdErHJb7fBhTNaOEV9sYGFLuCUtuZfw yYGKEIW7EXaQCo3c/vZspjOw+1/3gJ9EOS3gZeyxLzWGI/f/a0P9iufmWijLNGcRSjtEQiwrRs7 bP04= X-Gm-Gg: ASbGncuKxzvlxsvet1HDZTP01uf7zDMzs/OYZl2uRKLXEZGtzg0bOzuIq1VDoknvcQP WVZgTf8u5TF07TMrBNncpL0zp6A8amGMB9YvrbE1LYQye6U0qASgAmDS7h9OQFOVg98qYK+LQ+9 FKT72RITONiaUW4QV83h6JJ0sqKsrMk5LwCya//kSCoXOUQuW5hPwYSQdesS7MVzJs6ltqz0xjp 4Gd+6RfjR4F75HTIL2uotpkWr6Dn/VUUZRVp2qm8AADnPndxN9qA6HORNP/fmmWnT6mcH9hPUwQ W11OLmMqQaxsrcZkkvvDp29jetO7AeW8mTyJkRaP0Nh1uFiXJS3m9vxnjFMr X-Google-Smtp-Source: AGHT+IEWAWGMObMnhOy9NH+yqwA5mYdR+SJNhSUGwMdFUBsUKZBnMzeyVQ/Wktf899o39eK9KZHclA== X-Received: by 2002:a5d:5848:0:b0:385:f527:be6d with SMTP id ffacd0b85a97d-38bf57b7fb2mr30390174f8f.36.1737821190451; Sat, 25 Jan 2025 08:06: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 ffacd0b85a97d-38c2a1764b7sm5980460f8f.10.2025.01.25.08.06.29 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 08:06:29 -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 v2 07/24] target/hexagon: Remove CPUClass:has_work() handler Date: Sat, 25 Jan 2025 17:05:35 +0100 Message-ID: <20250125160552.20546-8-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125160552.20546-1-philmd@linaro.org> References: <20250125160552.20546-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::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 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 16:05:36 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: 13950436 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 95212C02190 for ; Sat, 25 Jan 2025 16:13:47 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbigI-0004SW-JL; Sat, 25 Jan 2025 11:06:46 -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 1tbigA-0004Q5-B1 for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:06:40 -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 1tbig8-0000k1-TM for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:06:38 -0500 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-38a8b17d7a7so1539699f8f.2 for ; Sat, 25 Jan 2025 08:06:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737821195; x=1738425995; 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=UHbN2tToduDTkJcJ0D4GLXiIYvPDcyYJESrXCYOD/jjBj5w6cxXbr0glx0Itn3tXFC TveVLUIbKq/lHuX5/DS799i1fYK+FJY6evoJqXkMeAHN71NmcLxV3xpKUNsF7z5p3Ftq waYNsWwSE+M0prF9+uc7Sji5xgNdY+GF2P2zhu5QGexFUpt9V6ZvueBCRHepbGRXcJK5 7/Uqsvq35+2sGxAalJ2xZ4l8HV6D8ktHNWXQu+ptCKvKtnA4mt2+NDIvGbaOTkLhskzW Cg0Im2DEsQ3yGCrZ3Vgd0HZDY1FotV48KQesbEeST7gK+UPNtiUbfYfLj+JEDb4RVjJ/ adZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737821195; x=1738425995; 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=NL4+dHO515kO8JduD4XicN3lCwnnsoEG3xUx4HFye/YgPwrUO1pHt+GjavAHw5OeNA NraXJFTfZd/4PJXLt/CCF92zxFSX4A4ZVWUfboAMt+cAXLrqPqHcsdF/hAXq3NViKztG /bA7EEbvWWk3fvDCByMiyZpVc6VIYcjUjCN0GR89XKZJpQ/q1ar/WxpXoU5IuTbwlCJx uMWS1ZFRct/Rvn5etgMsOiDxD4+QHNa1DJTL4zFANlk+9XN6nzYX8vFVyoDufItGectK enjQZpm0EEC8J0b8/GndJj0pb9lQX6eIeQ7rkp68c+5kYrSaBPpH2PfJgMOv42gNI98s cdmQ== X-Gm-Message-State: AOJu0Yz5Qm4gDbaTWb+L0eMGmAeJxXAv4uOJQfp0V7nzDgqrUjxus1EP It08Apot+S/VlR02SHXgqLZuYhWf6N4EOjelDyCk4YL0gOgJw4JEA5oE4mSwFykAZL0dCbTxINO BQu4= X-Gm-Gg: ASbGncsXKOZwzWmZzX8nhTCe4hmVJbN6ArdKPu+tkwI6f+djaBIZ6kTiqC/HIU+5ifO fJU5b4a3TnIA6G6TDKdHUNo03W7TvP5F8gZj4wGRTMcqCU7l80usuYfBm5qPkFh2ReYi5ABBwaj ocx05gTHQdWeKFvcHH6PutKD0RokjX44ZiDMHsaEVwy7wEsvKqDa4rICcEln/nOIro3Ywf3rCr9 goo9WroSBDf5J+5l3CwqfYuop0/jQFxBqf7KqrYF5lNdD1bX6eScG8lbfgJGgO/llmnurbxdS5h cCu09X947D+s/YAfvTdwV1VeD1kqb3Z3WTzDUEL37QaT1RjOLyU4vdJqnrtn X-Google-Smtp-Source: AGHT+IGhdlxDeSmJOdRt6MxTG8DF3rfQ1qXPLO1zYM1CtgyARcPlkdWxQrfw20sij04veFVv7ZZAMA== X-Received: by 2002:a5d:47c9:0:b0:386:3e48:f732 with SMTP id ffacd0b85a97d-38bf5662a1amr34862909f8f.16.1737821195065; Sat, 25 Jan 2025 08:06: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 ffacd0b85a97d-38c2a1bb04csm5949053f8f.73.2025.01.25.08.06.34 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 08:06: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 v2 08/24] target/hppa: Move has_work() from CPUClass to SysemuCPUOps Date: Sat, 25 Jan 2025 17:05:36 +0100 Message-ID: <20250125160552.20546-9-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125160552.20546-1-philmd@linaro.org> References: <20250125160552.20546-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::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 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 16:05:37 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: 13950425 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 5C271C0218D for ; Sat, 25 Jan 2025 16:10:24 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbigN-0004cw-5b; Sat, 25 Jan 2025 11:06: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 1tbigF-0004SC-P2 for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:06:44 -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 1tbigE-0000kV-25 for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:06:43 -0500 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-38634c35129so2770855f8f.3 for ; Sat, 25 Jan 2025 08:06:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737821200; x=1738426000; 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=ooKhTioMfOLQhxxJBHpcBOA5SGRAs0ch/ObzD9QR3Vc6bZJQ8RTxVoOtr7PdArKFwY mSfsJ5Gxq5iRbMZ39Hs2zvda+4t6ldWJRyFA9tEhOc6+EM/3nIZfB3BtplGh/QyRd7EC IttjAUCt+Oix7Xdcb8d0qXTgk9Z1RtSS9+1CjWgApxkG6CHKlffzYGrrj0Hi2ohgdig2 lePf8MfkStwr4J9IgfdkskTazSix3gwi7nLKzudSJIHde7DRpkVVyQaFPuZFnhD2y3PK MsTQmF3nRHlMvpHAs+MeuIsu8yXEwB8AVON+DtIqivP0b9R1Uw1wOdHc24Kg9yOBeWZC R0Vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737821200; x=1738426000; 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=vpbn9FoGkWAH5GcLUf5KNBlEUOyUFsOFrXo9txjNjVrCg8XmqUSyciQTC+kb6ZFAb2 LqPDwyO3CWUajJKx8HYQ8KZOl8xmgTYWkScoshMpHSvZrH/tACzptV/7RA3IlsZokZDW ZsFUM6kwIft4uAGJ9vypNTVKTA/YTKW1zS3Zsey89pSiHqD8H6y65yVnEVKohcVAaQiO kWtYu6+LQoZNv02PmSD4FfpGzVVnvrmyyE+6KLElPboq+bW3Rd86Bi1kusMr3YRacmlT JIcpqcA1nhD76oCyhai1MBwo5yjmUQDEj7HvBSEWLeIECKUZ1BS7qq6fdC1aXXQ59Ipq RVoA== X-Gm-Message-State: AOJu0YxVyJ1GpLFO3UmCQSUkQ9BruyYGrXtAKTel9xP/HIb5Hlh5bJ3I joNI1KM73CHxZ7GDXxgcG4okUw2VCMTQJft8ytItpPyZfKsPg6DHXswN1kjnu5UNV0wTtIlQ9lg l4TA= X-Gm-Gg: ASbGncv//XI4dkh+YYfp4MDiCN2yKxrbIsibNQCy2zeE4mRVE7wf6M9xIklDKanGvXw bcy2pU8T/OQxJFHZfgcTdoaJrKFYWm62/8RoQWs/zLemrQ/hXWbt3QijF5R39c2AwPvdxlMRMyf lCKIsEM7y2DLv8J5in+1INuPyq+I5NMPWpZijlt/AC9t5E6HQd4GJkWIL9qgLy/iHv6tbLWWVU/ p4FCFBwd1rcZYDRU4yzUmsD0CVxTEfl1+AM5FYaBAiyY7bP57A6KAMMjixx7FhZ19sPtrobpr/L nyC8TyrUIohs6w/RYnHhkkNfzqxVn83GGz88OXBwUvPUBOX/T+TKfbJEg7em X-Google-Smtp-Source: AGHT+IFXxNkkIAel2yXAFQqMOua606u74PK7nSvBr06WlLQcgeCRt+/UUayPs6Lz/zmN7aB+PlvKqA== X-Received: by 2002:a5d:5f56:0:b0:385:e176:4420 with SMTP id ffacd0b85a97d-38bf567800cmr33027278f8f.10.1737821199685; Sat, 25 Jan 2025 08:06:39 -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-38c2a188d5dsm6088635f8f.55.2025.01.25.08.06.38 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 08:06: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 v2 09/24] target/i386: Move has_work() from CPUClass to SysemuCPUOps Date: Sat, 25 Jan 2025 17:05:37 +0100 Message-ID: <20250125160552.20546-10-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125160552.20546-1-philmd@linaro.org> References: <20250125160552.20546-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::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 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 16:05:38 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: 13950411 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 177B6C0218D for ; Sat, 25 Jan 2025 16:07:58 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbigN-0004fm-P0; Sat, 25 Jan 2025 11:06: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 1tbigJ-0004UQ-Ht for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:06:49 -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 1tbigI-0000l3-3L for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:06:47 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-436ce2ab251so19732115e9.1 for ; Sat, 25 Jan 2025 08:06:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737821204; x=1738426004; 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=RBW5FcgW4VuHVfxx2aldE3jDYLYgjLtGzSURw3WzaOJ+eWgyFDscuX0hTdX5xlSpvx zVUbL35L0fCu/7DbddAG0QUmPoZGgDXR/Ddw1d76Gzj3LrfNraT00BiC/oiG9PzSd0jW LuWtPi83GPblKgzvGuaXRmieRB/kNmfvqLi1rDfaznxmWHPP5H4ug6snDxHBwxZ32GUN EMvHDR3V/ozwhV9rq1Fq9FuV2DFDE7kr0jRLAQT+MJgBnv9MmmWTmNt1IXyvpDjyPYGJ HC2BaRdWeyihaWXjOU2IdgUQP2k5+r9OCDxf3HoebxjzQC4qJW9fwyN+D4a+1GWtjOXF 4GBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737821204; x=1738426004; 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=Z5X6Ky7o5KotnesYb16wWMWoxN75Kx1dHWIdZ0ytsc9a6KCouUH5kMajlF6y0xVosc k5f482nJolX7sBu8C87lbmJnJEES5K/jkUM2AV86hfoRANyUh7vnVl+GKFIe/S962/o0 iTWFqD2oCL0jxKhpgeFZO4+4ieqXJJ8gRwG3V0XvtfZ3QHAkiTZNHBMQABBd86ausHHm 3EDPuMNktGbV/oWXfOjhR4E1lDbFQGAitqLY3mM3Ywl8BSzI8F/+iDkh5xuR5j00Fypp /R7/jcu0K0vyl+0tpC6bK7XGc2CAK+8ucJ/t2pZVa1kGHueeCnazECGrNLhF+KJJBSfi 0Rqg== X-Gm-Message-State: AOJu0YxPS3hLE5E95ZlWXSlMORK9jXS9B8s5ZZyvBFG4TGJvSIzQcHTt /nbQeE4tF4mbr50KNPQ/xvf/kP6LQqg6EF1f+zyarZiXMZDsN5vEXffTUoOVJmaHDDtuk+/lEKB gC88= X-Gm-Gg: ASbGncsFR27Kj/FiO2YUAG9hp7+Zo1Sio2wrqQFUrIlRgm4VERckYO6W8/mc9sgsI3F Mcz2SEf4NEHWxWbCxP3LFheFPJQW4tw301o5TGaOdJzrO4JP/PLbBs6NUa8GyM85AWMTdthOugX yRyuUyUhgeh6/dRn5TRXtg0GyL2XFyT+1grHA+p43pAI5C4uEAdYd2ucxX6JSZ10HFjk9tmfVLX AlSxRvi0um9vuUi/OtDh3SFTiKWOj341nk6fqe069oQX2iDhfwgf6upqz5TFp0GmLHo+DEbYs7e ZF4oI+bO3TDg0O6DhMq6pLUlgkZctTpYXlRpbbmaRiLXUvKRYoiFRxvxK8LO X-Google-Smtp-Source: AGHT+IEWu2i+YTLFqeAb4LRThmyQu41nXXGb1bDpdviB9wmM9QVgvklg2o1ID5kzpelR00ORWj2XiQ== X-Received: by 2002:a05:600c:4e07:b0:434:a802:e99a with SMTP id 5b1f17b1804b1-438913bec32mr310554025e9.4.1737821204358; Sat, 25 Jan 2025 08:06: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 5b1f17b1804b1-438bd4fa3efsm66192825e9.2.2025.01.25.08.06.43 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 08:06:43 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= Subject: [PATCH v2 10/24] target/loongarch: Move has_work() from CPUClass to SysemuCPUOps Date: Sat, 25 Jan 2025 17:05:38 +0100 Message-ID: <20250125160552.20546-11-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125160552.20546-1-philmd@linaro.org> References: <20250125160552.20546-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::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/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 16:05:39 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: 13950428 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 B87A1C0218C for ; Sat, 25 Jan 2025 16:12:38 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbigT-0004nC-Es; Sat, 25 Jan 2025 11:06:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tbigO-0004hh-F3 for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:06:52 -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 1tbigM-0000lL-Tr for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:06:52 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-4361b0ec57aso32239165e9.0 for ; Sat, 25 Jan 2025 08:06:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737821209; x=1738426009; 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=g0kUjjDrpKxKA7Y1DinBul2kfZ5n2R6fJDH16aRNRzIpxlH3OOLijPFciJrnMmwuGI wUq9CMwme0EMWtqA72b8diWyU8MdfSnIAGHrIqLgFqPd2Kw4702iGEQqs5HcgLS1eWzw D1TtwGB+5W+MfuMj12pWG5+nkhffLXajGdaFjjxcixWZKXDzfCQmEb9K3R7z9TcP2mI+ nVNF4/bzwlGPwV0KGaxJLCHRiyE1itKI986x8Pzc5g5hTzi9oVbYu7+Hi3xYoKfdCBeF N2/9pHKXxIjVNsUxRC6VgA8mnlthBYcS2L6WjgfH9+E7X4iF2f8FeEoRpoZVWBIxJgGL k3ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737821209; x=1738426009; 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=KFq/pJ4uJQvwjJmnssNciHhlgPgNC7Q/l66NEcogaxDAQiPio2yJ8sbpkZUMLx1wSb mcKeYEhAr2UBYpdasGpEDt0ctid8eHeI6nzT3CzPA4bxhqGCOriucpHT9wna7mbQbXzX yxrx/O4eJMuFcYzHlIE1H3JNzATpr92DeJzil50Mng4VlP6sW9NT1rnNAV8Y/tXGeZcX Q4q4s75WIE11VvD4pg+fnlFZl4TFewzfkyrjQZI7UOZ/CoWVcRYhBq2d+DEzKhaDDNpZ +zuEJUIVwmgFpXEP/QlNjBjpWvQA1hENufa85oe3jP17KE5Z5aZsZzrewKvKbtSxvrAC 81ew== X-Gm-Message-State: AOJu0YyhkSLC/VjaTUvE5mKq82Ejsui+/doR8n/vxmF3h64Z4QvgAFSD QbivrIBApmBggZ60DRp55tikLBUUpqYCU5lLM9QHtkhJBC3Aokt5OumiU40VUGcRpbVbwA/bOgS XFcI= X-Gm-Gg: ASbGnctbYPdxYGMTZktpDygwtLja/LR+uQ3aiPJtoqByaHITsChxwT1pEa/70L2z+N6 ifKdeBdgizGH6MNuXCA67+wo3CsF2OD3TVZeC/Tt74PWyUFpTbli/C9iKrHV9klh8xKHROU7KlM LFlmfkFPFX74HjYxbxG7dpYXfEz4j0h/yB3GcWkWThTciQR6rVG2Irug0ThhuM4RPU91vDAQWa6 g5vvMmy2A17++zE8y99VIA/HqjUW3sWQFAWZsL6TxXFisV0iCzW7tuGXGJxFdE7HGbLMwwSFTSY QubWxfyuA9GzyngI4Z5RRsGSwFFqT+NQMrOSH8tU56JFlbe9Xr9NDG+f2zpH X-Google-Smtp-Source: AGHT+IFuk614/SQNsATqkDcTFnF32ZQWSllROnIjTf92x9cZHKb1qoFw1csQKbkwXGzNPqK5/5A+6w== X-Received: by 2002:a05:6000:1f85:b0:385:e374:be1 with SMTP id ffacd0b85a97d-38bf5662b18mr33155014f8f.13.1737821208961; Sat, 25 Jan 2025 08:06:48 -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-38c2a17d70bsm6061750f8f.33.2025.01.25.08.06.48 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 08:06:48 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= Subject: [PATCH v2 11/24] target/m68k: Move has_work() from CPUClass to SysemuCPUOps Date: Sat, 25 Jan 2025 17:05:39 +0100 Message-ID: <20250125160552.20546-12-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125160552.20546-1-philmd@linaro.org> References: <20250125160552.20546-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::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/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 16:05:40 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: 13950412 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 C8B25C0218C for ; Sat, 25 Jan 2025 16:08:12 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbihQ-0005NS-0c; Sat, 25 Jan 2025 11:07: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 1tbigT-0004nY-2e for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:06:57 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tbigR-0000lh-Iv for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:06:56 -0500 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-436249df846so20390595e9.3 for ; Sat, 25 Jan 2025 08:06:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737821213; x=1738426013; 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=o6l7Ge5kfvblG8oywqGfAlCg1eMUnlHju2cg6j/2rj9a3FunwW4m1LfBSldI7w6giJ Rv4pFNTdlcjpg9yU6krFe8NqB+ZGxG1u1GHRwWPkPLFsxd4pvMMbGoM++OQMiGAZL2HX udgH/10uDZhogvr6JGIhzmSIGrNEf1qUy0LS4XdI5/6GegZi9MRx9XyrH0j+pQmbaYlY uOplNdSpONsM9gpcFduRbLPKV8HwfR2PKB7AqGAqukQwB4J0rc/y6Wg/DFR/hB7c76Al nXhvq+q0sPiN+8JkI/eBc0yILvidrsPAeoy7fUMxvNPgQrPCOOMstPfP4wFkvDkwzu+8 TF8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737821213; x=1738426013; 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=Rc/ayEyb3Y1KYUA6hgKueC9tBpUPBw93ZwnJ4BEP/v4082wMMMYeGgnn3l9oHOuoYx AdV2NV395wK90kyFX5jbEkCBJ+ac0ZgsJfMnNnhQUwXYKzdW/50bDmRvEebdmeGhIDQy sF37HbQ7Y+DOg/3PWU+aZp/0j1eOR3dEQpOon6VRNdGbE/JKwP/7fwBf4jDIRjWn1t60 0p5KARHlMn+fUFRRrP+mk9gnq0qdpf6aHa8dOulXe7WUHVTTNZLYb0UE+XST04wutg4h XE+wGztqVR6qU4i0lYHxK8/WNotIxTMpY86qx4RQACbLb3Wuyxc4q4X8MNb58EZU3jyb t16w== X-Gm-Message-State: AOJu0YxrRrC2Pt9npIg/Q3z9XxomTSy8AW5/Si8MqZeh1vPspmnqtXGA BCRjjmXMY/P6qiJ0FDXn2EEkIam+mNIrpEMs1KSk4gCiSPn0N+XF0pWkVGBpm6vMGAN7kSN3bpj Y/Ek= X-Gm-Gg: ASbGncuft4a4QbCE+ml2s8fxk0wpv5v3JazwFtiFCoA+Esu7CntSVDkvpwC8bXOdWaD f+0D2Po4XvqsNePeMs6NJhWAFrUx9YK0DZxoTPpkqz9faAf5cMPJzXhg3q5kh9EgnI5jG11/DKM GvLCNbJdspmUxwEXU4HbQLBWUTStzVLYctjur4JJCkfs/2/0IOGdTy1b9/3CsUbwgXxtsCtyAxH A/KVMzWffhh7m84Oag/kei8BfUk9rQxZe18STzvF4fmhHftPKk4ePqsZHJaZwfDB9FR/OjWVG+7 Z7+EAG69NdbtxpsGlruYRW33JA0/Q0idC+GQaa2faibvyTNNWsIB0+gQRrjL X-Google-Smtp-Source: AGHT+IHILPplRaVUzHiCBheosdCq06cl7QoxsYc0bMu6B3+dnXkZGsjFj5elh0l8v6F3rhZ5LWpI4w== X-Received: by 2002:a05:600c:4ed4:b0:434:feb1:adae with SMTP id 5b1f17b1804b1-438913c8604mr317792555e9.3.1737821213570; Sat, 25 Jan 2025 08:06:53 -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-438bd485007sm66492205e9.12.2025.01.25.08.06.52 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 08:06:53 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= Subject: [PATCH v2 12/24] target/microblaze: Move has_work() from CPUClass to SysemuCPUOps Date: Sat, 25 Jan 2025 17:05:40 +0100 Message-ID: <20250125160552.20546-13-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125160552.20546-1-philmd@linaro.org> References: <20250125160552.20546-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, 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 16:05:41 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13950432 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 E62CCC0218C for ; Sat, 25 Jan 2025 16:12:58 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbiiN-0006Sr-VB; Sat, 25 Jan 2025 11:08:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tbigZ-0004xR-2h for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:07:05 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tbigW-0000ly-Nn for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:07:02 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-4361f664af5so34746425e9.1 for ; Sat, 25 Jan 2025 08:07:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737821219; x=1738426019; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=McaXcSpNynHCA9tSKGj/1Op/r9CMceoElpHx5WUOIrU=; b=mmfL5Qy5chrnB+SXRHGG3XajjavekGTIS/CYQ4xqRIMSwtIDDzVkVC1GvsxXt2ijrJ sI8h1iiPa3F/KNUXvu9a7wdrT+sehQEGwNP7jZ2UZPwmuQJPqLbrPvST+4U3zRwx9N0M CDeFIZqZ6yzOXHBhMl7FK1be10sL3ymuakxC5g6om3H5KZWc/jphYb24xXSWsJ0QY/lP mLBBvlFWaRAFelinwsAUCGspptEYDnpgXMY+GVQ/PZV8a657Xr83wRwoVoa5g0u9q0kh zgu5NKZUlR1GSGJqaY0FLAmnzVZRiE4klzDXg6rYgNtrrghma0w8TPQBsmjDHR7s7wVO gHIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737821219; x=1738426019; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=McaXcSpNynHCA9tSKGj/1Op/r9CMceoElpHx5WUOIrU=; b=ZRre7hCw33Nw0l9SwoNkpxyh7Z/AYqslmibgXUCPagAr4brcCOhEYWRQwTDfpixcs9 ovu/6T1+ynUEuj18xO9Ix4FKxLXMzzZkOwIcu0YqUeykbYWaR+L0e1S/dL9891ypmBdy B41Q5JANNxH5ZNY8/arBRt+oKS22Ey3G0we/CRvbA+xiUQDcXv/JVsZ6b2AneBoP1BmM /eRAyi/ITifUYLlEkcr37szbBN3JCuBgP2GycxbYOAz3ivV5y4AM0FCzJoYLImPutnNn uFU72EVcmLrOtLP3DIljk0q2oZXK95bQv4qD9M3AxTO3ql6aeUZ03nUnoNQq6zkPY2Ku TuoQ== X-Gm-Message-State: AOJu0YxilQiiosW/lfz5hgh91nucU2fmE2XXLMPr5+7qleqY8Ol80Dpa sZSr5aUexbVTm9as9wSPEoEP2gTphfocEgPTYUDecKTENxdvVddIPEaoSaguKyEevDz4UUnnnQM rs8Y= X-Gm-Gg: ASbGnctAvTmdKrGNKTMKAchhlfpS65Bx5Vi/2MjMKnT437l+QYVw+2brGTec9kKOGka TxjBP5Nleu4Cy0bqiHyp6wmLCO0gsQo8ATBaWIzJoNszk0Rtva/Nv5KEq8o9RFhrpc8lEzXcuO8 wfVaLkSzXwhc55Mf2HmsgOuadB2T5GOwrLwvza6rFWf9Wi0JnYBTXKNz8pOOfCG54pq++HYyjuC xvuhXE8A10yW6s2R+mhUDgsDrW9b4z9ASKZMeo9NV2RhzDzMI0Z7bUTxOr5BSSppH66aZa3/Q7c xXK6r36ipq7wDCSIeyPbSe428ZTBj6J/MqiZ9JVVB2DaUtnCPVICuHskIi4z X-Google-Smtp-Source: AGHT+IHCnMPr6Kj/99W06ZXWMSTu/6Y9nxq4GADDNX5XU+CEP945s8WXjn5tiQnYQ+Q+X+n2j9eH6A== X-Received: by 2002:a05:600c:46cb:b0:436:1b96:7072 with SMTP id 5b1f17b1804b1-438913bebe7mr327719045e9.5.1737821218155; Sat, 25 Jan 2025 08:06:58 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438bd5082d3sm64038195e9.22.2025.01.25.08.06.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 08:06:57 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= Subject: [PATCH v2 13/24] target/mips: Move has_work() from CPUClass to SysemuCPUOps Date: Sat, 25 Jan 2025 17:05:41 +0100 Message-ID: <20250125160552.20546-14-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125160552.20546-1-philmd@linaro.org> References: <20250125160552.20546-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+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 16:05:42 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: 13950427 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 22902C0218D for ; Sat, 25 Jan 2025 16:10:46 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbiiO-0006T9-1c; Sat, 25 Jan 2025 11:08:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tbigd-0004yn-Rh for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:07:19 -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 1tbigb-0000mH-EH for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:07:06 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-435f8f29f8aso21608625e9.2 for ; Sat, 25 Jan 2025 08:07:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737821223; x=1738426023; 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=Qn6RA2CzLgOWX/mJZpX9lxHieJWnrfHFBAgqhHKEpUbOxfMxDtxo37WRIUDgWxDho4 4xR698cVoohRAPdpV9DN18CZ/JJjD+acrmIpzHG3pTZh9Shb28xdNg/GUInrcbbwt414 XZrEM6fJBinWB3k9m1YFhrmo93t8ZrF6rh2/4V0GmZNFmSMfEQEkwenlHkisDxh/4dLm +1XBQWXxMKT3KNx0S5I/LB0gJ+4tR7TEDm0B3lLViZFDQpJqvs4HZK4aYBF2pUeqHcz1 1wN2zNOvIivJMOqr18sDkKZHbJgiLHXCbX5XMGg2lV2ZBLOFkgOl8XTK3l1ZhF7bCe7/ 0YAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737821223; x=1738426023; 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=rM4XA/1QMWHdP+CxC16kE2zhfyFdchQB6yraPnrppTiS3LvR1Amf/QEGy67znbW49u pDEdpaumYa42wBvZWGKLbrybPSMwR4eGFEKmbXIZNUbB+HYxhBFz48IM5vWg120Z/Ugu 6CWi+3aI8LIMpGMiHGyzt3B7wTPnR5IuZJyVdpEzXlbP6nWvGoFWiyz1OonMu0RWzFKJ 8pbKaSa1k5nZbctkQwnSpJZ3s/U6aamdVae5HfDSq6v1xaqQSm6UCuBKaU7WltL3tsLg Q0kvgyQBIE2g+dm57Gh8Zu67m7pi4vVMWwQs2YV3yEnbFuo6YkNI4lRVMH0wpICkk32K E71A== X-Gm-Message-State: AOJu0YxLjGpi9JVqiLtJJMaqFJXobWLuIdq2QUYh+XDrLLQT9PSUqvRE 5rJLY0rTSZyKw8YY5nX1NWlyPG81O6Ah919HK/KGkfAtCnmxImT3tx3lngcNnCc5eMgdhEfqcHO DoOk= X-Gm-Gg: ASbGnctQaZAAd3IqfU6tplJrIARGBzAiBbDuniksCScxrY88YXPgE1Z/ZSmlJ3pSFnX sW+NdFJZOzxmKsBCJqX31DRL0B6hgVSVEvyf2d0gjDGq7TmpbqDpMW37QUUOim4BiU9/Z6392/p G0c3M7dQSzdJcAfKKlbf5fPfC8raCSZmUVR2T3xCionnKwfEO3Edy6D5AcG+Qth0CVY3SB4TuoA lVw8Nrjeec0LG9dAFMdkL99mB/B4D51T/LQOQllfQdwkji/ioK40efDAxwAF7GyMsAAkSe/OKlu pP+1h4+UTt9piAPEBrfXfA/olWVo72B8YmYOWNDDpJejXPvNJi2DbM3RyEo4 X-Google-Smtp-Source: AGHT+IFyR373lNCFlgrhe7uQR2OQbsebZQ8SvwmPr31yGf2wcKxXyVTE1hhLqfKj/KTDF5AdQs1ABg== X-Received: by 2002:a05:600c:138a:b0:435:194:3cdf with SMTP id 5b1f17b1804b1-438914292demr315723785e9.19.1737821223566; Sat, 25 Jan 2025 08:07:03 -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-438bd4b9a1bsm64480165e9.30.2025.01.25.08.07.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 08:07:02 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= Subject: [PATCH v2 14/24] target/openrisc: Move has_work() from CPUClass to SysemuCPUOps Date: Sat, 25 Jan 2025 17:05:42 +0100 Message-ID: <20250125160552.20546-15-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125160552.20546-1-philmd@linaro.org> References: <20250125160552.20546-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::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 16:05:43 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: 13950413 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 28F98C0218C for ; Sat, 25 Jan 2025 16:08:38 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbihH-0005L0-9r; Sat, 25 Jan 2025 11:07:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tbigl-0004zO-9b for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:07:20 -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 1tbigh-0000ma-TT for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:07:13 -0500 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-38a88ba968aso3029339f8f.3 for ; Sat, 25 Jan 2025 08:07:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737821228; x=1738426028; 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=rgHzBP+37M63r+F4shB89gvD05ayW14E3gFACR6eVzW3RmgbrnQy8UBL1+S01Umwm3 X2hUAkGT+wLogQ4eCK4UgjlHgrZ1e9L0ttesMR0bmoBRU3XpbuWGrE/PsjYxPhNLOMaF 5T9RZKNVMm+Hyqz6hJtsRiY1zbfojaI3j6AwNQv883Q1anURvZ5oMWsaptj7f08IA8Ln FXSTnv1cZdZhzv76gM1bTsAhTXOX8Mm/m+RXUqPqx8fLgCfKTkbypYeoA/dn6+Zuy8zZ aSK5CrzSfxTpyR0JJTk1UoaacvHGNQE7crA1PPd+WswTVYJek1kQayuVwkIsSCLJIdkc 7+GA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737821228; x=1738426028; 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=fieCMNWX1ts3fyxTwYHGtuPFj6XLuDePCZOL91x2y9PCwEbyUN7QWvSwY2bm3ueI+D NJlyn+uH/e6wiFWU/2LBgTTSp1+zrvXmrM3b8i80+sThfWRaRRxeCW3jqE9Xg5T8tHdo e1X6PRITWChru9PmLgNTCKoOYmkSQvCHz0XfcZK2WlnRkuj0jB2wnWfmKBv/J9ZBNGN1 UfGSmq6sVoVPU3ikRg9PkF7kOdztk1cjr1S5/+Hmj5N7uzn17ykHNWBJPf4vwYRD9sKz UQsewzjnnKQULEri0QUWes1Eyw/cgl5ge1uFtBsBjIq1dGX8E6ldzCg0enrNTz8swylG T/jg== X-Gm-Message-State: AOJu0Yz0bN+xyiaL3boS3iy6zfXMSXC9iv6YBb8J3gnPyf2xmn7YatSp S1D0FBUI9B1RzXgWf+1ecPOVP2OZZsV3MR577BRsZ3evLA2iR8poMWSJ5jbq7iPg9byblHQZ2Eu TEkA= X-Gm-Gg: ASbGncsaetFCFv+jEVqHunqwD4yP1YHG2lqR6sudl7bIdDD8L/q0UjLJ7JMYYiK3zML ft+JY410t9hFTdwdrD5UrlsRZwl/DCXL9WwYZJ4tOsaIy+Fps1LirowNYj41BuhswFHXsapCxB9 uv2Fqu0dKGG6SbOB9ejcqoWgAUk0tCWDmV24l4+BBricqJouErBwfR4F7UMNEF6iarjREyE5+iH s5fgWR+csN/BCf74ujdzed1c+yB+YAbzVXlqvz6x8sRTqBpBKY7mOOxRhFJDspIZhlcWlfpwrOo KJRq0q9nweQTdTm2iDZxXO3EUaWaoEtLqcIBm/2gbMgkMIp6PgYvA92BTP4u X-Google-Smtp-Source: AGHT+IE29e/VRe+FJHJXaEsdRGwGBRv/PBKLP5qsLl7YLqMkY1j59ys2P07V3dr5BPESbiEE7tdbpQ== X-Received: by 2002:a5d:59ab:0:b0:386:605:77e with SMTP id ffacd0b85a97d-38bf57beaebmr36094501f8f.49.1737821228273; Sat, 25 Jan 2025 08:07:08 -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-38c2a1c42b4sm5952252f8f.99.2025.01.25.08.07.07 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 08:07:07 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= Subject: [PATCH v2 15/24] target/ppc: Move has_work() from CPUClass to SysemuCPUOps Date: Sat, 25 Jan 2025 17:05:43 +0100 Message-ID: <20250125160552.20546-16-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125160552.20546-1-philmd@linaro.org> References: <20250125160552.20546-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::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 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 16:05:44 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: 13950434 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 21F9DC0218D for ; Sat, 25 Jan 2025 16:13:46 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbihT-0005V9-I1; Sat, 25 Jan 2025 11:08: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 1tbigo-0004zp-Ct for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:07:22 -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 1tbigl-0000mr-25 for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:07:18 -0500 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-385d7f19f20so1576072f8f.1 for ; Sat, 25 Jan 2025 08:07:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737821233; x=1738426033; 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=KDSjV8K3x+ZucaXuRw5Cb3C07VOUJ1/+FQnCyEyib3y+QPyaBvazHZxKuPErI9BgEC RsucQVM2/OtJbqwhMz+Ka8ckIvh/WKzHnJ7euxefusiEMwJPeFkcMvfq6mej8MDyEzFk l63SKDsI9oJEMcLfSk0bu0lN7rLtGh7Fc3JhFe+VfNzWc/jUlO5DKN8UvULgrgOop2PV AHn3OtMuXfT7asNtYwvYE2ZyZq8slj/0Kr84Kc5Mh0SwScAnIgdY4kNXS+B0b7zOFwjL oxXwzKrHgrLr5MPOktZ2EbAOK6ZtLBRarrNx/MuP1B6TWmO51NQYTi0R2PSsw6kWI3Rb ZR2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737821233; x=1738426033; 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=sZSN7AVIbR+dobLKZGfBVhYO0WoJtugoDIlw2sFCW6psjd2uZ7yk3bfOx4wiiX3oxU mj2tI7M1fdj7lNTd0evK2FCI1G+0+paUAkSFEZVFmdfeBgT4+J6t/x+7WRMzK5p34J1p YmRDCSLcCc2V6hz01GkkHfo6xaHHTGq2DBraGFbSnMjPHU+lsZr6xK6voJsRxKiKdFBe Fycb1AJOb9MNejOW7OmNMqSqjDkSEKEN1WS1LCtbjP818wnfgC0GIs7/NNDYEdm0ztfZ IELEVkrHs/tQiIqagqB990UTt2xkxeBLLUCLYcI8+umLuDnd3mFMua905xD5K5qG0cQ2 VIew== X-Gm-Message-State: AOJu0YwSsdbWJNdrxM4vpUs43yYV3nCCWUAaiwhOkFXTjmR7zqop5r7w FmM0OEUO3cJqYxBQq+EBVltu/eSPa4Pz1IYYVrbjidkEk+yCRgh3OIx6SybXBVe47uh8n+2tPV0 NqQM= X-Gm-Gg: ASbGncuGhezYiHQYJAxlKCNqGRdlXUZxw+dH/GjshVFbRldxO8cQAMwKqWbRZdi0Uv2 n7HIU6kxkkrlCFS7FdYxNFSZZ+r1DWgVGzSaeK1dC+7rx/6AgaFL5tHasMwpMn3/MOd5pCMqdbP p8z4y3yToCtBSUUZRU/7GeHIN1XwlV6qaiyucSE5PIio7s2SnHC3eofUvBFEI2/R3HeQ3aHY2NR PdhcX3EJzpW8oQHQWoZ6fmWIp/2ntsJm+WwJgbF/Dm8QuP7TKVz9dJ4ljUj1IlEcl0phHytud5J SYZLPL+tzzT6taoQZd5Ns/C2tlJaZ1XgOksZfSP4I6ECNtelYgxgTfH2eQmK X-Google-Smtp-Source: AGHT+IHLhJh2YqNnHE3fSUV3On0ysIelj39LxAbMChPmUDOa62DMFtRr/OpccKkMtbpmSQ1MOKkwaQ== X-Received: by 2002:adf:cc90:0:b0:38a:4b8a:e47d with SMTP id ffacd0b85a97d-38bf5674f99mr24452337f8f.26.1737821232905; Sat, 25 Jan 2025 08:07: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 ffacd0b85a97d-38c2a1bb02dsm5896988f8f.70.2025.01.25.08.07.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 08:07:12 -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 v2 16/24] target/riscv: Move has_work() from CPUClass to SysemuCPUOps Date: Sat, 25 Jan 2025 17:05:44 +0100 Message-ID: <20250125160552.20546-17-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125160552.20546-1-philmd@linaro.org> References: <20250125160552.20546-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::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 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 16:05:45 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: 13950435 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 24F39C0218E for ; Sat, 25 Jan 2025 16:13:46 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbiid-00079B-II; Sat, 25 Jan 2025 11:09:11 -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 1tbigr-00056T-Hh for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:07:29 -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 1tbigp-0000na-Vf for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:07:21 -0500 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-385eed29d17so1625793f8f.0 for ; Sat, 25 Jan 2025 08:07:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737821237; x=1738426037; 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=atzhW1vH19stUIwc7Q2FdITCTNois8GFoblgsX4g72LrYo32to0SffWP6fZK42Pxcf S+wCG2LPNAAEUyKcfyfTw9Y6IZvKIvR/Q6S2TaCofji5iZUvrDj22/BOpc7lC6ST9pLq RD6JQm9nsc1sVI6nkmaPnj+HCEyCWJy3d4N16kVb25I4EVbtTt6H2RKblXIYvdotAnmB DVzlh9jTDtFIfQzjWJStom/cUFS3qmIpOkL1U153eNXk1mSsC2eU37TOS1x0Lq8K6UYa 0NHrYsrTN8KvFI+b59+5Cj6HXOw8/cBN8m5zrI3fl2ib8tmzIEm5oMNu1zG/jMBDJUp3 +ixA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737821237; x=1738426037; 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=CVJTw6O3Pdkkm8kAr3LkoIeV1Gr9HCongsjQU6tsWAmAKc8t8uoTQFniyxbTZTQB3s WLOzHgSJddDjD8VakZhoHbDdh3jYjFEs4i22ruha6e8/VDPwnXB7PCCyhKnG/Lw08PkK dbBqUr4f9470edsxKSqfBDwpwlbUGUGvi5asQ20dCl8FbjyNYt9ME8Bc+KNUFvsEEHtR ejw0t0QJ60n+XOnHIbBS4Vj4WoefZjGzZz5oTfdcMLHvlDA6pssBn2OeCaSFjyK408KR ndNO4byiBqHKeJJurrGklprP3yrKn0dDyBLXdlEjhQg9rrbrqTfmGYUWsYRN/Ob1OCFo hxsQ== X-Gm-Message-State: AOJu0YzqrwlD8b5PsUGNnE+WmVSY5QMDYtFNXkN2gAFslzOsO7r/wj2X lS5vOV74wjvO/2Xrn9c0rQqQeVrtcviCM1DDA8zAncSfcgouZN+e/ykmy1o62EZ2YxHt4R9cu3O S/b8= X-Gm-Gg: ASbGncte7G3tWJ2uXBEbMVLqZ3jK/8BNyo2FsTqfXykPtySJAdPvi0t6AY3jLV6Rklf MmQwvQdLwK19s964nHbIEEC7wm2DVn8H3Ild/or/P3Q6Vuum7JoI3/mMS38CRkPkreLNX7eRU/B tVSGeIWn4bCli95qBcdNqemIdHPDPSGu8gnhTSxtR8oQMGyawnifEVBBS1qvHb0gdJ1uXC/bmFy 755m27hP7yKwhzDjmigti+hK4mZat/WPT0BmGMLYHhprWvzh96shQd9IJl1RjgM7FUqOELUXCX5 F523TdjjIgzOx3Cayqadx0Xs0IlQVH997pvwVgp4TKA7BtoS16KirgBqwWs2 X-Google-Smtp-Source: AGHT+IGYkfYUrYo9gaezwZEcSP/KhLgJCk7dG3M3871x6TROReEPEBUD896SuG1dal2Z5xOH67agJQ== X-Received: by 2002:a05:6000:154b:b0:38a:8888:c0ef with SMTP id ffacd0b85a97d-38bf57be3ffmr30005007f8f.52.1737821237509; Sat, 25 Jan 2025 08:07:17 -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-38c2a17d6e2sm5858221f8f.23.2025.01.25.08.07.16 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 08:07:17 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= Subject: [PATCH v2 17/24] target/rx: Move has_work() from CPUClass to SysemuCPUOps Date: Sat, 25 Jan 2025 17:05:45 +0100 Message-ID: <20250125160552.20546-18-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125160552.20546-1-philmd@linaro.org> References: <20250125160552.20546-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::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 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 16:05:46 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: 13950426 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 5B05AC0218D for ; Sat, 25 Jan 2025 16:10:36 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbiiT-0006Xn-V9; Sat, 25 Jan 2025 11:09: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 1tbih3-0005Ar-MD for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:07:36 -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 1tbigx-0000o1-NP for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:07:33 -0500 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-38a88ba968aso3029461f8f.3 for ; Sat, 25 Jan 2025 08:07:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737821242; x=1738426042; 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=xCLG7wXNIxaAcdV4oUHmSbZE/aqhyt9/vHldPn3M9Wz+yvd+4f9shn9CcdMPRvNbhk +W9NT2SUjj6Z6Hz5ItCeHeC74SIpxZDTJLpfmwL3XqcrhK9naO4jZ9A5QtJI/Tav4hPb zF1/CXG56Na49s90dfeW2QSdPx7+H7ckXAWV7Qjry4CqJqQ32MWVMdY/7j6ZEBaeJ0bP KTLttgMtJl9X8N7zm4zqaQ+/9fBrnkHzFOO5zpfayNml09RldGPgdt8csVGUBb7992AY e4CqH/DPBaio/SokAMPWsC895q6SoPT7JVoEtfFgcgR1fUFaddnTv0sSqlTJq1p6VbvD X4iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737821242; x=1738426042; 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=bBMkCe4UXqOZCYyMjrA0FPboKq/zV5rSbam/PL4DWQJ52JocV0cVuEcw9RAdPCfB3C Ox+VbDy+UCv+mJICa+G1Ehu356VyW+BaSIrNZJ5ixK0PNDcnc0wro5F/vkbMcJA7wM65 LILwqzExSYtgQvpDY/nOcsbbKkwOI9Do0fXg6htggNGDC8lXa2IJuTQQJhj+cO4rQXhn t7uEKKqiB4is0VrLpNOijhem7nMk102+z/ZWvc560+KQD4unZjxxrbpHdp+O7X35UTSm M0t/3WHb2PXgkN7UwiQlffamx1jDXDOUoZ1DRNBQvONiVTYUZuQCx18D8tlXxft7juWi Sxfw== X-Gm-Message-State: AOJu0Yy9RTHfB0VR/RBURU6w6D3Dyoor7DLlposnMoqgHGyEqcy8mZiH YAkiwP5KK7A0LQkdGeSblOoSJCTKb8Rb5+icMZbYfBkzLnTcBpCcg8IbIpdQpVfiqQq9LOldbvm d4yc= X-Gm-Gg: ASbGncteRNB8fqnpooQMrXw13G5/Cy/wZRNx9g/twtqxsiElY0rpDJ02T/LiJKdk2Tf dPn/SgYYjXLvkTys0rn6gAsPpy+ArxK4fGdUIvoE0RWIBUBFEVRVEWH0Yt7CUGciRemZBlW7ne/ FFgeHOGVO6ScNYY0Zdf6BdVR1yTY8xDCsWwHh5ecN+0kECTm03TwzNtBjxvh7Fcj1Ex/WiACWQC a+5KrlkYIg+6D3KJE+3HgXzwmJaE35UUXzXgl4iYUobr5ZztiEqqI1u4iIoGfAqfXsvJrQFloBC rrP0GFSxBYKi/MuBOV8kml36KgNYQtS6EYhwuNpj/LuZit+1AtdUwNCojqkV X-Google-Smtp-Source: AGHT+IHgrXlWe0MpSqPY6pSVu0ECjDs95xLyN659PlZB+CQUMCn2qd09IWEKr84iEcsUwM41BkWLew== X-Received: by 2002:a5d:648a:0:b0:385:fb8d:865b with SMTP id ffacd0b85a97d-38bf57be4a2mr37116557f8f.48.1737821242172; Sat, 25 Jan 2025 08:07:22 -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-38c2a1c3f5dsm6030927f8f.92.2025.01.25.08.07.21 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 08:07:21 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= Subject: [PATCH v2 18/24] target/s390x: Restrict I/O handler installers to system emulation Date: Sat, 25 Jan 2025 17:05:46 +0100 Message-ID: <20250125160552.20546-19-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125160552.20546-1-philmd@linaro.org> References: <20250125160552.20546-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::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/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 16:05:47 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: 13950424 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 C1B99C0218C for ; Sat, 25 Jan 2025 16:10:21 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbiib-00076l-HG; Sat, 25 Jan 2025 11:09:09 -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 1tbih4-0005B4-P7 for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:07:38 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tbih1-0000oN-Uk for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:07:34 -0500 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-38634c35129so2771233f8f.3 for ; Sat, 25 Jan 2025 08:07:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737821247; x=1738426047; 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=QAiWdEmEI6T2fjhMShEMOkvl3HoL7+Mkc0bGhgcroxRXWWtmNY2SO2SDFQ/913gVzM 71xE4crFl2dNAIzVM49WkTeh6IyRtSYi1XfMsjEBrRjnnN+hYrQNRLh2qjOG3LCwEiR3 g9gtZvaxPSA3ao5+Jww/bpxCrHopK2Jxy/b4iNeMNB+W+5zPm4HUQnv3JauO/712q0SX xuMxwgBHbP6WXhNJRSGSPmwRlDuIA/MHhM7gkpZcPPSSKOIVT57TM/OqAV9ufJEZHkcF Id06py8raLO2VqPdil9Z7eZP5iM1eVmFMYUmB4U6Z2KZCg2bgk/c6A5HJHgPpqn7TWBs c+vA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737821247; x=1738426047; 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=vZcox9lRR1UHLVJkMaM3IJSTbr+kg0JDaYSh/Flykd/ECWfshXg0qXeIA29A1EN0oy FDrhD6F+NTxrPqJy+uHlmbdCz9HtAZ3cM9yhV9kbl04QrjZMQGr5WeyG71pIeL5LBzo7 muEdNXe4wtLWqOr7XrzxOvhEQbDmcpfbqkI7PuNmp70rcKqOG+xoSNKsUmCA38jK1gz7 YLEJlETjPhCMRnrASAcXss0+zGZRQH2aWq1R84/zS5zBkaLXDO7+5mMHnbns1Djq3NSG CxFjfrwJtHtFm4wIvJz7x+qRLXIVXAuLXRR8KBLDKzVUNXxcSnG8QP5gGe2MGWSE6pYp 0qwg== X-Gm-Message-State: AOJu0YzzNLKnypm170es4YrjD0e7oJx0XzsVCHs+LUaWNXYTK1uGoi6g iTSAJgCzC9WoQ3DTfa4x5AaUlLbjzdpa/qc9I0MFiycfKy715ASb6Sc8L8yjtenZPTd02dELviE Q6BE= X-Gm-Gg: ASbGnct8w8U8dgrmpJgwsJ0ZNpAC1/X4byfQpZw4md1isli9wwkS2BpXeIaM5vaqqJd T8/q+uaGlNmJaA5ElOIuo9w1Dc1SjtXrsIoT4Axcs97RBnF4qnzsLMYOP+EjNB+glWr0ls2HQ6X QXSg79pFx0/CyrY/JdHcfvW29JRThYLjo23RgebcKc9XxELkBFvXCOO9KWwcDPMallkGuHyXxCU Sc2LsJfklpiLxikq8OVeTSkJq+ptQ3zqJe+2/39ni0LmlCPscdUDER/+DjdJXX/8bdjHh7+S/bE tvjTjMbMVOl0jokBskTyu1xGOZDpXVgZLnhKWT9DaW2kOleKhDF+v9bV3jBL X-Google-Smtp-Source: AGHT+IE9mfMSP7xYzxXtZf3mC4ApZLSH4ZnW32HQaiV4P8mWmyDzkfa71ppTnXGfMPbT8F4BYnud4w== X-Received: by 2002:a05:6000:188c:b0:38a:8d32:2741 with SMTP id ffacd0b85a97d-38bf5784a95mr29584300f8f.19.1737821246761; Sat, 25 Jan 2025 08:07: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 ffacd0b85a97d-38c2a188fd0sm6060157f8f.58.2025.01.25.08.07.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 08:07:26 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= Subject: [PATCH v2 19/24] target/s390x: Move has_work() from CPUClass to SysemuCPUOps Date: Sat, 25 Jan 2025 17:05:47 +0100 Message-ID: <20250125160552.20546-20-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125160552.20546-1-philmd@linaro.org> References: <20250125160552.20546-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, 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 16:05:48 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: 13950431 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 CB317C0218C for ; Sat, 25 Jan 2025 16:12:56 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbiiA-0006Ks-ET; Sat, 25 Jan 2025 11:08:42 -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 1tbih6-0005NK-Tz for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:07:40 -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 1tbih5-0000pL-6x for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:07:36 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-438a39e659cso19666355e9.2 for ; Sat, 25 Jan 2025 08:07:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737821253; x=1738426053; 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=vwHy1xlGxP7b/EPE33Y8/li9Q3umNNUN06eGCcHrFsuRrUllqZrMwQGY1BQuBHDLQi pIROPhw9evbPePHZyeY5v5P9/fXoLyojXDhtNud6tr+4pj9uObaasUcpjoRCApEOC0Zg tIPapEfhIU3/oqBRNdQ7MjlBmeWRo3I3uqtKZTwJEs8urkFPmCmeOPaOSz5cFT0Y3Mwt yig5+ViYlkBsn0u/nLa1a/4fL/tZzhkRcgpXyOO9Qw1IRx60wfSgcuv/j0UAimJaHkPQ UE5POHrbVHrwyCg5m2p2MlWBfQPh6WJdn93ijdwlctClDQvOAfynPv32KSQATFEZxWqX HHaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737821253; x=1738426053; 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=cbNYZAgkA3TVxwNd72evDLiTHIB2A7Epy+8Ts0B2MvQgrIjIA358N5TPsbHFT8pzVg DsuRH5wfQMOatQYcoU/BEdCObRc5PmB3MGXnMMh+td7rn/+1z/5LbNi4EoW39kxF7zLh zmzWe+mhmgl5fmkXrf0kyubWx5cmUduywjBGHVFWeJ/lqTKl6iX6ixcBtEQyBQ3z8ZIL YvzlxrcSLuvdsO3/ggWnNgn2Mue4Ce9QJD2sjxKbxhbnYdtMr2By4WdJNxuhhFKr/N8M zZ0Ep3OnkGistzRGcRBTMRqTVVmBUfDV1V3cyMBukhM7f9GfY7z2vGAijLeEMZkxI5IX LcqQ== X-Gm-Message-State: AOJu0Yy8+J7sRuIQmiei2u4BB/mZoefFzq/yOFgyvifre1uQ4H7sySDn 0rh4H8fx4NeVbp/rHD1fvZYjGDzulMy1K7VXAmeFeYMTSVEe0sxJkjrb15frXJbITnDhBXi7J9S aGNU= X-Gm-Gg: ASbGncv1nvQVCGt70Zyb3N/LuXYclv/T0/GAkm4o8qXB3uLa3YQxLdcf9zsKl1RLZi6 B8eCNmVkbhAe+s++xEgFjvL/UZjVNssEb6LFuw5wFFgLJmE0LVmWd0j5Ew9KmKVC4pAg64OD7aC M/wa6DFlwDNcs6BSGsbOuXl5NWDsduqKO65EUb+L54tUe2mPXkY8Cn6HDbaKUpThaYelW6vZKfJ 8Q4ubJg0RcLCFqFXmSMTz1eoCZHjHnKANbw7Ic5iyYKBnpohTTtS75jao+Jtq6U68s57B37nyr5 bviGhdHfnTM9AuETmM+S/gl2OPHYqZvF30C8pkwHy7nD6sB0YpULDGydFuWB X-Google-Smtp-Source: AGHT+IG/g7VKpQ0gBoBlw4D7ZteRzDvKJuwDglZZfiZJj6vtZ0t+hazzSH4ku1B2g+xp7iiO/6U/LQ== X-Received: by 2002:a05:600c:3585:b0:434:9936:c823 with SMTP id 5b1f17b1804b1-438913ef6d0mr330481085e9.18.1737821252907; Sat, 25 Jan 2025 08:07:32 -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-438bd48ae29sm67355635e9.22.2025.01.25.08.07.30 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 08:07: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 v2 20/24] target/sh4: Move has_work() from CPUClass to SysemuCPUOps Date: Sat, 25 Jan 2025 17:05:48 +0100 Message-ID: <20250125160552.20546-21-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125160552.20546-1-philmd@linaro.org> References: <20250125160552.20546-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::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 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 16:05:49 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: 13950423 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 11740C0218C for ; Sat, 25 Jan 2025 16:10:11 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbiiZ-00072O-ML; Sat, 25 Jan 2025 11:09:07 -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 1tbihA-0005SD-T7 for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:07:49 -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 1tbih9-0000pz-8U for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:07:40 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-4362f61757fso32018825e9.2 for ; Sat, 25 Jan 2025 08:07:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737821257; x=1738426057; 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=eHF14ornHs2nMOinBWJFnNjxCMfPJCFlUC3OK5+Tsj9m+AQv2JgcXsQeTKweJDj8oU rjCu5AszUoV9Y6Hymc6WwnuIYpK5EgVPLTnjF8D9PvOvZaBv7G0dX2C0Xn0PIv2uORrI o/hYL6EEUVDlKNfPt2MHebDrzLjj7qbQy3yEHdM8qAUp8w1sikjijB43u4M6eq9em8Cr dclIwXP8c3CXRTbKPP7DqU+vFcE2zJthyp2dlRInUa7NMMFVtdNVyoXS/xtJRJ/VjMss yabBhlhu6o4XmPCqcW+VGexgZSlEhsLbDghw62WsVFowpchFT1S4aNQo4qmvhqkFoJ1c /iXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737821257; x=1738426057; 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=nendCJTbhyp4TdD2yT6qr+Q0xHS8bTuY9Vbf/KzxmOkF6F6LCeDiHGA1c1DgGrQ/2r BJyeKPg5+ycmMoRm5wuHFwh+WSkxKBZdHWrFfPDGBBxSSC+d16Kj6R5IX8zfBEl0lz/0 tJ/1NczQTK+FrR5Zg4GTZMc70ggXTZiGTeZsaf9TZIeRFYBzSJhCQne4TtBhrEiVl17M insgdz7ouNVWLnbdivTY5UJ8/FrllQq9NzwzZT622h4XOmhbMKg+8PEiKzJzmYz35fpw FD3I1fXpbw9x3jY0EsVZPHrhbEMXp/g9Z/9VOMdVUgT9B0GHcLzZbsJNH+ZNcCKWCHNX I7ag== X-Gm-Message-State: AOJu0YxGWCYAM92fwN+RmJdbfxRFKGIP4U1mv0mwANIHg6f3X/xzFyjP i8DbxZhBxCVRVfc0vNUCJvWsOveCZalUk/Qq+3MxUZxGhb4IEld0JQoL8S+IZyb4TMo9NrlTDUh +rDM= X-Gm-Gg: ASbGncuqQ3p1Jdkf7OfUltCq4kALTiFosbg/yC+hB05KK/MmMPMokS25XIjSGLovNQJ oU3y5Loa5k3u2E7YIk/qZL8/usLRur1E1ichlOWNifOzTg+io2rlGQ9ddUbpeQO3g83+4HZ8qMi jRspWsZTowiKlXCiQ83g6ReCSIE4g4lsAkldyNJyO3TA+dT7EcSejIqjLz8cAfIgYiAC/iKswn5 hTuYb/DWllpypk3BFeDt/Sz/eQD1djAgxfmGQrPtNmlzoNmwME1II4Gm3bMEIkkl7dAM9qs0765 PkvvjyPhC4utiNbvjrPH8yMP/4NOoJeR/QtbLn5bLwFZsXYOMVGUS3nItwhF X-Google-Smtp-Source: AGHT+IFU2gyeJX3+XVjXok1Ck2wPdw2IeWdIPDp36nxxSUxe+irMyg6OxfHmN/7/P/I6fUsBWoo+Aw== X-Received: by 2002:a05:600c:4713:b0:436:9227:915 with SMTP id 5b1f17b1804b1-438913caa3cmr273402185e9.9.1737821257390; Sat, 25 Jan 2025 08:07:37 -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-438bd4d3dbcsm66717135e9.40.2025.01.25.08.07.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 08:07: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 v2 21/24] target/sparc: Move has_work() from CPUClass to SysemuCPUOps Date: Sat, 25 Jan 2025 17:05:49 +0100 Message-ID: <20250125160552.20546-22-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125160552.20546-1-philmd@linaro.org> References: <20250125160552.20546-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::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/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 16:05:50 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: 13950422 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 CF568C0218E for ; Sat, 25 Jan 2025 16:09:57 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbiiG-0006PS-UV; Sat, 25 Jan 2025 11:08:49 -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 1tbihH-0005Vi-3n for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:07:55 -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 1tbihF-0000qU-Kt for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:07:46 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-438a3216fc2so31513255e9.1 for ; Sat, 25 Jan 2025 08:07:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737821263; x=1738426063; 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=ga76srhZr+ZA4p5oAwwhLPBX0FpM9x/evZVdMKDHPokyniX5knFStBoUT8NvJADeWm hPJxhQ5DvExpTUSxUmN19omzyTQ2lbFnEVTP552KrLNQThtQ5w7Ga1bZlOfdb06kjq7I pCDOZnxV9CkFRi88JlSFqqgI/Z3k7Q5+hN5R/8SuvOVtJMIiFkzERya7I4igoPsaO5D2 wsh7ZcOxlCLqbs+rrQAcbV3W/pXf1TMAVoV1AqxLEH4m7FD0HSG0C+sFOPI3v5otLfgs K0VzV+ZZ+GbIqC9GwwnKb+//qoVh1yuzjTxLmQdWoYhx22OF7uZvv3kR0EovfDyI3qPX iopg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737821263; x=1738426063; 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=dv2nw883st5Oo0+lamLhfbk6Tcxgy5JSffu4RI8+3bvE+q76OMeJ8VAcnPlsK9NubR Qo7mSufT++nIY7AaY4ohghPq2gZpjn7FuUW+UskWm8Z/QwDfs4HDOfUJlJBaH7Nh0WSU Uh5pvFni123G5gVZUNA4H1Pb/OjdFijmWYofetk9rLNLi2yKdWOZrpcfMSsISiAUJOj9 HFmvassVFc9D8EBlB1outf/cPu2+irUG+s5VBissoE3DywoIUdBK4LV4kW2Ad/MtyWgA 8gCwOwo+JnFSn6JjqsMPGu6oUERNkxDDqPf/Or2lMVQaYuD8M3+lp/38YKGtsCEA+/b4 qwwQ== X-Gm-Message-State: AOJu0YwCmpnZhnTEHUKhSqE0uOigoscsgsqQGR0YOpGv5VQE0scuGIWU 7eXGOfXL/+92Q7Igw3T4SyqoBIZd+3uFim28/8lwPwauvhTWoe/K2OgvH3q28cFR/EoZsXyDKBB 7lOk= X-Gm-Gg: ASbGncsDHHqcMwqXz0szMcpLXQUHKQcGOKm89EJNNXBIG1lArgfWgj20fMWG8NNTiqf 5XlJX7XmC8W0TIsbSWADjwxcW5dhHjjmhIF8GqoaFlvkrln7iOYXS8uxmuh62xvRfV/EUH+ATq0 uxQXdc20s/5ogzEB2UkOKzDONJMT1WBO+EF/GmBCv0PulcfibNwLndLtK4huqTWrbW6wr8BC9tQ QuY65aRuyUrwH50bT54/yCTVtIB0vsSnwRpcUFyCob3/UfVgb70cazTkDK2bT08ETybIPWJKPwH 1e0DzMD0yWT29ys67rSwa12GjeIw/kYZXFzsrscpPsXIRQPlLjk7Fvm/HG5O X-Google-Smtp-Source: AGHT+IEXbVNtLiwLB6adkaJqninsCyPgOA8BDY4qudZlTLdvfKz70mVYvP4AdUrqu2ZLcXxpJKjkXA== X-Received: by 2002:a05:600c:350b:b0:431:58cd:b259 with SMTP id 5b1f17b1804b1-438914671fdmr358035835e9.31.1737821262753; Sat, 25 Jan 2025 08:07:42 -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-438bd485695sm65140295e9.14.2025.01.25.08.07.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 08:07:41 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= Subject: [PATCH v2 22/24] target/tricore: Move has_work() from CPUClass to SysemuCPUOps Date: Sat, 25 Jan 2025 17:05:50 +0100 Message-ID: <20250125160552.20546-23-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125160552.20546-1-philmd@linaro.org> References: <20250125160552.20546-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::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 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 16:05:51 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: 13950433 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 B7C58C0218E for ; Sat, 25 Jan 2025 16:13:00 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbiiR-0006UU-Ri; Sat, 25 Jan 2025 11:09:00 -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 1tbihT-0005gg-3H for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:08:01 -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 1tbihQ-0000qs-BT for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:07:58 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-436345cc17bso21777825e9.0 for ; Sat, 25 Jan 2025 08:07:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737821267; x=1738426067; 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=hHYsesyxy0gJMSS/wGrF/rwHtjJIq4fNXH/Pj6jF+6IXEqu070v99jdCy0tfoZxJEo DDEWSxZYkiwQkSHgbx+ftNwd/dAtd8Ut/5Wof88jkbyi/ksx34gRxJedXW0UfBO5c/NA TaQj7Ue8/Mg1/mBUPV+J4X6JY9TD9DEOYEvolO0aRkNnWmp0l8x7fcGIfCvH9R8357Bn WewTV/EVypWJb0NuowInkE9aNW30tNrwpjrv8JMmgxZBmWsjBkmWkNEexx5PtnVdl6O/ fvHXm80PPEMUr9VM5zKYKlbN03nNoZednxjj4Lu9EGcCUXrHVWlhptO4eyHIUaucPF4x A98Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737821267; x=1738426067; 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=suhO9O/1+1ILaN7QpO60wCCcF2/9eftefPyqXSZHXBE1tFiIYvjjeepNwxEof8XIi2 PutpV2tK+WC4qUC56oHvZ6ChgmO21bSDpn0CzUjmO/BjYJIVMKwyWQQL5eJAm4p4ZNGP BlaZ7JKtjBkoCDenLRK0foH1HbkeXPCWEi3a7z//aMAOxWpHX8GEaeTfl12KaK5OikHG BdUTL/WkBR0t6CkbBF6N8rDjZ9MxKt/gvrNdv2gP9E5LjOhSULauEoYAhYq1z4p2UkuK TSb51FjiTLlQaf53wafOlf3UtPatrFhp1qK7XRBxM2Jmr9o8d19ipnDY0APtSvy8pPiJ mooQ== X-Gm-Message-State: AOJu0YwSzc5oCVFA03w3dPxS3mKJm6CR2oPbO/QbuuNUuGS4FOkhED22 vjiUmb55GwsQHPFlajoh/HkO1q2YmtntpANvHYYSJoGfgh+aOuvXH1F4nNnxnBoP4zvzm6+DRR/ IRx8= X-Gm-Gg: ASbGnctdvT4zBhlT1YRxx9z82G5r9SfXzP8C44tLGxjZR/5xKrlZbZtUw1FhHaRbfo6 /SIvNmlKOWyuRiFPkrpVxtqVnKUNMikwpgkOjAkTBe/8S7+z70EfTNnBpiYPdwUspfJvRfldron RNlkgUe4IgOTygxXTxjhSdr094h5+zhDZIGCcxDSAlQAmSVPTeJeFdBFn2Ei+QUG7BUCYlj9EHp HnBRwsecKBGK7UFRXJR9Nk6iOyUFleHuozomHedhYen+XdFhRzQlOcJCNlzIp9lbxkl/rpe9d27 5ZZjUNe+xZfAoXXfGLP4D/+gB0LiZchvsKDOit2YFf9dM82+iuvhNeGmJTk+oMBY3CEMOXw= X-Google-Smtp-Source: AGHT+IFiUi6iyKyDvhKyW97+Syu6lKgE51e685uianCVdMwKhVvn1nZpJmv7uNn4wf0DSHL98eR99Q== X-Received: by 2002:a05:600c:4ed4:b0:434:fdbc:5cf7 with SMTP id 5b1f17b1804b1-438914373e4mr310199725e9.27.1737821267377; Sat, 25 Jan 2025 08:07:47 -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-438bd4fa463sm65705545e9.8.2025.01.25.08.07.46 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 08:07:46 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= Subject: [PATCH v2 23/24] target/xtensa: Move has_work() from CPUClass to SysemuCPUOps Date: Sat, 25 Jan 2025 17:05:51 +0100 Message-ID: <20250125160552.20546-24-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125160552.20546-1-philmd@linaro.org> References: <20250125160552.20546-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::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 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 16:05:52 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: 13950430 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 21D8DC0218C for ; Sat, 25 Jan 2025 16:12:43 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tbiiM-0006Rw-6n; Sat, 25 Jan 2025 11:08:54 -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 1tbihT-0005iE-QB for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:08:02 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tbihQ-0000r4-O0 for qemu-devel@nongnu.org; Sat, 25 Jan 2025 11:07:59 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-43622267b2eso31632395e9.0 for ; Sat, 25 Jan 2025 08:07:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737821273; x=1738426073; 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=5jEVe+YJcTp7UAkGQALuSFnfsOHF6JbuBlxYoBxiLJI=; b=emGWG8f+wSEEV1snF87Hselcan53i0B9UvyG/dkNohGE3oR05W5oqp5z6G+gvVwiN/ TblnoxW1KNLA2Gloe2VjBxj1QJMPHGsG5OuvGVsZ2RCaF1rWUWoz0tkWCHtXkVNZV80v M5j15cFKKJg8CdUpPeUsFIltplN6hJqfVxneabffXF161GhZn0Mt+YgeGJkD3Sae+LsD yfomMMwwz0lJ0/bifvcrXtnvSi47C8sWnDI6IwPquRITo+xDo6phJdPGV9snsCbp62Pv Mf2C/kNqz+rxtK1xthdySyZYWtoGo+HGe6UoOHBDKWPbzV0KK89fBpTE9b6rwPiECTMi DZ+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737821273; x=1738426073; 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=5jEVe+YJcTp7UAkGQALuSFnfsOHF6JbuBlxYoBxiLJI=; b=E1RAHCGGjW2J7D/FEn+MUTbzOTvjulXK7Io4h5L6FS+TBGV8IRx272C73rxewLqKBP 03cFrltuI9o4sriNHHP4+/46cLLmEyn5mvtHBjg84XBPevkjVbmOOe/H2z6ZDXjDVJFd /uxu6TkymfnYHcSK1OPEXQvx/c4Ov7GaqF8oUMr4Xizbhd72eOFtuo8NwCUVRxiWIho2 93sUvJ138XK2mnX0b4KlWXpDuC6r00bX0IQInvaEl0HJhLa9niwjec38aZReTq6M+W81 CNiVN2xTzMkMamZJng76nWh7ugKy3wYv3xFR7NsvOwqS43FiEbYzGzvAXMllEqtgcpAa HLqQ== X-Gm-Message-State: AOJu0YxZN7SlPszphpPvj+2bCYphM/mZV7Sfzq20JM9s/QLrwcLkF74Z 0HVOOWh0wmjA9jZnpkv7vmvDcpzPH4uu8p0h4OCgDYrpzjba7+BhJ9i84zw5Zpa7G67hJ05WTBG YwCk= X-Gm-Gg: ASbGncsfS+/l3i+kBhAlsnnT9vFfWWTgyS+EPUsjryNC2CQ0wSNtM/UnycXcsp+/+ee sTljSwB+R1YZIH6+zZBMSanVTSiNiUvURWV37Qog0xundPMJsy91Bt0EXoLnPyT2lPg0ORh10t7 yCKIRPaicTsfE/1FrrrLW/IiWGHtnpxUTC40a4rBtwmu6/YKRbdUtoacSPYV9rtViAHd//Mv7pK KL19oVJpKXVb4jAE9wc9wLjrdCSQDXKCcaIyi1TZmK0cYRIdYzkYIscaUmcbaHGr61SRiXrmMfX MPw3QdWHTN99nnaHIzPystdYSXd75A3Kj80eDSjX4RM9rk3Lw0ySUAiKDbLq X-Google-Smtp-Source: AGHT+IGCVz+8vLHTQ7faHu4eYfs+0l264fo5YbCyoXqqRWKlC/E8YZYnLrUuQ7EPleNJ67eJ3gy9zQ== X-Received: by 2002:a05:600c:524c:b0:432:7c08:d0ff with SMTP id 5b1f17b1804b1-4389143768fmr316253995e9.23.1737821273389; Sat, 25 Jan 2025 08:07:53 -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-438bd501c38sm63952545e9.11.2025.01.25.08.07.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 25 Jan 2025 08:07:52 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= Subject: [PATCH v2 24/24] cpus: Remove CPUClass::has_work() handler Date: Sat, 25 Jan 2025 17:05:52 +0100 Message-ID: <20250125160552.20546-25-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250125160552.20546-1-philmd@linaro.org> References: <20250125160552.20546-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.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 | 2 -- include/hw/core/sysemu-cpu-ops.h | 2 +- cpu-target.c | 4 ++++ hw/core/cpu-common.c | 6 ------ hw/core/cpu-system.c | 7 +------ 5 files changed, 6 insertions(+), 15 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index d64c823e768..2bcad4b16bf 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); 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..15aa8afef55 100644 --- a/cpu-target.c +++ b/cpu-target.c @@ -217,6 +217,10 @@ void cpu_class_init_props(DeviceClass *dc) { #ifndef CONFIG_USER_ONLY ObjectClass *oc = OBJECT_CLASS(dc); + const CPUClass *cc = CPU_CLASS(OBJECT_CLASS(oc)); + + /* Check mandatory SysemuCPUOps handlers */ + g_assert(cc->sysemu_ops->has_work); /* * We can't use DEFINE_PROP_BOOL in the Property array for this diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index 886aa793c04..c933de1416c 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); 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)