From patchwork Tue Jan 21 14:23:14 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13946318 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 07D72C02182 for ; Tue, 21 Jan 2025 14:24:44 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1taFAW-0000LD-Js; Tue, 21 Jan 2025 09:23:52 -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 1taFAV-0000KR-Id for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:23:51 -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 1taFAU-0002xo-4H for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:23:51 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-435f8f29f8aso40947815e9.2 for ; Tue, 21 Jan 2025 06:23:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737469428; x=1738074228; 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=UG0trGBZa/zHcAjVBtljvnuPb8rCcRdqGnikIpWwT/E=; b=tPpVNRT9Sz25zVayH8cmdU+l4I6O2mNyYgnqUIL6SuscPBIsJijtPDMEaSwv2GgHML 0Cyo00LkAt+/ZbtvMgsxV4dELVvWDLVHqHJ6fJ14mKyyrCQcwRCqczIu88ZttWYysXFp uioiJLxxWU0539vz71Il3kolY6SCHZ5sGGf3e014BC7bBPUrwezcCA4UBJPMK/SFm0M2 mQeHwhxURc31g9fwd76Sv429j49LABl1T+ux2yThdDVsCqJDvATemD4Uvq8W1vLDWYjk ub2Y2c5axkSSYST0Kt4hadt+2aGmi2oHTORWD2PQOymwZMTdtMUlGF9lnqZRJxoZzmhV LxYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737469428; x=1738074228; 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=UG0trGBZa/zHcAjVBtljvnuPb8rCcRdqGnikIpWwT/E=; b=fJW96WDEo6JQiTnu1w+vOaubAoJqpR+HlSlx5oc6TkZZ0BlNQT+ZdT17Q0gv1zuGi3 U39KNvEswfiH9s0+GMp9Pvjd8B4NdTTMw5U+GNyYzEwHkxdhwqy/cri4wd6AoLlbi3YI Xi0B8D5g9sjUMjx4Y0BqjyctPahR/GnwnYaOZu/8j5C2qA4pwvX8T/2f8Ki5zFS2rCE1 CbWlyvC5NTwpX5kD7MCUXa/ghYg3eSxunYweRx2hos5Q6DAM30H+L/XRZNMrmGbZbcAf yDl+sLJWnu2xdPX6opZ/oQYi4lB89E7xj2JViaPOLFhCSAGPWcPIUAqf5kGJAC9Ylkws jSnQ== X-Gm-Message-State: AOJu0Yxvaa6iz2GTVfafXlHt2q/dQF3eTI5QLa1mVlrMOBjNsFmyH+Z9 G0kXWL6QKxi0Eb3CwdlFwKHBehP4nhC3xFnwF2ogJKBjg3FKTRGHrvlzZMm0CYcOfCMP0sk/kwU cMxY= X-Gm-Gg: ASbGnctB1OGbZte10wcQ8o9k60aRz4wTlHXIzoF9s1bErdb8vy5IoOGuoPnLGAReafk JqycnrKMmcULn27LqdR2OsCVA6jjHFfWGnNK3vu8E0b/fllDbGA7+mZUflsmx93J+ylHfxk/ry9 5BuP5MQUygFa+McVpp1G1DQIrvrp3oesjhWpRgl3j8Bf59/LggLXOuVi3jLqfe2BLJdgUOjrnYl RiFrB8x6/e9S7aXsBxhxt0+9kU8vAuXDeyLUCW7YJBeoc9TFYIRCNrs9S/TMsh9kF5Adl9WnQjM RCUJmzZCAQBt4rPxD0ngwc6aZjWeOj3FN8v3NJLZxzE8 X-Google-Smtp-Source: AGHT+IGjuV68zkjMzC56OZPOHSd4ONXCv+cHsFdMxckEbUNUtN6Rb1XshAzelw3fkl/lkUre+ozVBA== X-Received: by 2002:a05:600c:3d05:b0:434:f767:68ea with SMTP id 5b1f17b1804b1-438b0dc9532mr10630425e9.5.1737469428481; Tue, 21 Jan 2025 06:23: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 5b1f17b1804b1-4389041fec5sm184309165e9.19.2025.01.21.06.23.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 21 Jan 2025 06:23:48 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 01/28] target/hexagon: Ensure not being build on system emulation Date: Tue, 21 Jan 2025 15:23:14 +0100 Message-ID: <20250121142341.17001-2-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250121142341.17001-1-philmd@linaro.org> References: <20250121142341.17001-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 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 Currently only user emulation is supported. Assert no target code is built for system emulation. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Brian Cain --- target/hexagon/cpu.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target/hexagon/cpu.h b/target/hexagon/cpu.h index 79e60d4bfa1..f78c8f9c2a0 100644 --- a/target/hexagon/cpu.h +++ b/target/hexagon/cpu.h @@ -26,6 +26,10 @@ #include "mmvec/mmvec.h" #include "hw/registerfields.h" +#ifndef CONFIG_USER_ONLY +#error "Hexagon does not support system emulation" +#endif + #define NUM_PREGS 4 #define TOTAL_PER_THREAD_REGS 64 From patchwork Tue Jan 21 14:23:15 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13946325 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 39324C02182 for ; Tue, 21 Jan 2025 14:27:27 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1taFAe-0000P0-3r; Tue, 21 Jan 2025 09:24: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 1taFAc-0000Np-1a for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:23:58 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1taFAa-0002yw-8s for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:23:57 -0500 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-385df53e559so4380557f8f.3 for ; Tue, 21 Jan 2025 06:23:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737469433; x=1738074233; 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=An4WuoQ9oUhjA0b8UFcs05igfO0lRfI1lKgEsGkbyfQ=; b=KkkzBTS5ciSvtq2OK554eAKDXOLXhQ2KEU1BXDdO187J9bLIuuvcUQ0pp/0tpx3+7L RyioxP70JY2TOsG/IOTRFK0s0v2MPYuFbCPdEWkkatZaWuSk5jZ9Xyxf3y7x3vEWE7NU eT6Op7mlU2pdU7IDpk4XjEI7q18fVw3ieB8wLEHk4d5mVhjh2PO69O47tqzqaZUIDnV4 obcBn7JbD99cYTCxkzDmoA9983jj2ZaOunuIsFcn5B8X6s2mekHixtS2y2b53yd/0HYL v7GG29ALGzqeg8aTjHiR4pdLVEDNNihhZiO9OfQk0aUJps5goswIlNXfRgwBfj2udROZ 523Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737469433; x=1738074233; 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=An4WuoQ9oUhjA0b8UFcs05igfO0lRfI1lKgEsGkbyfQ=; b=DQA9GwbQJHpFHPOj4s/k7XI2iEPpl/Wyaxd+5VKlExJyBg04x6eo2O2IQrHpmS5h4k 4Ygce7TItcLXoCKorIZM3Qnu3HyoABOpIo1JTlWJqFhu/u7v4OYR7Xll8gfICA/yF6SE yxYjh80K4cLF2dY1oAOdHfELad+bGU93vCubdaPAGk/9R7b2+Qf9y5WNKcBBZaSWuAu2 UAyXOoWzxpxzsid5A/SnE7TEbERxX/2Fyc93o4ncWLwiAwf1d+67Hs1PzT4+QeSuBIgv CIhxDld2TKZheQTUedrxhEmcZgZwBbgLtT1QOxV9/0Fj8a0F5143kP/VT03HxTZUdT/d 3u+w== X-Gm-Message-State: AOJu0Yyg11Ok7XJTbEYKap8r2bf8Wt3dw/De9qNGdQFK4nT4SD6i0U0g pEw1pk5i0/jT/HEJoaOQMqlYy2NTqeK3X1AcNjTY0My1pkc8qLrPtRV4sJIA4cZV3MHUCb4/vBS gqME= X-Gm-Gg: ASbGncuUtN+Z6Wi2EFXOOD9rEQykz64ogyFVzte9MttK8EdvvhPDbM6qBquE1rhfyrV pLQtlN9DLV1w5XyxYWtIq+TRZbLCZhfa/zH+GS6/oeY4mVsCEGLrHhaAjtWf0M5vmRidpmvmTW3 PNx9bzf987gDlJoM9Llrk2O+qA/ageLhukdPA0WrjM599keEpcpG3eYbkUL/7m+9VErcoYpcX9G pYxLG//SLwpbRQAljR/ITeRq8zR60KEFgeiq3+mODyVyPI7scJ2RgJg3rjXZAeQsWF0TLqAj6rH nJUnGVNSZA6Qx7MFVUjqN+QXxBgomRvw6si98FsCUoy7 X-Google-Smtp-Source: AGHT+IFdnHijVGQ8OHgYhsJUBUXhSM/tYw4Ahr+XweE1xA6xZ9bEyVW6TlKLZf0El257Bd7ogaAjfg== X-Received: by 2002:a5d:64ed:0:b0:386:3e87:2cd6 with SMTP id ffacd0b85a97d-38bf57b7633mr19466181f8f.38.1737469433241; Tue, 21 Jan 2025 06:23: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 ffacd0b85a97d-38bf3221c30sm13728474f8f.32.2025.01.21.06.23.52 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 21 Jan 2025 06:23:52 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 02/28] target/rx: Ensure not being build on user emulation Date: Tue, 21 Jan 2025 15:23:15 +0100 Message-ID: <20250121142341.17001-3-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250121142341.17001-1-philmd@linaro.org> References: <20250121142341.17001-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=philmd@linaro.org; helo=mail-wr1-x436.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Currently only system emulation is supported. Assert no target code is built for user emulation. Remove #ifdef'ry since more work is required before being able to emulate a user process. Signed-off-by: Philippe Mathieu-Daudé --- target/rx/cpu.h | 6 ++++-- target/rx/cpu.c | 6 ------ target/rx/helper.c | 4 ---- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/target/rx/cpu.h b/target/rx/cpu.h index 5ba1874bd76..349d61c4e40 100644 --- a/target/rx/cpu.h +++ b/target/rx/cpu.h @@ -26,6 +26,10 @@ #include "exec/cpu-defs.h" #include "qemu/cpu-float.h" +#ifdef CONFIG_USER_ONLY +#error "RX does not support user mode emulation" +#endif + /* PSW define */ REG32(PSW, 0) FIELD(PSW, C, 0, 1) @@ -129,11 +133,9 @@ struct RXCPUClass { #define CPU_RESOLVING_TYPE TYPE_RX_CPU const char *rx_crname(uint8_t cr); -#ifndef CONFIG_USER_ONLY void rx_cpu_do_interrupt(CPUState *cpu); bool rx_cpu_exec_interrupt(CPUState *cpu, int int_req); hwaddr rx_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr); -#endif /* !CONFIG_USER_ONLY */ void rx_cpu_dump_state(CPUState *cpu, FILE *f, int flags); int rx_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); int rx_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); diff --git a/target/rx/cpu.c b/target/rx/cpu.c index 8c50c7a1bc8..aa310bd6144 100644 --- a/target/rx/cpu.c +++ b/target/rx/cpu.c @@ -184,13 +184,11 @@ static void rx_cpu_init(Object *obj) qdev_init_gpio_in(DEVICE(cpu), rx_cpu_set_irq, 2); } -#ifndef CONFIG_USER_ONLY #include "hw/core/sysemu-cpu-ops.h" static const struct SysemuCPUOps rx_sysemu_ops = { .get_phys_page_debug = rx_cpu_get_phys_page_debug, }; -#endif #include "hw/core/tcg-cpu-ops.h" @@ -201,11 +199,9 @@ static const TCGCPUOps rx_tcg_ops = { .restore_state_to_opc = rx_restore_state_to_opc, .tlb_fill = rx_cpu_tlb_fill, -#ifndef CONFIG_USER_ONLY .cpu_exec_interrupt = rx_cpu_exec_interrupt, .cpu_exec_halt = rx_cpu_has_work, .do_interrupt = rx_cpu_do_interrupt, -#endif /* !CONFIG_USER_ONLY */ }; static void rx_cpu_class_init(ObjectClass *klass, void *data) @@ -227,9 +223,7 @@ static void rx_cpu_class_init(ObjectClass *klass, void *data) cc->set_pc = rx_cpu_set_pc; cc->get_pc = rx_cpu_get_pc; -#ifndef CONFIG_USER_ONLY cc->sysemu_ops = &rx_sysemu_ops; -#endif cc->gdb_read_register = rx_cpu_gdb_read_register; cc->gdb_write_register = rx_cpu_gdb_write_register; cc->disas_set_info = rx_cpu_disas_set_info; diff --git a/target/rx/helper.c b/target/rx/helper.c index 80912e8dcb4..7f28e729891 100644 --- a/target/rx/helper.c +++ b/target/rx/helper.c @@ -40,8 +40,6 @@ void rx_cpu_unpack_psw(CPURXState *env, uint32_t psw, int rte) env->psw_c = FIELD_EX32(psw, PSW, C); } -#ifndef CONFIG_USER_ONLY - #define INT_FLAGS (CPU_INTERRUPT_HARD | CPU_INTERRUPT_FIR) void rx_cpu_do_interrupt(CPUState *cs) { @@ -146,5 +144,3 @@ hwaddr rx_cpu_get_phys_page_debug(CPUState *cs, vaddr addr) { return addr; } - -#endif /* !CONFIG_USER_ONLY */ From patchwork Tue Jan 21 14:23:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13946321 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 7FC19C0218B for ; Tue, 21 Jan 2025 14:25:49 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1taFAl-0000SU-8t; Tue, 21 Jan 2025 09:24: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 1taFAh-0000Pu-03 for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:24:03 -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 1taFAe-00030N-0F for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:24:02 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-4362f61757fso58476565e9.2 for ; Tue, 21 Jan 2025 06:23:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737469438; x=1738074238; 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=R8Fp3sEVk5tNH2xc5e8sHq21AAMknUb1MPMoentFoZ4=; b=rAh/6Mikcxxi5oc4GjunUU/9Cw1iL7gTIBpM68n/k5sw/RodEzS/pgFcUDv1ZRDFCH WxQEVfVw9JHduRVJ0PR4mXtBOSa89ngwPEEv3GMRWcsIWnKGe+9/1g+rCaMD9tYx38MO 3zYWnE7jZjynmmd2n1clWWZg0kx+ipPlADysxETNUAbLULu3V7SHaNtY7xe6oURJggRo BdR1nw0N/9lWOEBrnL5f6LhrX30w5I3zZ07julFpfa5X6LkadDPSQ9mhlVfOtXFxY41p YaGCGARcdT4uEyznjEmtOVTt3fpryimpJEU2fgviQp0DBmV35KmI9foebYnkrHWSnoMk bYJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737469438; x=1738074238; 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=R8Fp3sEVk5tNH2xc5e8sHq21AAMknUb1MPMoentFoZ4=; b=mcxaxk5LhOdqAPhBTICnVipSASgvyhiXkOeNImE2+eJTfps5SJadJ7Qov6kmKdHMXe fpYwizSAnk9COqlZmNqAS4DWw5ucfqgOzPnFtDPRGeH2qFcH/8j+bU1fHMFeby0Y6VlW nb3d/I2QVi90W9K9beI0MkNbkwR0+eFaWt1E/CeXWJVzRJFibcHAcX6Gaa40Mnhip+p2 cCFSpOx+Snei0lu9bKSkNkN/guDQCX9XnMolcFlC/B3rfZfI+++mC7Ou9zwr2w1AB6Gd YadCLz7ms4w831nDC9VH+QHub4WD33RpdDpb4UV1oeCrcBdzOW5Jmsl4R07f8V6WiCQk n8ZA== X-Gm-Message-State: AOJu0Yxh3Hxn/1hKorH3MjaNIeWc2fffpw2va/Eopmxq8OvFUjYC6KHp 0VZ4u/AaJYK9inrzWP7m8GvApMufqFPCtyHVompXvYAvyKZo/Y8qZrNcfUJ+29r2PncROR6XZCQ zbA8= X-Gm-Gg: ASbGncsgmK6pMdQg7l39R/sjChIX9AKsV0gWtYit67cq5/0OJqWhlaEWYUGHkHRTq1T JjugvjsClIOi8qSkgBhG/Q1JneaCumvOAj7zyrh6SOdlPB33ap0/5NUn4F1BQSr7UsidBDheP0D tpYLyusfCZmgqCNgxNY6XzNY0dyQSKVsLHkETmhDRbFfSFJal/Z7NTos6iM/8ArIwEBzkSxRj9M c/EkowvQiTlbBalVapSGLQViYbjJ5YHqFuuMG5IYKoqZ5jcT+s4EqR9/fP3Jwu66eeke7+pVwGa CRbWIQr/UVRhwILr5rjtwzaXWWWg2lRUr9YeOvtnR9sV X-Google-Smtp-Source: AGHT+IHRRRFi4Nx+gUlXNrOIqKZ9RUDyB/BIJ9YPDbNLtzDmvPK2tnlKcG5OwU7XsrJAhWhrUi9wvA== X-Received: by 2002:a05:600c:1c83:b0:434:a746:9c82 with SMTP id 5b1f17b1804b1-438913be56bmr168297705e9.5.1737469437897; Tue, 21 Jan 2025 06:23:57 -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-4389041fec5sm184313625e9.19.2025.01.21.06.23.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 21 Jan 2025 06:23:57 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 03/28] target/tricore: Ensure not being build on user emulation Date: Tue, 21 Jan 2025 15:23:16 +0100 Message-ID: <20250121142341.17001-4-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250121142341.17001-1-philmd@linaro.org> References: <20250121142341.17001-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 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Currently only system emulation is supported. Assert no target code is built for user emulation. Signed-off-by: Philippe Mathieu-Daudé --- target/tricore/cpu.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target/tricore/cpu.h b/target/tricore/cpu.h index 8e431d79222..cf9dbc6df8e 100644 --- a/target/tricore/cpu.h +++ b/target/tricore/cpu.h @@ -26,6 +26,10 @@ #include "qemu/cpu-float.h" #include "tricore-defs.h" +#ifdef CONFIG_USER_ONLY +#error "TriCore does not support user mode emulation" +#endif + typedef struct CPUArchState { /* GPR Register */ uint32_t gpr_a[16]; From patchwork Tue Jan 21 14:23:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13946345 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 1778FC02182 for ; Tue, 21 Jan 2025 14:34:53 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1taFAp-0000UG-Iu; Tue, 21 Jan 2025 09:24: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 1taFAm-0000Sc-3H for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:24:08 -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 1taFAi-00031q-Am for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:24:07 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-436202dd730so41437325e9.2 for ; Tue, 21 Jan 2025 06:24:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737469442; x=1738074242; 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=XFAdNtSt1Vac9l1lQj/iEUHKax6ecgV2tBSS3BkOMOM=; b=N6xlUVlRKXXUos8vRWessYSLKiRPyVgDGQHbzJiWtrBb4LBkrhBlXMGryOlk1vUTkF 8ppmQfGS892h44LbQyfIRmjcheQef3tzyUYQOGa4EB6Ds++/7yiZADy/XM89mNzDOVLJ vvnzhjyCRqelph58deXNTWvgdsiFrSjSww1qxHEVXwM+ZAxcy7jka8rw/k9gbGvlXCVJ cFii7ao+Up/9Lz4iica1u8LoAUlLYQid/cHibmTdR8nKj47q9a6MzVD8P8yL45tiB1CM jubUqoPuSx4sAHa2F9kJEA+PXM6rJwJKnLEX0L/Xkz/nT0+D6hS1dBYirZH4l0twNtDG kUvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737469442; x=1738074242; 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=XFAdNtSt1Vac9l1lQj/iEUHKax6ecgV2tBSS3BkOMOM=; b=SF7oyMOWvATYitdSpynT6EGZAlLxGrs9CrZ5NgK8KWYJtBcYVsFFxwzQ8T8zWK/3c6 xKQ9JefDm33/o1EjklcYMGgGmxdQymSnFmdveybJ4ZwwvCo8toVronIdoXcdXZKDP5qc 3gwiPwO8QCKnWMIHzESUqESK8tRUlwe+0MNpD54FMgMJK0Hf0RlbCnQCniMp6FOZnvmW rc6cQuNyBDn9OQjrEZ/DKhK1oAjZd6ol3cTvjNiXeADeRqF4/5YOdsY+qPQw5pFo52VS fC2I/dopMedrGtrF9CSkquUdX3FLJSfz6ijxNJC8T10veJKP8iwevzZ/EFq7VVNOQ+8V /l/g== X-Gm-Message-State: AOJu0YwUyjZetigpcWddMO/hMnp9YSKn0QSByGD27UPEtHoCFA5EFoAL krQBGY+rV9ZBxUz1mEoR/WuhoN1sFRv+h9p/HaISc68LGr0FrKB5ze25mnvPK0wPKIOBG9zoFVB jcOk= X-Gm-Gg: ASbGncsNQEUoL/0qViAGUGQ0nxKse9Dm/T2zSxCu8xBktEQbwvtsfYH96vVUB8pcShy JqqWhTm1Ei7x3+KFcjBgc6Y9Rh8ZnJiPIdNs01rDO/qiTTWzidbhVv0wsIf8u+MfRwQuZdlFBjD VyGbDA6RM2X3XgXokma1lj5WP/DSVktzBEWN7UhZrZyS5f2W8Yfiqi2wssdibi9Xw1FtO+u6JbB gl8pa5aZ8PwETvyq0JNEyT/e3yygTrn2Cvmv88zu747jlFisYdAD//jgBM2RUw7k8L2EPTLm7U8 WOgu5BVU+ilIX/ZwjpZ3PCKL5EAYjlj+hjWMBTKueUVi X-Google-Smtp-Source: AGHT+IF8EkOmZIKsyhJCbT2LadC5Giexa7uQORK2zEjITVG/7BmaMjTO6X83J1cyu1fKyFMtZq8hwA== X-Received: by 2002:a05:600c:34cf:b0:434:fdbc:5ce5 with SMTP id 5b1f17b1804b1-4389145288emr173734005e9.29.1737469442591; Tue, 21 Jan 2025 06:24:02 -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-43890367b48sm180702695e9.0.2025.01.21.06.24.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 21 Jan 2025 06:24:02 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 04/28] cpus: Restrict cpu_get_memory_mapping() to system emulation Date: Tue, 21 Jan 2025 15:23:17 +0100 Message-ID: <20250121142341.17001-5-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250121142341.17001-1-philmd@linaro.org> References: <20250121142341.17001-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 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index b7367f6d808..2402706c7d9 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -614,6 +614,8 @@ extern bool mttcg_enabled; */ bool cpu_paging_enabled(const CPUState *cpu); +#if !defined(CONFIG_USER_ONLY) + /** * cpu_get_memory_mapping: * @cpu: The CPU whose memory mappings are to be obtained. @@ -625,8 +627,6 @@ bool cpu_paging_enabled(const CPUState *cpu); bool cpu_get_memory_mapping(CPUState *cpu, MemoryMappingList *list, Error **errp); -#if !defined(CONFIG_USER_ONLY) - /** * cpu_write_elf64_note: * @f: pointer to a function that writes memory to a file From patchwork Tue Jan 21 14:23:18 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13946346 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 3EC45C0218B for ; Tue, 21 Jan 2025 14:35:22 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1taFB4-0000aF-2z; Tue, 21 Jan 2025 09:24:26 -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 1taFAr-0000Uv-CG for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:24:13 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1taFAp-00033O-CI for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:24:12 -0500 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-3862a921123so4053260f8f.3 for ; Tue, 21 Jan 2025 06:24:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737469448; x=1738074248; 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=uL4Y+z6DzTKVC74EB8XgyjJw99XhZeyPYSd4sWJmzog=; b=kyyNbtL7qPBGpgMfbNJwFYYqeqULyktpceO19h6lQvNTWMgFX7/jLfVke35PIlf54u PYeJRNAIwzOxDqFp4kaeaUsG7pWxS+r/E+Jk0bj40R0zmiQK6Hpuj6ti+vuNfcm4WeUg zIC3n4/PniBI9/IhV4xUFPdNeA73lad829+63X6lObpPjo4I4/b3qquHzJHrBcQKrgn7 DHzvHjyAHH70v7UhMWzjDYKWxuJnQdkorRXSYa5EQOieF7/YE5zq6WGhdxkpvpYwJgnS 2NFF4Gf/VT41UeCVkC28jczrcaoTQHYvck9pGJGlp14IjFWNYF9yQMnv4+FtOhKVuPOA FpHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737469448; x=1738074248; 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=uL4Y+z6DzTKVC74EB8XgyjJw99XhZeyPYSd4sWJmzog=; b=jCgf0ULPdtyLnUoI5utxR6mvkFNYY7dzfB+orljh+haLtV4t8KLD1NbbIO8HyYka6t Zs9GsUCfUo9hGbNQ++Zk5Jn37xIifmyRXCKB/PUevu4ohD/ygz3LTEn8cNJBXiE8JoqX f/6YlNFhzqk5ki9MKbxuoY73Zn3SvaEw2XdouRYk8o0yOqt9ncIuMiB8SpLt5VX9Y5jX rv+YHOscPffCCMbZeudQS4pwEuRLpTEXcNVpGtYfQIrTC0iTbLm/G87wD2iHpesNSL12 5NWgBtDQBEj5jyoPL3o95JZEEQjAY7P+31s05NMcv4IVxQ5mDwF2Op4jKuDM1ctCknDr CXZg== X-Gm-Message-State: AOJu0YxU++8uD+ytxaCpAG/dZKQfLpLPJs3d31RMHN6yLMpmfOIK13z7 A1ohMyXpn9TaCRsMKcNAxxxmxYdUYMobXWO11WEsQX+eQSnbnuSXBHtx3EOIKsodaf25OxRKG6M xVDs= X-Gm-Gg: ASbGnctGikYZqn0LZpSubU03Tn99X2PQNd6zeOiX0oKsXCuxZtX+9NctV+WZV8rlRrA BD8hPww+8C9kK7peWF8G2TD5AgR+y0Um/W3Z92lw1v9nPpPIouiUbRNSnye4OGX58rQZz+sq+R0 /FkF3/Jl6Joq8vYUgUe0zzuXkhUQ7CbsODzel1pezFryR50I3Z+XlQk5Ey0hR3+FT8YAtfgP9Ry L0PFTjbQ9QH+eN6hQUJjRU2l7lk7SfFw4aHrvTzxeg3RNB4kfdEbVyyovlsECnniCdjqY2RtfrQ bfebNysXi2jwvMcK3DAOrgLvZOO0Qipm1WJLvUj4ZBwM X-Google-Smtp-Source: AGHT+IG2J+fBTwBjziF/CKK3YvS7IkMDlLeRzzR/kuQ3HqnpmWiqykgSetll2TWOSALFBgnl02mvBg== X-Received: by 2002:a05:6000:1849:b0:38a:8888:c0b6 with SMTP id ffacd0b85a97d-38bf57bfcf5mr18393431f8f.51.1737469447276; Tue, 21 Jan 2025 06:24:07 -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-38bf3214fbdsm13815861f8f.19.2025.01.21.06.24.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 21 Jan 2025 06:24:06 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 05/28] cpus: Restrict cpu_has_work() to system emulation Date: Tue, 21 Jan 2025 15:23:18 +0100 Message-ID: <20250121142341.17001-6-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250121142341.17001-1-philmd@linaro.org> References: <20250121142341.17001-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org This method is not used on user emulation, because there is always work to do there. Signed-off-by: Philippe Mathieu-Daudé --- 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 Tue Jan 21 14:23:19 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13946347 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 36F85C02182 for ; Tue, 21 Jan 2025 14:35:22 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1taFB4-0000aJ-4c; Tue, 21 Jan 2025 09:24:26 -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 1taFAv-0000Wn-TN for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:24:17 -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 1taFAs-00034M-58 for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:24:16 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-436345cc17bso41079805e9.0 for ; Tue, 21 Jan 2025 06:24:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737469452; x=1738074252; 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=GxmkPvBiu38d4nUnNXUTFzs0Gc1uo0/SVUn8XW+hnMU=; b=TjRGMuDOEFgJpuQbrjpiGAGfGLBjEeUWM5sfnTrFiYV9bhsUhPig3Z7YzBkdKgVL1Y 411d6tyr6Wbrnlt7qGoECwX05YYWKssi23GenIOtMfdoPOXVIdw/8dX3MDBYkfZ21FKL MVrbGTTvHLPLDkODw15gwrH8mQxnMUVjAooWGOUWQ5ei8Q8475WA2KBJUdnq+9lTG9Ec dB4+tBiC7WKRXpZrA8vK5Lq+5nbXdzfy0LHhPd5aA/hiDMdH/wLxtBJwc8Tsu+aFmojr QvXfepxz9v52KHHiXpARzUai+KYGqWlxcsgP2TazembSabebXUuz11YLqzKX3/OksM6U jgow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737469452; x=1738074252; 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=GxmkPvBiu38d4nUnNXUTFzs0Gc1uo0/SVUn8XW+hnMU=; b=eOLYca+rlP+CGT+kCgkR9p1tMb5H8AtWd5+WqK2R1L1zRkOU8ZRBVA+rtabi8l8CI3 p6mYIwP0XiqkDERZbNhpv4qc5av4zNVrXeJTbuFykJ/xZJBU+/D5rvA2eMsxcTZi0CtZ 9qlK9Van0VHXf46XSF9qDlWmsgG2sROGCF73v7/yE+qKa5PT9TKA/wZV/Huoq1FjR2m+ DuN23hYLLM6ja//H3Is2aGcHu8S+Go2h2+G87ir0mNFEzcf2I83oaCwVL+BkMSa/JaQy Fux5daUwqtmXnnLYXMu1RzvXoXkIb3Q9EARTT9E/JuiyJwA9SoTEtWfTFltauNsw9toA W8FQ== X-Gm-Message-State: AOJu0YyDAZfhlij+4GdjdZato4Qwi/fXKlYSpl9VeDiSLEGfsbRxxblJ VJl2rwqyYbbyoclBO1LAS7Z3h5KX+WN5Rrb1EA65EW+gbZs9HwqDoqv7ybNLnEZrKxh7A/HYr/u sHP8= X-Gm-Gg: ASbGncuX1igfI6W6e5vhUyJ//AcyG5aI21wclnvF91zg/92ssZK8/S1nQdXegv8CWxg tvep5XDSx33EUU40rIiFTLWtibjgcuRpuViZxLRUXI6XSr8KUIZQbf0MSAcSAseH/Um0OOXtM10 L/LlC/acQtAq/kiLbnmsBV3ocVDb+Z2SiMOqSQGvEHVWjQgKJfs2TqNzKTk731HQDiJQDa60RhR Gc0+LtPkO7l6e/Ieyj04aaLZjAFx62EfRf2QRmxl0SP9kfGHjtOM8O207AVEUCp0yKwyQLkV5lA Ju1sbWLq3/ni5tztNcaqU2lY7EgeECKlvJC4XNTh5eIt X-Google-Smtp-Source: AGHT+IFZrFESwsFNUaYJimOkejXsWSHj1fmxkyRQ7dWj7lO3cgLc/tLtR93I3PvPnuqUDGaw2gsplA== X-Received: by 2002:a05:600c:4511:b0:434:f871:1b96 with SMTP id 5b1f17b1804b1-438914388e5mr185146615e9.29.1737469452073; Tue, 21 Jan 2025 06:24:12 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4389046885esm177866955e9.36.2025.01.21.06.24.11 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 21 Jan 2025 06:24:11 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 06/28] cpus: Un-inline cpu_has_work() Date: Tue, 21 Jan 2025 15:23:19 +0100 Message-ID: <20250121142341.17001-7-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250121142341.17001-1-philmd@linaro.org> References: <20250121142341.17001-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 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org In order to expand cpu_has_work(), un-inline it. Signed-off-by: Philippe Mathieu-Daudé --- 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 Tue Jan 21 14:23:20 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13946327 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 A69E9C0218C for ; Tue, 21 Jan 2025 14:27:34 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1taFB5-0000az-07; Tue, 21 Jan 2025 09:24:27 -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 1taFAz-0000Xj-21 for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:24:21 -0500 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1taFAw-00035r-Rl for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:24:20 -0500 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-3862f32a33eso2605101f8f.3 for ; Tue, 21 Jan 2025 06:24:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737469457; x=1738074257; 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=TsVY/fcRHeZXKk3a5d2Km1G2q9T8ML5TT9t31iGbzvY=; b=NfXod6/rdzemCPAe4mdDtTTVgoo7y7nMq/o094G+cJwnJVpmBIVRUmtN3/9cGuec6q F569eYFvRyOERouYEgHCZJWJWy8R7tV1bnzas6k7NU6C5NH6VTpEivlFkAoNypY4q90W wbHP3nMRf0hqL3pZR3sV6GnloQyuBIzykVVAM3ni1ncbsVOpAqnS2KtgU9gE21WD7rt+ e4ihH6NFnbH+LxSOh/AtlrUwSLf9ITzyweCLpqJEtVI++sitzdu4YhzFegx4cCLdLirI UJ5aZzLty/1JmI1qt1aMgdsRH5IN1dVw9kidF/s9WZ9MrhDIs45BYqeSFKK9JlvJxIFm 77sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737469457; x=1738074257; 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=TsVY/fcRHeZXKk3a5d2Km1G2q9T8ML5TT9t31iGbzvY=; b=qdiEo1nI9GvWwYVVkCwvUZa5fPK4BHLIa/MGx2dgVfix58z9hqvRujyHOrRAajBzPl imhdQDIA5fY1ec6LHNpnWy76osfWzyqhqJhgemPPKVsFbur1ljTHK4mHypw5mxTBM6Rx PPX2hm3+8tRSEkG/2T9H2V7wY/iU/Tueewuxo6hgTGsqpjnayd8Z+VBTd0p8yAhSfDwf 0/ZRZMt7yDOB8fD8xcY6C9jf6n71xF0NaBACf3kH5HwWcX+NciCe7D7Xfn0BIpO7ojaA U9npq+BbCWy6CREpsSCLLRdSj5B7qs1EnUsb0DedepuFzt187f/JGJ/9G1tO6UdbQc1n Bffw== X-Gm-Message-State: AOJu0YyPFkZ0MFx8VsgnJs/3zaC8/9pP7aIVp1jUBkOpSLIwID0wQKjS MAgx+UEr1Booj0q5P/bAkkA/vXWQSqlBnp9mJT4uKmcyc5m/hngiFI/yopQJ8rMRA//ZiGFdB/u gtHI= X-Gm-Gg: ASbGncsVS2jI2tgUpCzJrhbqv6tUZDmmEFzGzXsjmAI3ZfzqlLOUA1nhE0eo4nUxSdK GHMsYQKrcyezfmqL/chel3is/mJA71wFrcqKTcumiSRNdjsF1LXcbXp8gvvDRLjhJDK6oxP31NN ydq4HC3KPUNXWrXEvttDahpPc1JOiEvvoBESP3zH8ww/WVc23Hv6juWu7U57TiLUCkW0YTIKxIe Tc61BAqzHTOBdJzZCFg4ys7m7RoXVF/FqbohYUUUEp7YnD7U9Ky8LrjRygNn2TxEw3/tpnefnVm 1J72JzYadd6JJYHgm7XYIet0jZ1C8hcl3QIvoDrHhiZY X-Google-Smtp-Source: AGHT+IGTydqLNfzweZB411kRbV7hpURXpknMF7xt9dbj/T0lfmlVTsVP5DxJy6Q4H4Keq+8EUtkGcw== X-Received: by 2002:a05:6000:2a9:b0:385:dea3:6059 with SMTP id ffacd0b85a97d-38bf57b64d5mr15824747f8f.49.1737469456865; Tue, 21 Jan 2025 06:24:16 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38bf32755cesm13442420f8f.78.2025.01.21.06.24.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 21 Jan 2025 06:24:16 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 07/28] cpus: Introduce SysemuCPUOps::has_work() handler Date: Tue, 21 Jan 2025 15:23:20 +0100 Message-ID: <20250121142341.17001-8-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250121142341.17001-1-philmd@linaro.org> References: <20250121142341.17001-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=philmd@linaro.org; helo=mail-wr1-x430.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+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é --- include/hw/core/sysemu-cpu-ops.h | 4 ++++ hw/core/cpu-system.c | 4 ++++ 2 files changed, 8 insertions(+) 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/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 Tue Jan 21 14:23:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13946320 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 0242BC02182 for ; Tue, 21 Jan 2025 14:25:34 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1taFB9-0000j9-2v; Tue, 21 Jan 2025 09:24:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1taFB4-0000aN-6B for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:24:26 -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 1taFB1-000379-Mz for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:24:25 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-4368a293339so65574685e9.3 for ; Tue, 21 Jan 2025 06:24:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737469462; x=1738074262; 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=k0wDf/v1rzss+MDug7NzvC/4aBpdZSiYNuTsdH6L/x4=; b=DZpJgyMKiq84AbJ+d9mDJcCdIeyXn+WnR44sn+SYVVr09UA81Z7rgE/AvBJyO1AiDi Q4O+uhVd0CfxvU2xhxqCNq3il5CeHt/dGkPRvOdM54LzPwHXvN2y2qgECYzfR6INtU9X GsU9BOzN1iFM/B+NOfZWxDORztQFKIBos1xv2RvcdrMz3vm/lPiRd3C1f6sQKCnsfZtJ OBfYoxsqe4mgZFfjwGa9RoYKEHy4egDe01pL5OKIBqoCUTlN2vGwDtY/0uysO6BZdNPG GIsv9icRlBK2POww3O4eH4d5q+0Hf66RDFbYLsZZu1QPeNyRPkumYdGrVRyFKYKh15yS kLCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737469462; x=1738074262; 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=k0wDf/v1rzss+MDug7NzvC/4aBpdZSiYNuTsdH6L/x4=; b=l00hmFG/CkQSCuGnbJMrymSdOOumH5IbkByAxnnl0eZnpwdg0tW7TKad9/uVldud+t 5PWCUuv/bpmSxSVT+ScgTsn7aAKe3A9ddK97juil4I+T70lk1Nu06u2ZYntFir12A2pX 9wd8lknmkFjfHUyJ9rv9fDSNDvkVNMxrVNbPy2+fEa92ZRcjlDUq7A1sMnTnwd7YULlK d7jb3usHwv2oJR1ZKzKLeHVK0rFbJYt6svzePeoxrvjO+djQFhuAZp9GoWuvPDBiwgmn mKcS+efRoTipafuakJqLOz/h9OtT1R7cIYKF2rYPbGsTtzafPMo7Ina9vmxfEUFWXvUM /RMQ== X-Gm-Message-State: AOJu0Yy3wLsDB8MwfOzPVGfSHAxhac+/4GCvqLlTgzvZ9eOnlWOF8dMl 0uT+8vDeVbJ5OkcMbng7LujOvdxIaPntkPdPQo9VGxA6ZvboQLa/C/Oemx8F91nIXmLPCuAqEeH UviE= X-Gm-Gg: ASbGncuCQUFKMFe4pk29iCBRnjGtpJkHlnOFDkJKBc3a5Fr44py7rFHVdFq3yuby2rf 1jkNA+vtvQADkdL/s7jitmLOE4Xj8Tf3Xiqo19knPOHNs1nwUtvvygCwEsRe3fQnNlwt9UV2O9X n31su7FzarSyJ7mFMJKNdUOTvABHYpOZcjKYrDKWOCSimo1QbLab4yIVVaUsQ7sjSFmPnv22wCS nP29yF1yIdAESs/epxu5UIgI7/BDhVkddjDZiarjd6rpNUWE8Q51EZZfhpXaMoBhqjqwDNkhAhm naeJbRG1O+dEdn8VoN//WhuzyUgET2efrk/87Ij9A68S X-Google-Smtp-Source: AGHT+IHYUFOS6tZvpJOkAfU3W0IUvXEkurbm7qTDimNOrMxqJ3vKyynrsbG/ez0xMFK9Dxc30Yf2ug== X-Received: by 2002:a05:600c:4f42:b0:434:a7e3:db5c with SMTP id 5b1f17b1804b1-438913cafacmr182541425e9.11.1737469461663; Tue, 21 Jan 2025 06:24:21 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438a1f07e1bsm134634695e9.7.2025.01.21.06.24.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 21 Jan 2025 06:24:21 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 08/28] target/alpha: Move has_work() from CPUClass to SysemuCPUOps Date: Tue, 21 Jan 2025 15:23:21 +0100 Message-ID: <20250121142341.17001-9-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250121142341.17001-1-philmd@linaro.org> References: <20250121142341.17001-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 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé --- 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 Tue Jan 21 14:23:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13946335 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 07E52C02182 for ; Tue, 21 Jan 2025 14:31:01 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1taFBA-0000l5-EH; Tue, 21 Jan 2025 09:24:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1taFB8-0000hw-Li for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:24:30 -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 1taFB6-00038e-CC for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:24:30 -0500 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-436281c8a38so41432845e9.3 for ; Tue, 21 Jan 2025 06:24:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737469466; x=1738074266; 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=JiIs8YYj06822iMH2Rgg/pc1ZfogTC4R+p3YX6Af3lQ=; b=jTB3p5lDYf3+8kBtX5RyuD6LvUrcnogsIHONfQbMgRKJCV8vIcj2LxieF5U58M5dkQ fKLJ4CAztL5Tff2TetyutnsemG4C1vj4ovtpzoOJSbuV4rtpGWQsL6f9itG0ZVH12Veu ek5na5sfAyFudb+CyDRSK3imkSKN590idOVsiQOJ/79nNr1XtzmRZCR/DXgXphxc3o5M pkizCO9xoirdwf9eIvi1HY5bsLqhslx7BnKiFwUd7DOXdIn3X51WcjTtFiFQwMYnz1EX fK9bo/BeY3kRn955PM/EHYcUrM1eELUyBt5ICG7pDsNHI019zCme//J7n0mUlHq2Kr/W vJXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737469466; x=1738074266; 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=JiIs8YYj06822iMH2Rgg/pc1ZfogTC4R+p3YX6Af3lQ=; b=GkY82AMXbUh1hC5RI+kOVS+HuymKaHCfzDGegRPnm8wFr/ClONe/Nyj/i8OkZHmsGt J653mLj+x7xqPQ1X/Mkq6nL2L85BXUzj0kchtLBBG8mG+51x2tSstzslHsFQkCdYYnWW JaIw9T59wSygH9bubCJgaPuOggcrICBk0PZLTBMFU30W+Ye1t+gHPYusFjFnSQV5HoGt AMWb/54nwAy/the5ikZ7GWzpAtqHAVpsQfSrZEH+MV+V2WRziF2B0HCL7UwJmjE72K2I Sr4tbqXyp3b1mINU3GVheb5bfpzYVRBq6czRzrbebn1TO+m+4Q+0Gp7vkxnwKmXeZpZQ vOXA== X-Gm-Message-State: AOJu0YzPI9tqLx9xWIxwHgINWkxxVpeNOOnnaigxvB51rESnf5mQ6PvO msIY2XGIIu4z/ACbjee6ahEt0hjXcPQ0OdRhYXv95morhbp5eLCmLnL6c/J71f9Bf01EFpmhF8J fy7Y= X-Gm-Gg: ASbGncvqpaIq7zcLrgaTnTLzxyPi/7WKvFAOvb4Uam0QeLVFHmVl+nuep/1hTxP5LRi QwI9zJBtC41aw5fazEMJW5H4Lh0uPZb/LMR3u9loALGu2gGiV23h+TJDgmHKV1aBC2H+SM423pQ Dag6kIua+2FkQZstPzK+ZFKN+tfLX3YjNrR45dmdX97k0xFSD90s41bPZynk8OT5qpdiZbdbi43 xLJu2WPYhjt5RejAZ+LlLvfI2jSS6w35mJtY1/atn0+OV1VjwINx7g87CZDe7Tvd0nya2oyHiYl AxDU3ly4xYrENv+Q0vLNMS5iu63Hp8R+TqSVkY+4PYU3 X-Google-Smtp-Source: AGHT+IEqU4c1vPc61VRhbpZWCkP23zax6N4SJjoafycJSvu6Z6n9Ti+CKt0NEksxbyrgsNYG7j/HIw== X-Received: by 2002:a5d:64ee:0:b0:385:f1f2:13ee with SMTP id ffacd0b85a97d-38bf57b9426mr14843696f8f.46.1737469466639; Tue, 21 Jan 2025 06:24: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-38bf327574asm13594085f8f.68.2025.01.21.06.24.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 21 Jan 2025 06:24:26 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 09/28] target/arm: Move has_work() from CPUClass to SysemuCPUOps Date: Tue, 21 Jan 2025 15:23:22 +0100 Message-ID: <20250121142341.17001-10-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250121142341.17001-1-philmd@linaro.org> References: <20250121142341.17001-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 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé --- 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 Tue Jan 21 14:23:23 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13946329 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 4A341C02182 for ; Tue, 21 Jan 2025 14:28:13 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1taFBF-0000pT-RN; Tue, 21 Jan 2025 09:24:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1taFBE-0000o3-28 for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:24:36 -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 1taFBB-0003A7-Gt for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:24:35 -0500 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-385ddcfc97bso4678811f8f.1 for ; Tue, 21 Jan 2025 06:24:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737469472; x=1738074272; 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=B/u41E4nMIW/k62qEE4hRVrm65mo7EuY+EqapQU9Sik=; b=hdRG8NAwx/JOXaaOpiwGB4OlVWvJSoossnRi/N+krSUE/Ejw4X22V0QQEpigXwz9V6 Ao3Kr4drLiK7Wpv5G8nIVdYxtAfgTKukn2dKH6IqmPaOksKpYEOgV7U7o0aFV3rnDUFw G91R0vjGkfHhsFeF0aX7z53n+JBQVX+Eu2PaqIpimHGEV3/B+1QdjM5zx+3Rc5WFlqvh J646EZa1IvCyL/io4/h48lCpLUE2VFkbVKSigpebuKQbOuxBRvdmufRwXrAUoXni/U+z GOAXOtBeFXrakyJCb6g1cH7Za69cBpMt5ONkWMirlxzGCKJAiCfH1O5hpCLo11+ucjRi 0xBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737469472; x=1738074272; 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=B/u41E4nMIW/k62qEE4hRVrm65mo7EuY+EqapQU9Sik=; b=uLr5ocrT7BATajJkNO5Nij3HXKF1W8324adbmjFe50d+xKoFiCHyfRJgQEmPTqoRgs w62INdbS+dKWR7tL8IBCcL1LB+MKbn4DL0ltX9AX8Y9ccvDSLfhOjHImM5ktnZAkS1wK U0TH+SVxBzcuPCp/KZytcr2628eoKZ08wALIaq9nABHZZvvIMUaoX0ftdl17uhnGb+fs mTaEV3nciQ0TLdbPIdtu1LHXKzcIfF67wvpXs3iA6d5FmpsTXff/47pMJhOxgNhglshz h2anBfM5O3x5n4mdR6vXzF7rHy2VKbB3mw3fG8IAJcHQWVu7saxPtCRX3lLDST9wZS0E 0XZQ== X-Gm-Message-State: AOJu0Yw349XmIPC0hG+avwMV3izj/crUS/b8dmD5QneC/QSz3IX//JjR d/g3ovqm4YSWDc5axaEIH6MknrsBybl8tx/+TDhBgfkqs/vgkfWWn3a3wA2vA5xBWkz6+O6/9eM CSSI= X-Gm-Gg: ASbGncvOpDGB2sigkxg5TpQXmUDnSpEZ6n9Lvrb2JYawl6TX7Moe0NzglGixZnEAFko taglmHTZybjjR/lgzpkZZ6VmNPowzaydiYe6arry3uHOYD8gw0S5A8hyfM7WukoomXCZNDnSv2I //ha2AuZQpSNqnPuOWNnlZ8njostKySesVT+7A4XNBlevm0/PG61Q8LX++GS8xZIQ2d1mvyNarl /O9+seSLa8KyVYEcErX9TojEaMtBm3AzjgNMkNwDrd8oR2qApel1QdYRpx2sn1C5/Gmidr77knx NTk+bwB16ZFzSwkcJKGEcbBghv14dQlY5XDHxioR4K7y X-Google-Smtp-Source: AGHT+IFirpz56U4iOszGwu97M/SwfxkHVWS84L1btC1WZ+Nhb7WV4UBqSxqleLsMwTaP1uwWgNLU7w== X-Received: by 2002:a05:6000:144e:b0:38a:88bc:d57d with SMTP id ffacd0b85a97d-38bf56562e1mr14596922f8f.2.1737469471577; Tue, 21 Jan 2025 06:24:31 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4389040854bsm185820005e9.7.2025.01.21.06.24.30 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 21 Jan 2025 06:24:30 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 10/28] target/avr: Move has_work() from CPUClass to SysemuCPUOps Date: Tue, 21 Jan 2025 15:23:23 +0100 Message-ID: <20250121142341.17001-11-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250121142341.17001-1-philmd@linaro.org> References: <20250121142341.17001-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 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé --- 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 Tue Jan 21 14:23:24 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13946323 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 1DACEC0218B for ; Tue, 21 Jan 2025 14:27:03 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1taFBJ-0000uq-Ui; Tue, 21 Jan 2025 09:24: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 1taFBI-0000rI-Eq for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:24:40 -0500 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1taFBG-0003BH-2E for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:24:40 -0500 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-38632b8ae71so4645786f8f.0 for ; Tue, 21 Jan 2025 06:24:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737469476; x=1738074276; 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=6hABGcPHmiijhFm7hjFblq4xQHOf2UnsfnjVyHAHFsw=; b=HevhkfgqFto4/R5hN1Lhk7bFrknBJ/L9gEgDZ+x43RGYI4R8VhjT+MHdAYd5yIrk/w r//GA3F7IUyqWcrXciPS7yU5Qs8ajcfgjRTfCuC0K2j6L1ThYprNF6uId/+INJg5y3ax n30nobJdQ1lBRM64aHdpxSNVOc0nXTmmsWVixOMWOUiRkiBXkwNU+6VMyPVkDeXR8yNP By23wmbvqIDKXABhrG/u0X//zLPtLJ6Gt90Il1Zm+l4syATLCKpCm9nxWnQYgec3q7kl 2/KwS9d4sblBav+XEtIktjV5Tkb79z9ek9lyc75+ttzYgdoOYVV5W+vm1cJPWgfXXF+7 jaXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737469476; x=1738074276; 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=6hABGcPHmiijhFm7hjFblq4xQHOf2UnsfnjVyHAHFsw=; b=Rq4xqJxuapDwLKuw5tHBPVP56NpJfxA9qUATOpA9n7xqiVRQh+stCm6taqXzm6ckND 2EH/nHe9QtR69wkyqqCLBvF9iDulj2P862B/Tb9UVhWA69PpAw504trMXMUt0Cge2x6m gyXlZ0ulou2hZJhM6ucjgfs2mNim07m7HQV71TX2CQoqVglg4/LEp1YpsD5r/Y4I4YtB 14m3HbbDTEhx9Z4KPRDPjQDyJh5Fb2qdryE/0bcYnrSJ63mDdUnMbLhI38SC522P5bLr giprqS9fU4tgDB6kNVuJo86QJtiUeyWE4XeWDD/ZpzP5Z4lz1gU8x2gUVmf29Ww260iC JD9w== X-Gm-Message-State: AOJu0Yy32hl5zRD/Sue6W9tGfLvm8r3NZDyepQ1CzDP8HJ5L1q6QrPsN aEyWLG1METfiB/rD2muEO1n5kwSvhuaQNE355cKdMpv0P03Ahkit93RLBo9NvXs/RdlZhwEki2B 5WM4= X-Gm-Gg: ASbGncvdJ/TdXKfjnKYRYzkHy0c81p6Z70FqQYTT1hhI9gJXmci25CLSNqdZ4GWKUK7 keEqZgRnEwZR11w0EvV5DKJv+TjT8STfToJa7QRwmvlIkfDVSka3aF7tzYsvuHHUqkpejY2TSX6 sNHbzDlWQC8cyOJ/G2UOuuh5HTjajPDWyOQ+nLOJpLZdNUJpqqRCKLmHAdB5/EU6BEzc0U6kdk8 n0kIqAh1R+auHJK/ykXg7MRkL7AYg+aGsu3Qz7rNRJwj1s58VGyAqGmm742l9HdCUORgiTis+2k qDm9V4wtW8cTw2gJcJ9mpx9f6/MWFhQIqazONW96ib8l X-Google-Smtp-Source: AGHT+IGIxSjDIteLplytyWb4SbkEn65RNpXJxjDfZiWtqImZKNx2vP8MFkD9+ilwTs8fv4ijYBKL9A== X-Received: by 2002:a5d:4845:0:b0:386:857:cc54 with SMTP id ffacd0b85a97d-38bf5679b17mr12220038f8f.9.1737469476324; Tue, 21 Jan 2025 06:24:36 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38bf327556dsm13492289f8f.71.2025.01.21.06.24.35 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 21 Jan 2025 06:24:35 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 11/28] target/hexagon: Remove CPUClass:has_work() handler Date: Tue, 21 Jan 2025 15:23:24 +0100 Message-ID: <20250121142341.17001-12-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250121142341.17001-1-philmd@linaro.org> References: <20250121142341.17001-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+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é --- 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 Tue Jan 21 14:23:25 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13946337 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 8CE26C0218C for ; Tue, 21 Jan 2025 14:32:07 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1taFBQ-00019g-GL; Tue, 21 Jan 2025 09:24:48 -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 1taFBN-000137-JG for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:24:45 -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 1taFBK-0003Cg-Ue for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:24:45 -0500 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-385de9f789cso4321310f8f.2 for ; Tue, 21 Jan 2025 06:24:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737469481; x=1738074281; 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=i0IEgUTUoJtMoDUBjCVWUA9LQ/fRvYT8kph+CQLQqnc=; b=OLHDIXs4a/Pf3z8kFmoMXIh1gin6KSzrNPk3FvTLFnWbTG5v9MQcBAL5NcGntDBxLR ++EKQafU6UBlmEIN9ESTi/ac2sbLcMiCHoXHfWpnDsWSncxlFX3WnjgJf8Z201PjEng/ bJAc8Z37BhWLlJ7/yTbLHu7R7tepSVbhc2gxPe8iTUAc0Xh+8y0bWVplEJyIRmdhbou4 0bxSmz0LotzfbeB/skshRiTUNZmN+Sdggg9kzCgwFEEbYmMECwK0WKaqhKMBFUh69LBC NNAkrQ7rPIUkKFuhy8ZMjqmrn3LKZUBvmQFwuzWuFcEhw/e3fcvNrr97H0a2HofjwrQ7 PP5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737469481; x=1738074281; 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=i0IEgUTUoJtMoDUBjCVWUA9LQ/fRvYT8kph+CQLQqnc=; b=TLEbxMucjyri2po/vsUPBXsdw9NlVKxet2nDRZsq33Qw72Vog8ke0nQ2l7iTXm78Z8 K4xKEvCfq6N146OiKCv7jRlMRcBp5INpeq9Vli06xp9R44YYjbLOvvdwCEGQ0dYe93iI F7Z8CZUBvNS66SZm8gU6duXavcD+K0gSJ//UkD/DL+TxY8V9NoqKOERMZgbE0FjjJC/i T5fBsQxvs3e4vyYhIu2I2tadT2i27mvjybH/z6Hm2zNTHOMwPtl+T3rUFv7KvKqW0qH+ yzpvixEl6LoJzfx6n5GsuLNuKU0qce0LHg8TZRTrGXqXAewKMjLyBHTjjniwbjuIdZoR QKZg== X-Gm-Message-State: AOJu0Yz7Tghnyr0ftXGDyXK+nSr6UMNs1+DbnzukvYPS5i3FMN8wIJSq XT+toBYoqDVwpGmUDiIVZTvj6P9wnOViZMyycyAXTRUdUQtbi9+2n7uHNXNLVDj94wPRplABncY MrdU= X-Gm-Gg: ASbGnctRyfZcFiyzRHuyF/cXh3wjcJo03FGeWcFDtLeRk26qqLlLi9coHO31Frd+5jE TmdnoqyV+xoA880/Tew+mz7yVEICHeeonD4cM7gjogQoPzXvDVsgPgvXUxJ1UkgZRc1BEQYorjt GsYjY/k6cobLoxsY33yDa0ycFfsSvkM63+9d5dbYLpczpEyD91VeMuYV38dn7Xykyq/ikJJsxnw f31rzTf8OrOespcB3ws8AOdENDvZxEFE0+q6XF2GxeM9n8A4n10S8uRyZTvoWPgOemw9g0pTVdq 3mQA+r57wX/TUOat5mpi7J4EE+9P7BmZG6IsP6+T47o0 X-Google-Smtp-Source: AGHT+IGmK+04j7KIt7xGWt/FgU5zgcafQ9vituDDOPLVNSUOhJzowwtpVRwn76WAIAbcLcmUtYLWyw== X-Received: by 2002:a05:6000:86:b0:385:ef39:6cf7 with SMTP id ffacd0b85a97d-38bf5673ea3mr11098765f8f.32.1737469481194; Tue, 21 Jan 2025 06:24:41 -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-38bf3215099sm13303268f8f.3.2025.01.21.06.24.40 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 21 Jan 2025 06:24:40 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 12/28] target/hppa: Move has_work() from CPUClass to SysemuCPUOps Date: Tue, 21 Jan 2025 15:23:25 +0100 Message-ID: <20250121142341.17001-13-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250121142341.17001-1-philmd@linaro.org> References: <20250121142341.17001-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 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé --- 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 Tue Jan 21 14:23:26 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: 13946334 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 04BB3C02182 for ; Tue, 21 Jan 2025 14:30:48 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1taFBU-0001Ks-S0; Tue, 21 Jan 2025 09:24:52 -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 1taFBT-0001Ge-57 for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:24:51 -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 1taFBQ-0003Dr-8z for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:24:50 -0500 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-38a8b35e168so3978366f8f.1 for ; Tue, 21 Jan 2025 06:24:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737469486; x=1738074286; 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=1OW6/o4DCFgT3ilwuV2iLRLfLVBrhuRs1sUZEij4GK4=; b=AFVie4bxAX3IOVeGygVIgIKoeLvoMBdGwL5hxqZJGRca3iKS99wMO3B+z5oGyEjeYt t0vn4XxTEwydUeuEuyUHEdFPAVyjiHZaNUyUSBBQvLZliiF66MJQpWbvWntGfCCvzE+Y XBbhr7xSX93lWpJNuvw3R4q5LXiBH4Tqd/bLVapkCc5I9rS5+4O6OXr07/nV+qeX0GlH qSMdkO9z4hsV7Yqs4hSKvPkUIZYsznoce+DwhA4XVu4dyO8TMH6hsp6cOn1qZfBBB8kP 3Ob0iyBcn88LrAs8gVbebfAnwNMoujnKeGjk6JI83Xfn4tYHaEl408SdIUyr2Pafrghg ufaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737469486; x=1738074286; 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=1OW6/o4DCFgT3ilwuV2iLRLfLVBrhuRs1sUZEij4GK4=; b=N3CL+njYXZ2ENF79xNDFJvKcCPamQRO8/zW0xnE4/wepBIvADqfOnAeW9UHKGcjHiL jvwLBi7iZpqwZR5V9WKBkfDnyjGaaAEAsUroFCPgQTXWa/arVC+N532BCAEMw4JKTCJq CwWZ86+jT6JBe3VfJexlLVjIJF0yqGdNvV6D3fijA70uDo3XOHLnEQ1+YhcqOplPaVA3 nLQ5oC7Ysjbx321DYQDdvjf1htDQ7wA/aX3g1jSINX17lLywLdp2bGcp4bnxFTIWgEYB PtwUB4H5mcsrQ2CvOK+mivT7ncYIdrcYr+TrJWQVIgCu++k4zif3JbhDGj8m4qhbTei5 5B3A== X-Gm-Message-State: AOJu0YxQXP5DFKE6IWwL7kU9i8Memweo+Z9Jepuqi0Zbk/qVVmhcIaT6 Sv/6Wze2PWtzMdN/k9CEmc6LExj9TE9scLUGIThpoefqf2qSpkIJLlWuaujhv+L/uz2rPu7a3KI tXzQ= X-Gm-Gg: ASbGncuwaMcudGbKeqYZT+WMYZcIUJAkWtawh+vq05bsRNBxrzIEE33cugtSkDOO6Hi 36E6XYBk0igkCoo6DfPCATV/sG2zHxyiQLrotzCf0KG9zDCWuSePhb8p6ayBcEVZzWxtHVgGOFx K6sogNqYnbzJhpwf9SGKZD+5xrGDoEkCPpb8YyrF4KtYvULhVWIeiNm/RFhrW3agnTNZU/srXB+ Xp2qye3a6w54gVIWUSshZ0SR4vdB8gj3TixU+bp2ItSOYqFTLXqf2+MOiuiZvZKVGfkgPCxuESv fECM5PimXIZ5nPelf7w5YcJBS5f7fuRhwDm4pgOrmnK6 X-Google-Smtp-Source: AGHT+IFtX5g/GjBbUB8jJEpboAIbX7nsBc2mIcKl0+bFua6BeE629tSoqVI5R6ihsJ3W5Zz1ZAkiSw== X-Received: by 2002:a05:6000:18ab:b0:38a:49c1:8345 with SMTP id ffacd0b85a97d-38bec542923mr19873328f8f.18.1737469486020; Tue, 21 Jan 2025 06:24:46 -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-4389041fec5sm184339285e9.19.2025.01.21.06.24.45 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 21 Jan 2025 06:24:45 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 13/28] target/i386: Move has_work() from CPUClass to SysemuCPUOps Date: Tue, 21 Jan 2025 15:23:26 +0100 Message-ID: <20250121142341.17001-14-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250121142341.17001-1-philmd@linaro.org> References: <20250121142341.17001-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 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Move has_work() from CPUClass to SysemuCPUOps, restrict x86_cpu_pending_interrupt() to system. Signed-off-by: Philippe Mathieu-Daudé --- 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 Tue Jan 21 14:23:27 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: 13946328 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 0CA11C0218C for ; Tue, 21 Jan 2025 14:27:49 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1taFBY-0001Tr-KC; Tue, 21 Jan 2025 09:24: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 1taFBW-0001PD-VW for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:24:55 -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 1taFBU-0003Ez-GO for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:24:54 -0500 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-3862a921123so4054112f8f.3 for ; Tue, 21 Jan 2025 06:24:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737469491; x=1738074291; 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=8lI4er/UZjcPYTUPzfGtiHhd0qjCJFKtyBNhq4e87GY=; b=esQgRAPD/FZMex6GAPmJvaypxjfKid92ezVM97BbSqipCH5GSoODeKHEZfrg76EH7c AAkRDUzb4ZC1T9TFyLkVu47S+3h/5szEU5IseAkE1e5xqnrYZQ2QRPZXv4ClI9BnUx12 RZ01iURINdwZdpuBgU8aq1O9LZGPMV8We7C8wMEI3tx2abXTDsQ1K8uiBJzCb0dZo42w FNa6Rayf8cgi8zskhSbxjaM/ILsPF+h9WqKAKJhdAka+OVsnoX7GK7E5+eQrkSXTOVhK 4XASeYMgKEZZgRwaDjm09ujeSC7+Xz4xXYZy8DqSbJTTytcackWMI3N7G/Z4uSdLTs5C YP5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737469491; x=1738074291; 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=8lI4er/UZjcPYTUPzfGtiHhd0qjCJFKtyBNhq4e87GY=; b=sFV6KFELp9rf+WuBRH3A6KnCH8F3ZbHP586C0UU6Hi68vJQcUhRo+uy2QsCs49q+mh 31BFeeV61P7d2jxmVZb5YroVqzpqQ3Radz5Kg+u703MR/ZJ688vljqWDKyW7lkl8eSuW uZrFbLg+j2BqtrjLmu4Ywkm4AEKPol2KIDyMcmURWKkHAPsa6vmdPuDjJ8UcgIzygfSk O4KG7kmpEjJWce1d+eAmYw2sb+dphJcfVTeNmbwQ8Flw7MFAr5DyTb66buvVcQP9BbbI k19wB+3KVEBBH+e9UEgg8xmN6hDwjTnxYdSQAA1CmDbLxlDI88/62mr9emN1rD2gCjxm 8pYQ== X-Gm-Message-State: AOJu0Ywl83RFNfztvxWqkn0n7irCAeYUnm4u+3DvxZxc7vV0AvzARh+J T4alGlkwAWgK+ShJZPmPg8jHS7OvwB4AwFWSfzYCq3CsuPCH+C2Htwr8hB2Za5EM5rdfcj98HEt KenI= X-Gm-Gg: ASbGncttSOx8u3KefPdy/II6RZg9ZBuDmwayl2TbiF5m/Aff35ONvuvvhbxKmEYjM42 z2fJRQNENNU+WrqoLp3KD0X0/IQUI0TKMV1ZNMhmLf+MMEzfWy3G8sXlMgF6FvPiA6GNFMwsUaX v8659LLXiYBO1nD7LFXU6M34nuqjgjLJBks4qAV0Cw2J3V4c9RUSMIC6YXPvjSRbbOmh7n9FVPu P6r10XsShLp4DtbDmJ82yhAw+O+o5GEbVYElh0azZ7o4zLZygDVuc5kGsVh767Ac6RywosOuC/b YU9Alr2EinSE8KqP7KN3ux94WSyEo9s+dJZCcxsuDsuI X-Google-Smtp-Source: AGHT+IH2AmG1H5wmqFP1XWCb9LXlLG+q0ojNMzegSUW2QTBvIadZuNV+Dfb/zpIvofwccr5fOG1SQw== X-Received: by 2002:a05:6000:1849:b0:38a:8888:c0b6 with SMTP id ffacd0b85a97d-38bf57bfcf5mr18396110f8f.51.1737469490716; Tue, 21 Jan 2025 06:24:50 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38bf3275501sm13812644f8f.65.2025.01.21.06.24.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 21 Jan 2025 06:24:50 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 14/28] target/loongarch: Move has_work() from CPUClass to SysemuCPUOps Date: Tue, 21 Jan 2025 15:23:27 +0100 Message-ID: <20250121142341.17001-15-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250121142341.17001-1-philmd@linaro.org> References: <20250121142341.17001-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 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé --- 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 Tue Jan 21 14:23:28 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: 13946322 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 0FEDBC02182 for ; Tue, 21 Jan 2025 14:26:22 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1taFBk-0001mT-Bn; Tue, 21 Jan 2025 09:25:17 -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 1taFBb-0001hR-Qx for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:24:59 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1taFBZ-0003GH-DX for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:24:59 -0500 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-438a39e659cso20287345e9.2 for ; Tue, 21 Jan 2025 06:24:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737469495; x=1738074295; 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=rNIgPRy0oQV98ilB0QwBxq4p43kinmbOyoZfOJB/SO0=; b=Ybs3JTAZv1f1cKoJ7cY1UaTpa7paPCbav+D4rAiIqrfwh8cUZ7odrEdwL5bvYx7tvu /1f+CrUTy5LUqe339MwlC+OuUpRUyWe1a77PQXd5N9NGu/O7A3s2FURhyGv48bKnIME8 yCPlSvbLpxfgbJnNLGfj0CVzEw41KTs4AaWsvtRCzWMDrJBtxQe3IzPrOlREuyTK3wbk Et4FrjJEorPaQoPk2D41h0qIhX5NUB1+ASErzBvCUMdiBoKQu/BQkwSxRUTxeJqYNeF+ RYBdD1exSS+dmEdStJHO9POwW4iYrUUWkbWQ4GiGDILGAvIsCEz6A3kdxwYV6uuUvllS ddHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737469495; x=1738074295; 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=rNIgPRy0oQV98ilB0QwBxq4p43kinmbOyoZfOJB/SO0=; b=UPq0cVVrt/GGZJzCwn/CepNnyYH6hO5GzUxzd/pBmH9vsNFsPVF2PqTD6hT0QibMMq 7eq6IlWIgO5jir6/yKL/z6EmjO3GmOXTvEhDDC0Hua53xuHaGEgqkQqdnb9/Lp2baLke JhFHk7QRpEdXu9teKR0qGdYS4O8gH/v/TXCf2CXEKVm7tOh1UVO6SQQOWepaMTa7Gc5z xsqFwDX1ZT+Q/weJbsyiX54MIF0NLIuxzNl+rYFRqhPZk3zqXH+LO4xpjeeZ3GfcML0m RacuvHarjW54JGLJd23yZFs1mYA6lB6ADW5hePtjqwliGEv45CpCWcWOC9kdUnhR9e+K razg== X-Gm-Message-State: AOJu0Yz6QqJNgEuRwl9GbHKD4wuVeTP/Dkfo5HD9IXBz5S6bedYuIp7w IPBgl7glOjlsWjwH2/oo25hKDXKFpzPpTY0E6ND/4BXinOe/8bqz7r0J5WUet6xblGPcQsMaxzK Zifk= X-Gm-Gg: ASbGncs+OeT1rRaQ9/91jhrcSaY0NXuFMst+gZc3nCkQ7Uf+EHB6bd4X2SiwOArIJiK am58GAvksqu5sXxxgAA4ynjp/Yd2A5r94ruBYaANG2yTpzHn0A2J/NStBhrxG1Rkjms+q8/mU0M AKbCEF+KkG8tPQB7rw4AyuCeZjX3D3UQgi0Ldjur85eaNlAsBVQH0xMz1a2ep0hFQZ85tM2nvET vy87faVyN739UioHwmZmWIajAzV6ypD5OCycU00p8kLSyHpb7RDN/7H4NDmQqOUZE5r3OC5PmC0 ndswzur5X0FpO8PtzDpfd7y9WgbuvSNMSShHQgcdoC1O X-Google-Smtp-Source: AGHT+IFQXoVBKdPu8VgoZeW5FLoHVgCaLbQlxJfMl+FDHbq1pIlW+Exqt4RoyE3gVakq9gB4RvMMnw== X-Received: by 2002:a05:600c:1908:b0:434:9c1b:b36a with SMTP id 5b1f17b1804b1-438913dbf63mr157694825e9.13.1737469495469; Tue, 21 Jan 2025 06:24:55 -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-43890408a66sm184008325e9.5.2025.01.21.06.24.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 21 Jan 2025 06:24:55 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 15/28] target/m68k: Move has_work() from CPUClass to SysemuCPUOps Date: Tue, 21 Jan 2025 15:23:28 +0100 Message-ID: <20250121142341.17001-16-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250121142341.17001-1-philmd@linaro.org> References: <20250121142341.17001-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé --- 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 Tue Jan 21 14:23: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: 13946340 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 BD2B0C02182 for ; Tue, 21 Jan 2025 14:33:32 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1taFCZ-0002lx-Dr; Tue, 21 Jan 2025 09:26: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 1taFBi-0001rD-0E for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:25:15 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1taFBe-0003He-8s for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:25:04 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-438a39e659cso20288235e9.2 for ; Tue, 21 Jan 2025 06:25:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737469500; x=1738074300; 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=xJiPCCG+WztNHXWvHaN+Ou3cngv4lAHFeGfB5H1KSFc=; b=Joru2x0UA3WreeWp+RBvbTrkrChHpMH82jQbL3XY+oz0Rs/Nc9fFt20Uev6Pw1pA7K v8VOpg9yhviE2BlGj7d9i1BaKh7H90FQ/2YorG0Qyx7J2jn5i0kjWm2axRi7GxnreN0T OMhoYGayn4xSAU8DViiSPmGlcOy8v4SMRz0Zv5kOG9cEL+IcDKPbTM67B81xyE9fH40s MsUX4gVtuRWcygi8L8oByP6N/HIDt24aV9URp/oWHLRhcEyCIpYMzYNcLY23WddWUP2V kp5WbcdqpzPUaEQbzDjs3elOBTyYPvWkEjDYhGBWT0T/dESbTV7LrwWEsKABFewO9/LJ f4fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737469500; x=1738074300; 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=xJiPCCG+WztNHXWvHaN+Ou3cngv4lAHFeGfB5H1KSFc=; b=XPHK877mblUdyjPiA3YhrGoLveETD7XxS8XdLORHdUjEQ1Yqfpb2KbFqDmdVLzeFxV 9nYCbKmRpx9H7dHVetL7mvzp+s4l+oFicPBmzeFF8R7oPzNcRFZtIw89Om5CKn7A+OHG ADzet72J+DcYqp24NSDIF2ryuFteFp4dWOYU2v0q4Vk/bleTfjEm3bxEy8cDSKcxtToS 23Bhbh9ZSVK/3wzYUItooJvuWmU0ec5s7zkXIz+OLB36RAU00Zx+ki2KzHKsm2/BWzAi Q4Q3+EuVbF2EFiQmtgi+WS9gexiwGn0neveH/3f5QtzgxIFftuMH6T8I+Zrx+1JwOndF /pjA== X-Gm-Message-State: AOJu0Yy/NdwYvX39Zdf8G3uBMMn+FGiF9C0JGqYFpL9DhlUgbsQrZo1E QtTZJ+LJ0KRn1r2IXd6MhbNXswpz2OsKmyBTa19Or/LnbGDnZ/n54Vy8Sf4uQwG+8eK2nkLCy/L upkk= X-Gm-Gg: ASbGncsVffy+DuRFSd4xztDjHtz1yDPQcwMZChQJ/rza0ON5GOvu74AdnxRywZqoCnd U7YaxsnTdfeQZC0wNuFy5jQ/Od+bgNwGXzgq+MBR/Qwy8ZydZW8PehwBdesfO+bHkTfTeo5gPIt x9x82Bd+DW77LLvkP4+EbtcY3om6McUHki0FVOkFTQBsGYeAihIoxZQtWnByyUVhOXbAWxmHapO V4R/tw1LUy+CZH6T1OP2JzKMQqyWqC0+gqPB5xj3O03wIZQTBLMiAQWtRKECG/O66KfpL19s44a ywgp/xua2YkqDbl5r49RjHj8vleNs1dFFNrUVL0vVWxQ X-Google-Smtp-Source: AGHT+IF9O8HqJLypCEu6Q5T6Q50TpWY2gzJiCNKDgpkayKJ82GUvzgYNUcjhETHkI8YWNvGx5Fw/ew== X-Received: by 2002:a05:600c:1987:b0:434:a7b6:10e9 with SMTP id 5b1f17b1804b1-438913e2fa9mr173391555e9.17.1737469500271; Tue, 21 Jan 2025 06:25: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 5b1f17b1804b1-4389041f7e9sm184241255e9.23.2025.01.21.06.24.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 21 Jan 2025 06:24:59 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 16/28] target/microblaze: Move has_work() from CPUClass to SysemuCPUOps Date: Tue, 21 Jan 2025 15:23:29 +0100 Message-ID: <20250121142341.17001-17-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250121142341.17001-1-philmd@linaro.org> References: <20250121142341.17001-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 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé --- 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 Tue Jan 21 14:23: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: 13946344 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 597E2C0218B for ; Tue, 21 Jan 2025 14:34:27 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1taFCa-0002li-3c; Tue, 21 Jan 2025 09:26:01 -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 1taFBm-0001zP-AL for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:25:17 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1taFBj-0003Tw-27 for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:25:09 -0500 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-3862a921123so4054408f8f.3 for ; Tue, 21 Jan 2025 06:25:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737469505; x=1738074305; 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=km3kArmfsAMK0iy+xJz4rtnl5tZfE33rr6rRoUamFRE=; b=esELUc+iZAUrjFGWCOfV8xw8hhaKtoJauqZoaLOo4lWl+m7BDiaxuiHsX11apIorFm ymoIt4Stq4KdgQRiyZaX2Ea3MVPIP0HT8VK/4r1KmXlPKwQIJs5LwW0xGJ1SLSA7m6WB pREm4f6j1QH3cK9akG2iLCWv92WlqDEc0yKQTh8RSrdT+Cvi0k6vex489pIRRZkNIbzd xlaDwnvcjvpl3S4X+2bJRdugwpDWzKL3eLZQ1CRtliziSDrNIwzA6Fnm3WaDtroTvy1d ulVGVdGDavBa5VXX2iUxNFRoP0AOJPzCMrq98ruoE5+AL/xi1WOF2ndh7yfE++TsnDk2 jKmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737469505; x=1738074305; 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=km3kArmfsAMK0iy+xJz4rtnl5tZfE33rr6rRoUamFRE=; b=DK7f0/ZO5Iw09pANaj9betHjud8EYxUBndkugeuEg6zXjPdxiN+XC4ya4MoD81awM9 XGSUA81xXIBpuxkm7JwiXHNBI7ul0Zt8n+hPXL4bPbgky/994Ju5omh4R5cqG/g9Psiz SdMsLxZ/7A7fi233VO1MRh2tlyuq8nbFwjdA4x//r3J6Z3nMr4SpU0qGbQS49GFOhigZ bJidrQChIwe26XLbMVHJ+Y9e59t17Re0BR9M+QPTyfjvI4tJO3tbjjyE00KJ9cxkEZGH I5qojH3WNug6664Ws7qapYwSymJZaKqfEA5y1NZVoFCRRIE0eJaAeo+LdaNyzub/zru1 uU9A== X-Gm-Message-State: AOJu0Yya6e43uC+7gatWUzwQVjS19S+StIdnfK2V2fW2tz8kcPutjsQ3 Y5SP1R9QxCoHAJA/Z99dSRZXvtYPz/iKe3IHUhrw52D9/PdoaJv+PKBLRhDkyGMJ1VDMGmwjh3U wEcg= X-Gm-Gg: ASbGncvhHaiFoRnoeIwQy3fyvagCGjCvYiVqOyXr4PChlKRPK7oDhwxYBONs6iLp8/V HtbE1veViup4LUQVtxqQ5AzTpu9TRAPx7IS2BQCJ21zjBFrtQVglonKTPPi0nJLPKcNDsYUb4sU V4Tidw8h6Kw9ZNmDDIV5gwMcUiIaOQr2Pz7LZkEy8bbVqLTRgNf+YZ36gt4FAtIkr1v2ibZO/tO /+Iy+X9P688JJyuIdwCG6t77PnE+aDk+lUvsrbJFkLVVdR+Vdy6t7JMM7/OI3imjGlYwstjMaox 7wZV64FLaVMhDabaazG0HHwL6pMebnYjRWlVN1MNaHmS X-Google-Smtp-Source: AGHT+IHxVyqv5FTa21nb19oJaZbD9h21zO+kugnyX2rWmBf9v4pFuURTISW5VzhmslZBx2RU/Pd5YA== X-Received: by 2002:a5d:4f8d:0:b0:385:e5d8:3ec2 with SMTP id ffacd0b85a97d-38bf566f8damr11608978f8f.28.1737469504953; Tue, 21 Jan 2025 06:25: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-38bf327e1fdsm13688194f8f.94.2025.01.21.06.25.04 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 21 Jan 2025 06:25:04 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 17/28] target/mips: Move has_work() from CPUClass to SysemuCPUOps Date: Tue, 21 Jan 2025 15:23:30 +0100 Message-ID: <20250121142341.17001-18-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250121142341.17001-1-philmd@linaro.org> References: <20250121142341.17001-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=philmd@linaro.org; helo=mail-wr1-x42f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+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é --- 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 Tue Jan 21 14:23: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: 13946326 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 831FBC02182 for ; Tue, 21 Jan 2025 14:27:34 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1taFDr-0004HO-KH; Tue, 21 Jan 2025 09:27:20 -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 1taFBq-00021D-73 for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:25:17 -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 1taFBo-0003VL-IK for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:25:13 -0500 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-385df53e559so4382172f8f.3 for ; Tue, 21 Jan 2025 06:25:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737469510; x=1738074310; 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=GkHLGnbNtUXznuzSD8HY730UHLCtgMSWFluNpwmKQeM=; b=Y55VdusCRh6NRwkgQrV9LWzBaxaMP9zNebptp8syRImpceW2JUrAbDmlBfxFdrx7In gixa++qGF/ruAYBXJvfXwMBG1D+FtP0Un8Lp9/RfyxapDotSi5Fu3O+E9ieLqfEeFWuf 4p9gIE45BH8wjKtJT7HnKoeVX9ZACOAwkEourgakv3i+1295KY7BWtK2JyNr5yFnR2CI 9FBJtN/OeYOZL/FDTDKLa0Zcrfsl5oOoel0q42lRsYk19fuCj8DHbYnz7v8dVsfsJOHI 5IXO4z8bcUEF8R7SVUJOGNlB42r/zgkXDgYYB/61ADFZ8cWFTphQHmZyHvlVgyOZNztf Ii3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737469510; x=1738074310; 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=GkHLGnbNtUXznuzSD8HY730UHLCtgMSWFluNpwmKQeM=; b=XuPyDFEUFn6yBciEuFHfscRz1N6HtWGbH1tg4AYut7fsW4VoUdNN3yWOJkBKRqVzpL l6O3H/rxC4qduBqICtO0biXbCKO7Raqun7rrT8E+mPOxQlT7/H0UYyi523bCf32Cxg6i WOf2yKTxCZWyjpihW3SGpmwgtA3tIolD1QUgwGm9PeWyjoaSYt+pcj7PzZ2Brgvg8kVq qnIMgyj4mGAvO0OsrVCq43vmS4+RzPByHAZ0kxhdY3Q7YfkDx3+QlqsW6hQ9C2YmbmM6 P64wOqzHJc4nbsqAEwKsSEw4NuGs1oMyNXagE5zjTfARxd3cxHZyn7RkIW5HrZIvAG8H ASrA== X-Gm-Message-State: AOJu0Yw/mNXfhULhmfXIM+VbROOL0RqIX8HQ3iHH2N/9kWyqzEsjSczC 6HBNsSl01D2IkRKkJRUDTIc0+PZFD/2xYI9gFl2OjoamjQHksMt9D+pxaGmbAuoILawRiygTbis eWrY= X-Gm-Gg: ASbGncs6cy2yYsEOEEwwgHC5gs9A3MjSaKlvQYnTAhRceUb3tyXp3lI9jIsVYgxfqDm szBk+3bPnIJIxq7tO3aSC4+ZJFeyFrBgdWq0gBU25YxFshfQxeVybc5/wvdtaCRGDDrM09Thap3 tHN3/bpllZojpLSWCRNMM/MmpHDfuO4zghlGjnVQan6B4Ar6m0mUjkXFra6bvpvJo1x+kOFQLLo hL2xxAgENNCgTv8M45uhGZZ+l2SXUg2oSL4e6Sroi1qG7FHaYBkZCDzn/enxx+VQPd9AHWrWG+Q LFeS/MWBlroRXr1W9HRN35nM5sFoUim9y0af4fwzOob3 X-Google-Smtp-Source: AGHT+IGvEab1ClV7h5y897LB6+BdG5W4Px4cgpiqOAOhbSj4iHnOZ9w31FgAecyvJTeS+fdrHtBNiA== X-Received: by 2002:a5d:47c9:0:b0:385:fb56:5596 with SMTP id ffacd0b85a97d-38bf5663956mr12725335f8f.19.1737469509642; Tue, 21 Jan 2025 06:25:09 -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-38bf3278088sm13563656f8f.73.2025.01.21.06.25.08 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 21 Jan 2025 06:25:09 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 18/28] target/openrisc: Move has_work() from CPUClass to SysemuCPUOps Date: Tue, 21 Jan 2025 15:23:31 +0100 Message-ID: <20250121142341.17001-19-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250121142341.17001-1-philmd@linaro.org> References: <20250121142341.17001-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 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé --- 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 Tue Jan 21 14:23: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: 13946324 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 45BA3C0218B for ; Tue, 21 Jan 2025 14:27:27 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1taFDu-0004Ou-Fd; Tue, 21 Jan 2025 09:27:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1taFBu-000258-Sw for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:25:22 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1taFBs-0003WQ-7C for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:25:18 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-43621d27adeso39093455e9.2 for ; Tue, 21 Jan 2025 06:25:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737469514; x=1738074314; 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=6+p++OfByvnnjrmCWTGZNYeoc1QnZaouIzDSmAGjov8=; b=zLuCsclzR8QhUwrARZZrcv8kZi6+s5aP4uo2Oa02T3T79NFvKlGKsKE4QAKGE6mg14 itB5we4Yiv1Vf9WBO+SQTWlyjHBvF5csOOkXdESHnuMiTD/9qRtsRZ7UGgZ/0eDToK/G /jrDQgHWUXtVFl34aKNIHAv1MT37JStfza1pRKukZusPnUa+KWTDgdpWe5IQNNkXuWrX rDULHF6u+aGWJ92uTyfB3Fnek8wSC8tPo1tapdgMt/KkJmhq+BFavYI+UKwFlGoRx9TD g26g9VAVjc7R2oknDcpYMlTH4uV/6bYQoQG1Sd1LtMll6cgrP3mdipPudi1JvHOaQuLn ONsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737469514; x=1738074314; 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=6+p++OfByvnnjrmCWTGZNYeoc1QnZaouIzDSmAGjov8=; b=dIsO/d8g9VJjrpqctl+3BmdozSqOFLsIlDgeo7rfbKl6On60zmtRkGSS71/k15OfDq SiDORRadrCXNkAq9IX25jWSJtFPTIoe4DiBiY5rITBDc4qu9N6l9D8NpH/6wjAy8WaFO bfKBA/Z9shAg9oLuaTPiYTSuOORIZcuU6dULBcu3R/GtIRAlT7l36JHgYzGurvJaZgCC CP9R/zj2ugj0r/9L69zO/+uUECTE8gQ8V94oHB5VTbLqcJG+SXdqO+4nXdjs+CaIDuB+ JvTAOVxWnJOvz2xiZuGOlUyRovetwzkah2K+rLeEjQ5cZFv5KKlxeB0QPbljHdsqWnhQ l7Zg== X-Gm-Message-State: AOJu0Yy4Y/5/HiaimJiXPNDa9rQYSHfXN6yMc7araA7/dBRWN2ob/IB3 Q/B94ZHuhlEZt5GKkYRfDMXgUDougY6aAKyFgTBShrBcV5JRX9StS5VnvB56y/NLhQAw88SVdh+ +C8M= X-Gm-Gg: ASbGncvHJaYiShSNCOTyAZFhD/rm6KUYDgEMewDageJfHwV/pygN4Hjv+djj7eSZduO IkbgqoZ+oub9QH/1fbmK7/mF89EFBfSg826fxJdgqDCdOpijEkEceWdAMvtn0pshaa9vm0qUfyq zPEK73R+xLQgvP4nYZY+q3fvMUxbY8qU3rY9ZFp8Mo5Jwi/m9nXwEKlaieiCG/EA37CqdBkQzk2 E6pESJl5vwDOcCbg2eZl8M85Tbt6G1BBu/eEmQ90B+7gzThagd10mXuOMLIkHR6Xax2BpuZT4c+ OUN/PBGzlhAUWRrVCXQ7fcY18LDLSEc1EclOBhzA5OqC X-Google-Smtp-Source: AGHT+IEvOwqMxcIB4CxmsBHfttg0Kz/rGyaM5A6hndZP1gZhHsB3FmvGqmb9xhrMEyQ0ZMSypwnoTw== X-Received: by 2002:a05:600c:3b02:b0:434:a7f1:6545 with SMTP id 5b1f17b1804b1-43891441f27mr152566255e9.27.1737469514459; Tue, 21 Jan 2025 06:25:14 -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-38bf322a414sm13450253f8f.47.2025.01.21.06.25.13 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 21 Jan 2025 06:25:14 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 19/28] target/ppc: Move has_work() from CPUClass to SysemuCPUOps Date: Tue, 21 Jan 2025 15:23:32 +0100 Message-ID: <20250121142341.17001-20-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250121142341.17001-1-philmd@linaro.org> References: <20250121142341.17001-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé --- 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 Tue Jan 21 14:23: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: 13946332 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 D693EC0218B for ; Tue, 21 Jan 2025 14:29:56 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1taFE5-0005I6-W6; Tue, 21 Jan 2025 09:27:34 -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 1taFC0-00027R-PP for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:25:31 -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 1taFBx-0003XV-0n for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:25:23 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-4361dc6322fso39879415e9.3 for ; Tue, 21 Jan 2025 06:25:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737469519; x=1738074319; 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=IMSIk5ncDu4g6LHPrdwoX7hzFMRJx5hOXsfdQDScvts=; b=j8o5i5Dom/lccFaL456KIzUvG+PkY4QhV+dVu++b5d/5l52Lry3+l/G6oGrlkq90XP gCedCX9SJpDOo95Eu73dwyZdEoYT1cYfDETOx+SiP+KaikiykBPebKBxq6UvAgR0FXHW KZMWDV8b9ilvupBvimBdK5Oz0k4dXTXC8cEqZu5bUm+vztWiTA4kbH66gqNahuQfmh8n Qx4olRVuCesI3j2subUXxUuWgYPhjNwjto6YerIKC5Oz164QUapfjUs9QIiMjipQBRRM cIGCjymPNcgu4Hw/aW2i5a//WgbMA/YQt+XZKlPlDMKBqOYtqmI5gC+jU5O8l0XiCtsR CQGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737469519; x=1738074319; 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=IMSIk5ncDu4g6LHPrdwoX7hzFMRJx5hOXsfdQDScvts=; b=pLBoksb7q5KijiN+xsy9+DvGBvsw9NqJXoMr5lHlvR2x+0xNiwUCuYXj1WkYA2N6Y2 /0zebbApEgzLjj9IPNKPXUxTGYmnUwnH9lhiCZpPcOul7Rct7BTQo4oHpgUf4hooEW6J NGee6rPsMGHF1hpXRP6EMgPtc3LwrDIk17ZHgTTZtar9NN1nCNUTA8W8nX3WDRqiF7v6 3gzedEtRzo2I1SvnWymTozXAOPqxjmrtVxW8oWi+dZ6JPWgINd88SVrimxdKbEuk2iXq 7rq8FUM+ujY/v4F6WvdEaUzFK9ntifL3WKdiOyzm4GlKx7z4lnAuvg69q5g3Bczs6GOI n5RA== X-Gm-Message-State: AOJu0YzQbYjWMRtSOSLEqpEXIMajLrp+zrV79aTD7IDLwwfRNUG3xYl1 gYSVupV2u0wqvHCqlpnEGiT69ae5t2Y0QKpLF7grYWb+eiHTZtOIfW8uqL/x1unF7M9U7MupV6I uQm4= X-Gm-Gg: ASbGncseZrizOV1HLb9ZqBPM5GFdmZrf8uU8qCA13h8WcauFKFfSudjmOdOAcQy/yeF Q43W0+zRVVW0tbjQpqvvb9qhF4aM5Fbd8Ww3YmSodK2chr8kBx1himxUhePjtcPjUz27MZgohDA IEXLxjuJKvg1d5Vq/NoLDrbfXYvtAz9qE4wUOl41Fq6Puo7x0iMlFkHb99qGAvvzQWMoz0Y2VSm 9PErKR2FGkzj++kHafU6UzhU1wsxcBaQ9RZdPUyRB9WXHmpWC2Vc3iiPFA1R3zy1JwdM1I1VC/O ZQx0PyXXp2YhLn1FOmSZkntB2+L3wIGYad0KvG0+Y/ss X-Google-Smtp-Source: AGHT+IF5jZgttv+LZ0wXfptSGAYls5/Jm+rh3KFwCcEvh2S2Zke/7/oH+7hnKV7UQYeCQuZJLTuIcQ== X-Received: by 2002:adf:a343:0:b0:385:fcfb:8d4f with SMTP id ffacd0b85a97d-38bf5788966mr13313679f8f.21.1737469519203; Tue, 21 Jan 2025 06:25:19 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38bf3214df8sm13543832f8f.4.2025.01.21.06.25.18 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 21 Jan 2025 06:25:18 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 20/28] target/riscv: Move has_work() from CPUClass to SysemuCPUOps Date: Tue, 21 Jan 2025 15:23:33 +0100 Message-ID: <20250121142341.17001-21-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250121142341.17001-1-philmd@linaro.org> References: <20250121142341.17001-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 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé --- target/riscv/cpu.h | 9 +++++---- target/riscv/internals.h | 3 --- target/riscv/cpu.c | 8 +++----- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index 97713681cbe..32e8e064f36 100644 --- a/target/riscv/cpu.h +++ b/target/riscv/cpu.h @@ -552,10 +552,6 @@ int riscv_cpu_gdb_read_register(CPUState *cpu, GByteArray *buf, int reg); int riscv_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg); int riscv_cpu_hviprio_index2irq(int index, int *out_irq, int *out_rdzero); uint8_t riscv_cpu_default_priority(int irq); -uint64_t riscv_cpu_all_pending(CPURISCVState *env); -int riscv_cpu_mirq_pending(CPURISCVState *env); -int riscv_cpu_sirq_pending(CPURISCVState *env); -int riscv_cpu_vsirq_pending(CPURISCVState *env); bool riscv_cpu_fp_enabled(CPURISCVState *env); target_ulong riscv_cpu_get_geilen(CPURISCVState *env); void riscv_cpu_set_geilen(CPURISCVState *env, target_ulong geilen); @@ -576,6 +572,11 @@ int riscv_cpu_max_xlen(RISCVCPUClass *mcc); bool riscv_cpu_option_set(const char *optname); #ifndef CONFIG_USER_ONLY +bool riscv_cpu_has_work(CPUState *cs); +uint64_t riscv_cpu_all_pending(CPURISCVState *env); +int riscv_cpu_mirq_pending(CPURISCVState *env); +int riscv_cpu_sirq_pending(CPURISCVState *env); +int riscv_cpu_vsirq_pending(CPURISCVState *env); void riscv_cpu_do_interrupt(CPUState *cpu); void riscv_isa_write_fdt(RISCVCPU *cpu, void *fdt, char *nodename); void riscv_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr, diff --git a/target/riscv/internals.h b/target/riscv/internals.h index 67291933f84..86def39aec2 100644 --- a/target/riscv/internals.h +++ b/target/riscv/internals.h @@ -142,9 +142,6 @@ static inline float16 check_nanbox_h(CPURISCVState *env, uint64_t f) } } -/* Our implementation of CPUClass::has_work */ -bool riscv_cpu_has_work(CPUState *cs); - /* Zjpm addr masking routine */ static inline target_ulong adjust_addr_body(CPURISCVState *env, target_ulong addr, 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 Tue Jan 21 14:23: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: 13946333 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 751F4C02182 for ; Tue, 21 Jan 2025 14:30:10 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1taFEA-0005wO-2J; Tue, 21 Jan 2025 09:27:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1taFCC-0002Mm-Vz for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:25:41 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1taFC9-0003Yw-Lw for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:25:35 -0500 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-4361815b96cso39945625e9.1 for ; Tue, 21 Jan 2025 06:25:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737469524; x=1738074324; 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=PSfO83fjWsnWHDr8uFKNeFyF3V9Fa6fmQk5hnrhkQ0M=; b=NzEyyoU/CLnm9tCPLVy9tDhBvVwSgt0VJVmvzQDqVAPqq5ecjcgwkIlYt2HpyhaEJ/ 0vBpH9TvtpmGTcqpynsL18PqrMaZVEwJ4J9TkTZxA2k+X9ZBoSdqOEbsmhxpxHU034Wz Rb6bLQm9EWQWED+s95MqeVPY1xRofiuJ7tyn2rYxjpGJ9+5eILJmbU9vAI6RrxdSVORR 5IhrdFEgpTguhS6OFXlS3rxyCZ+89ocvaWYPtVji+peoFAuIP70Zhe8WW2rNb8DrkRSy d1cSZFP2wNEc/kL3FaSk49BnK91KesgvX/JM2RshPC9562xVrK+dscDXad85/dfIN5Hg 9uRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737469524; x=1738074324; 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=PSfO83fjWsnWHDr8uFKNeFyF3V9Fa6fmQk5hnrhkQ0M=; b=AKM6+gS5EOmJJ7lEPPtaAcXWxcFoChXdooLI4iCEf1cNkMgzq1xOKXd5krtUC2Yn5t B1Vmlj+hXPlU05UtyiEvneicogAtZ6t/KR64NC9u9TswRTtorM0DOkVcOaQtE/IkZ6aV BTHWV+GjvNmwlhBa4tMc/nBiipwl0udgInNj4p3mwGONBzPlJqYOrAgJqiSXewl9Xlu1 VxiIHTfdYkzXnB3xOVAJTb3R15gH657gT0GSPA6RYbRMjU+YxB5znf3ubU6JYCpSezlh g4njwrVc0ZhOECMu3a0lT4NJsWwVbFL4S+u2UbKEdPZaH/JiZ6aW0h7CK3RfAE+RuYNC 8q/Q== X-Gm-Message-State: AOJu0Yz0KjT4yU+0UIBhgdHPNeKDrExYvRWiy/cPJClQ3v40rpIINju4 V1VXZszpXjYXiyCm+/06htDjLHJWdZ52DPME2pd/weIcizdmKmHzGmrJseab1FulE1b9PYFLEjS D3Us= X-Gm-Gg: ASbGncvkRtiUqLouKRcwhyro2hyGZsVVqvpzUthIDus7s8raJ8QCyU7CJfIuRbcxlyO jSRI24uf7W+UrAFtUkCUXBTH+37Jca1/FF5hCCC686FEBRqAoXIPNWtTyrfP6q5fFYvY3UgxRCD Sj0yz+uivncmgF2DOzXY8KaEYzeyatJbHmWYPd4nCeo29RjtZxitGs42FaHZnJUhTBeJixBD2oD QGTkkjZcrDNZUP72lB3UF5f8HOP70tFJelvkX3D/9cuo6XBqb0TnqMQdKmV0xsvBgJ/IkxHMRKI BAzP4z3KP3f45EkM03Qs5/2WEBNP/ctJiXqJfEXpeo1D X-Google-Smtp-Source: AGHT+IF2omPRSjnWN9jhrxVc6jEnwsOGEAA0Rr/Lp2vLVo+a3b31TLCUPOMWoPdHRg2s7zVe2kC5Gw== X-Received: by 2002:a05:600c:4e0c:b0:434:a802:e9b2 with SMTP id 5b1f17b1804b1-438913bd972mr157194245e9.4.1737469523913; Tue, 21 Jan 2025 06:25:23 -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-38bf32221a8sm13684934f8f.37.2025.01.21.06.25.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 21 Jan 2025 06:25:23 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 21/28] target/rx: Move has_work() from CPUClass to SysemuCPUOps Date: Tue, 21 Jan 2025 15:23:34 +0100 Message-ID: <20250121142341.17001-22-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250121142341.17001-1-philmd@linaro.org> References: <20250121142341.17001-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé --- 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 Tue Jan 21 14:23: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: 13946339 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 2088FC02182 for ; Tue, 21 Jan 2025 14:33:16 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1taFEL-0007fH-JJ; Tue, 21 Jan 2025 09:27: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 1taFCF-0002Qf-Mq for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:25:44 -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 1taFCA-0003Zt-7M for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:25:38 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-436345cc17bso41095965e9.0 for ; Tue, 21 Jan 2025 06:25:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737469528; x=1738074328; 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=XLtjxkwdz6L1VGr45Id+Wfm3w9Chh81Y/cb2LCx94qE=; b=G9NCpxCkXb7KaCQ/IPs055hnOPgDAQKTXS147FrPUPJZEDwuRmWsw8dZeYFL50hhMn uTRR7cjbmR+Y1utadxek5uxcLgET2vjG1QD0O2W9Ec6Kf9b5Qp+z5cx4TD/iVfR/9LSm YzZZl4VwHz0qbxf9LWxeFTf/e/dbldDcELLxe96rQjBHsOPIiLgh2TpHf9iUW9YKq6sW nINPuW0qgw1vn0/JvsLmE5e5eWmV4IOlUoeNEc4m8JGGkkaiVvxicX1Me63LwDaMEk0H y4yo75TRVnBlDhz0+ewA1Rk6Zy6VF8nzDU7cIFu2doGHKjMrxsgvgygvLM+RPAlj/GDu 4L7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737469528; x=1738074328; 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=XLtjxkwdz6L1VGr45Id+Wfm3w9Chh81Y/cb2LCx94qE=; b=eVZ7cPpbfzAxApEGJT1fiuXicNRvEgwoGf40QtjAL5k6FQlQhY3xU75ruNSJK72Pdl iuJwV7SCDji9V3chCdyvDrvi2VM1jp1S6WaCBqxe3r0VJYfe8DsfPRtCcFohFjswH5WU l7c9ixPqLppDBhN6O7Jms/0dZ/HbnAAFRDzF8XqpjZ0AdsKVwCWc/chYMl4EY6NHmKxH FaXttBZAqc4mu2871C0n8Ff46kSX9B/hADpk1ob7Q9PFnANz8AHGUVOgkHS678VMrhBs jx1XYMvfmPtU2Y6IKxaaLlrHzBCeisbeLWYh2D3dfZFka96l04t7tYxMR5KUkGkbHCeP u40w== X-Gm-Message-State: AOJu0Yw/273QdrkQrXjGsoVc6Z+cPtWnb21K379Nthlru8NlXehxNf1Y 0WbOIk0MFaD/708KXxD6EVDgiG9YMHxymkOf+/sKidzq372rUoaRqpAH93K4o8iKmuQTJ/uJLo8 qDf0= X-Gm-Gg: ASbGncvWXSizqbGCrJF7kQEAWXJxb2+IDlRmiep3At5LNMgtOBJiJ9Zu2v8yxYDiT/k lOes9iudRwp7jMDSJbFUS+FjHIRGfcZEZY8KNUa5WxjV5xMOikros5VS4f558rcKmjhnUn48WOy Uzi+gpOAx4yPL+ilY83zTt2PsmLaqcHOAW53bNR3AxtoqjWva6N65A4xwBk2OX31cyGYtaefbfN THl6OtGGuY4JCGhnqGDLmGLUfLvD555TVDX0+wv5bqrmGlLr72mIueRnclG6kg8U9vCk7OSCyvV MCBQl04l8WXqIhkT3fakhxrDBPqBlHXdl5ZCJwqedpOH X-Google-Smtp-Source: AGHT+IFl/O4MKtba9v34wpsx1JISKH5fHpqun99JFLA44cDthFrGsVsrvg7dwbDEcTwqpfpZD1Dg9A== X-Received: by 2002:a05:600c:4e08:b0:435:136:75f6 with SMTP id 5b1f17b1804b1-438912d5426mr194266845e9.0.1737469528605; Tue, 21 Jan 2025 06:25:28 -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-43890420412sm184694965e9.18.2025.01.21.06.25.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 21 Jan 2025 06:25:28 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 22/28] target/s390x: Restrict I/O handler installers to system emulation Date: Tue, 21 Jan 2025 15:23:35 +0100 Message-ID: <20250121142341.17001-23-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250121142341.17001-1-philmd@linaro.org> References: <20250121142341.17001-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 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé --- 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 Tue Jan 21 14:23: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: 13946331 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 11C64C02182 for ; Tue, 21 Jan 2025 14:29:10 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1taFEF-0006lT-Rg; Tue, 21 Jan 2025 09:27:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1taFCF-0002Qj-TX for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:25:50 -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 1taFCC-0003b4-Ky for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:25:39 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-4361815b96cso39947775e9.1 for ; Tue, 21 Jan 2025 06:25:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737469533; x=1738074333; 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=w5Osj/Xm8a9n3farOlX+BcfUKPr+xmHC/WIuo/LHRro=; b=RWjh0YQ3VckF3VazggSMMAGkRGw6xkDKltedpocGjkSgWo97imqH4zRYR9RFM79lID y3XBcqVK2XLHam4sYxPKJeAkr28rQhESnJMlfeafUUzlKaScJmA5Riysd0WrLuY2Qqqk Q0UZC7BHY3O5G7/VLQFM0r7qMDDgyo4s0a1/U/Esbzwg4jkrSfYAwqOJWe/DB+QpIcSc 8aB/K6bjTj3JRIqN5vdMQfVWHS1tGKah58X02BCV0m/5g5y0IUeLi4LAoLANM5fqki47 uiJtqTbBgLlIFSSlgIhVdpbD5+ZTYN9rH9O6RTBjOGK0xud/v9JJCz7J0/nnqeDwap3A APLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737469533; x=1738074333; 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=w5Osj/Xm8a9n3farOlX+BcfUKPr+xmHC/WIuo/LHRro=; b=ulMj/GNIeEcED4iSDwHhdEsL4aiERlA8ONRMDYiM7ancBBmjbSHvNTsUcoyA70UX+A UWFra3q09gsJaS0SDcyfNhzrVlqLvqgwqaZrc9wESDWQKfSq/uE04oo/CF4bqXDO57JU RNfQXYF7IFeHvMD33MRtvWkxEDbBVT86Rgk4YlAukvLwmx8iAfr8+1xJvAOc6m5lkj67 5uPB0iKaJRq0G8UbjJHSdyj6LGiQ6hSk44SsQpO0uMgC5J+nFJf+JtpGtNA6VDkSgwgY sfZ4RdZQaCDHrMXLVwHtaDsbttSfcTlAGBdN6ajK905Z0ZJVVBkF+HEQmSjA/T5hBblV M8mg== X-Gm-Message-State: AOJu0YzZgczTtGpY48s0BUPFe956blUHfmbwldVr/1fKTkAFaZyH5Eh0 iqPYW+x/2R+0BTgREnQ0jW5O2rgDDL2rmxcbKje9xdWRCXuafuJ9+mxKLmj5Mo+xxTSWSBYeQ8h 5NwQ= X-Gm-Gg: ASbGncurLnaft6aFMNX+o1VT8y5s5kHEMJ6BiAN+yFNN70KpZ9vtbCtHXhQveFLVbVK 6yeRhS2pWXnMN6Dq5EXZ6w7/o+jNTdiqG/X68UzNY5EIc2X9yMbzEMMFJuhwL7iOtmF4ocaAElL y6kfXD6jajQC/TmDLh7rLmHwAE6FMq6UCe3zfgrSveclsi9wQiaW/czAUNFoaj+D6eAU6sOa/kV l8WkuWYL2FWEsKL3AyVesVIWu/5t5a+Uw6a5DNSNc9X90jtHATjQz1scPd34NjJryvULS8TRUZX 45mUJYCE0F2h70gRLkKeay8CbOlcCweCQ8qjSY33p1rr X-Google-Smtp-Source: AGHT+IFy475/36H2ngsXVZqfotRfT3spRy/Q+K2ilZTYIEAsI9KYg5NCPKl5KgR4uvaDNCcS5GALIA== X-Received: by 2002:a05:600c:1f86:b0:436:faeb:2a1b with SMTP id 5b1f17b1804b1-438913db2cfmr154848375e9.13.1737469533314; Tue, 21 Jan 2025 06:25:33 -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-43890462195sm179610405e9.30.2025.01.21.06.25.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 21 Jan 2025 06:25:32 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 23/28] target/s390x: Move has_work() from CPUClass to SysemuCPUOps Date: Tue, 21 Jan 2025 15:23:36 +0100 Message-ID: <20250121142341.17001-24-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250121142341.17001-1-philmd@linaro.org> References: <20250121142341.17001-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 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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é --- 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 Tue Jan 21 14:23: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: 13946330 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 3B003C02182 for ; Tue, 21 Jan 2025 14:28:59 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1taFE8-0005iC-KW; Tue, 21 Jan 2025 09:27: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 1taFCI-0002Qs-A1 for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:25:50 -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 1taFCG-0003d9-D7 for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:25:42 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-4362f61757fso58501475e9.2 for ; Tue, 21 Jan 2025 06:25:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737469539; x=1738074339; 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=26PmvKZTfrtdcJJ/pIkG+XcoOAjc8KeXuItpvNN6yaQ=; b=tMxS0X67tGfF3I+TyrsH3/w6ECmbjJoiamkSRg+BckI3xvz1Jaya1n2Mh6sRW4eb4o GGg/vLvSa+44tYeoiP1jroJrq/LRvaNs7c+bWJeJzKT0OiNGdqU2B8b+2AgqAB8CRR2f JhJU+Tx83tVjwZBRc64M9wD0iW8h26azyuzSXC1RB59z1AYju/UBMVLaAAN6rxVndNbL uZ0Siv/F1HO0MoKL0TBtaNo5TjX+95DQRumW3hLd7baG0ngL+/mw8T3dYUdyg73jRHkH kTqtOVQOoAv3Z3AnLsTBUgTjccRi19/PKE1PhHEQvLOhAIxKedq6A0gsRqP5rvRI2i0z lehQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737469539; x=1738074339; 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=26PmvKZTfrtdcJJ/pIkG+XcoOAjc8KeXuItpvNN6yaQ=; b=ukkuqILP5UCfKbrCaBzsT68yIZo1veU45fEg1GtU0gx5J4b7miTUph2wFt+ss7Sobx SH9RhhV4XEH6bBseZsY/6MIzN+ujb+gyuSKmm4wezIp7FaN7m/ZndR+tzEApTG9VPnOa n61h16u6yEgIN2YkatxP+u1ARRFtKntj5d8RKSdU+hediPzRkdZjX58HxaMtzISqIDM3 ATL1+3dfTDhUflH84vvxKv7eKUQKzpktn5AufF1p6zEmvSU82c3fFUwVsfBxXTcbe8O9 9UhO4oBMGW1+MMz4S5+Yy6N2v9ExdeVqauAhpWtyad7jsjBj6PiSscG0HCMj2Mkwdxg5 SVKQ== X-Gm-Message-State: AOJu0Yw45Aji3YYGNTpHdSjFA/h0u9b69LLg816+Q6lOa6mVdO8/Nfl2 /5157pBjZGyEdeuKKJxM0YjdcAClrdfQ6IkohEC7aMbW7GOhaJQAxA36G4f/RyLhr0fP6QrgzIv AviQ= X-Gm-Gg: ASbGncubEggPm8/tI1sULjT6+kEOvr4teZ5fDRq5T9f/LbfD+qP6GjUFqn1YJyS7GWD 5l3Pj8hH/1o+F0VavCQfrrUs+jbFyB3I57AKbn8lt/fuT73VkJLVcnpX8/AMRapJ6DD0xaCO21o p9IRCDckvaSZiE6IyTT9D9e/TWf+LmSyq7nI3b/SQST2XJJx88Fq0gxskIX+hTIGgzzmcYcYURp HOikmvSZWhYLFuMj+ivNsMLKP37VNFfJBvTbi4u7WAym3sDuYyIXYWBdF71QKiMUuS7gxQjU0GQ krg2VSiO18r+5i81QpwjjiY9fz0NoNHeha+AAWq7OnqQ X-Google-Smtp-Source: AGHT+IHn7OCXdpP6y0WKV3U3dWvYNFXahS3mrVA1x0yj2ZHdNgu1Q64ITNT06q0vuAJgcLpA6VmsGw== X-Received: by 2002:a05:600c:4f84:b0:434:a90b:94fe with SMTP id 5b1f17b1804b1-438913ca9bamr175432655e9.10.1737469538002; Tue, 21 Jan 2025 06:25:38 -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-437c7540ae7sm239090455e9.33.2025.01.21.06.25.37 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 21 Jan 2025 06:25:37 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 24/28] target/sh4: Move has_work() from CPUClass to SysemuCPUOps Date: Tue, 21 Jan 2025 15:23:37 +0100 Message-ID: <20250121142341.17001-25-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250121142341.17001-1-philmd@linaro.org> References: <20250121142341.17001-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 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé --- 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 Tue Jan 21 14:23: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: 13946336 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 11C33C0218B for ; Tue, 21 Jan 2025 14:32:07 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1taFET-0000Bp-Br; Tue, 21 Jan 2025 09:27:57 -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 1taFCQ-0002YK-Lx for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:25:52 -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 1taFCN-0003fQ-Th for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:25:50 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-436326dcb1cso40030625e9.0 for ; Tue, 21 Jan 2025 06:25:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737469543; x=1738074343; 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=fr9YdHbhOcKThpVgYMMFdjV9+ofIfxxdmaz/V1NjYlM=; b=WSqpmHGPk6i8G3sbwYP0y9gvZVDR0dZgpEIv9xnsHcsRAPNEGxC5/pR8Z99ENLi0IL sFjqADgkbU896wjWZBTDq/+/wPFGZysM6aTpVsckleLW3dhhsCZTCLZT8elARtmVLogD tmdOzpbCZV9V0TPicJdEuMSWYYXo0rKTTw4j1NMGSZTiMlYPmy5HiiRqk50h7fh3JPCe HvEzA0CQcX4zWh23/0cLyVF5994fUHcuq2fEBrnjRsipy+KNFJjI7J/smNGp2mVqwJFQ mdNganYAbLs1ErmUI865ncL1eCX7Sizu8vya1N0gWHImamppW/6hNBs7l8c8oeSiTrfl caOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737469543; x=1738074343; 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=fr9YdHbhOcKThpVgYMMFdjV9+ofIfxxdmaz/V1NjYlM=; b=EbiCMdQg49UD1llvl3dha+2/0tWIKsZM1hRy1Npe96zbjT20k0tGN+orQ59K9QcekB 4JFI4vdP12FUKPFGW1Df3cFw0NDSpiIvgvNnFxw+LDx7nAGwRuMnxp4ZNhF83+XkrSuP zgR7nUcmo+SE+VMeIhE1w/SWdmM5FCodf6fgEWeJkjgkxr8Wivj4rUnQI6h8GYdALQ3J JUMOO2gt4MU3ggsahjHs6bNjBRaVW2QXNxyonHJn/XULQFLCgbavitDYZPbGC9927w6p wTJ6nm3UVF5fhVc5gMN5d+bgvSxCs2osRIX/CxL/ULePSMA+9Ng5SnL6mVaSttbWOQRy 7ilw== X-Gm-Message-State: AOJu0Yw0C1hQWh2Zi2EN6vVKSubK6ZGrxeYMv9KMme+DScaMVRj7woCL QzT2ZZS9UJLiUcoAYNBCeZJpCPofu8OHajYw+jLzLD6IsIZIfNQSQZTlPhSpEtFsYoKh/Z1Ol1B G/5g= X-Gm-Gg: ASbGnctoH0VbnUL6mG+x8bCtxYABYVpNLhaSSM14DXlb+nSvA+pUAMNIoyUImdXfACM OScz2IRj5zr1YP/BuxLrRVkgmlFafMBvC8Q/M0u715oGBi9uLTifAVUkcvsup9NbUgOg9D2busr 3Rdmv7yOGz31NpghR2TNDv4td4KoEiHGPjwxgXyo3tqszamz5Qh8Wazx4HtnyV6fnzuc+AFTsSA JFsZe+JhVOmWkc/uDmbe1yNSW5VmmcMr5qRipqN+m6C7IdJEZfQuUcOBDxJVN5LcAA/eKlPiAhY WdeDdQS82M/OPtqbckLPcMDM6m1qzd+3/uboc2Cid8kN X-Google-Smtp-Source: AGHT+IHZiO9H8UoGX6X1M2K5zPNmAaDRQIcmdu2Llnl02sgRHrc/qLvRlcC4n4j8oG1pmLQ0tOBk6Q== X-Received: by 2002:a05:600c:310a:b0:434:e9ee:c1e with SMTP id 5b1f17b1804b1-4389144ee14mr176936965e9.31.1737469543400; Tue, 21 Jan 2025 06:25:43 -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-43890461fc6sm184735035e9.29.2025.01.21.06.25.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 21 Jan 2025 06:25:42 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 25/28] target/sparc: Move has_work() from CPUClass to SysemuCPUOps Date: Tue, 21 Jan 2025 15:23:38 +0100 Message-ID: <20250121142341.17001-26-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250121142341.17001-1-philmd@linaro.org> References: <20250121142341.17001-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 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé --- 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 Tue Jan 21 14:23: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: 13946343 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 F0F2EC0218C for ; Tue, 21 Jan 2025 14:34:24 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1taFEV-0000Wj-09; Tue, 21 Jan 2025 09:27: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 1taFCU-0002ea-4S for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:25:55 -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 1taFCQ-0003g4-1S for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:25:52 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-43634b570c1so41590385e9.0 for ; Tue, 21 Jan 2025 06:25:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737469548; x=1738074348; 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=0FrZU76fBoB9L58Ptipeoob4B1ixlMZUB4jhFVr30a8=; b=GW6mmm4m/6iyclK3TlIzNM1Ve36GvZ+Su7+pJhRfXGFXSixFyiYVKMXdm2xbqFyqkt b0ZqMyO4IKDShyLvxZ0/gkNNkpFZiGxKrGu4f01S69Cmwlzk9/N5SunQ5X2Xc8jd5YN2 AZH5yyvYr9izNup/JchyUcKB8PKqoMDL2DhQ7nYDpLOA7ZAynzAeJlla3GALGqTq2Nfs roPSnsYs4LnWS4GFDMQnAyUPlLCo6Gs55I+05Dn9brYEfANS4UT3LW945sugSDzPcuJW Eo+q0UfxvMPZsKNrohUduqFwyhbboHYDzYM7uOt8CZZUM72zuTZAf39FXFDzldxWdeow vXPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737469548; x=1738074348; 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=0FrZU76fBoB9L58Ptipeoob4B1ixlMZUB4jhFVr30a8=; b=KjPDhQIJwctQfFAt5uceSrpqcMBarMm4gpCYxzsJurE4lk3WWEcV18ffZEE98ZjHQD HSrpw1+lsWoZEAtF6pct9dSoT/1YRAAv3EOOwjkPzrcvzN8RG7RNoPZBvHYECXS7tPiI l7+oQ6M7/gd2DZszs10mziikwyQ1eTDH7fMf0o6dxAFHR3r1j2EInI4OskvGXUgD8YA5 OWRBVS1f/JckYlvIAajcqgNPd0AoOeuIdMV/6yXJZg2hrBvDsLbE0fYbI0UIMuH92ONA dAdlJeqwRFFdnn27yqkbXQI8Lneb6HPHbWwbGSXQKqw1oMVVL4+bdx20yvKOzch2Ya6J PYXg== X-Gm-Message-State: AOJu0YwQ0ZsmwL/bBzscT5x9Del3DXB9tINnJ/Zm5IAQYjmXA07TXx1V h/+6OZP29NjHOeXvHWBqsHgGrN/Q5+XAyEFqNFivPTZGg7rvYJhL0sK/SWHYo6eTin05WXkSVrz SyR8= X-Gm-Gg: ASbGncufXBDGjxDIuYW+S0G+H7puJml9ixyquU01IDezctmgArnvXafM21ZPbhYO4LB p8bhaYWwgb25nwiQe/eWk6imufeSlNm8bnIw44AM8IAnd8l00xSixUfknBMrP689JYF7AN9USBd ejHR3XtD8RCfLcFNGIy02wWy3IhWuHScRag0tg2CcSisgnWSd6/nigrzuIyvaPIIqa/1MpzAarn qROYmqDR37ubtqlLRWK4KXzfqezUgSvXySitQ90Np76euGRUbgVq3AyGbqC2vYf3Rt72ZctA6BV pkruDv2NSrSHu6A6nEo4QHg2nzPmvC+/OF9jDpotA77P X-Google-Smtp-Source: AGHT+IHq54ksNrWuzoEUpJHqcipFKGMJ0Fqjb8W7rV16FrkkTBukeGz0zZskwTpyM/E8CWll5UMD3w== X-Received: by 2002:a05:600c:3542:b0:434:9e1d:7626 with SMTP id 5b1f17b1804b1-4389145137dmr137502485e9.25.1737469548047; Tue, 21 Jan 2025 06:25: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-38bf3221c25sm13311295f8f.23.2025.01.21.06.25.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 21 Jan 2025 06:25:47 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 26/28] target/tricore: Move has_work() from CPUClass to SysemuCPUOps Date: Tue, 21 Jan 2025 15:23:39 +0100 Message-ID: <20250121142341.17001-27-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250121142341.17001-1-philmd@linaro.org> References: <20250121142341.17001-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 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Signed-off-by: Philippe Mathieu-Daudé --- 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 Tue Jan 21 14:23: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: 13946338 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 5851CC0218B for ; Tue, 21 Jan 2025 14:32:16 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1taFEI-00078p-7N; Tue, 21 Jan 2025 09:27: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 1taFCX-0002rx-Rs for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:25:58 -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 1taFCV-0003ii-6U for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:25:57 -0500 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-43635796b48so36655935e9.0 for ; Tue, 21 Jan 2025 06:25:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737469553; x=1738074353; 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=5HU2b7p1M8gNy7Q1wMvIjKnoAVWtRUTk8UBT9dkhhN4=; b=x6oEL+TMpKCORxVcsobLgkJ4lcBE97kQGMWWFC9hsOA6vuK7UHhlYyAtEiXgtThPUO 7WG131z1HEBh9g4b5X9SILX9WJienge/1GsQj9RhYsYypCjg6suaxsXcR0tyOF/+YXRp id4AYjkd18odwte9UQxK3BkHbY1Z2rkst539sfIU9Rx4Xu/AYO5BC1fk9ZaMGbAgWzJO q1kLfsMoG9xb97gQI5h+jXvSiZdIr/K/spQ5E1+YKHl8TjIXoLu0skKBk00ssiPTMXV0 cZdonGlD6UswZXE+jx5HdRxTv2L1ts8dJFt2ljOv5hGNjniDpu3sHbkmGxYPM/vCmXCd nrkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737469553; x=1738074353; 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=5HU2b7p1M8gNy7Q1wMvIjKnoAVWtRUTk8UBT9dkhhN4=; b=GzhxelY/Ry1e87kzZpWMc2fSCl1vkTfPzeSWhOM5DiMN684dJbd5EkfGdnzb04re0I oRdm82lmxPvy3+5nV22oqJ8E12llLLkDYY3SqRrMwJcb68p/G3b6mh8H3XYkp3JuUagq +4vjITB5fhPxQjacmU3l6JXET1sTicRMZVkwgvnhfJWQmSMtP/ZB3bWgWrFIqTZ11J9u hL/5HJr+HcT2kEE9lpzyslCYANE2pM404oohE2u7hB/mMoN02+jKgpVnYPlA1iifKxot 64/N9zYYnKOqb/cqzrXRayhTB7+WZ2aS6JZwf0isknz5JpfoK7FpGEpaO9ud51cicfPs YCZQ== X-Gm-Message-State: AOJu0Yzu/upcREcj03NY2uEESHooXr7GZWIwWMePJrY5Wv5kC0R4Af/T 72Y+WVJApj5zpClm3SATH7WDgw5f0tNFSMpoDjAGVaaLEqHXVBh/4h9k7F66NwVtIyU7RIDo7rN 0sFE= X-Gm-Gg: ASbGncu1KaFMU3g3uSNKDYvcUgbxgR15YbowBdICZHHR5UYOLWx1eVMquhcSKQs2Tiu BtipM2EdB2zQj9N8SEOM/U5rRQC7SLciZGWirbOSU3qOYAdFb3LTA7Z++oTW0m7VwNj5S0HOJlf mcywwWhRblpU5PYzeoHtuXCrbWyCkdgJKMrpaExEVjNgVmd3uuxQPsNfOtARp2QLRnRIKn1nq2u WzlNdjxdAkPT1p0FY0PnbLYHY8QB0F2Sb9y2JWfEB0EtDeXGrQ948J5rLh7Ei77SuzK56MdmioM tIV8Rdsa0rhDyOaKgC+/zjLc76IZmIjbR/ceI4VrKEEH X-Google-Smtp-Source: AGHT+IE9NOtTTWXPLNGkrwN4J7V9evFmJq/+qT1gaX2Pu4XxtqujvUkrdCA/cP4YvoV9KqWVRvG4nQ== X-Received: by 2002:a05:600c:26c6:b0:436:1af3:5b13 with SMTP id 5b1f17b1804b1-437c6b475f9mr239225505e9.15.1737469552939; Tue, 21 Jan 2025 06:25:52 -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-43890413053sm183998275e9.10.2025.01.21.06.25.52 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 21 Jan 2025 06:25:52 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 27/28] target/xtensa: Move has_work() from CPUClass to SysemuCPUOps Date: Tue, 21 Jan 2025 15:23:40 +0100 Message-ID: <20250121142341.17001-28-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250121142341.17001-1-philmd@linaro.org> References: <20250121142341.17001-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 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Move has_work() from CPUClass to SysemuCPUOps, simplifying xtensa_cpu_has_work() by directly using CPU env. Signed-off-by: Philippe Mathieu-Daudé --- 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 Tue Jan 21 14:23: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: 13946342 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 7F9CCC02182 for ; Tue, 21 Jan 2025 14:34:24 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1taFEZ-00013d-JJ; Tue, 21 Jan 2025 09:28:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1taFCc-000309-5f for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:26:02 -0500 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1taFCZ-0003kk-EW for qemu-devel@nongnu.org; Tue, 21 Jan 2025 09:26:01 -0500 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-3862a921123so4055430f8f.3 for ; Tue, 21 Jan 2025 06:25:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737469558; x=1738074358; 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=y8HZuuYQMEsWgExTk6OZpUbl9UQpyo61BMv/xXe3yCU=; b=BfQu0p4DVC4KY7tbxL8KGrsDq5jbC+kD+4AMX7qFMcOod9Vpfq+Lh/YMDw+zWR9xau 2/pwlGSKAgDxX0HLbjJL05Mr/DVienYWSazErsOLDiyDg+ASNw8RAk6sYGK6XmkPTHYk TWJ3ElDDjwFNDCFC4YTweyMhmH9qKTtKIXEbss5JlSfconBbIJBmP8y17c8aFWeDIaAy pkRzyA3seBFqNPpJl/WDVoZ+rZYEN2qeUlk8E1MO4LQb7PJ4gf1wmE0UKQqr5k3r0O4b kIq3VcZ5nLwncZ+DYhWBUjNoB09HsFv73WKXGO/d+GetRh/qcDfwtQu/PUzQyFJdYLFa wdkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737469558; x=1738074358; 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=y8HZuuYQMEsWgExTk6OZpUbl9UQpyo61BMv/xXe3yCU=; b=iaokzRLrHzk0BUf4IFHr5/XDZgABhmobJR55/Cv8L8GOQQqFcptRZS8YRklBdc1HAx kGF7xw+etF4uEvUF7etrlVu0fdTUGCTPPKEBxYkBdAJj8f82HevRLkTzBJtdQtnzvvGI iPGIdFll6v8c2Ce1DwtVNxu+QomQKoNh4f33UIKOXl6cTqoS5zD+bDmupJ4SmSVwZDQZ TH6blf7W+cDxuegke1gTq/WGXb8wHp2XGN3Pn1YX8X71nc1x4spcRIiki3pdFZNhy3n8 3rE5PccIbHayTQK9ONr2dKGBiTe39rUwzfb+FeN3icnOIvFieX11U6Adjs61BpW2MsnK iQqQ== X-Gm-Message-State: AOJu0Yyg+4hMw+Cz6GyBh7EWPqyrBWXGCR9pltNw+8tddeW1dcWlIBUE 16Qdp1zzjkHZHARz1p1ZiROOsemDAaM49gpQ21RI0RraNr2oeRJfeHyZzXc4WEIyseRPcz1CpMa m0CI= X-Gm-Gg: ASbGncvsDz0DTD0R4bvjQClZGGreYK9gOHm4XN+bkboD1ByT76Te5kDL6361HRZ7d98 XDo2bYVZFqvatPHVw8F3etk2XkSDy4UTTZquMumbdf1svq7wWgE2XME0asWvyCVMl9yUWcZpGta bKjTxSwDxUq1OdIENQzoyYMlslhTGdCVtVh9OaCMgbvSd0REJDV5Q9YDA1YxmkKg9gwwEgCrCNT CFUh5T5ZU2b8XYm28I9wuZpQxgMCDbY/rNBfJpVe14WLffJXc8Ibyh24Kl3gXtYyDRW2mm4lFvk f2S6sRoCoI7TzwJFHgUE+bO2frYuYWmWwMRt/49X8jZQ X-Google-Smtp-Source: AGHT+IGXBMPZV3pKxE3kbnvFv67XaZmF+3jLiMcRDIvwoyctOcpXqWVJtM2TBXtUgdoIVmH5D1Ndww== X-Received: by 2002:a05:6000:1acd:b0:38a:88be:bcb5 with SMTP id ffacd0b85a97d-38bf56555f4mr14225672f8f.5.1737469557655; Tue, 21 Jan 2025 06:25:57 -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-38bf322aab8sm13695067f8f.57.2025.01.21.06.25.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 21 Jan 2025 06:25:57 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-riscv@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Subject: [PATCH 28/28] cpus: Remove CPUClass::has_work() handler Date: Tue, 21 Jan 2025 15:23:41 +0100 Message-ID: <20250121142341.17001-29-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250121142341.17001-1-philmd@linaro.org> References: <20250121142341.17001-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=philmd@linaro.org; helo=mail-wr1-x430.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+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(), asserting SysemuCPUOps::has_work is always registered. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 2 -- hw/core/cpu-common.c | 6 ------ hw/core/cpu-system.c | 8 ++------ 3 files changed, 2 insertions(+), 14 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/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..7f287984aa6 100644 --- a/hw/core/cpu-system.c +++ b/hw/core/cpu-system.c @@ -25,12 +25,8 @@ 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); + g_assert(cpu->cc->sysemu_ops->has_work); + return cpu->cc->sysemu_ops->has_work(cpu); } bool cpu_paging_enabled(const CPUState *cpu)