From patchwork Fri Sep 24 09:38:08 2021 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: 1532141 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=Z+ZVrJA7; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4HG6T111m2z9sX3 for ; Fri, 24 Sep 2021 19:40:05 +1000 (AEST) Received: from localhost ([::1]:48948 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mThgY-0002eK-R2 for incoming@patchwork.ozlabs.org; Fri, 24 Sep 2021 05:40:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41032) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mThfV-0002bW-BR for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:38:57 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:44933) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mThfT-0005rk-PY for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:38:56 -0400 Received: by mail-wr1-x434.google.com with SMTP id d6so25365641wrc.11 for ; Fri, 24 Sep 2021 02:38:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5Bzxb+cyFW2fTjguo4+D1GgUMJzgo2oIaa6x4dhI9M8=; b=Z+ZVrJA7B+LRhlph252Bs05w8qRernFAcR0uaW2EqZLIaeL87gO8XvD5r4bZvNkp3+ hX1EJqJbuippSwE2WDYNrROZL+rBetx42PlK+8wrhGeLsOGgUGPblfRoclfGG3tfCD8u eBI9iXodHTu4cufWPSR+WxyXzPIObVXP8ArcVDSr/vlzcvRGCwDLdZr/Wgz90lKfUY2X VYUokkVXMJ0JPMQprbFAppj22boPdVagE8pWBhyciFYNxDEwamnxrhXfsA4rT/riAhY4 bbdYIb6pIWaeV5dgSnR9Q0TviODcmzuX3San6zlU6rCX7RAU8jGc5jtP5o00lXg3s9rh wKbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=5Bzxb+cyFW2fTjguo4+D1GgUMJzgo2oIaa6x4dhI9M8=; b=5RlNJwvIEWt4WUrI7XfxjwKL0OnuWxLYY3PpJ7Vmumy+TsHH9HQ4hnDLBaz80N93R6 DZQZbeHQlTa1wxFXMStp7gKWvMJNP3g0pwMVAHADO0JPALeyJDCkrLZGrg+EPUDP2v0M hRlyY0VzK6pfR1BPa3+1cazVQWRw+GrU4P6ySVSlN5ZKe0Ou8TgbWIDm9sLE1ShLeQ9O eGsWA+GnacFlHKDRoWsDQaLITm9XopDSqBG4eOF/S8wIoQ8O5SypWz6HUmQis2UwWHVp RJI/dCoDJ+m8FZQFjgsfOUS+LbKTwAM0nSNaVpeIumXhSBLL/8O/mihqUTaMPFIILTts d+Jw== X-Gm-Message-State: AOAM531jL3CTF/D45Wjt12UAf8wkVcTWtZkllveUnxfwqel65NJP+fbW XQqJIJtI0xmjhXSDaX/3oFj+dCnJM7Y= X-Google-Smtp-Source: ABdhPJyEXLnBJ5FQO1c2ws6DQTUoRXlRdbtMRIFIWPeSVBvWTRWmUt4mhI0LSmwm06Oty6TGQxjWjg== X-Received: by 2002:adf:e44f:: with SMTP id t15mr10482837wrm.394.1632476334139; Fri, 24 Sep 2021 02:38:54 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id q126sm11435167wma.10.2021.09.24.02.38.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 02:38:53 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v6 01/40] accel: Simplify qemu_init_vcpu() Date: Fri, 24 Sep 2021 11:38:08 +0200 Message-Id: <20210924093847.1014331-2-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210924093847.1014331-1-f4bug@amsat.org> References: <20210924093847.1014331-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x434.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" cpus_register_accel() already checks for ops->create_vcpu_thread being non-NULL, so it is pointless to re-check for it in qemu_init_vcpu(). Signed-off-by: Philippe Mathieu-Daudé --- softmmu/cpus.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/softmmu/cpus.c b/softmmu/cpus.c index 071085f840b..646326b24fd 100644 --- a/softmmu/cpus.c +++ b/softmmu/cpus.c @@ -604,7 +604,10 @@ void cpu_remove_sync(CPUState *cpu) void cpus_register_accel(const AccelOpsClass *ops) { assert(ops != NULL); - assert(ops->create_vcpu_thread != NULL); /* mandatory */ + + /* Mandatory non-NULL handlers */ + assert(ops->create_vcpu_thread != NULL); + cpus_accel = ops; } @@ -626,7 +629,7 @@ void qemu_init_vcpu(CPUState *cpu) } /* accelerators all implement the AccelOpsClass */ - g_assert(cpus_accel != NULL && cpus_accel->create_vcpu_thread != NULL); + g_assert(cpus_accel != NULL); cpus_accel->create_vcpu_thread(cpu); while (!cpu->created) { From patchwork Fri Sep 24 09:38:09 2021 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: 1532142 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=Pa9TAG3D; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4HG6T91Qlgz9sX3 for ; Fri, 24 Sep 2021 19:40:13 +1000 (AEST) Received: from localhost ([::1]:49184 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mThgg-0002oy-TT for incoming@patchwork.ozlabs.org; Fri, 24 Sep 2021 05:40:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41072) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mThfZ-0002kD-Jg for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:39:03 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:45949) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mThfY-0005wS-9D for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:39:01 -0400 Received: by mail-wr1-x434.google.com with SMTP id d21so25358911wra.12 for ; Fri, 24 Sep 2021 02:38:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=v/6Xo0TImgBm2K/shdcIyB243lN4oaXhrr/liWYNm+w=; b=Pa9TAG3DJJNK60sjEqpoeDmA5Ja/hj8QumRUf3uvdx8KtTwf7Db64hlkgabldj/bgr w6UgkL2fGHrya1aOpmSDbYmhs0nmg1RfYZBuzVEx/l3pxiRslAE93ncb9NQ2owsY2RQV YAI9fUzxrQvJxCEToZvURcG28wKKOUFMXjt5ZycSM6W35BE4NFCIdVn71KZ6hpStsTkg hmjtGORbtz8XrFcfxWw2vkhckEz2pjbRztnT+y4lB1V/MqyRcl9FL4lFia6d5UlRxXBS yT8TkUGFNxvLS0iwxk6MK0yWevpgf4+8RPyykY2PKPeZSyJGK8A36kykXuJtSA32jfJQ OHGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=v/6Xo0TImgBm2K/shdcIyB243lN4oaXhrr/liWYNm+w=; b=19JEwu3rA27yTIDVR3roKxgXrPRvj6vgsTCsCzVw64C9Qr5KzWtA6CKMF2x9mNEx+Q 3QL23IBTY77fn6RMUnrhDIZt5u/x3XFYcVs5CQdO2y2vNbhAlGBm+b7Hzu+vwT/fcgHm AWybPdh1DzYW0ZXMAOitp8xBwG6RMUDE0oxN5OIFHXSQlMOFiSL226o2p4psdIU130f7 IB2BdHeWmO0HbAHpqDsvFs/HCzZ9u+P0rsry1oNDcUa0DvujT7z3SY2m3bzpt/vlyONa ukPKwzD/lkJrg4bhUHysKOxzV9C3/FREHQKWAKC8UVt3UKbfHLN/la76LFmDiqpNJoDB YDzw== X-Gm-Message-State: AOAM531lsOdZXvTyQsVttzXSAV3RItNsWp3vwd9RSIsLcjHe4LyXhzHb mcp+WYoYwNkRgLAP8ByzcFit2kKbBNU= X-Google-Smtp-Source: ABdhPJzhrnXA0uhl2pqV0q5B3dpoBOUbVOmIkvNTuLFX1nY/29IPrGM2JLjn3E6eMtqMs62Y3cpC9g== X-Received: by 2002:adf:ef48:: with SMTP id c8mr10126026wrp.349.1632476338844; Fri, 24 Sep 2021 02:38:58 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id c14sm7622119wrd.50.2021.09.24.02.38.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 02:38:58 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v6 02/40] accel/tcg: Restrict cpu_handle_halt() to sysemu Date: Fri, 24 Sep 2021 11:38:09 +0200 Message-Id: <20210924093847.1014331-3-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210924093847.1014331-1-f4bug@amsat.org> References: <20210924093847.1014331-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x434.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Commit 372579427a5 ("tcg: enable thread-per-vCPU") added the following comment describing EXCP_HALTED in qemu_tcg_cpu_thread_fn(): case EXCP_HALTED: /* during start-up the vCPU is reset and the thread is * kicked several times. If we don't ensure we go back * to sleep in the halted state we won't cleanly * start-up when the vCPU is enabled. * * cpu->halted should ensure we sleep in wait_io_event */ g_assert(cpu->halted); break; qemu_wait_io_event() is sysemu-specific, so we can restrict the cpu_handle_halt() call in cpu_exec() to system emulation. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/cpu-exec.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 75dbc1e4e33..5fd1ed34222 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -588,8 +588,9 @@ static inline void tb_add_jump(TranslationBlock *tb, int n, static inline bool cpu_handle_halt(CPUState *cpu) { +#ifndef CONFIG_USER_ONLY if (cpu->halted) { -#if defined(TARGET_I386) && !defined(CONFIG_USER_ONLY) +#if defined(TARGET_I386) if (cpu->interrupt_request & CPU_INTERRUPT_POLL) { X86CPU *x86_cpu = X86_CPU(cpu); qemu_mutex_lock_iothread(); @@ -597,13 +598,14 @@ static inline bool cpu_handle_halt(CPUState *cpu) cpu_reset_interrupt(cpu, CPU_INTERRUPT_POLL); qemu_mutex_unlock_iothread(); } -#endif +#endif /* TARGET_I386 */ if (!cpu_has_work(cpu)) { return true; } cpu->halted = 0; } +#endif /* !CONFIG_USER_ONLY */ return false; } From patchwork Fri Sep 24 09:38:10 2021 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: 1532145 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=WLY7+TOk; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4HG6YL4gVJz9sX3 for ; Fri, 24 Sep 2021 19:43:50 +1000 (AEST) Received: from localhost ([::1]:57282 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mThkC-0000FZ-BT for incoming@patchwork.ozlabs.org; Fri, 24 Sep 2021 05:43:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41088) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mThfe-0002p4-FL for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:39:06 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:44929) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mThfd-000607-0j for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:39:06 -0400 Received: by mail-wr1-x42d.google.com with SMTP id d6so25366862wrc.11 for ; Fri, 24 Sep 2021 02:39:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tcpBP/9O11lxH2OkY3DQ1OAE3IFU4nJ2jfhNdgzdGjo=; b=WLY7+TOk/x3MxGIBWFNhGUNSBik56JD0m+P7Kt0ZcaeIA9YpEwGM5Qsi+S5zh5nrHr UbpgVVcAgadzYKqxRs/bZ3nHkFfj3jWBRiFSocCVJ0B5kuQEuV3XkfFa0DYCI5qacq9k wejFgzHUtWnGvsj6ZFIp1tt6z1XeFjEWbDrzwFl2PSCDfl6fDVsfq1ow039vvRsRRM5s IhOdjr1dToXzmRu4Eo0i7eW+5wb2Zx1c2uF9YQE4fGdKMNbYihwEMXbWATSE5zH2Ov2t FmuOFunbalKKu6IzesVW2HqbljUPQ5dAsltiq8dqmHq0BBf4UuRx6oDN8Fx7/qo1oFFt iOPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=tcpBP/9O11lxH2OkY3DQ1OAE3IFU4nJ2jfhNdgzdGjo=; b=kcfUSU2g69Hh2FwpcRFFTYlgM5lgWg7+KtdaN1weFZs4hOK1N8eEL34eXh7/Cu0bOZ jqFVWeWJO9GMPegdgMjk5JWnxFkYxyZkEY04TxPKAchi38Fpu5ZRaPrlXmKHW1yx4Nzx nX0zgd2RmLNpd0jnpAuYmpkK/sp6AOUBaOkpwlxjwNKmw3GY5TwQGNIIbm1SH06NOtBq jvxWZYnpHahdo+CPk1ZaxMmn2Fe+DCj2OFjdqgbNfbCNEmPGWs9CguQ6WeNj/7kVXWKt /DmIJGdaMsVUl/I6BqpMaLLDHYB0QLX9xFhRYFrmY6aUBeP4pr94yeF0v1EcQwu3sG2m Pd+w== X-Gm-Message-State: AOAM532GDUIMrzkusmKnzwXR83GJPXXUo3LSID91XDAeNsmkDOUbVkX/ znI3dEAHY4d6BucxZWr1iB1juOMsPqg= X-Google-Smtp-Source: ABdhPJxw76TXcxjMtX6av9tiKhPOijBdHW9A/O/opESJjSyXGHgMGLoZ8t4VqmFCpHCnAM53AweWAQ== X-Received: by 2002:a7b:c20f:: with SMTP id x15mr1053776wmi.59.1632476343524; Fri, 24 Sep 2021 02:39:03 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id n19sm1325752wms.47.2021.09.24.02.39.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 02:39:03 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v6 03/40] hw/core: Restrict cpu_has_work() to sysemu Date: Fri, 24 Sep 2021 11:38:10 +0200 Message-Id: <20210924093847.1014331-4-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210924093847.1014331-1-f4bug@amsat.org> References: <20210924093847.1014331-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x42d.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Eduardo Habkost Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" cpu_has_work() is only called from system emulation code. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index bc864564cee..2bd563e221f 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -538,6 +538,22 @@ enum CPUDumpFlags { void cpu_dump_state(CPUState *cpu, FILE *f, int flags); #ifndef CONFIG_USER_ONLY +/** + * 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) +{ + CPUClass *cc = CPU_GET_CLASS(cpu); + + g_assert(cc->has_work); + return cc->has_work(cpu); +} + /** * cpu_get_phys_page_attrs_debug: * @cpu: The CPU to obtain the physical page address for. @@ -636,22 +652,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) -{ - CPUClass *cc = CPU_GET_CLASS(cpu); - - g_assert(cc->has_work); - return cc->has_work(cpu); -} - /** * qemu_cpu_is_self: * @cpu: The vCPU to check against. From patchwork Fri Sep 24 09:38:11 2021 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: 1532151 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=X8jSb8nl; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4HG6d856H4z9sX3 for ; Fri, 24 Sep 2021 19:47:08 +1000 (AEST) Received: from localhost ([::1]:37584 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mThnO-00064p-CG for incoming@patchwork.ozlabs.org; Fri, 24 Sep 2021 05:47:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41116) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mThfj-0002ux-IH for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:39:12 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:41536) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mThfi-00064U-2x for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:39:11 -0400 Received: by mail-wr1-x434.google.com with SMTP id w29so25411158wra.8 for ; Fri, 24 Sep 2021 02:39:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Q67ayF6mp3x5mowVghP1HWubdfr0XK9yIREcYkI/kjw=; b=X8jSb8nlvy5DUpq4TReP05C74t8DlQTUjC9WZyHg9+N597Hi1Q7xk+7LGFGfJ1rj9q G6pMzt/xI0ZVBxcI7p6dQaCTAchymKCBWOxxR7iyM2HqcKwOnxGYUO7NIQ1fu3H5LbCY +ar/LzCQ+2nnLUAbrSE7G5EjhAvSenY8urSQuT74OFjK5MWL9ZLc//Rgo4PAfIDI6wol Ym3nEke8uC7jWo9iO4+Dtxg0GJsyV+ozUT28S9Q2C0eNxC/S/VhT9ISeTTcbvHSgmUgx acl2iVfvfVdM5ENxLspEl5+THSFKEC60KXHx03yHZRe61bl/yO9OogSbcRu74pQ95zpg Um6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=Q67ayF6mp3x5mowVghP1HWubdfr0XK9yIREcYkI/kjw=; b=QkyUF/CZfpyZ5yAoN6ZMd8oEm3RCq2DXRSrB1uXNZ/lwdKZEZ75B0Zpz0wkb2XDvRm rhxBLeXSfYj5e9sP0iVqXFqujg2+j3xxuo8tQyV/xvtCcyyXYwIzbZIhvEd8/z7ChAVd r+swV4jnDyTyDoPCRwVtm2duljFyHjPfjLmpIbIp8NdR/DWhelBBf338fFRgzzsssBD6 AhckFYfEl96NQmnFB3m6Hezvfdy8+3JzKgJwNSY+Xd/mx8h1/lG89U2lWk3VRQO2igJS n1XBagtomzfYULGyhyvrJgYyNIkv/yf3Y5QqFvF0kQ/lULeCj1hkcjhy6XMm0X/XfUWe RnmQ== X-Gm-Message-State: AOAM531SIYl1A4LZEL6iryGUSAt8D8X+TDvgfLP8kyqXXEvBAlbuLV0R C2mfH/RJnmiCG4M+4ioqkVCwcdA92dc= X-Google-Smtp-Source: ABdhPJxyM6ks6f/AtXulz0XTwPp/1u7KfSSyfo+XwK0vrDjMgXFmljXnDBube4Y4Mvua0waVnfMNfg== X-Received: by 2002:a1c:9dd2:: with SMTP id g201mr1046586wme.46.1632476348340; Fri, 24 Sep 2021 02:39:08 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id s2sm7438491wrn.77.2021.09.24.02.39.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 02:39:07 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v6 04/40] hw/core: Un-inline cpu_has_work() Date: Fri, 24 Sep 2021 11:38:11 +0200 Message-Id: <20210924093847.1014331-5-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210924093847.1014331-1-f4bug@amsat.org> References: <20210924093847.1014331-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x434.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Eduardo Habkost Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" We want to make cpu_has_work() per-accelerator. Only declare its prototype and move its definition to softmmu/cpus.c. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 8 +------- softmmu/cpus.c | 8 ++++++++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 2bd563e221f..e2dd171a13f 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -546,13 +546,7 @@ void cpu_dump_state(CPUState *cpu, FILE *f, int flags); * * Returns: %true if the CPU has work, %false otherwise. */ -static inline bool cpu_has_work(CPUState *cpu) -{ - CPUClass *cc = CPU_GET_CLASS(cpu); - - g_assert(cc->has_work); - return cc->has_work(cpu); -} +bool cpu_has_work(CPUState *cpu); /** * cpu_get_phys_page_attrs_debug: diff --git a/softmmu/cpus.c b/softmmu/cpus.c index 646326b24fd..6a05860f7fe 100644 --- a/softmmu/cpus.c +++ b/softmmu/cpus.c @@ -251,6 +251,14 @@ void cpu_interrupt(CPUState *cpu, int mask) } } +bool cpu_has_work(CPUState *cpu) +{ + CPUClass *cc = CPU_GET_CLASS(cpu); + + g_assert(cc->has_work); + return cc->has_work(cpu); +} + static int do_vm_stop(RunState state, bool send_stop) { int ret = 0; From patchwork Fri Sep 24 09:38:12 2021 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: 1532146 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=dtaPENSH; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4HG6YS2CC3z9sX3 for ; Fri, 24 Sep 2021 19:43:56 +1000 (AEST) Received: from localhost ([::1]:57694 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mThkI-0000XY-0B for incoming@patchwork.ozlabs.org; Fri, 24 Sep 2021 05:43:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41168) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mThfp-000302-3l for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:39:19 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:42858) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mThfn-00068d-0w for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:39:16 -0400 Received: by mail-wr1-x433.google.com with SMTP id i24so9556879wrc.9 for ; Fri, 24 Sep 2021 02:39:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0AqKBFC+aFLNQwO8nQ0Y0K7FTRMmlUnvtkKFuSqHBPM=; b=dtaPENSHWgqPCqi+uk96kCR07UH/mqS1ORNhhtTyDM7hhadwpEy6Szr93fFMW0qjEF MVUbQ7hiiWAlWh+x2FJyHgwxu3DxQEOc1CWdWo6xS+oqjuu23Tj84K/2nixMYCXv97I9 NQ41qjmmFdQA3SCCl043i6iA4DqFqTlyPTCqiPzDAX/2fDnFF6MTPoyThhmhFw+9yOmE 9QEDItSxG5RKsUfyTFScLRrYQeYNcQk0YnVa4CRAsJqyMK3dNEQYjlL3EzULFEFVY0Ia 4Akhyp41ZIRPRLfRTi5gEOwWRjdooMOgBxkm58BARyTjnY13OJz5D4Lev9IlsUAoId6r mDZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=0AqKBFC+aFLNQwO8nQ0Y0K7FTRMmlUnvtkKFuSqHBPM=; b=wONluHZ+ee9Bf1ODBWQkDblnhu7flfXUaI8he0r5kE/0yMl2jh6JPIB5uCXNXbv7eA 1lgvlSmMInwoy2ub7e5IWoIQmc9AjU8f33vIDlHXhttn6wITgcdtRrj3rgIz6uuM8iIP oO/x5T/5YMQD5atCbfMk2Rz0JHF+1kDt4WrHCZY21RJ2ExSdcBnSfoupTQX1V+0GuI5s r2vkhr4CVywDVNO2ZR6fLh7zAY8BvmKYcGRdiOEvabZUzKNNTKSne718eH7fLr3AQZMg jkAjeavlvwKoaZC5jtDgI2tms4sG5sOodOpfpeO4GbtJ9yG5TlFz3+eEcKreEjZU53E8 RhXg== X-Gm-Message-State: AOAM532lBGRbU0XI5JSsoNrICuLl7sVtJlz7GBm1jktY/2tek/7LWj0j O7ilHe+kx74bjaRLIkZwGgI3959W/fo= X-Google-Smtp-Source: ABdhPJz9UK14yoXE1B3z9UZMUIsew3qRgZpVt2fmKtsCDzDAOGrjCPlzJrS0FAx9kT0lPHVHEVdVUw== X-Received: by 2002:a7b:c148:: with SMTP id z8mr1012888wmi.160.1632476353468; Fri, 24 Sep 2021 02:39:13 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id q3sm6362677wmc.25.2021.09.24.02.39.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 02:39:12 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v6 05/40] hw/core: Move cpu_common_has_work() to cpu_has_work() Date: Fri, 24 Sep 2021 11:38:12 +0200 Message-Id: <20210924093847.1014331-6-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210924093847.1014331-1-f4bug@amsat.org> References: <20210924093847.1014331-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x433.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" cpu_class_init() always register cpu_common_has_work() as CPUClass::has_work() handler, so the assertion check in cpu_has_work() is pointless. Since cpu_common_has_work() simply returns 'false', we can inline it in cpu_has_work(), improving the function readability. Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- hw/core/cpu-common.c | 6 ------ softmmu/cpus.c | 6 ++++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index e2f5a646046..5ed1ccdfdd5 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -143,11 +143,6 @@ static void cpu_common_reset(DeviceState *dev) } } -static bool cpu_common_has_work(CPUState *cs) -{ - return false; -} - ObjectClass *cpu_class_by_name(const char *typename, const char *cpu_model) { CPUClass *cc = CPU_CLASS(object_class_by_name(typename)); @@ -279,7 +274,6 @@ static void cpu_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/softmmu/cpus.c b/softmmu/cpus.c index 6a05860f7fe..accb20f0589 100644 --- a/softmmu/cpus.c +++ b/softmmu/cpus.c @@ -255,8 +255,10 @@ bool cpu_has_work(CPUState *cpu) { CPUClass *cc = CPU_GET_CLASS(cpu); - g_assert(cc->has_work); - return cc->has_work(cpu); + if (cc->has_work && cc->has_work(cpu)) { + return true; + } + return false; } static int do_vm_stop(RunState state, bool send_stop) From patchwork Fri Sep 24 09:38:13 2021 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: 1532143 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=EvaFRens; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4HG6Tx0Wlsz9sX3 for ; Fri, 24 Sep 2021 19:40:53 +1000 (AEST) Received: from localhost ([::1]:50686 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mThhK-00041x-Pu for incoming@patchwork.ozlabs.org; Fri, 24 Sep 2021 05:40:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41184) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mThft-000321-HF for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:39:22 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:42851) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mThfr-0006Co-GL for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:39:20 -0400 Received: by mail-wr1-x42a.google.com with SMTP id i24so9557442wrc.9 for ; Fri, 24 Sep 2021 02:39:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ka2Zs6W/m1VUMtJW+H1oHcUfryePq3cXFIahmgjrmno=; b=EvaFRensYZxh9D5PT9akRhICWZWJ/6eumSUu4f0GcnI+T0iuwWj7HjkXDwIWYVIxnV BrEaCV77i2oFP28AQLSnQSne7lR7ifHy+5iVH++n6XBFSu6A3LlBwtAi5XtAqoab2biu jVN2Q+bIPnlmG5Xpol3pdgCSuK2mafnh8xZvU6A8GTDNPWeF5wW4tkrtuFB+ipMOV0v6 Q48579hx0dSgs4Xn3jqNwaBmmVF8WJWl14W9seoGpztq/Z1sj6gOVSATa7mHEHF/S/q/ L9m4TFLgBOI6XQ2GKTUOoZyF3J9EBirMGMOh5n0Y/VAQSy7VtlKVlIzeaYPCWMTqHqYp MQZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ka2Zs6W/m1VUMtJW+H1oHcUfryePq3cXFIahmgjrmno=; b=wZYdL7TUmcp24b/vd6Y9fc0/h7FpZOppUALIMVVZ/W8KpoYNr7E8Ri6Xs53Y3LV0rd KhX0mSESaIJOtLZ7mzDoFa+0d3e2bDMqcv1qPCQ257DN0XDXVtdGOQ4nMM4F9lDcJEgY gnuEmfKi0eqi/L6T6foCVFEWZOTZ2Y7wIUYkSmGI0ovLCMZ2qLdVY8pzUIuO2RjwHnxe b11fei8YQEPVv1V7p8Y5yUi4cPlXkNvHibMEi/4ZhtZLkeYKpvu8WvlLHm32ruwtH11/ 1p/eYFBw1uD/H9RDdF6HJVAkmMs+DRJXSDHvvBwrl7hkWtgrn/KoJ/kOTg3ZOH+q8FX3 eTdQ== X-Gm-Message-State: AOAM530foWVkT1Q/1QvNcnNspSPZ9qqIlqzPgXGxVlOf1MtIAvT9WxRf OdQwlAjiXq5teVD2fq71tT+EWZ3dN6Y= X-Google-Smtp-Source: ABdhPJxzjmqTC5K7mNYDuSfrC51vDvMquYGGU0SuXIsSr7WzqPVqQy8zk4b1Iq3JxKArB7cgB+AEEw== X-Received: by 2002:adf:e783:: with SMTP id n3mr1369078wrm.37.1632476358111; Fri, 24 Sep 2021 02:39:18 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id 20sm12861271wme.46.2021.09.24.02.39.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 02:39:17 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v6 06/40] accel: Introduce AccelOpsClass::has_work() Date: Fri, 24 Sep 2021 11:38:13 +0200 Message-Id: <20210924093847.1014331-7-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210924093847.1014331-1-f4bug@amsat.org> References: <20210924093847.1014331-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x42a.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Introduce an accelerator-specific has_work() handler. Eventually call it from cpu_has_work(). Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- include/sysemu/accel-ops.h | 5 +++++ softmmu/cpus.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/include/sysemu/accel-ops.h b/include/sysemu/accel-ops.h index 032f6979d76..de83f095f20 100644 --- a/include/sysemu/accel-ops.h +++ b/include/sysemu/accel-ops.h @@ -31,6 +31,11 @@ struct AccelOpsClass { void (*create_vcpu_thread)(CPUState *cpu); /* MANDATORY NON-NULL */ void (*kick_vcpu_thread)(CPUState *cpu); + /** + * @has_work: Callback for checking if there is work to do. + */ + bool (*has_work)(CPUState *cpu); + void (*synchronize_post_reset)(CPUState *cpu); void (*synchronize_post_init)(CPUState *cpu); void (*synchronize_state)(CPUState *cpu); diff --git a/softmmu/cpus.c b/softmmu/cpus.c index accb20f0589..85b06d3e685 100644 --- a/softmmu/cpus.c +++ b/softmmu/cpus.c @@ -258,6 +258,9 @@ bool cpu_has_work(CPUState *cpu) if (cc->has_work && cc->has_work(cpu)) { return true; } + if (cpus_accel->has_work && cpus_accel->has_work(cpu)) { + return true; + } return false; } From patchwork Fri Sep 24 09:38:14 2021 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: 1532152 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=Ww8e5hZD; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4HG6dY4yyMz9sX3 for ; Fri, 24 Sep 2021 19:47:29 +1000 (AEST) Received: from localhost ([::1]:38208 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mThnh-0006TH-PF for incoming@patchwork.ozlabs.org; Fri, 24 Sep 2021 05:47:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41200) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mThfx-00039T-QX for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:39:28 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:45951) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mThfw-0006GB-AJ for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:39:25 -0400 Received: by mail-wr1-x42e.google.com with SMTP id d21so25362189wra.12 for ; Fri, 24 Sep 2021 02:39:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=D1NIBiKsJLet/LtgtEl9N8uYnLoHyxQP991kqXpIcyw=; b=Ww8e5hZDWqw9JfWpbMGhlqI7pDDqNdcsWrhsNdLDPKqjDZuCT/aOjXMXb3ffPDz4JC q4k8WWznxOI4F1skYyZqEK49yp2FXUcThpTuvaBp4eAAxMqnxHpRgbgShH5w+bK6l+qN 5CbHVj/3aQaStowcB7zyX9sRrzHvahYpMf3OEf1LI3dUTj81LxjmhzocnrQtkABZT4bv pOjNSpXr+tK4BYdzodu+F7O/vsKfVbunl1/0JxhfUws8bpvBn7zud2onCKzhJiPhXEHd X+zYEuybb3KioSVSLtAJeCqSWblWl3MMoMNaTWjoQbL2AQSeoiHPEyH5HYcl/aJsxWDB pFFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=D1NIBiKsJLet/LtgtEl9N8uYnLoHyxQP991kqXpIcyw=; b=tPKyeSQ3aWfg0jzlziJcAKgXRduj9RS00ptobk0c5C//7lXcJPTvPRaRfWUFLw0Dy2 uybU+zKaU2Cd1OaFRgadmR/n+XTQrAlAVJw7ocqtLQhMeZ0X0DIG89E4F82SO1QZXg5e kt+g2kK4XJNAAvaIbZ3Z5Hns+W9Alydxkk9AcG4g5VT6y5UYkQECwYMyXMhXmPvR1UUN E27z3N6J2e8WqGkUCclP0/ssvGs3+sjJzxC+W7P0DjbZMKnBtoGL+YwUFgy8E0O2sF4k 4YBySHNKRVpPJEcSx4XCaXV62bCzLMeJSvJYl8m7L+FM2TeI0cdQ0vk5/VVyNbA3scZ1 sYwA== X-Gm-Message-State: AOAM5301p/qPzKxX0wBnV2EW7dAmCtFxJsGkltZ9qizLmAmb1FIF5O0+ 94S8Nl73aEu9TSS3zzqM4kCtP7dJoVs= X-Google-Smtp-Source: ABdhPJwoZCGo+hg2kmuMf981/dvpSfGlMLdZmtK66h5QoVdyf/I/omnPIeNLYPXTYxRqHVoRVka+SQ== X-Received: by 2002:a7b:c947:: with SMTP id i7mr1051357wml.136.1632476362750; Fri, 24 Sep 2021 02:39:22 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id m128sm5645595wme.0.2021.09.24.02.39.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 02:39:22 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v6 07/40] accel/kvm: Implement AccelOpsClass::has_work() Date: Fri, 24 Sep 2021 11:38:14 +0200 Message-Id: <20210924093847.1014331-8-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210924093847.1014331-1-f4bug@amsat.org> References: <20210924093847.1014331-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x42e.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , "open list:Overall KVM CPUs" Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Implement KVM has_work() handler in AccelOpsClass and remove it from cpu_thread_is_idle() since cpu_has_work() is already called. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- accel/kvm/kvm-accel-ops.c | 6 ++++++ softmmu/cpus.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/accel/kvm/kvm-accel-ops.c b/accel/kvm/kvm-accel-ops.c index 7516c67a3f5..6f4d5df3a0d 100644 --- a/accel/kvm/kvm-accel-ops.c +++ b/accel/kvm/kvm-accel-ops.c @@ -74,6 +74,11 @@ static void kvm_start_vcpu_thread(CPUState *cpu) cpu, QEMU_THREAD_JOINABLE); } +static bool kvm_cpu_has_work(CPUState *cpu) +{ + return kvm_halt_in_kernel(); +} + static void kvm_accel_ops_class_init(ObjectClass *oc, void *data) { AccelOpsClass *ops = ACCEL_OPS_CLASS(oc); @@ -83,6 +88,7 @@ static void kvm_accel_ops_class_init(ObjectClass *oc, void *data) ops->synchronize_post_init = kvm_cpu_synchronize_post_init; ops->synchronize_state = kvm_cpu_synchronize_state; ops->synchronize_pre_loadvm = kvm_cpu_synchronize_pre_loadvm; + ops->has_work = kvm_cpu_has_work; } static const TypeInfo kvm_accel_ops_type = { diff --git a/softmmu/cpus.c b/softmmu/cpus.c index 85b06d3e685..c9f54a09989 100644 --- a/softmmu/cpus.c +++ b/softmmu/cpus.c @@ -90,7 +90,7 @@ bool cpu_thread_is_idle(CPUState *cpu) return true; } if (!cpu->halted || cpu_has_work(cpu) || - kvm_halt_in_kernel() || whpx_apic_in_platform()) { + whpx_apic_in_platform()) { return false; } return true; From patchwork Fri Sep 24 09:38:15 2021 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: 1532148 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=NOXtP4ti; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4HG6ZR1WlXz9sX3 for ; Fri, 24 Sep 2021 19:44:47 +1000 (AEST) Received: from localhost ([::1]:59354 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mThl5-0001ga-LN for incoming@patchwork.ozlabs.org; Fri, 24 Sep 2021 05:44:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41212) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mThg3-0003Co-10 for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:39:31 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:39663) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mThg1-0006KZ-L3 for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:39:30 -0400 Received: by mail-wr1-x432.google.com with SMTP id r23so155370wra.6 for ; Fri, 24 Sep 2021 02:39:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vUe+1tkOVnIH977cfWQkm6Ao8Hfy7tcpnU7MaXPzIOo=; b=NOXtP4tivCAS91rDMAhwcVwUZzXzzbkSv+QjKJ53FeSn9Xi9BrrohzeIoOe083Auhf Rovu2J9tDQUgFTnOnJA0A8JS1Fh/vbSmLlgh8Z6CRoWsxqQF4+8H1ulArWxRhjbzp2RO BQr3FSkNYMVbFsYi+maJfwF0AV6r609/wpE1pmr8/O12OrMonO2p+PPNi1i3/d0RKyfM 8CvbEpYFwGLhhiS/TXF9BgXuMB1W3XMYVD6QgCr6i5t55wCHcvQ59GkoVaTDg7NjiSAk txaVcnhdtpKICqfoPxSdrKU6Cy0xajhMTjXKVO4I3Zj1rA0oKTlfrfRkFZR+Gyw6el64 a/9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=vUe+1tkOVnIH977cfWQkm6Ao8Hfy7tcpnU7MaXPzIOo=; b=1iAouwbhP8lQKYQrs3SFoFxwfAlc1eVfXxUE4XqPty2Wq5QbqhljBMeP/MPzrqNivF pU+4+MrI7V3EVdlu1sHGWlizOQyvssGX2/en+/WNE+1n8TXW47kDQk5+DfSkl7S0iteb 72AhESn3kVTDt8sNIvygFqZ2x40ddPjdHt2fA7iipV4pec8quCR+u41BbDVBmyyl4c0T HqtNCtGDCHit8O3Sa/xrKHcotELVDhgHbgpJjh6+YdUew6Sd0ziy3QT2mq/4GkR7Z5Wc b2q+jADsSavGmqOlD/YBLuhVvLvCR5p47CJLZMwv/7FGldt2bqamfvA0iKBo7j44SQmz 4sDw== X-Gm-Message-State: AOAM531szITLPoxunV3jE2tBwBo7mwk2sO/NCzlm4hXSfBONpTLOk6EY DDAyHq4Nn9/zG9wtObv8M+uQjKYhnhs= X-Google-Smtp-Source: ABdhPJxAfed0bikX3dT1RihVvD06PW1q4E6qZ3w02UQIER2y5HHf+TNjB7gg0sCIGuc2E7m2Gcfnug== X-Received: by 2002:a5d:4538:: with SMTP id j24mr10277773wra.348.1632476367315; Fri, 24 Sep 2021 02:39:27 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id n19sm1326723wms.47.2021.09.24.02.39.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 02:39:26 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v6 08/40] accel/whpx: Implement AccelOpsClass::has_work() Date: Fri, 24 Sep 2021 11:38:15 +0200 Message-Id: <20210924093847.1014331-9-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210924093847.1014331-1-f4bug@amsat.org> References: <20210924093847.1014331-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x432.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Sunil Muthuswamy , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Implement WHPX has_work() handler in AccelOpsClass and remove it from cpu_thread_is_idle() since cpu_has_work() is already called. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- softmmu/cpus.c | 4 +--- target/i386/whpx/whpx-accel-ops.c | 6 ++++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/softmmu/cpus.c b/softmmu/cpus.c index c9f54a09989..5ffa02f9cef 100644 --- a/softmmu/cpus.c +++ b/softmmu/cpus.c @@ -41,7 +41,6 @@ #include "sysemu/replay.h" #include "sysemu/runstate.h" #include "sysemu/cpu-timers.h" -#include "sysemu/whpx.h" #include "hw/boards.h" #include "hw/hw.h" #include "trace.h" @@ -89,8 +88,7 @@ bool cpu_thread_is_idle(CPUState *cpu) if (cpu_is_stopped(cpu)) { return true; } - if (!cpu->halted || cpu_has_work(cpu) || - whpx_apic_in_platform()) { + if (!cpu->halted || cpu_has_work(cpu)) { return false; } return true; diff --git a/target/i386/whpx/whpx-accel-ops.c b/target/i386/whpx/whpx-accel-ops.c index 6bc47c53098..1f9c6d52c27 100644 --- a/target/i386/whpx/whpx-accel-ops.c +++ b/target/i386/whpx/whpx-accel-ops.c @@ -83,6 +83,11 @@ static void whpx_kick_vcpu_thread(CPUState *cpu) } } +static bool whpx_cpu_has_work(CPUState *cpu) +{ + return whpx_apic_in_platform(); +} + static void whpx_accel_ops_class_init(ObjectClass *oc, void *data) { AccelOpsClass *ops = ACCEL_OPS_CLASS(oc); @@ -94,6 +99,7 @@ static void whpx_accel_ops_class_init(ObjectClass *oc, void *data) ops->synchronize_post_init = whpx_cpu_synchronize_post_init; ops->synchronize_state = whpx_cpu_synchronize_state; ops->synchronize_pre_loadvm = whpx_cpu_synchronize_pre_loadvm; + ops->has_work = whpx_cpu_has_work; } static const TypeInfo whpx_accel_ops_type = { From patchwork Fri Sep 24 09:38:16 2021 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: 1532155 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=qmujrEu3; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4HG6h50SD0z9sR4 for ; Fri, 24 Sep 2021 19:49:41 +1000 (AEST) Received: from localhost ([::1]:45966 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mThpq-0003DI-OK for incoming@patchwork.ozlabs.org; Fri, 24 Sep 2021 05:49:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41224) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mThg6-0003HU-T4 for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:39:34 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:40515) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mThg5-0006OD-Gd for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:39:34 -0400 Received: by mail-wr1-x436.google.com with SMTP id t28so12098017wra.7 for ; Fri, 24 Sep 2021 02:39:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=unRoKxdhmIQ/3+a2J4b34FjTNk3kwzqzxXg2lM7z0e4=; b=qmujrEu3hn7XgcVz9kAzGT/jAIzF8K/yOgPqjK8Lil7oWfw4w7gZeyRdBPI55MkkwV x2k5P5C8z6aFCWkQh2WPlMW8kf00hsNJFdIWCfXROCoYhO37u+mwQ1io51IzHcGCEtvw 0hhQ1FSqIJlJ9XYE7YcZNktmqkMRyR2hwppSjDfJeB4VFWuJPYxmrxl7+REEe6XvSw3a rY1I0kyRvC2fcyg1lzMt2eRUXkNUnWbpqtAMKDVZrGIrKfD2XWzKX42lTEqSpjPMx4dn P0ND3soSQexG9hZIhVBu/SXapPbhwGrYYkmYy0FXEjTOPSHmxBt7goJdY1DPkhmqmN7W 8rAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=unRoKxdhmIQ/3+a2J4b34FjTNk3kwzqzxXg2lM7z0e4=; b=sgfI+BHx6MedjjTjfaVfXyV6OqGObjJrSsIb4vbxIP1fMqNe99vfAltXqcyCnhZl5m rHbrfIjkx2VJNJpAvHO7EG7xVExDfiqS1TSwr5l/Z6e293eRKqQ4HWP9NDMPx4leWjx1 TlsCgqDWRQNSuMetm9orLregojYKkl45ek2FByo22Ip2O/ifBA+nLuCoDjroJlGU4s0e ivo/nu2I4ZRLdLafibAE2dDtEe3FgBOo9qATBXzTrHyr9dUJaUqacYaT/is2aTyujtQh 8rjgxAJqf9ORRJ1sHnvoAkO22Igdziyc/2UF1q4mPnOW26NKzMUuR5Nl2QkEPmv5vBwr AuHQ== X-Gm-Message-State: AOAM533FfbN2XRYJzu/nktdZzF6S/KRRZHMwsfwLOaHyUFaxvtUTUihD sVICU/LZdPx9xbeRjV9uUzN6e1ds+XM= X-Google-Smtp-Source: ABdhPJwoSWqS8c0rBTbISQPqY0TkK2y2mKEKENvpQ3aFNCqeowBkhiUwo/emexE2feG3h4xscjkCOA== X-Received: by 2002:adf:e806:: with SMTP id o6mr10005295wrm.239.1632476372032; Fri, 24 Sep 2021 02:39:32 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id r2sm8364089wrg.31.2021.09.24.02.39.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 02:39:31 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v6 09/40] accel/hvf: Implement AccelOpsClass::has_work() Date: Fri, 24 Sep 2021 11:38:16 +0200 Message-Id: <20210924093847.1014331-10-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210924093847.1014331-1-f4bug@amsat.org> References: <20210924093847.1014331-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x436.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Roman Bolshakov , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Cameron Esfahani Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Since there is no specific HVF handling for cpu_has_work() in cpu_thread_is_idle(), implement HVF has_work() handler as a simple 'return false' code. Signed-off-by: Philippe Mathieu-Daudé --- accel/hvf/hvf-accel-ops.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/accel/hvf/hvf-accel-ops.c b/accel/hvf/hvf-accel-ops.c index 93976f4ecea..ba7d4f20a35 100644 --- a/accel/hvf/hvf-accel-ops.c +++ b/accel/hvf/hvf-accel-ops.c @@ -454,6 +454,11 @@ static void hvf_start_vcpu_thread(CPUState *cpu) cpu, QEMU_THREAD_JOINABLE); } +static bool hvf_cpu_has_work(CPUState *cpu) +{ + return false; +} + static void hvf_accel_ops_class_init(ObjectClass *oc, void *data) { AccelOpsClass *ops = ACCEL_OPS_CLASS(oc); @@ -465,6 +470,7 @@ static void hvf_accel_ops_class_init(ObjectClass *oc, void *data) ops->synchronize_post_init = hvf_cpu_synchronize_post_init; ops->synchronize_state = hvf_cpu_synchronize_state; ops->synchronize_pre_loadvm = hvf_cpu_synchronize_pre_loadvm; + ops->has_work = hvf_cpu_has_work; }; static const TypeInfo hvf_accel_ops_type = { .name = ACCEL_OPS_NAME("hvf"), From patchwork Fri Sep 24 09:38:17 2021 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: 1532156 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=bfJDRUtH; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4HG6hG5nJgz9sR4 for ; Fri, 24 Sep 2021 19:49:50 +1000 (AEST) Received: from localhost ([::1]:46796 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mThq0-0003l9-FL for incoming@patchwork.ozlabs.org; Fri, 24 Sep 2021 05:49:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41236) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mThgB-0003Sb-Ux for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:39:39 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:38835) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mThgA-0006Rg-2O for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:39:39 -0400 Received: by mail-wr1-x430.google.com with SMTP id u18so25545820wrg.5 for ; Fri, 24 Sep 2021 02:39:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=I61ARzsVO4/KzAGYtcJMZn32sXSEJVm6F+jp7uLlVMM=; b=bfJDRUtHlsDizMGatZPk963VYYfAkBfTjsNmiwj/ymhx0kRc6VMLElf3zBqxnARhDn lgmgbrEhIGHtgHu/8x+tntzdV2SngC2qWF2GAwfvOtMhG+V42rxSWucJiP7xIrIGReXz l5t9jVP65mPF1GmicTiZGk4oLjys78iV6BtOhMY43Z6OA7grVc9JwzvqRzjqVuuxwUkC i1rYTGO8A5FNd3Xng6BsOrIPE1h+jG56FVJbFE/XhtVgUXtuAxE+HmINDUE2vF+hCr/y 7CIfaAlsit+sLqNVs49NVF94QACZCvY/8QbD4Llhgxgoqiw1AsyONwYLBrR6BOTi/Z/H 7hpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=I61ARzsVO4/KzAGYtcJMZn32sXSEJVm6F+jp7uLlVMM=; b=0ygSC8FshLWtxHWifv0TVklorsVRowrFIl5M/1S68q06/FaSir0Cbp45ulFeVw521Z x860czo9LK5ZNnp2gDfdfdULUrNi8ApbtYsinfLZmnWVJJnS04iB9KPPYgashi+wY91R myJxiCKGCPAi3krOLgC+ptB34Ws87S0HEHQLylcH7+in1c/QFpGogJ7eTFSM+2YHaxXC ACyJ0nq1ZvlxZN9Lpnurc5jpsa+6rxw34XBCO6O3kJ+ox9/tUxgcWTQ1zxIv0TccDf63 sGbvnAr5u7F5YesV0U0C8NPVxu6o+Rn17sn2opwKGS0SAt3GkcG29tehEJ2ClKVrlVza mV8w== X-Gm-Message-State: AOAM532FyVla3D8ABRttvcvsFXvXbwUw5eiVs3v4iHCB7h7Jaxs3XJXT BNuaz44gu4pXaHRF8QNvb8Niv/cI3J0= X-Google-Smtp-Source: ABdhPJzv1Bde65pNl0VvYERfNs+TTxQ5croc4mEh0wp0bxdkKK3MHRcKkC10fZSBqwi13saNHJwzfg== X-Received: by 2002:a7b:c459:: with SMTP id l25mr1077703wmi.60.1632476376611; Fri, 24 Sep 2021 02:39:36 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id c185sm8256519wma.8.2021.09.24.02.39.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 02:39:36 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v6 10/40] accel/xen: Implement AccelOpsClass::has_work() Date: Fri, 24 Sep 2021 11:38:17 +0200 Message-Id: <20210924093847.1014331-11-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210924093847.1014331-1-f4bug@amsat.org> References: <20210924093847.1014331-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x430.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Paul Durrant , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Anthony Perard , "open list:X86 Xen CPUs" Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Since there is no specific Xen handling for cpu_has_work() in cpu_thread_is_idle(), implement Xen has_work() handler as a simple 'return false' code. Acked-by: Paul Durrant Signed-off-by: Philippe Mathieu-Daudé --- accel/xen/xen-all.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/accel/xen/xen-all.c b/accel/xen/xen-all.c index 69aa7d018b2..fe5a37fa2e6 100644 --- a/accel/xen/xen-all.c +++ b/accel/xen/xen-all.c @@ -215,11 +215,17 @@ static const TypeInfo xen_accel_type = { .class_init = xen_accel_class_init, }; +static bool xen_cpu_has_work(CPUState *cpu) +{ + return false; +} + static void xen_accel_ops_class_init(ObjectClass *oc, void *data) { AccelOpsClass *ops = ACCEL_OPS_CLASS(oc); ops->create_vcpu_thread = dummy_start_vcpu_thread; + ops->has_work = xen_cpu_has_work; } static const TypeInfo xen_accel_ops_type = { From patchwork Fri Sep 24 09:38:18 2021 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: 1532159 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=IrGQXkW1; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4HG6ld54SGz9sxS for ; Fri, 24 Sep 2021 19:52:45 +1000 (AEST) Received: from localhost ([::1]:54556 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mThso-0000aI-E0 for incoming@patchwork.ozlabs.org; Fri, 24 Sep 2021 05:52:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41248) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mThgG-0003Zm-0O for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:39:45 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:45953) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mThgE-0006Vd-L7 for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:39:43 -0400 Received: by mail-wr1-x42a.google.com with SMTP id d21so25364663wra.12 for ; Fri, 24 Sep 2021 02:39:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dCLxbLnwCEUqojfStjhPo9ZalBzirYzUtLUPN9TYqi0=; b=IrGQXkW1n5HXVXm8l3rQZkFcWUN3GlQa7CXEGz/UbfUi8EvXCQbYCJ9sO0dgmdN709 SM/jH8+yBDg6sC6/ThbReQvDWwtCGZqALiKVqgaxE/naCXd9Q0/fpS8U3E2GdhO88VA3 hkRZqc35BeK4s3T/yxOFRf11qBqv1ZYbq0zgn3j/SZua9u6G4r0i7boQsWyncihUJLGP rvY0zojKDT0mXSVMzqyxBerdzsE63j3HqYzGIMxng9f0Ufu18FaIKuKLwAzY1V4kyfoG QZXkDV+Bdf2XQFwscX5fwn3C+Cg7lBPzOV8WMtqrmeJEh86OcRdQVSrj8s/vTlCRWPKu osXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=dCLxbLnwCEUqojfStjhPo9ZalBzirYzUtLUPN9TYqi0=; b=3EedwViIV9fKAJuVJWfOABTsjpZeN0B0bY2M8Koz1bXdcKkX8zTAsQt9ConJyucZOR c2kJ6DbKE1YV9EEt49ObDZvYvxDmXhnkNUh3YPAB8BtYwrl0N8pVRQkIfaIvsOoDCKlE 4SgR1DGTe3RFHLom35sA8yTULlhX9NI/Xc49wd4WoqZRYjO9PX9aX6oO1fW3WH4gcyba 2tZKVO4ofqOQ1fevZbx39qhsbWmVOvsjU/AxGbc/4tfJo3c/TQSDRZG4+9zrN0ZqGzV8 TUWJ0rRfQUkVDFdJESaA2ScN0bxcQ+MeNQJtiWwhmX02GUgHpTQwfKpgggBQYgHo2T4/ 386Q== X-Gm-Message-State: AOAM533mUj3QhWSB+I5ak0xNWEC5VPLzxtJN8RnpJpox/Ga7dblL2mXd fiFYmxiSVsbFQnxamLp0eEqvceJqiEY= X-Google-Smtp-Source: ABdhPJwDDNnd4J3DU7bH6DJfW2OgZOqw0H9ZdyajHTI5slOWsSAXNc3DrbyWYgWXp+6lzcgzKuLJIQ== X-Received: by 2002:a5d:4b4f:: with SMTP id w15mr10367662wrs.175.1632476381266; Fri, 24 Sep 2021 02:39:41 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id x21sm11744898wmc.14.2021.09.24.02.39.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 02:39:40 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v6 11/40] accel/hax: Implement AccelOpsClass::has_work() Date: Fri, 24 Sep 2021 11:38:18 +0200 Message-Id: <20210924093847.1014331-12-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210924093847.1014331-1-f4bug@amsat.org> References: <20210924093847.1014331-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x42a.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "open list:X86 HAXM CPUs" , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Colin Xu , Wenchao Wang Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Since there is no specific HAX handling for cpu_has_work() in cpu_thread_is_idle(), implement HAX has_work() handler as a simple 'return false' code. Signed-off-by: Philippe Mathieu-Daudé --- target/i386/hax/hax-accel-ops.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/target/i386/hax/hax-accel-ops.c b/target/i386/hax/hax-accel-ops.c index 136630e9b23..5407ba17eaf 100644 --- a/target/i386/hax/hax-accel-ops.c +++ b/target/i386/hax/hax-accel-ops.c @@ -74,6 +74,11 @@ static void hax_start_vcpu_thread(CPUState *cpu) #endif } +static bool hax_cpu_has_work(CPUState *cpu) +{ + return false; +} + static void hax_accel_ops_class_init(ObjectClass *oc, void *data) { AccelOpsClass *ops = ACCEL_OPS_CLASS(oc); @@ -85,6 +90,7 @@ static void hax_accel_ops_class_init(ObjectClass *oc, void *data) ops->synchronize_post_init = hax_cpu_synchronize_post_init; ops->synchronize_state = hax_cpu_synchronize_state; ops->synchronize_pre_loadvm = hax_cpu_synchronize_pre_loadvm; + ops->has_work = hax_cpu_has_work; } static const TypeInfo hax_accel_ops_type = { From patchwork Fri Sep 24 09:38:19 2021 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: 1532149 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=h3tkiY2k; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4HG6Zb5nTgz9sX3 for ; Fri, 24 Sep 2021 19:44:55 +1000 (AEST) Received: from localhost ([::1]:60104 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mThlF-0002Aa-HZ for incoming@patchwork.ozlabs.org; Fri, 24 Sep 2021 05:44:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41260) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mThgK-0003nW-Qz for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:39:48 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:35534) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mThgJ-0006aR-8m for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:39:48 -0400 Received: by mail-wr1-x434.google.com with SMTP id i23so25588934wrb.2 for ; Fri, 24 Sep 2021 02:39:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tl5Shev5pC48yBd7v32jcWMdVT27BoRgDVkMAOt+xfs=; b=h3tkiY2k0lHeSqtRriwt9QIC83HOiZiAKrcsDl8tQbBwa4WPBlqa1Orwxe9R9O4cs9 CWPEAqw3MPFnJq9fY2NBiOnvT4dsQ2v4zVPT+YobBKMrvS2a4emJ1KD5hPYAePG9QptX OHPUS/NyGTwTw1ArwaM5QcShpmvHmCJVDA6NWhzBJjoqPlFCFMtgIUwy0Wou9XnYrdf/ Vxv7ucrIHbM+lJEjTF74ZwWIGZVF4ZZ7h2OWu9KcZGl/+OuRvFhtlAcCfWXg5tl6mLvA tqvunK7SyObtxVQwIH7w9dYlRJ0LMpCA17thLnWOvdRjBz2awCnV0PYMnzcIzXG2F1o/ U06Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=tl5Shev5pC48yBd7v32jcWMdVT27BoRgDVkMAOt+xfs=; b=Z93Ascr0+XMRlsXPN5iLA7werD57u3AcPWkIYTAcr/jPyqHbRvCJ0TIg2VdD1hjh9a WsntmEgPFQKsGMnGPvUwuXdE8xuRQidQ10n6R7lu8MSxyaE+BiuFtPQUoy3Epizb565w abebFKDlRkwOUGbsxo2QOrV0SUBk+DDUeb2Y2aI4MstZBnYG5qTUenTGM9bEd9GzBl0F f004cuISF7L+4LKnI/YjstCfPPrfTHqrr8oLitbvlfAEadcERNSyvphgq3/7Ext4Bqsw gxglC5c08NaCzTSeb7A6O0hGkKQceUNI6NFry+SbIRf/76SLKhV25KMwslqLoUjjfnTr V2vQ== X-Gm-Message-State: AOAM532KdLgo1rK4P5E9Dm/AmycyxVBtUsOOxcmcEWUsAPxv2R6yYxVI flWruJL8JSomS86J5W/9XIImcziD0MQ= X-Google-Smtp-Source: ABdhPJxpSFfhBSDIUHhM4X9NLXTfO2llO8y8MDnrDunwT+GB1+QmAcUEuH5WSEM06DTsSFyKa8xDtQ== X-Received: by 2002:a5d:64e2:: with SMTP id g2mr10244900wri.323.1632476385844; Fri, 24 Sep 2021 02:39:45 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id j134sm14310026wmj.27.2021.09.24.02.39.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 02:39:45 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v6 12/40] accel/nvmm: Implement AccelOpsClass::has_work() Date: Fri, 24 Sep 2021 11:38:19 +0200 Message-Id: <20210924093847.1014331-13-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210924093847.1014331-1-f4bug@amsat.org> References: <20210924093847.1014331-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x434.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Reinoud Zandijk , Kamil Rytarowski , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Since there is no specific NVMM handling for cpu_has_work() in cpu_thread_is_idle(), implement NVMM has_work() handler as a simple 'return false' code. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Kamil Rytarowski --- target/i386/nvmm/nvmm-accel-ops.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/target/i386/nvmm/nvmm-accel-ops.c b/target/i386/nvmm/nvmm-accel-ops.c index f788f75289f..36296f79ff8 100644 --- a/target/i386/nvmm/nvmm-accel-ops.c +++ b/target/i386/nvmm/nvmm-accel-ops.c @@ -83,6 +83,11 @@ static void nvmm_kick_vcpu_thread(CPUState *cpu) cpus_kick_thread(cpu); } +static bool nvmm_cpu_has_work(CPUState *cpu) +{ + return false; +} + static void nvmm_accel_ops_class_init(ObjectClass *oc, void *data) { AccelOpsClass *ops = ACCEL_OPS_CLASS(oc); @@ -94,6 +99,7 @@ static void nvmm_accel_ops_class_init(ObjectClass *oc, void *data) ops->synchronize_post_init = nvmm_cpu_synchronize_post_init; ops->synchronize_state = nvmm_cpu_synchronize_state; ops->synchronize_pre_loadvm = nvmm_cpu_synchronize_pre_loadvm; + ops->has_work = nvmm_cpu_has_work; } static const TypeInfo nvmm_accel_ops_type = { From patchwork Fri Sep 24 09:38:20 2021 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: 1532163 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=f9ZL3EOw; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4HG6q939QGz9sRf for ; Fri, 24 Sep 2021 19:55:49 +1000 (AEST) Received: from localhost ([::1]:34760 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mThvn-0006Ds-4c for incoming@patchwork.ozlabs.org; Fri, 24 Sep 2021 05:55:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41288) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mThgP-00045o-Hp for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:39:53 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:44017) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mThgO-0006eO-5N for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:39:53 -0400 Received: by mail-wr1-x430.google.com with SMTP id w17so25392521wrv.10 for ; Fri, 24 Sep 2021 02:39:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=aLzuxgLTjxaUP4zi8sBdv28yd73Nm8j1vjkLU2rmh+g=; b=f9ZL3EOw/t0ewQ/J3qUr/XDg+2/vLXiO08wfQZMDath/X8ZF2LHytkPE6mXMpEYpPR sh0p3mkeEI1BCzJpnbrBKPhK6Qn6j5h+4WsfFSzaq1X57X2aZRiGrjDYQJBXHHjaf+Lr tZbI86ntZYeIJ9KAo/sIkpgSFo5zBy7QeOP2e+igZI3aNYcai36Z1d1HchBGjb029rlR 0gpAn5OumA47ALj9BFcFSTA6PI94Yk4m0a+WUwvKsVuCYWiDEsfogyG97r+R3zbfIyNY lzDeC/mzWAOWFegP9vBD6i5mnLUwADAs7iY6FrUUzUnIz64lugaagTZUAviIwTI7sPGx CT7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=aLzuxgLTjxaUP4zi8sBdv28yd73Nm8j1vjkLU2rmh+g=; b=vrW651lMzI/9m4DKmVdYqQtRKArmCYx2ghMTusl1EClTi1LGAJKRpCnEYcyPQXfOZQ pmXG/tmAQvfB3mTrf8TWSrwFnFOiBCv62rwqV9tZh0klBclEQLPOwn2dGClscj+VyjVk g7ZHQfHS7v2G7dC6ws8ybyspNjj6HGELTKvTkpXe1mLht0NdyFFvFEIeiMENTdfqXGOq S36FjOFBn89ClCxDC28KzeqG0lx1QsaZKj+BCFjRi4KcXSUaP5AwSSlMDL0tKb+BOYab y4A7L1eH54ZwkPNInk1s6ALM7NAf5LyS2Eewc4ktQoXIjqNtPNRpoT70chFmTEq+yFmc HtAQ== X-Gm-Message-State: AOAM530s7KxUI/7B4Eu7nAbW02GBckGAsV6HbJa/piEVfYds+9Y/PX/V fGaRq0KbavaJDqpq/+a81FqQ/VE0pgg= X-Google-Smtp-Source: ABdhPJxp/fayYxaCMCK/+TcvLqk2YoBMQJ5PaEhNYsJeXbQWsoZDyzGhocfAOG/2rhLTrLb40Dpdpg== X-Received: by 2002:adf:e404:: with SMTP id g4mr10220699wrm.143.1632476390668; Fri, 24 Sep 2021 02:39:50 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id y64sm8519500wmc.38.2021.09.24.02.39.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 02:39:50 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v6 13/40] accel/qtest: Implement AccelOpsClass::has_work() Date: Fri, 24 Sep 2021 11:38:20 +0200 Message-Id: <20210924093847.1014331-14-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210924093847.1014331-1-f4bug@amsat.org> References: <20210924093847.1014331-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x430.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Paolo Bonzini , Thomas Huth , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Implement QTest has_work() handler in AccelOpsClass. Since no CPU are available under QTest accelerator, this function is not reachable. Signed-off-by: Philippe Mathieu-Daudé --- accel/qtest/qtest.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/accel/qtest/qtest.c b/accel/qtest/qtest.c index 7e6b8110d52..903c39ec1bf 100644 --- a/accel/qtest/qtest.c +++ b/accel/qtest/qtest.c @@ -47,12 +47,18 @@ static const TypeInfo qtest_accel_type = { }; module_obj(TYPE_QTEST_ACCEL); +static bool qtest_cpu_has_work(CPUState *cpu) +{ + g_assert_not_reached(); +} + static void qtest_accel_ops_class_init(ObjectClass *oc, void *data) { AccelOpsClass *ops = ACCEL_OPS_CLASS(oc); ops->create_vcpu_thread = dummy_start_vcpu_thread; ops->get_virtual_clock = qtest_get_virtual_clock; + ops->has_work = qtest_cpu_has_work; }; static const TypeInfo qtest_accel_ops_type = { From patchwork Fri Sep 24 09:38:21 2021 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: 1532166 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=piuXccYl; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4HG6sp72pRz9sXk for ; Fri, 24 Sep 2021 19:58:06 +1000 (AEST) Received: from localhost ([::1]:43222 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mThxx-0003YV-15 for incoming@patchwork.ozlabs.org; Fri, 24 Sep 2021 05:58:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41308) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mThgU-0004Ma-HB for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:39:58 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:42862) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mThgS-0006i0-Tq for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:39:58 -0400 Received: by mail-wr1-x42a.google.com with SMTP id i24so9562385wrc.9 for ; Fri, 24 Sep 2021 02:39:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0BYMbs0TcChkwFeeNZ8rPK4jjNXuJ+c6QHnkutAyXs4=; b=piuXccYlN3pEG3QB6KUJxZROq8gtYy7hkcwhGJTm/x2GBBhHfBeMIyKJ4LHCbVCO35 S3VVWTh66mDq7BepwM4Tzu8xVWntL38jfkgKRK3zdUkfnoGp12fv25h6TYw7GVRChCI0 lIz6RgT6x6AxQHYBY3gRv5fV5euyNBg6nUUDp78XLnzOsvabKwg1PD+aYu6ZPJ7ZVFZA pdY2WfRKp2HeQMI3X8K03SCJRqlFVRCAKKFWnSj1TrqR27fZYOP+GEBMS89ISRxTCq0i gsncAXuB/0Pv/6tTPEqpHv+ZIuII6RZrjIj7GyNqM3JjJzzXu1y/J6ghibdd7l+ikGrX RIgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=0BYMbs0TcChkwFeeNZ8rPK4jjNXuJ+c6QHnkutAyXs4=; b=NXto56xva/pT9Y/7L85L7a38NnGVdNC2ARobB8yKwRYMWCdx9rjBXvkvvYQi8sF5Ak WBje1mMG9rvlkfSRapLDcrxzEGPvDt6Hp8LuKY6V+djST8cg6L/6QE2dCNvXKL5ezmW/ 802GtKarNZ007lXMcBAfVw1wVau5bpaL3UVJcf3uUqVO0GZGZbYPp52l7qkFSVYnzfJj FEIdEagNDQQnGVaKnEKqG1HA6j5rx1ZFhaL3ik8MqdLESFE3Ufv+KhcDqxee/TRKvvWH o88mLnzD+R8zoL/aguzLMmEF9zGFwHQurRXUF4ypjTlzaZJYH0Nb9hkio/XzveUF4S9I kJLA== X-Gm-Message-State: AOAM532zuTfmU97TqnPIQCG4sAH5xvLd+QvNHTp0zFzQXbKQFDl/YFmv lNuihT7q06325EjZl+8H70UzaSIHbc8= X-Google-Smtp-Source: ABdhPJzxEbLjNXVAhVczmkZLoaNcSxiI1KyrqlrNQ4c9XeN7cFaT/3PSW+YZkjGxd5XD2IVVFvohXA== X-Received: by 2002:a7b:c056:: with SMTP id u22mr1075873wmc.15.1632476395366; Fri, 24 Sep 2021 02:39:55 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id y8sm7518713wrh.44.2021.09.24.02.39.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 02:39:54 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v6 14/40] accel/tcg: Implement AccelOpsClass::has_work() Date: Fri, 24 Sep 2021 11:38:21 +0200 Message-Id: <20210924093847.1014331-15-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210924093847.1014331-1-f4bug@amsat.org> References: <20210924093847.1014331-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x42a.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Eduardo Habkost Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" All accelerators but TCG implement their AccelOpsClass::has_work() handler, meaning all the remaining CPUClass::has_work() ones are only reachable from TCG accelerator; and these has_work() handlers belong to TCGCPUOps. We will gradually move each target CPUClass::has_work() to TCGCPUOps in the following commits. For now, move the CPUClass::has_work() call to tcg_cpu_has_work(), the TCG AccelOpsClass::has_work() implementation. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 2 +- accel/tcg/tcg-accel-ops.c | 11 +++++++++++ softmmu/cpus.c | 5 ----- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index e2dd171a13f..114eb3b9b2c 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -89,7 +89,7 @@ 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. + * @has_work: Callback for checking if there is work to do. Only used by TCG. * @memory_rw_debug: Callback for GDB memory access. * @dump_state: Callback for dumping state. * @get_arch_id: Callback for getting architecture-dependent CPU ID. diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c index 1a8e8390bd6..ebaacff1842 100644 --- a/accel/tcg/tcg-accel-ops.c +++ b/accel/tcg/tcg-accel-ops.c @@ -73,6 +73,16 @@ int tcg_cpus_exec(CPUState *cpu) return ret; } +static bool tcg_cpu_has_work(CPUState *cpu) +{ + CPUClass *cc = CPU_GET_CLASS(cpu); + + if (cc->has_work) { + return cc->has_work(cpu); + } + return false; +} + /* mask must never be zero, except for A20 change call */ void tcg_handle_interrupt(CPUState *cpu, int mask) { @@ -108,6 +118,7 @@ static void tcg_accel_ops_init(AccelOpsClass *ops) ops->kick_vcpu_thread = rr_kick_vcpu_thread; ops->handle_interrupt = tcg_handle_interrupt; } + ops->has_work = tcg_cpu_has_work; } static void tcg_accel_ops_class_init(ObjectClass *oc, void *data) diff --git a/softmmu/cpus.c b/softmmu/cpus.c index 5ffa02f9cef..bb16a25bcef 100644 --- a/softmmu/cpus.c +++ b/softmmu/cpus.c @@ -251,11 +251,6 @@ void cpu_interrupt(CPUState *cpu, int mask) bool cpu_has_work(CPUState *cpu) { - CPUClass *cc = CPU_GET_CLASS(cpu); - - if (cc->has_work && cc->has_work(cpu)) { - return true; - } if (cpus_accel->has_work && cpus_accel->has_work(cpu)) { return true; } From patchwork Fri Sep 24 09:38:22 2021 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: 1532153 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=RE5yOKxU; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4HG6f65qVzz9sP7 for ; Fri, 24 Sep 2021 19:47:58 +1000 (AEST) Received: from localhost ([::1]:40466 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mThoC-0007za-IB for incoming@patchwork.ozlabs.org; Fri, 24 Sep 2021 05:47:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41354) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mThgZ-0004Vi-Du for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:40:04 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:37561) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mThgX-0006lu-II for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:40:02 -0400 Received: by mail-wr1-x436.google.com with SMTP id t8so25549842wrq.4 for ; Fri, 24 Sep 2021 02:40:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cb3odcmCuQWoFCXt4iYOTDt5qWlPQnfLAh89ZyyxruA=; b=RE5yOKxUSUjUjzBeY1vl15zYkKv1NHrBTccxFGXGjCS/P8zN3+D0uQ9sIHQVbSsTIt td/0iLjn78mOYgZIc3PdXVrGdDrxmHrfN9GfRv0E5OnWan024I4RpKk5z0hJWGEw1ysq DowOcOy9Degv8AWfT55kpHF4S9G6ztmdPJPbJHzdFVPzyluXiNcbmlX6Thq9sB37LmkJ fishgmrRwg/hBbS8lxrVFpu902Wj4L/bNAavQdrwePCHfa31N+RnN5TKjsvqBXkA07YB Km8Sp0rMXWHLQyFxubHUPYPXn4/Z/X/Evof3TNc/Ti4rX967BPgWGdDz/DR8UGw6vfaY nd5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=cb3odcmCuQWoFCXt4iYOTDt5qWlPQnfLAh89ZyyxruA=; b=sVEcc/3owFuljTcmyOZKZJK++Ic1t305SQ7vhPNpXIzgG4ip2Vv5qiwhHtn1r5OGJ7 19RLPH05iTbebuWoqM+xNNoN9fJAZycQuHsetIPdnq7bZSC3cNo28oAJ03saUjcMM2LA uaO8QyPP4uFSSxZFeL1bARSR2yGV79PohUtyVgd5YG2PoKi2xyD37ukQ7FmMSP7KCkfq rrglHDmVGSoNauyq3c7lMxx0R4md7rSJF3JqsveMVCszjOXPPcgsmd5t0QZnXaPUUje8 39J62IPSVItmUyNLbAERtBMdnf3EVQUpDcuMGvIwOy5QLKencNP+og1vhxrlp637qJci au2w== X-Gm-Message-State: AOAM530PU4ZdxVMtgbQvHKhal5FIIGnCuEgFV2TqCYhLR2fOI9suITSl L9CBz2LqGzAzesuE5hsTG7fytkWzfyg= X-Google-Smtp-Source: ABdhPJz2P7KzGgKM/BX5BJYm5dekVepazlfXTWILHEYQqAftVsrNjp4pAZ+F/NQEE521ToO/3fMsiA== X-Received: by 2002:a5d:6ad1:: with SMTP id u17mr10469818wrw.204.1632476399970; Fri, 24 Sep 2021 02:39:59 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id k26sm1163062wms.39.2021.09.24.02.39.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 02:39:59 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v6 15/40] accel: Simplify cpu_has_work() Date: Fri, 24 Sep 2021 11:38:22 +0200 Message-Id: <20210924093847.1014331-16-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210924093847.1014331-1-f4bug@amsat.org> References: <20210924093847.1014331-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x436.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Now that all accelerators implement a has_work() handler, we can simplify cpu_has_work() by removing the non-NULL handler check. Add an assertion in cpus_register_accel() for future accelerators. Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- softmmu/cpus.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/softmmu/cpus.c b/softmmu/cpus.c index bb16a25bcef..bbb83d5982a 100644 --- a/softmmu/cpus.c +++ b/softmmu/cpus.c @@ -251,10 +251,7 @@ void cpu_interrupt(CPUState *cpu, int mask) bool cpu_has_work(CPUState *cpu) { - if (cpus_accel->has_work && cpus_accel->has_work(cpu)) { - return true; - } - return false; + return cpus_accel->has_work(cpu); } static int do_vm_stop(RunState state, bool send_stop) @@ -613,6 +610,7 @@ void cpus_register_accel(const AccelOpsClass *ops) /* Mandatory non-NULL handlers */ assert(ops->create_vcpu_thread != NULL); + assert(ops->has_work != NULL); cpus_accel = ops; } From patchwork Fri Sep 24 09:38:23 2021 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: 1532170 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=B3in8lo5; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4HG6wm1Ff8z9sXk for ; Fri, 24 Sep 2021 20:00:40 +1000 (AEST) Received: from localhost ([::1]:51568 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mTi0T-0000fw-QO for incoming@patchwork.ozlabs.org; Fri, 24 Sep 2021 06:00:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41386) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mThgd-0004bb-VS for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:40:08 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:37561) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mThgc-0006pa-Dm for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:40:07 -0400 Received: by mail-wr1-x434.google.com with SMTP id t8so25550649wrq.4 for ; Fri, 24 Sep 2021 02:40:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JRKOlLYiSGogxCXK7W1sZhtnHuRe58y47UC3DXkXm/g=; b=B3in8lo5Ftj1ZWYW4d3iRbT6My7HPS9340+n8jYee0PG6H3f1FWsaxbQ29hBXTsR96 S5ylV6RBV6667ZFItiMgghyH4+172SWd1bkQC0ZmSogm5rJDoGmGmEtK0KHO3f6HuXpn CWPlShK2FnjnqBTgjEbcIMOookkO3/65IbnMHsLm69rTcuGZwidgn+eu7tK8i9PXD5i/ xa8zQz2Lgvh996KoRx0bYi+n52RGzBfxpYHrTJMUO4ubBOddewTjxSEmlm6JUaHE8K05 1LDYPwRVmypRiErPoeyvNS3CjRrF33D6sD0jrp78MXs+wYepXxRQpdY0iHQNYRLnTh3X O0Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=JRKOlLYiSGogxCXK7W1sZhtnHuRe58y47UC3DXkXm/g=; b=spsKhz1HzoqsUyaWEHkGBN1yTtNpuJbDlzhlTCzUVvfIsMfiLYQvV4nRcNAudCztfl 8ao/67ut4nUq4NDv+m6fFxIpzPiPBsLU/ZPP8pn4ziYt52YkLv6SlJiDLGysJfiUxAuT Cgv8aaYbgjF+iT6Fz08ShR95268GD0u+VFg3IfHvch94DEbpnpIZ5fjAN56AT1WbVF8p v/q5bISs/UYE2R/7HozTR6HZuaWExVbTpiyobf0HTxvUCs92C3f6D8PBkthe9uu/Kw0m EmI6FSQkhoFj3Eet2ZcPHBBDKTv8eI+zo5xGeYuY28fz42pO/fz010s5cH7YKaGpPMOt e7KA== X-Gm-Message-State: AOAM531e+EH2YlaTwHmkYYt1eqDES63MZP1oDjJCXuw8l1X1zu2yf76Q BpRew/5fLFhNqideWQ89wIq+XnGitFc= X-Google-Smtp-Source: ABdhPJxSsi7GocfHNhpK13aPvafIyRTlD02upQgzK1BlcjNSRQVC4JWnZMwFlNu2os4BXMV9LBa9Wg== X-Received: by 2002:adf:f207:: with SMTP id p7mr10524041wro.166.1632476404945; Fri, 24 Sep 2021 02:40:04 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id v191sm7786345wme.36.2021.09.24.02.40.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 02:40:04 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v6 16/40] accel/tcg: Introduce TCGCPUOps::has_work() Date: Fri, 24 Sep 2021 11:38:23 +0200 Message-Id: <20210924093847.1014331-17-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210924093847.1014331-1-f4bug@amsat.org> References: <20210924093847.1014331-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x434.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Introduce a target-specific has_work() handler for TCG. Eventually call it from tcg_cpu_has_work(), our AccelOpsClass::has_work() handler. Inspired-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/tcg-cpu-ops.h | 4 ++++ accel/tcg/tcg-accel-ops.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/include/hw/core/tcg-cpu-ops.h b/include/hw/core/tcg-cpu-ops.h index 55123cb4d22..4a4c4053e3b 100644 --- a/include/hw/core/tcg-cpu-ops.h +++ b/include/hw/core/tcg-cpu-ops.h @@ -66,6 +66,10 @@ struct TCGCPUOps { void (*do_interrupt)(CPUState *cpu); #endif /* !CONFIG_USER_ONLY || !TARGET_I386 */ #ifdef CONFIG_SOFTMMU + /** + * @has_work: Callback for checking if there is work to do. + */ + bool (*has_work)(CPUState *cpu); /** @cpu_exec_interrupt: Callback for processing interrupts in cpu_exec */ bool (*cpu_exec_interrupt)(CPUState *cpu, int interrupt_request); /** diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c index ebaacff1842..cd44bb6d0d8 100644 --- a/accel/tcg/tcg-accel-ops.c +++ b/accel/tcg/tcg-accel-ops.c @@ -32,6 +32,7 @@ #include "qemu/main-loop.h" #include "qemu/guest-random.h" #include "exec/exec-all.h" +#include "hw/core/tcg-cpu-ops.h" #include "tcg-accel-ops.h" #include "tcg-accel-ops-mttcg.h" @@ -80,6 +81,9 @@ static bool tcg_cpu_has_work(CPUState *cpu) if (cc->has_work) { return cc->has_work(cpu); } + if (cc->tcg_ops->has_work) { + return cc->tcg_ops->has_work(cpu); + } return false; } From patchwork Fri Sep 24 09:38:24 2021 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: 1532160 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=WOIjYrXN; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4HG6ls4mCRz9sR4 for ; Fri, 24 Sep 2021 19:52:57 +1000 (AEST) Received: from localhost ([::1]:55410 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mTht0-00019R-SR for incoming@patchwork.ozlabs.org; Fri, 24 Sep 2021 05:52:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41404) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mThgj-0004nW-2V; Fri, 24 Sep 2021 05:40:13 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:36543) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mThgh-0006u1-Gz; Fri, 24 Sep 2021 05:40:12 -0400 Received: by mail-wr1-x42d.google.com with SMTP id g16so25530287wrb.3; Fri, 24 Sep 2021 02:40:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3jjDpP5pLPewtdopPT9Bv9deCPUCIA2fG6dBKaHxXEg=; b=WOIjYrXNXbdh2jL5gRIhbK4TBGocSjPE/HYr5CjsD476vvB12UEKRlCfGDj/7zhFoJ 5OABnVasQCMDkKYYZuvToEsDwXl6IGgxpwjwOnJKCrYrCmXhKLlR7nVtlEEhH/nzLyMx H2Ig2SSLbo71t4LmouRRkSBtEDMFlVbT68nhfRml0pri6Hp+vDTqqa4I3DqbNe/tg4m3 rHsT+9JF6oIYOXSVTjxh6G6opZOrvatb+xlmdwLKResJzYwCZw+hvD7sub/7DfwChsLY atBypv4w1jndbo7cHsf4LimPyqCPL5UJx8ukAk0qx6NwDRZUUpRxMmDoHeRntkP5vje2 VVVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=3jjDpP5pLPewtdopPT9Bv9deCPUCIA2fG6dBKaHxXEg=; b=gB5OxKvrkDHh0D0J7BclVnSO2Bm8vsfJjPd5613SLd+OoEHtfWBBqS+5jWyqPw3jl/ zWdGAkaUbp+6yesd99N+7M/ihN6q9ICMBTtO5+PJLt/rfNQGNfQD8M9MyDa/SnseWTAb v1gcocLoqZYPJs4dsd7t5dJJ4oNuBu1E5Hs2jxjYHM7KCXlsl56qLPWNTFIXtETjFZAX xx3qEn8hBh+YPc/FW6naja3HIIHI+d4u6cNphlPYJufoS3y/aCV0Eyj+ZaEoWNq52zps 2Z652WFXdWgeXbMM9QlpUqcWj8QEYN2XcBSNX8R30OcYJvuE2/EcqEY0InK+f1Rx3Ep8 dwIg== X-Gm-Message-State: AOAM530quCwvFq6JvQYq/tFm2ivnxFBSLAc/0cyGZVili6Ypwzf/JqsQ X4i01DQVgZz/sqNAsiDH5WDETp2JGGc= X-Google-Smtp-Source: ABdhPJy3+AHIs93McQTzdxLkhMqGCtC9ki5PzV1Ocglawiy+Jokpjoa2rZ1FFQvtFa64D//R3aCBzw== X-Received: by 2002:a05:600c:1d05:: with SMTP id l5mr1016581wms.119.1632476409645; Fri, 24 Sep 2021 02:40:09 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id f1sm7964722wrc.66.2021.09.24.02.40.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 02:40:09 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v6 17/40] target/arm: Explicit v7M cores use arm_cpu_has_work as CPUClass:has_work Date: Fri, 24 Sep 2021 11:38:24 +0200 Message-Id: <20210924093847.1014331-18-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210924093847.1014331-1-f4bug@amsat.org> References: <20210924093847.1014331-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x42d.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , "open list:ARM TCG CPUs" , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" ARM v7M cores inherit TYPE_ARM_CPU, so TYPE_ARM_CPU's class_init runs first and sets up most of the class fields, setting in particular the has_work handler to the generic arm_cpu_has_work(). Thus M-profile and A-profile share the same arm_cpu_has_work() function. Some of the checks the code there does are perhaps unnecessary for M-profile, but they're harmless. Since we want to move the has_work handler from CPUClass to TCGCPUOps, the next commit will be more explicit if we already register this handler in arm_v7m_class_init(). Since arm_cpu_has_work() is static to target/arm/cpu.c, we have to declare it in "internals.h" to be able to use it in target/arm/cpu_tcg.c. Suggested-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daudé --- target/arm/internals.h | 2 ++ target/arm/cpu.c | 2 +- target/arm/cpu_tcg.c | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/target/arm/internals.h b/target/arm/internals.h index 777f9687648..864b5ad4cdf 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -177,6 +177,8 @@ void arm_translate_init(void); void arm_cpu_synchronize_from_tb(CPUState *cs, const TranslationBlock *tb); #endif /* CONFIG_TCG */ +bool arm_cpu_has_work(CPUState *cs); + /** * aarch64_sve_zcr_get_valid_len: * @cpu: cpu context diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 641a8c2d3d3..4b08f717f64 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -76,7 +76,7 @@ void arm_cpu_synchronize_from_tb(CPUState *cs, } #endif /* CONFIG_TCG */ -static bool arm_cpu_has_work(CPUState *cs) +bool arm_cpu_has_work(CPUState *cs) { ARMCPU *cpu = ARM_CPU(cs); diff --git a/target/arm/cpu_tcg.c b/target/arm/cpu_tcg.c index 0d5adccf1a7..9a0927ad5d0 100644 --- a/target/arm/cpu_tcg.c +++ b/target/arm/cpu_tcg.c @@ -920,6 +920,7 @@ static void arm_v7m_class_init(ObjectClass *oc, void *data) acc->info = data; #ifdef CONFIG_TCG + cc->has_work = arm_cpu_has_work; cc->tcg_ops = &arm_v7m_tcg_ops; #endif /* CONFIG_TCG */ From patchwork Fri Sep 24 09:38:25 2021 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: 1532157 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=lypblXQg; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4HG6j848HQz9sR4 for ; Fri, 24 Sep 2021 19:50:36 +1000 (AEST) Received: from localhost ([::1]:49006 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mThqj-0005EX-1D for incoming@patchwork.ozlabs.org; Fri, 24 Sep 2021 05:50:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41438) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mThgn-0004zv-Sh; Fri, 24 Sep 2021 05:40:17 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:44023) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mThgm-0006xh-9e; Fri, 24 Sep 2021 05:40:17 -0400 Received: by mail-wr1-x42d.google.com with SMTP id w17so25396090wrv.10; Fri, 24 Sep 2021 02:40:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=138lKCCsDusDobsjTqkgHXFS+q7YngmR9S6d2RdS3Vk=; b=lypblXQgni2MLkl05r8H44c+0FOKn+nARJAdFkzwDpwtIyvHpqTey9VZZuaOGHb5Wf Z7pchjExeKF/vaHiW9+23NWPiIpPcIrWeP9YV8EFz4ujtbg35rog0burb9GK3SuJSPww R4IXwvbpZ6eaamT8wQjtzx4x2+GbRz+oaRgfuZOZ4d/hOTut4sMgFZ2LY2q7fe+G8t/f OqY9Qkt1S6n6AxrLmAkXjN8DO69azDNb8JB+5aSNRQdDySV52uyepCnk9xEHX16C8CfF EbVtowKnr49CuvfvrIJitXWog072b3VL+Xq6Xh+5E//s6+40Ey6P7mMkc2IhhQcycriN L2pA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=138lKCCsDusDobsjTqkgHXFS+q7YngmR9S6d2RdS3Vk=; b=zkLplrE23ZxGyVHKvyFj/G3JwFl3TmANQUB4ac2d6/bazPhzpSUAPApwZwWwXPnt4L 28P/BLP5leH2g9dWMCn5jY9dSTOES5xDclQGG8RXFF2BxMk/x8GNFau3WMVteVYBAgM1 uXAbnJ5ENFHvHjH6xcMY2AoyH44SO+yCoh90MTH0rvc+nDJSSZf6vr29Q9YVU7bT5E8m WCO38FuWAbguH8fcMGrppgASyLO9pUpRd/SVxRnRBHAAwTvWMiISgxy3ye4q5ZP55m+B YRnbklARmFTwur64DfZKl9ZRqBw4HHon0TVzua5WLl/b8tzri0RYPe7xu4f/tCL63tZX UI7g== X-Gm-Message-State: AOAM530oHOGvlknShvGJY+Q6THL6X1B4GOErkZFuExwCioSr94L6P/mv +mPFN4K34bLiR5WHAkNn/lMmVm0Sci8= X-Google-Smtp-Source: ABdhPJz5Mhg4SjIGXAxwlA1P8B7B0hXecgEQQIjmWt5AlgAIp7Yy2d0W3X6wwYFu5Ahjn+dduoigxA== X-Received: by 2002:a05:600c:3209:: with SMTP id r9mr1041690wmp.35.1632476414383; Fri, 24 Sep 2021 02:40:14 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id o17sm7541189wrj.96.2021.09.24.02.40.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 02:40:13 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v6 18/40] target/arm: Restrict has_work() handler to sysemu and TCG Date: Fri, 24 Sep 2021 11:38:25 +0200 Message-Id: <20210924093847.1014331-19-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210924093847.1014331-1-f4bug@amsat.org> References: <20210924093847.1014331-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x42d.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , "open list:ARM TCG CPUs" , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Restrict arm_cpu_has_work() and has_work() handler to TCG sysemu. Signed-off-by: Philippe Mathieu-Daudé --- target/arm/internals.h | 4 +++- target/arm/cpu.c | 7 +++++-- target/arm/cpu_tcg.c | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/target/arm/internals.h b/target/arm/internals.h index 864b5ad4cdf..29bb815100d 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -175,9 +175,11 @@ void arm_translate_init(void); #ifdef CONFIG_TCG void arm_cpu_synchronize_from_tb(CPUState *cs, const TranslationBlock *tb); -#endif /* CONFIG_TCG */ +#if !defined(CONFIG_USER_ONLY) bool arm_cpu_has_work(CPUState *cs); +#endif /* !CONFIG_USER_ONLY */ +#endif /* CONFIG_TCG */ /** * aarch64_sve_zcr_get_valid_len: diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 4b08f717f64..53c478171ac 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -74,8 +74,8 @@ void arm_cpu_synchronize_from_tb(CPUState *cs, env->regs[15] = tb->pc; } } -#endif /* CONFIG_TCG */ +#ifndef CONFIG_USER_ONLY bool arm_cpu_has_work(CPUState *cs) { ARMCPU *cpu = ARM_CPU(cs); @@ -86,6 +86,9 @@ bool arm_cpu_has_work(CPUState *cs) | CPU_INTERRUPT_VFIQ | CPU_INTERRUPT_VIRQ | CPU_INTERRUPT_EXITTB); } +#endif /* !CONFIG_USER_ONLY */ + +#endif /* CONFIG_TCG */ void arm_register_pre_el_change_hook(ARMCPU *cpu, ARMELChangeHookFn *hook, void *opaque) @@ -2035,6 +2038,7 @@ static const struct TCGCPUOps arm_tcg_ops = { .debug_excp_handler = arm_debug_excp_handler, #if !defined(CONFIG_USER_ONLY) + .has_work = arm_cpu_has_work, .cpu_exec_interrupt = arm_cpu_exec_interrupt, .do_interrupt = arm_cpu_do_interrupt, .do_transaction_failed = arm_cpu_do_transaction_failed, @@ -2059,7 +2063,6 @@ static void arm_cpu_class_init(ObjectClass *oc, void *data) device_class_set_parent_reset(dc, arm_cpu_reset, &acc->parent_reset); cc->class_by_name = arm_cpu_class_by_name; - cc->has_work = arm_cpu_has_work; cc->dump_state = arm_cpu_dump_state; cc->set_pc = arm_cpu_set_pc; cc->gdb_read_register = arm_cpu_gdb_read_register; diff --git a/target/arm/cpu_tcg.c b/target/arm/cpu_tcg.c index 9a0927ad5d0..7d0d9fcbc79 100644 --- a/target/arm/cpu_tcg.c +++ b/target/arm/cpu_tcg.c @@ -902,6 +902,7 @@ static const struct TCGCPUOps arm_v7m_tcg_ops = { .debug_excp_handler = arm_debug_excp_handler, #if !defined(CONFIG_USER_ONLY) + .has_work = arm_cpu_has_work, .cpu_exec_interrupt = arm_v7m_cpu_exec_interrupt, .do_interrupt = arm_v7m_cpu_do_interrupt, .do_transaction_failed = arm_cpu_do_transaction_failed, @@ -920,7 +921,6 @@ static void arm_v7m_class_init(ObjectClass *oc, void *data) acc->info = data; #ifdef CONFIG_TCG - cc->has_work = arm_cpu_has_work; cc->tcg_ops = &arm_v7m_tcg_ops; #endif /* CONFIG_TCG */ From patchwork Fri Sep 24 09:38:26 2021 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: 1532154 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=Vh6th4kw; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4HG6fB58Q9z9sP7 for ; Fri, 24 Sep 2021 19:48:02 +1000 (AEST) Received: from localhost ([::1]:40658 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mThoG-00087M-DI for incoming@patchwork.ozlabs.org; Fri, 24 Sep 2021 05:48:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41462) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mThgs-000595-3Y for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:40:23 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:46650) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mThgq-00075B-EI for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:40:21 -0400 Received: by mail-wr1-x42c.google.com with SMTP id t7so25376727wrw.13 for ; Fri, 24 Sep 2021 02:40:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GnKfjoq+otyiJmny5QHC7t7xnub0O32xM8y+f0O0Xns=; b=Vh6th4kwtGT1ClLOlEmkYiqpBcvwQz7Fng3nKOaxYPtsV9/wr1/F7i9kWLO68+3Ij1 TNFjy87wyG3bfRy/BEBbP5pNZluPh71lKPY90szCF7cCvliyVzYC2xsORpcQ+8XOjvTq UQEMxCIbgxMnRAOPeu6G+98edadCo8U6jFX6pMBqiHr7ZMw8AMwJXrEwqHarTg/8MdVD GuPtSxsXsMgGR/TnXhYwm+Ex8IyJtcB/4S+3BrCQW0rfsHJVZ5IqcB6oi5V/twsYGqT9 xz7h4m5LRNUYTBy5celyyQkxEoHHR5Hlil5x+53dYGaZBfcC4USkbpFH7g9sMQc2SHwt WoPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=GnKfjoq+otyiJmny5QHC7t7xnub0O32xM8y+f0O0Xns=; b=nVzHjkuLPh3VGwsxaiYqPLgfDnjmMDfTaRCAFOPKLLkqgC8T+oV2XiPps0+Y95nrdb 140uD56YXIwr8qnCLJdgvkQekydOJeNPhb+HvxrNzvJ3ODmna2BORx9fVJ8G9uan+dO1 R7JKJiq+6NMVI89krAYc7b9pNpPzji55k1bBC16/ZMPD6arHRNciDGnjhoyw8K8dGkD6 3GKt8Of4Uq8UHpcARHsGMI77XnaYibb64IDJJKGhVBYcvIP4oVo4jvdegrNM8o97MU8x xqRwWe4JmtvWr1tP4c7nV1APX3XnyPOBiLwSiBQbG4Yl7prDVN0mCqA5IjVOVUvE2+CB DW0w== X-Gm-Message-State: AOAM533RbWz9HSS52WJAW/zDRBHCyhwux3ei+MXn6JY+BWFMZ8sxdt2g R8WiC0zyT9hL3u0y7FICLIsqWJR6Yyc= X-Google-Smtp-Source: ABdhPJzS8EO/ffcbUl8Bd+UlNs0/QoNwM838HgPxDoQJzPaTt9z+x+bCyY44QH32FfFAKTQPFv70Iw== X-Received: by 2002:a05:600c:1d18:: with SMTP id l24mr1094046wms.98.1632476418930; Fri, 24 Sep 2021 02:40:18 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id d5sm7932898wra.38.2021.09.24.02.40.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 02:40:18 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v6 19/40] target/avr: Restrict has_work() handler to sysemu Date: Fri, 24 Sep 2021 11:38:26 +0200 Message-Id: <20210924093847.1014331-20-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210924093847.1014331-1-f4bug@amsat.org> References: <20210924093847.1014331-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x42c.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Rolnik , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Restrict has_work() to sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Michael Rolnik --- 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 5d70e34dd54..6d51f91ca2c 100644 --- a/target/avr/cpu.c +++ b/target/avr/cpu.c @@ -195,6 +195,7 @@ static const struct SysemuCPUOps avr_sysemu_ops = { static const struct TCGCPUOps avr_tcg_ops = { .initialize = avr_cpu_tcg_init, .synchronize_from_tb = avr_cpu_synchronize_from_tb, + .has_work = avr_cpu_has_work, .cpu_exec_interrupt = avr_cpu_exec_interrupt, .tlb_fill = avr_cpu_tlb_fill, .do_interrupt = avr_cpu_do_interrupt, @@ -211,7 +212,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->dump_state = avr_cpu_dump_state; cc->set_pc = avr_cpu_set_pc; cc->memory_rw_debug = avr_cpu_memory_rw_debug; From patchwork Fri Sep 24 09:38:27 2021 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: 1532158 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=J+sdCw2e; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4HG6jR3SlMz9sR4 for ; Fri, 24 Sep 2021 19:50:51 +1000 (AEST) Received: from localhost ([::1]:49146 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mThqy-0005KP-TB for incoming@patchwork.ozlabs.org; Fri, 24 Sep 2021 05:50:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41476) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mThgx-0005Cl-Qe for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:40:29 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:46658) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mThgu-0007A4-VY for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:40:27 -0400 Received: by mail-wr1-x433.google.com with SMTP id t7so25377297wrw.13 for ; Fri, 24 Sep 2021 02:40:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BtkZfC3Jqv9BX8O65q6cSfCgutSi0wjc1sQe8Yf13mk=; b=J+sdCw2eapRlTcLHEpQOv0W7qPRU4O8ULFwEPDOEXqlAZtJ+9bKMVpMhx8FYKLYqBO Ag3ypiz+6dwRFzEXeU+8f8p21fwrKlb47/K2OqC+aFHkE9NewoM6lMt1mRwMtUpgm5lP ZUF81W4eFdTBasqFdrrpQJbzyR82HxZZ27v3s+cxm3ME4JoNyFdbz0qsavT55L4mwR3D ZSaNffM8UMeA0b8YaA+lkuaw98gFol269tQw/rD8Ni74i4agAeeXphHzzE+qC8yF8vcE 4EMC1iYA7qoc4df7+ZQvKpIvegYw+zsQAgkT5Ytm+58+62Jvix0HwQr7beJKZ10NCW1K CY8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=BtkZfC3Jqv9BX8O65q6cSfCgutSi0wjc1sQe8Yf13mk=; b=Sjgc8FTMz9spaKxrFgCn36yFs3lgkZ6ClHYJDlnv2xpJ1JLs4kWOAR3H7Ut9H6d3C1 lLRH0GBhHQjvsfmpiQymTxtitsrqR9RtFjO3cyxaOoZbpHXkhAErIDEo53ehcslvYi+1 WZ/t9Y/+YpOZNcNOI5BdvBVNSKL0S0G7BYquFkhumDv+5oOhoVwaf9upbzfRE+m0pnK1 3WGi7SMWKdUIxhs+nJZ8lyZzSOLb/xsT7dofLa1ll4xsf364NiZh77Ds+nvVZfmOrhBJ zXlD7kcGa4WerruzrxrVxjT/gIwbkb9S50ZfpVGfM1IRzVFmQwTasHeXKfyHbP8tWX3/ q2ig== X-Gm-Message-State: AOAM5330Nh4ACdXFNmJnnVSgOgrnWLv/c3m90teVmdHgdGNY3HAIGPbm GIxjbUoVzSu4TlgZ1eYsplMY2/vjphM= X-Google-Smtp-Source: ABdhPJwAbqQzbkiTCAZ1vBq3StIchG3epvimAoPDx5NMYG4x2jIpO60xP2UoKBIObw7uB96NTcDdrg== X-Received: by 2002:adf:dc0d:: with SMTP id t13mr982240wri.158.1632476423514; Fri, 24 Sep 2021 02:40:23 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id g1sm14462069wmk.2.2021.09.24.02.40.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 02:40:23 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v6 20/40] target/cris: Restrict has_work() handler to sysemu Date: Fri, 24 Sep 2021 11:38:27 +0200 Message-Id: <20210924093847.1014331-21-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210924093847.1014331-1-f4bug@amsat.org> References: <20210924093847.1014331-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x433.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Edgar E. Iglesias" , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Restrict has_work() to sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/cris/cpu.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/target/cris/cpu.c b/target/cris/cpu.c index c2e7483f5bd..b2761f8b110 100644 --- a/target/cris/cpu.c +++ b/target/cris/cpu.c @@ -35,10 +35,12 @@ static void cris_cpu_set_pc(CPUState *cs, vaddr value) cpu->env.pc = value; } +#if !defined(CONFIG_USER_ONLY) static bool cris_cpu_has_work(CPUState *cs) { return cs->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_NMI); } +#endif /* !CONFIG_USER_ONLY */ static void cris_cpu_reset(DeviceState *dev) { @@ -208,6 +210,7 @@ static const struct TCGCPUOps crisv10_tcg_ops = { .tlb_fill = cris_cpu_tlb_fill, #ifndef CONFIG_USER_ONLY + .has_work = cris_cpu_has_work, .cpu_exec_interrupt = cris_cpu_exec_interrupt, .do_interrupt = crisv10_cpu_do_interrupt, #endif /* !CONFIG_USER_ONLY */ @@ -218,6 +221,7 @@ static const struct TCGCPUOps crisv32_tcg_ops = { .tlb_fill = cris_cpu_tlb_fill, #ifndef CONFIG_USER_ONLY + .has_work = cris_cpu_has_work, .cpu_exec_interrupt = cris_cpu_exec_interrupt, .do_interrupt = cris_cpu_do_interrupt, #endif /* !CONFIG_USER_ONLY */ @@ -294,7 +298,6 @@ static void cris_cpu_class_init(ObjectClass *oc, void *data) device_class_set_parent_reset(dc, cris_cpu_reset, &ccc->parent_reset); cc->class_by_name = cris_cpu_class_by_name; - cc->has_work = cris_cpu_has_work; cc->dump_state = cris_cpu_dump_state; cc->set_pc = cris_cpu_set_pc; cc->gdb_read_register = cris_cpu_gdb_read_register; From patchwork Fri Sep 24 09:38:28 2021 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: 1532174 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=KDCWAGWF; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4HG70R29mdz9sXk for ; Fri, 24 Sep 2021 20:03:51 +1000 (AEST) Received: from localhost ([::1]:60338 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mTi3Z-0006bC-2N for incoming@patchwork.ozlabs.org; Fri, 24 Sep 2021 06:03:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41498) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mThh1-0005FJ-2R for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:40:31 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:44955) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mThgz-0007Db-Mb for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:40:30 -0400 Received: by mail-wr1-x42c.google.com with SMTP id d6so25378576wrc.11 for ; Fri, 24 Sep 2021 02:40:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Qq83gm6o51EoSTv2SvU60Q/ZscN9CmckVp0QDVwTqtI=; b=KDCWAGWFJ7upO9THVyMnjHDFpep3f6zTACmCde0ZMovLrlalzOrwlvo0lsOtwv1e9g SNo15gysmGyaSBA/QGdozSsmZ+A1XmwBCOgvUIqWpB4WNSFF27YuSx6lM5yOpNp7h92h LLhywYEi/dmU48cSbtjRRxSiL3J+1yQ0gliA2gqR2BcG4/VvsaGcv4PK/5aGmzTByl8J CepeMYtBlDcLq39aBtzBj4Evzm3zKncqK4CkACkRag5ohrQHiNHioSHZU92f/lwgwVGr gL4sIAWEWtaVlOGir0Q0dcR+9zpwIMho4JOFBCGVQFuj4UuCnpZRxAomOaG/Z4Kxp/WA h/gQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=Qq83gm6o51EoSTv2SvU60Q/ZscN9CmckVp0QDVwTqtI=; b=Y80c4ffmMEdQKLD53eNJRJqCw9gHedaLAyRgvD08p18kmKO+ueBHoZw+0dLTgHaq2n XNRQB9IjbxROyYp3pwyJ8IodGrYhf9O7IpV6AL+IDzRW9uCG9Add/1o+yAUd5ESGbEBM Had+kV8YBVDgtRcyk3yfDHmSJvbbwEcWvfdrFfMUUeGP4g/B2J4mxdLOQrM69/fj7w1R FO/XCwyl/1iBfS8wuOPM3SccfPSDRXeyfMKXvON7tWrmv3ICcJPoEHbMC/yn8jJNxN/V mEfwbKBCQGxWy2qbj0JJsIFOw6xsyQasY8OH/xH/PRW/H77LAe93LbD4YuFNCJVu30sX n7OA== X-Gm-Message-State: AOAM531cIG/tLAsWA2RZZ3Hw9T4mtDQkTf7ScI6VC0SJ0tX/ssf4Uhrb Xjjff/W73cKXScuX9VaCKTBKH1llIzI= X-Google-Smtp-Source: ABdhPJw8GDZW7mDT3/NQPdK7CLRqqVrGF7VJGfXctgRgrFFg8nHO44TSZN+lIdC1lrT85tQ8cLkS2Q== X-Received: by 2002:a5d:63d2:: with SMTP id c18mr9942607wrw.311.1632476428088; Fri, 24 Sep 2021 02:40:28 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id a25sm11606310wmj.34.2021.09.24.02.40.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 02:40:27 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v6 21/40] target/hexagon: Remove unused has_work() handler Date: Fri, 24 Sep 2021 11:38:28 +0200 Message-Id: <20210924093847.1014331-22-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210924093847.1014331-1-f4bug@amsat.org> References: <20210924093847.1014331-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x42c.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Taylor Simpson , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" has_work() is sysemu specific, and Hexagon target only provides a linux-user implementation. Remove the unused hexagon_cpu_has_work(). Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Taylor Simpson --- target/hexagon/cpu.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/target/hexagon/cpu.c b/target/hexagon/cpu.c index 3338365c16e..aa01974807c 100644 --- a/target/hexagon/cpu.c +++ b/target/hexagon/cpu.c @@ -189,11 +189,6 @@ static void hexagon_cpu_synchronize_from_tb(CPUState *cs, env->gpr[HEX_REG_PC] = tb->pc; } -static bool hexagon_cpu_has_work(CPUState *cs) -{ - return true; -} - void restore_state_to_opc(CPUHexagonState *env, TranslationBlock *tb, target_ulong *data) { @@ -287,7 +282,6 @@ static void hexagon_cpu_class_init(ObjectClass *c, void *data) device_class_set_parent_reset(dc, hexagon_cpu_reset, &mcc->parent_reset); 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->gdb_read_register = hexagon_gdb_read_register; From patchwork Fri Sep 24 09:38:29 2021 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: 1532161 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=ApShoZYt; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4HG6n93T9Yz9sR4 for ; Fri, 24 Sep 2021 19:54:05 +1000 (AEST) Received: from localhost ([::1]:57754 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mThu5-0002iQ-25 for incoming@patchwork.ozlabs.org; Fri, 24 Sep 2021 05:54:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41518) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mThh6-0005L6-I4 for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:40:37 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:40529) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mThh4-0007HO-2y for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:40:36 -0400 Received: by mail-wr1-x431.google.com with SMTP id t28so12106288wra.7 for ; Fri, 24 Sep 2021 02:40:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Hcdc/mmIgCeyUTMws35ZeDR0xT8KVD3mt7/D2pvFUfg=; b=ApShoZYtj9bGnnWC81QPqXgZDeM8jKnDuzTzWs0ugMkG9F60ACuR9+yW0piAHHVnrD dN/Lec8Fpplq83Lw5ehpcru7C+WWl0j6KWW1HCSjClE5DrRjc3gf0Vjd0h72pHaJBwJE dTV6H+ISz6WYDfKRyRFiXkXAd6FT4q+O5QwZ2Hw79Ly8T9b3Hycz8kuMb2rHK/d+lPFw EGM9PMBw7r4WX3RkYRt3dCRV3Umx8xZVo+drk7X5XnkBpz4FMvlzsQmE5KJq+PFFn+r9 XY/eX1v4Kb2bY2tGnijImf4xa8P6DT4NkIzOQeattxuUBny1BkUdrrQYC25k4GG6OwsQ THYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=Hcdc/mmIgCeyUTMws35ZeDR0xT8KVD3mt7/D2pvFUfg=; b=1453SuoEPlDYatRlI3jmrI3X5OdesOSwTmq4fuM5Uus9N9jZwDbG+a4/FahR4Igib5 GFKZKTQhRLDEMcd/feggDLW8jx4xK1x7plHsVioimi7+gYb8/UuYaXxtqGbO7fkpQnY3 yOHKdyz/kDKOSZnKBG8aEgN0A5ihi96erulTy5VypOl4YWqB5JaCan6cNs55uxWpupkJ BNDPOSdcig8gUN5YQfQGE1hvm+4CKRsB0UCt4LHYusNZvbfmP/ftL1j3d/j0qfAsxCJB 3gWVlXakZ1v9+mAh+rv/as1dMU6AD819Ba3KDLFlb6PX57QWFB9l0kMVq3NV3S7RAgsV Qccg== X-Gm-Message-State: AOAM533sE7uWcWIVgXUKq6bNUqCY+Q2ZMlLf8TymXpO/a62PdKftuydF COWG6OmDWvZhoGiraQfqEMj8+5yNHcE= X-Google-Smtp-Source: ABdhPJzoqmTsBp+lpAAAfOeG3IfrPQeBmiO6L4KXy4vLYs5VxrvC51jMGmVLPllJ7Ki2tdHRInJtIQ== X-Received: by 2002:a05:6000:18a7:: with SMTP id b7mr10833781wri.13.1632476432583; Fri, 24 Sep 2021 02:40:32 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id l13sm7734955wrb.11.2021.09.24.02.40.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 02:40:32 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v6 22/40] target/hppa: Restrict has_work() handler to sysemu Date: Fri, 24 Sep 2021 11:38:29 +0200 Message-Id: <20210924093847.1014331-23-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210924093847.1014331-1-f4bug@amsat.org> References: <20210924093847.1014331-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x431.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Restrict has_work() to sysemu. Reviewed-by: Richard Henderson 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 e8edd189bfc..be940ae2246 100644 --- a/target/hppa/cpu.c +++ b/target/hppa/cpu.c @@ -60,10 +60,12 @@ static void hppa_cpu_synchronize_from_tb(CPUState *cs, cpu->env.psw_n = (tb->flags & PSW_N) != 0; } +#if !defined(CONFIG_USER_ONLY) static bool hppa_cpu_has_work(CPUState *cs) { return cs->interrupt_request & CPU_INTERRUPT_HARD; } +#endif /* !CONFIG_USER_ONLY */ static void hppa_cpu_disas_set_info(CPUState *cs, disassemble_info *info) { @@ -147,6 +149,7 @@ static const struct TCGCPUOps hppa_tcg_ops = { .tlb_fill = hppa_cpu_tlb_fill, #ifndef CONFIG_USER_ONLY + .has_work = hppa_cpu_has_work, .cpu_exec_interrupt = hppa_cpu_exec_interrupt, .do_interrupt = hppa_cpu_do_interrupt, .do_unaligned_access = hppa_cpu_do_unaligned_access, @@ -163,7 +166,6 @@ static void hppa_cpu_class_init(ObjectClass *oc, void *data) &acc->parent_realize); cc->class_by_name = hppa_cpu_class_by_name; - cc->has_work = hppa_cpu_has_work; cc->dump_state = hppa_cpu_dump_state; cc->set_pc = hppa_cpu_set_pc; cc->gdb_read_register = hppa_cpu_gdb_read_register; From patchwork Fri Sep 24 09:38:30 2021 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: 1532164 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=e2rjeBRe; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4HG6rM483dz9sXk for ; Fri, 24 Sep 2021 19:56:51 +1000 (AEST) Received: from localhost ([::1]:37998 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mThwn-0008T3-A4 for incoming@patchwork.ozlabs.org; Fri, 24 Sep 2021 05:56:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41530) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mThhA-0005Qe-Ra for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:40:40 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:34761) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mThh8-0007Lh-VJ for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:40:40 -0400 Received: by mail-wr1-x42c.google.com with SMTP id t8so25632686wri.1 for ; Fri, 24 Sep 2021 02:40:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FoSlQqSQ8ZbPbrlQxUB8XNqV2UVRF3KYNvOO8ZgTpHU=; b=e2rjeBReLlbDcXAeJ/Cb9Yn5v9MGsAeSRheiCavE1hU1Wv+UI1pnvHTj0fZQqwCGQ/ S3xfunAeKPbEm+6rvV48GPUzAgvLd8ZFvNGFwRCbeY88vffmZ50SmpvSxMRU9m9foy2y hoXaSipiwwdgvSq1BYaiM0/VZlGe94i4SrDW3PVAseH9bV2DXtKLNHRcnAAHRj1oskZ1 8KDTjzTxYFiTg7XUhyXrAMEm15JCMC3JSwBmASitL2joxL4fxC85Q6OkDgeIeZCEiUFg K6TJYsiLb+RhsAWG1u9i8NoyMHZXc+bU9sPU/spqF2snZD5kPV9RS6E9AqmKcZICatR7 CJCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=FoSlQqSQ8ZbPbrlQxUB8XNqV2UVRF3KYNvOO8ZgTpHU=; b=DGrDih2MmXdU0zHMQ/FrUW3wQCrBbZJCf9itE9YKuQG5HYrK+nnzrfoVZln0jCQZia 9o97kSQODIwh2tLd/9CYC9CyNSk+AOmP89rA9KNtZnb/JDQVcjlR/n7HxbiOY3HTKRz5 T3+WNHL6psR8Ipi4jSI1eFLVxgbzjZlT8CPJCdXgNCbHcetNLJi8JmSJvV6LiPrMIwGa jJAjWNyF6FCCvdsiYHJ44C6KH2zOnZLrQhtzHHU5JsDgVQSxh0k2nEsZ2Cqwl+DuCMuA a+TSPy4o8+ELEw3oWOPjYBrg4myWOSOUCuvil0zpJBfKkiBttNVwqnNHuNezso2Ytitt 3+fQ== X-Gm-Message-State: AOAM532kY6MKNrm2mae2BvpN6JKn9GrGOkKET51sVm2+gDRXgf5UESmn SDgz8PY6ceS+O7XWZIyFAL3Qg73aFXM= X-Google-Smtp-Source: ABdhPJxWcoBj6SCR5xO0qwLtIk6dqPprv8b3kvSgYvBzRvwxFpS1rYYwFwqP3o2oAip5FjrDfegeRg== X-Received: by 2002:a1c:2246:: with SMTP id i67mr1015259wmi.157.1632476437444; Fri, 24 Sep 2021 02:40:37 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id z13sm8769199wrs.90.2021.09.24.02.40.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 02:40:36 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v6 23/40] target/i386: Restrict has_work() handler to sysemu and TCG Date: Fri, 24 Sep 2021 11:38:30 +0200 Message-Id: <20210924093847.1014331-24-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210924093847.1014331-1-f4bug@amsat.org> References: <20210924093847.1014331-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x42c.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Eduardo Habkost Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Restrict has_work() to TCG sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/i386/cpu.c | 6 ------ target/i386/tcg/tcg-cpu.c | 8 +++++++- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 6b029f1bdf1..36a1c5f3fd2 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -6554,11 +6554,6 @@ int x86_cpu_pending_interrupt(CPUState *cs, int interrupt_request) return 0; } -static bool x86_cpu_has_work(CPUState *cs) -{ - return x86_cpu_pending_interrupt(cs, cs->interrupt_request) != 0; -} - static void x86_disas_set_info(CPUState *cs, disassemble_info *info) { X86CPU *cpu = X86_CPU(cs); @@ -6763,7 +6758,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->dump_state = x86_cpu_dump_state; cc->set_pc = x86_cpu_set_pc; cc->gdb_read_register = x86_cpu_gdb_read_register; diff --git a/target/i386/tcg/tcg-cpu.c b/target/i386/tcg/tcg-cpu.c index 3ecfae34cb5..aef050d0898 100644 --- a/target/i386/tcg/tcg-cpu.c +++ b/target/i386/tcg/tcg-cpu.c @@ -55,6 +55,11 @@ static void x86_cpu_synchronize_from_tb(CPUState *cs, } #ifndef CONFIG_USER_ONLY +static bool x86_cpu_has_work(CPUState *cs) +{ + return x86_cpu_pending_interrupt(cs, cs->interrupt_request) != 0; +} + static bool x86_debug_check_breakpoint(CPUState *cs) { X86CPU *cpu = X86_CPU(cs); @@ -63,7 +68,7 @@ static bool x86_debug_check_breakpoint(CPUState *cs) /* RF disables all architectural breakpoints. */ return !(env->eflags & RF_MASK); } -#endif +#endif /* CONFIG_USER_ONLY */ #include "hw/core/tcg-cpu-ops.h" @@ -76,6 +81,7 @@ static const struct TCGCPUOps x86_tcg_ops = { #ifdef CONFIG_USER_ONLY .fake_user_interrupt = x86_cpu_do_interrupt, #else + .has_work = x86_cpu_has_work, .do_interrupt = x86_cpu_do_interrupt, .cpu_exec_interrupt = x86_cpu_exec_interrupt, .debug_excp_handler = breakpoint_handler, From patchwork Fri Sep 24 09:38:31 2021 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: 1532176 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=FgN+bzOD; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4HG73r3Swbz9sXk for ; Fri, 24 Sep 2021 20:06:48 +1000 (AEST) Received: from localhost ([::1]:38168 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mTi6Q-0002Ey-83 for incoming@patchwork.ozlabs.org; Fri, 24 Sep 2021 06:06:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41550) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mThhF-0005cv-4e for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:40:45 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:40534) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mThhD-0007SO-OG for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:40:44 -0400 Received: by mail-wr1-x433.google.com with SMTP id t28so12107788wra.7 for ; Fri, 24 Sep 2021 02:40:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2wVO/8lNTdglwVP+4rQ9px8jTQizKXJBfsXgcLc7jls=; b=FgN+bzODD3/vzEgURNAkBOlFqtH0gPJBUL248NhSx2xNQIZYxJbTmst8H0ZzsPi2Si hxo1/lPk+VVUNQkUscAKHO3f0aMaSqCyEwi6EK+nWFD7adZFBiSzzp3lATJxV46Lo9tC TxgEE9ZlfNbjCkbN2c/GGP3XnZesPiTMlUHZ38+IZ3s7vQvt5E3z7HwTVyG+1gkj+IKl BaXGUNKXxWiD1s0oFAjL4zbo+JTciYA/oxxeUUTtYL9x/ZuOPAEifpiGI283VMn1MrEe F5gASGt4MTPjfsvhGsHy4SQWnTO54I7wmjhCunRhBPIj2YCJ7aaffi2HAmBNUdI6RVVV opcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=2wVO/8lNTdglwVP+4rQ9px8jTQizKXJBfsXgcLc7jls=; b=kpl5EWM00bGXcMWNXseT/3RYT2Fd6JF09fX9lf9AoDbzm5TEh5v5xXPQsixVQxCVnd xhrBhNBS8Izt2liHR/TD5SNPz108Qg1hRoZw8ondTva38uvcdymwWWPZUqN92RxZAw++ 3rzaoNaAhEDfZj7FSAAcWLMskuUoLYTWVxW3hDl7kxWP8m80HNy4ftM72IzKbeSTvmFT a36Hoo1YYBed4VIYwG4cAKGZ5rIWTwHZUoCngO71p+AAudimopHESi29U5Hh0uz2VpFg Q1+YqFq0P4p/p+FoHl2JvYVgt0tyMx239dkIh+Lm1UC6gPm/SdB3C9oDESVtpYHbj6xW 05rQ== X-Gm-Message-State: AOAM532GrvRYsFvZuZk5LzKHdLwJRWHUK+J/blcyrz6cBSIcfbfWOz59 1K71pFIrazx83bcFnelZL3aW8hoQlkY= X-Google-Smtp-Source: ABdhPJwoMYy0gpKYQ/1CTpDbgpZ2qrGlFUwIVBPLDcWyjY8RwvmwKJ9g+LFxUJVipkH/eM8ljaSVtg== X-Received: by 2002:a5d:64c1:: with SMTP id f1mr10274123wri.422.1632476442059; Fri, 24 Sep 2021 02:40:42 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id k6sm11192127wmo.37.2021.09.24.02.40.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 02:40:41 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v6 24/40] target/m68k: Restrict has_work() handler to sysemu Date: Fri, 24 Sep 2021 11:38:31 +0200 Message-Id: <20210924093847.1014331-25-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210924093847.1014331-1-f4bug@amsat.org> References: <20210924093847.1014331-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x433.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Restrict has_work() to sysemu. Reviewed-by: Richard Henderson 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 66d22d11895..ad5d26b5c9e 100644 --- a/target/m68k/cpu.c +++ b/target/m68k/cpu.c @@ -31,10 +31,12 @@ static void m68k_cpu_set_pc(CPUState *cs, vaddr value) cpu->env.pc = value; } +#if !defined(CONFIG_USER_ONLY) static bool m68k_cpu_has_work(CPUState *cs) { return cs->interrupt_request & CPU_INTERRUPT_HARD; } +#endif /* !CONFIG_USER_ONLY */ static void m68k_set_feature(CPUM68KState *env, int feature) { @@ -518,6 +520,7 @@ static const struct TCGCPUOps m68k_tcg_ops = { .tlb_fill = m68k_cpu_tlb_fill, #ifndef CONFIG_USER_ONLY + .has_work = m68k_cpu_has_work, .cpu_exec_interrupt = m68k_cpu_exec_interrupt, .do_interrupt = m68k_cpu_do_interrupt, .do_transaction_failed = m68k_cpu_transaction_failed, @@ -535,7 +538,6 @@ static void m68k_cpu_class_init(ObjectClass *c, void *data) device_class_set_parent_reset(dc, m68k_cpu_reset, &mcc->parent_reset); cc->class_by_name = m68k_cpu_class_by_name; - cc->has_work = m68k_cpu_has_work; cc->dump_state = m68k_cpu_dump_state; cc->set_pc = m68k_cpu_set_pc; cc->gdb_read_register = m68k_cpu_gdb_read_register; From patchwork Fri Sep 24 09:38:32 2021 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: 1532179 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=OM/0dF3N; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4HG76F6c7Rz9ssP for ; Fri, 24 Sep 2021 20:08:53 +1000 (AEST) Received: from localhost ([::1]:44148 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mTi8R-0006Ja-Mm for incoming@patchwork.ozlabs.org; Fri, 24 Sep 2021 06:08:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41578) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mThhO-00061v-5k for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:40:55 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:40527) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mThhI-0007Ya-9t for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:40:52 -0400 Received: by mail-wr1-x42a.google.com with SMTP id t28so12108523wra.7 for ; Fri, 24 Sep 2021 02:40:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TotqMEN5DrXYEF17ne4DDCu2zSM8Bp20jLCGhp9+svs=; b=OM/0dF3NI1YOwFRPIv0JxiIP+CxHF93wyDHkuapIBBYEvQy7/ooid8xn1Zxs7n4ENQ kql2G4sBHl99lz27wGxk3HvSsA+EhgZvJub9L3zcoVPtAi1CIYQY4gNB/5zPKXN4Qc1U 9Ip31zS2beKEShsjqrCd2g6HH1To7ALppRwvJkNiB04GyXr5zp+Au7mvGTkdF09NKADZ j98ug4D/QXmyUvFKwphZUsjUJx6BUggyPP/CagjX0XnJ3IrxJ1ZhuJdG903gqSmQb8gT i0Wne0pPNCTLiyCVseNuGlRL31T0nmt6CmY+N9P9xMXqaDkjPEbEQqHYVcSPWwSEAhQY fxWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=TotqMEN5DrXYEF17ne4DDCu2zSM8Bp20jLCGhp9+svs=; b=2TLwTKlIsW2sQZZvlOdrNQIMyIdlL8wwAI6o7VD+OnvxDz7DIyMuxfge7IlVXq/+97 g27SJhaj/Mpdt0aKfbdl2cOiVo4xuTbMWnnmqTUWuk6+gIO8Sx8KOWw0Mn/GgN2ftvMf zkXibByjdCED/r7psv1Eng9tBBKcWEio6hpsD/AL1/nx/hqgM63AC7h10Yub+bnCc2iA 2l1zC1JrHiKxsi/zzwQimJ1dEWbfGd7o3ytCl+fxrgOYbvGKqMmRUv+XkBI85vvAMPRt KIsLlZG9IYvPGgSdtNn4f6ZHYfrGY3BnrXNN1Au4RxWZh5DVHCwsf1Q2xfpp4nsPgEXv 9W6g== X-Gm-Message-State: AOAM530xnZ5JuNNyUa/FQX4c5xOUPRWtAzJARSll2SYz8i0YFxM3wxR8 3qtNNzdwJV0AreR53vd14TVMWrjJnAg= X-Google-Smtp-Source: ABdhPJyBGBgdEd/n8Zi7iyxga5yCoQVwc4ydEor1WSdcRy88clr6yA4QCAXVziHDgny2WZx2w7u+Jw== X-Received: by 2002:a5d:4d91:: with SMTP id b17mr10315790wru.321.1632476446748; Fri, 24 Sep 2021 02:40:46 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id n14sm6139585wmc.38.2021.09.24.02.40.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 02:40:46 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v6 25/40] target/microblaze: Restrict has_work() handler to sysemu Date: Fri, 24 Sep 2021 11:38:32 +0200 Message-Id: <20210924093847.1014331-26-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210924093847.1014331-1-f4bug@amsat.org> References: <20210924093847.1014331-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x42a.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, T_SPF_HELO_TEMPERROR=0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Edgar E. Iglesias" , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Restrict has_work() to sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/microblaze/cpu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index 15db277925f..36e6e540483 100644 --- a/target/microblaze/cpu.c +++ b/target/microblaze/cpu.c @@ -92,12 +92,13 @@ static void mb_cpu_synchronize_from_tb(CPUState *cs, cpu->env.iflags = tb->flags & IFLAGS_TB_MASK; } +#ifndef CONFIG_USER_ONLY + static bool mb_cpu_has_work(CPUState *cs) { return cs->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_NMI); } -#ifndef CONFIG_USER_ONLY static void mb_cpu_ns_axi_dp(void *opaque, int irq, int level) { MicroBlazeCPU *cpu = opaque; @@ -142,7 +143,7 @@ static void microblaze_cpu_set_irq(void *opaque, int irq, int level) cpu_reset_interrupt(cs, type); } } -#endif +#endif /* !CONFIG_USER_ONLY */ static void mb_cpu_reset(DeviceState *dev) { @@ -368,6 +369,7 @@ static const struct TCGCPUOps mb_tcg_ops = { .tlb_fill = mb_cpu_tlb_fill, #ifndef CONFIG_USER_ONLY + .has_work = mb_cpu_has_work, .cpu_exec_interrupt = mb_cpu_exec_interrupt, .do_interrupt = mb_cpu_do_interrupt, .do_transaction_failed = mb_cpu_transaction_failed, @@ -386,8 +388,6 @@ static void mb_cpu_class_init(ObjectClass *oc, void *data) device_class_set_parent_reset(dc, mb_cpu_reset, &mcc->parent_reset); cc->class_by_name = mb_cpu_class_by_name; - cc->has_work = mb_cpu_has_work; - cc->dump_state = mb_cpu_dump_state; cc->set_pc = mb_cpu_set_pc; cc->gdb_read_register = mb_cpu_gdb_read_register; From patchwork Fri Sep 24 09:38:33 2021 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: 1532167 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=poAo8TZV; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4HG6tS0bkgz9sXk for ; Fri, 24 Sep 2021 19:58:40 +1000 (AEST) Received: from localhost ([::1]:44286 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mThyX-0004HO-Qh for incoming@patchwork.ozlabs.org; Fri, 24 Sep 2021 05:58:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41590) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mThhP-00062w-Ce for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:40:55 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:42889) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mThhO-0007cK-1A for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:40:55 -0400 Received: by mail-wr1-x434.google.com with SMTP id i24so9570798wrc.9 for ; Fri, 24 Sep 2021 02:40:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iR+hhecIhVQbqLgRtJRf7TAYJMYyVJckrOxOor2tvDk=; b=poAo8TZVliy9CTJaK1iutNXJ9iF0CPrs8SUol+weLnwShMDjnexGYWQe4XAO/mDEP2 6ClZCATrb9xakVT1TdqgqqIoQAOHeBDDFxkYbXexXRdtFIWUxU9M7KAijVfyOkyPhTHL ulEfk9tTB/oqjy4qHetFVRRR74a+z9e+ZZ4+kLFt5QvyJfJx/5zeXRzZk/FZJ9fojG1l pPhKlExWlh0YSADiq0XYHgZkQLzlsVtxgCUH9CwqXWbWIqJq5hqltaquLoYtW7YYJCCn b5qNwTcDvE9CITU3vQqSLjQusvQm/KtvlopzBSirx6oynTDjuuoBy9C3Vu29JNK4cp8j sovA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=iR+hhecIhVQbqLgRtJRf7TAYJMYyVJckrOxOor2tvDk=; b=JqQa2eHMFPc7Xad+Um3cvz8da4YguZT278US7b10ZibMathURPFizRv765QAzEHrm0 Np3coK4+qY4uwbLJXk5pebpeHotmOrid6zc0eOerWbcg3lHBMo6kTQ4VpQWXUCnqXfqH YnJVT0QRMKW9E9yjNYXdCVmYUfwvzvoJKFB82I8OkLEAIb8zAAsVeShs+KZtVz7jCtv5 nmGOPg1ydM5To3gBwmVJRdlFz48qj8hMaiR1XsIGHNLtpOs37RC2jUv2wufblzA9S3e4 Zaec9YxyN+dYFkZjqjZdgszXwOO6B+gNb7AQzYferkXAGNU9YSpOdfUHC+Y8ZsuhmjHr /39Q== X-Gm-Message-State: AOAM530z2vvTaaKKTkDvwbFs3xeQCTTlnOWIt9tbr5syAI8soNLoKSK7 B00lQWreSkl856z8C+5qzoi48fX1hXs= X-Google-Smtp-Source: ABdhPJy5HMTxlNXPvYuT0ZCbUAkwbGeY6f1D5UvQG6GdUJlsPaWDT3+c/kxp98Fku5vy3IDY3Q1ymQ== X-Received: by 2002:a5d:6cb1:: with SMTP id a17mr10330856wra.72.1632476451519; Fri, 24 Sep 2021 02:40:51 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id v17sm5870249wro.62.2021.09.24.02.40.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 02:40:51 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v6 26/40] target/mips: Restrict has_work() handler to sysemu and TCG Date: Fri, 24 Sep 2021 11:38:33 +0200 Message-Id: <20210924093847.1014331-27-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210924093847.1014331-1-f4bug@amsat.org> References: <20210924093847.1014331-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x434.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Aurelien Jarno , Aleksandar Rikalo Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Restrict has_work() to TCG sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/mips/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/mips/cpu.c b/target/mips/cpu.c index 00e0c55d0e4..3639c03f8ea 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -128,6 +128,7 @@ static void mips_cpu_set_pc(CPUState *cs, vaddr value) mips_env_set_pc(&cpu->env, value); } +#if defined(CONFIG_TCG) && !defined(CONFIG_USER_ONLY) static bool mips_cpu_has_work(CPUState *cs) { MIPSCPU *cpu = MIPS_CPU(cs); @@ -172,6 +173,7 @@ static bool mips_cpu_has_work(CPUState *cs) } return has_work; } +#endif /* CONFIG_TCG && !CONFIG_USER_ONLY */ #include "cpu-defs.c.inc" @@ -542,6 +544,7 @@ static const struct TCGCPUOps mips_tcg_ops = { .tlb_fill = mips_cpu_tlb_fill, #if !defined(CONFIG_USER_ONLY) + .has_work = mips_cpu_has_work, .cpu_exec_interrupt = mips_cpu_exec_interrupt, .do_interrupt = mips_cpu_do_interrupt, .do_transaction_failed = mips_cpu_do_transaction_failed, @@ -563,7 +566,6 @@ static void mips_cpu_class_init(ObjectClass *c, void *data) device_class_set_props(dc, mips_cpu_properties); cc->class_by_name = mips_cpu_class_by_name; - cc->has_work = mips_cpu_has_work; cc->dump_state = mips_cpu_dump_state; cc->set_pc = mips_cpu_set_pc; cc->gdb_read_register = mips_cpu_gdb_read_register; From patchwork Fri Sep 24 09:38:34 2021 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: 1532171 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=JklFsp/J; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4HG6xF0LT3z9ssP for ; Fri, 24 Sep 2021 20:01:03 +1000 (AEST) Received: from localhost ([::1]:52794 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mTi0p-0001TX-Vl for incoming@patchwork.ozlabs.org; Fri, 24 Sep 2021 06:01:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41602) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mThhT-00064y-0J for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:40:59 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:38856) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mThhR-0007fY-Ky for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:40:58 -0400 Received: by mail-wr1-x42d.google.com with SMTP id u18so25557309wrg.5 for ; Fri, 24 Sep 2021 02:40:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=acgjCaHCdDvDEO6aQNdNA165wsQFWfR3HbCbuPW+vnw=; b=JklFsp/JCJxsM2SvH0dD32pLumT+1IDSWSWwJRMl3mAQbiHB305xm+u/juOH6YJTi7 Agf9Oq2L0ViuHACojTR7AXdF9ot246eJtDkfoaM++eh1M3OyaV3zZXOfkL8y9wABezrE MjxDqYpwx8yCaV1OykjdVvldcjf5PvUsAnB+a71yGVRK20AeSOsr68PHTZ0ILJN5THGD rarInE0OB+BbL+oDj3MZMabqJothzUZSb37xjty+xYfy/F6YEn54S0a3H3xq/W+PWGQg fB5gNRiDDlBz4QUyVYp2Vbl5usFB+rX7RFssC1/PH0IuxiBh3DQoJbnj/W5hwi9QdGys JkSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=acgjCaHCdDvDEO6aQNdNA165wsQFWfR3HbCbuPW+vnw=; b=ZcduTBKh4NSpMPQE9BMY+I5PjYyCu8s/z+s6rZ2SH0kIW7wp7ufPxgXHIke+oLkmr/ 70zQgAXSNBtGug+ducIytVbNHp2VL1bRNnDmNsnJIfavQMufayA3TQE/ADMsJE89kti+ IEwB2rkDTQ8oZCN1SrdM+NTARkMDy9h9b1WXEYnUA0iuZcvuEot+O3lNPNx4boEVPTEc khPnyM/h6R4JZ9Z7UesxslYSbdHbxMLkLRadlhkEtMgSZR4GAY9z2xkaJeaQVDiCngNo itI6kiqaF4TRfp/CQuVL46ELbdv3l7jqF+b7XXLeV8X4OEqZNqZoWvzlVbD5SNSHODA3 M8dA== X-Gm-Message-State: AOAM533O/MJB6EKSjF2oI9KmQTuDZwy5ZZj3FBthyEui0FBR6jSSA4Jw 6U23XNvXO2e5rAjgN4Dqll+X7doLgwA= X-Google-Smtp-Source: ABdhPJwrZ6cwL9qLE44d/Idg2E1YkVLY8nqSTXzOzkCYF2RW3k8J+F8+C2gHJTzigunGTsXzExu7cQ== X-Received: by 2002:a7b:cde8:: with SMTP id p8mr1065093wmj.178.1632476456123; Fri, 24 Sep 2021 02:40:56 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id v17sm5870485wro.62.2021.09.24.02.40.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 02:40:55 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v6 27/40] target/nios2: Restrict has_work() handler to sysemu Date: Fri, 24 Sep 2021 11:38:34 +0200 Message-Id: <20210924093847.1014331-28-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210924093847.1014331-1-f4bug@amsat.org> References: <20210924093847.1014331-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x42d.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marek Vasut , Chris Wulff , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Restrict has_work() to sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/nios2/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/nios2/cpu.c b/target/nios2/cpu.c index 947bb09bc1e..9938d7c2919 100644 --- a/target/nios2/cpu.c +++ b/target/nios2/cpu.c @@ -34,10 +34,12 @@ static void nios2_cpu_set_pc(CPUState *cs, vaddr value) env->regs[R_PC] = value; } +#if !defined(CONFIG_USER_ONLY) static bool nios2_cpu_has_work(CPUState *cs) { return cs->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_NMI); } +#endif /* !CONFIG_USER_ONLY */ static void nios2_cpu_reset(DeviceState *dev) { @@ -223,6 +225,7 @@ static const struct TCGCPUOps nios2_tcg_ops = { .tlb_fill = nios2_cpu_tlb_fill, #ifndef CONFIG_USER_ONLY + .has_work = nios2_cpu_has_work, .cpu_exec_interrupt = nios2_cpu_exec_interrupt, .do_interrupt = nios2_cpu_do_interrupt, .do_unaligned_access = nios2_cpu_do_unaligned_access, @@ -241,7 +244,6 @@ static void nios2_cpu_class_init(ObjectClass *oc, void *data) device_class_set_parent_reset(dc, nios2_cpu_reset, &ncc->parent_reset); cc->class_by_name = nios2_cpu_class_by_name; - cc->has_work = nios2_cpu_has_work; cc->dump_state = nios2_cpu_dump_state; cc->set_pc = nios2_cpu_set_pc; cc->disas_set_info = nios2_cpu_disas_set_info; From patchwork Fri Sep 24 09:38:35 2021 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: 1532173 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=i2jgb4SG; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4HG70H3zRWz9ssP for ; Fri, 24 Sep 2021 20:03:43 +1000 (AEST) Received: from localhost ([::1]:60352 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mTi3R-0006bY-AV for incoming@patchwork.ozlabs.org; Fri, 24 Sep 2021 06:03:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41622) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mThhZ-0006A1-3D for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:41:08 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:46671) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mThhW-0007jg-Ps for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:41:04 -0400 Received: by mail-wr1-x435.google.com with SMTP id t7so25382557wrw.13 for ; Fri, 24 Sep 2021 02:41:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=h26pMLEnUsWrxMoqQtHQ2NCzZkcdqUGqN4k/9eCW+zM=; b=i2jgb4SG15wpDl0VMAQFSr1Uk8/q1R/C2bAbK7nfz1wKoH3oEdUogCeB8kPpkkrFg5 fGwyFShCM54hUtUN5B26AzbrwEYxh+SrxNF7GIfDFAZUihESACkqIFwmKZ+aCxnhm+JN lzIXiK9gfSAVpsM2gX+dktjvdpajJ8HQcMKdeL2vzzOSd2NOQplJ+t379ort07PznYLW RwDcjvroIHR+n2TGnllT1MGz2Hzr2DHyC+dmA2vpUdP0bXnpBBf3RkrogWIEntkfVCNe 4ANDPpecf+ym3d9ID+dg/yzvQTxwq/E+Wnm25Me2GYx4s+Odi3yDZs5CVH9Fd9AcYJOY 3bZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=h26pMLEnUsWrxMoqQtHQ2NCzZkcdqUGqN4k/9eCW+zM=; b=ApPbe6XRnznXX2GcK8NldourglLO1ClZKBmtxNSNUr3VzoHtcAeqeTCvFy//XCeW2O Ia4JqbCccgCgzs3Co1pJtU9oUtc9XDhjX+ytXYeKjQWHRuRCrg7sGY4gohBGt14I05dH LEFZCGgvR2eZY+kqufnpB2762w4U//t2toZ/zaE/OYXNInpNq8WXmHUBfWHmk3EJ0piJ COPOjC3zIMtahENzfJl9FTIAPGCmzm0GNgrEx1uOKIz0Gd35N3zgI96v5N5D/UT5cPBh jppud0CO6MNG2ybyz8Gj8Jk7m4twXq8dPDiJCkgIMVE1vrGv6pXIQn7B4Rjxp8rVuGgQ tVGg== X-Gm-Message-State: AOAM532ulZNsR0G3ELwnL9QeBGAl7UgebHk95yKzox/W9v50tfonVe9U vlW3GRbwvvFE1iEzyf4XMnggvVvJPoY= X-Google-Smtp-Source: ABdhPJxPBqdq6C+OkU1AIPNDoICIzsm27N4kVsjTxh+NKpZ4u90T5oKFLdfLyIPpAUxSCCkKYx3Vvw== X-Received: by 2002:adf:e0cc:: with SMTP id m12mr10264279wri.62.1632476461266; Fri, 24 Sep 2021 02:41:01 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id h125sm8123691wmh.9.2021.09.24.02.41.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 02:41:00 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v6 28/40] target/openrisc: Restrict has_work() handler to sysemu Date: Fri, 24 Sep 2021 11:38:35 +0200 Message-Id: <20210924093847.1014331-29-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210924093847.1014331-1-f4bug@amsat.org> References: <20210924093847.1014331-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x435.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stafford Horne , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Restrict has_work() to sysemu. Reviewed-by: Richard Henderson 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 27cb04152f9..3c368a1bde7 100644 --- a/target/openrisc/cpu.c +++ b/target/openrisc/cpu.c @@ -30,11 +30,13 @@ static void openrisc_cpu_set_pc(CPUState *cs, vaddr value) cpu->env.dflag = 0; } +#if !defined(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 void openrisc_disas_set_info(CPUState *cpu, disassemble_info *info) { @@ -189,6 +191,7 @@ static const struct TCGCPUOps openrisc_tcg_ops = { .tlb_fill = openrisc_cpu_tlb_fill, #ifndef CONFIG_USER_ONLY + .has_work = openrisc_cpu_has_work, .cpu_exec_interrupt = openrisc_cpu_exec_interrupt, .do_interrupt = openrisc_cpu_do_interrupt, #endif /* !CONFIG_USER_ONLY */ @@ -205,7 +208,6 @@ static void openrisc_cpu_class_init(ObjectClass *oc, void *data) device_class_set_parent_reset(dc, openrisc_cpu_reset, &occ->parent_reset); cc->class_by_name = openrisc_cpu_class_by_name; - cc->has_work = openrisc_cpu_has_work; cc->dump_state = openrisc_cpu_dump_state; cc->set_pc = openrisc_cpu_set_pc; cc->gdb_read_register = openrisc_cpu_gdb_read_register; From patchwork Fri Sep 24 09:38:36 2021 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: 1532188 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=DW3g0HBg; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4HG7Bl3QL8z9sPB for ; Fri, 24 Sep 2021 20:12:47 +1000 (AEST) Received: from localhost ([::1]:55728 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mTiCD-00064i-94 for incoming@patchwork.ozlabs.org; Fri, 24 Sep 2021 06:12:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41712) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mThht-0006Rr-42; Fri, 24 Sep 2021 05:41:26 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:44972) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mThhc-0007oU-VK; Fri, 24 Sep 2021 05:41:24 -0400 Received: by mail-wr1-x431.google.com with SMTP id d6so25384421wrc.11; Fri, 24 Sep 2021 02:41:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7WPGnjIwDqq9FNiuzjIUo9e3oGnINOP8qAvzXoIP118=; b=DW3g0HBgSm72NyIUZ0l1AL3YPBRXrik2Fg9obkT6cJiYKQfvtQ2s3flA/ahT+eiRi+ WVxQX6nJyrImw7Gp35wLXIa792GtJmNYqosTL5mWwiuN8sPgRr0IFQmxvww5mlCnNKwU 3Xj40Hy95be6qLgJym6m9CPDeZegIviYdMrvoQv9quZ+7F6sBw3oVrch0XBC/Lt41TmU xPJrvk7bbBirlCLt/DzqIPtz7i5JgfIGNHzUYBXUQOSbCQxFj7TR38INRT/qge7J6JBi ljzyB/t66cbNiqnEA+wspbJdbfHrvSiKrRSHKhuZS2caE6thtVxhKjOwkKkFZbVT70OX NG9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=7WPGnjIwDqq9FNiuzjIUo9e3oGnINOP8qAvzXoIP118=; b=QuKYJghI0/fx7b5pJM4/a5yARrK1W3MYpF4CH+5yvBDaYb0AW4scccdHBXybXnvLzX Z1BkKCpllBRhHobHT+d3HHwzzmxUQFanp3/avJX7PElE/FtGX9E3rHr9vCTQON6Fo6iM JVFYX0Zxb+x6ljVCvJEXxtZ4oVdijQSj6WkTWy5QochJcYUDIgofMwpwxhv3LBGrank6 Wbkmb/agi1Gb8vSDRJulu2o9LlpSZmyHQcIjgxeWPESMLBjAY2hgZMypEipXZAi50Ic3 Da6NIw/DfTRmYp7LxG+l6vVqMuF86HDlQy9xKWnXoevArDQlCghpehPFC4JjRiwAGg9s D/eQ== X-Gm-Message-State: AOAM532e86gV77p93tMo2hrBUvtSsMd39CUoqLUGMG2NpipFYUF3qW7Q XqSJ+oz5ES4TzZv6XPyWn2H3ZaY/PD4= X-Google-Smtp-Source: ABdhPJyaws8sCJKrNNBWGp1d3cdvHkyeaFu9gNjCXvGQA0cMCiJ4pKeVLqHYFIj8iTedfDDf/XxWxw== X-Received: by 2002:a5d:64ab:: with SMTP id m11mr10182168wrp.343.1632476467094; Fri, 24 Sep 2021 02:41:07 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id a25sm11607839wmj.34.2021.09.24.02.41.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 02:41:06 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v6 29/40] target/ppc: Introduce PowerPCCPUClass::has_work() Date: Fri, 24 Sep 2021 11:38:36 +0200 Message-Id: <20210924093847.1014331-30-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210924093847.1014331-1-f4bug@amsat.org> References: <20210924093847.1014331-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x431.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "open list:PowerPC TCG CPUs" , Greg Kurz , Richard Henderson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" We're moving the hook from CPUState to TCGCPUOps. TCGCPUOps is a const structure, so to avoid creating multiple versions of the same structure, simply changing the has_work() handler, introduce yet another indirection with a has_work() handler in PowerPCCPUClass, and ppc_cpu_has_work() method which dispatch to it. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/ppc/cpu-qom.h | 1 + target/ppc/cpu_init.c | 23 ++++++++++++++--------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/target/ppc/cpu-qom.h b/target/ppc/cpu-qom.h index 5800fa324e8..36110112506 100644 --- a/target/ppc/cpu-qom.h +++ b/target/ppc/cpu-qom.h @@ -188,6 +188,7 @@ struct PowerPCCPUClass { uint32_t flags; int bfd_mach; uint32_t l1_dcache_size, l1_icache_size; + bool (*has_work)(CPUState *cpu); #ifndef CONFIG_USER_ONLY unsigned int gdb_num_sprs; const char *gdb_spr_xml; diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index 6aad01d1d3a..2f7d262b176 100644 --- a/target/ppc/cpu_init.c +++ b/target/ppc/cpu_init.c @@ -7621,7 +7621,6 @@ POWERPC_FAMILY(POWER7)(ObjectClass *oc, void *data) { DeviceClass *dc = DEVICE_CLASS(oc); PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc); - CPUClass *cc = CPU_CLASS(oc); dc->fw_name = "PowerPC,POWER7"; dc->desc = "POWER7"; @@ -7630,7 +7629,7 @@ POWERPC_FAMILY(POWER7)(ObjectClass *oc, void *data) pcc->pcr_supported = PCR_COMPAT_2_06 | PCR_COMPAT_2_05; pcc->init_proc = init_proc_POWER7; pcc->check_pow = check_pow_nocheck; - cc->has_work = cpu_has_work_POWER7; + pcc->has_work = cpu_has_work_POWER7; pcc->insns_flags = PPC_INSNS_BASE | PPC_ISEL | PPC_STRING | PPC_MFTB | PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES | PPC_FLOAT_FSQRT | PPC_FLOAT_FRSQRTE | @@ -7789,7 +7788,6 @@ POWERPC_FAMILY(POWER8)(ObjectClass *oc, void *data) { DeviceClass *dc = DEVICE_CLASS(oc); PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc); - CPUClass *cc = CPU_CLASS(oc); dc->fw_name = "PowerPC,POWER8"; dc->desc = "POWER8"; @@ -7798,7 +7796,7 @@ POWERPC_FAMILY(POWER8)(ObjectClass *oc, void *data) pcc->pcr_supported = PCR_COMPAT_2_07 | PCR_COMPAT_2_06 | PCR_COMPAT_2_05; pcc->init_proc = init_proc_POWER8; pcc->check_pow = check_pow_nocheck; - cc->has_work = cpu_has_work_POWER8; + pcc->has_work = cpu_has_work_POWER8; pcc->insns_flags = PPC_INSNS_BASE | PPC_ISEL | PPC_STRING | PPC_MFTB | PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES | PPC_FLOAT_FSQRT | PPC_FLOAT_FRSQRTE | @@ -8003,7 +8001,6 @@ POWERPC_FAMILY(POWER9)(ObjectClass *oc, void *data) { DeviceClass *dc = DEVICE_CLASS(oc); PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc); - CPUClass *cc = CPU_CLASS(oc); dc->fw_name = "PowerPC,POWER9"; dc->desc = "POWER9"; @@ -8013,7 +8010,7 @@ POWERPC_FAMILY(POWER9)(ObjectClass *oc, void *data) PCR_COMPAT_2_05; pcc->init_proc = init_proc_POWER9; pcc->check_pow = check_pow_nocheck; - cc->has_work = cpu_has_work_POWER9; + pcc->has_work = cpu_has_work_POWER9; pcc->insns_flags = PPC_INSNS_BASE | PPC_ISEL | PPC_STRING | PPC_MFTB | PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES | PPC_FLOAT_FSQRT | PPC_FLOAT_FRSQRTE | @@ -8212,7 +8209,6 @@ POWERPC_FAMILY(POWER10)(ObjectClass *oc, void *data) { DeviceClass *dc = DEVICE_CLASS(oc); PowerPCCPUClass *pcc = POWERPC_CPU_CLASS(oc); - CPUClass *cc = CPU_CLASS(oc); dc->fw_name = "PowerPC,POWER10"; dc->desc = "POWER10"; @@ -8223,7 +8219,7 @@ POWERPC_FAMILY(POWER10)(ObjectClass *oc, void *data) PCR_COMPAT_2_06 | PCR_COMPAT_2_05; pcc->init_proc = init_proc_POWER10; pcc->check_pow = check_pow_nocheck; - cc->has_work = cpu_has_work_POWER10; + pcc->has_work = cpu_has_work_POWER10; pcc->insns_flags = PPC_INSNS_BASE | PPC_ISEL | PPC_STRING | PPC_MFTB | PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES | PPC_FLOAT_FSQRT | PPC_FLOAT_FRSQRTE | @@ -8790,7 +8786,7 @@ static void ppc_cpu_set_pc(CPUState *cs, vaddr value) cpu->env.nip = value; } -static bool ppc_cpu_has_work(CPUState *cs) +static bool cpu_has_work_default(CPUState *cs) { PowerPCCPU *cpu = POWERPC_CPU(cs); CPUPPCState *env = &cpu->env; @@ -8798,6 +8794,14 @@ static bool ppc_cpu_has_work(CPUState *cs) return msr_ee && (cs->interrupt_request & CPU_INTERRUPT_HARD); } +static bool ppc_cpu_has_work(CPUState *cs) +{ + PowerPCCPU *cpu = POWERPC_CPU(cs); + PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cpu); + + return pcc->has_work(cs); +} + static void ppc_cpu_reset(DeviceState *dev) { CPUState *s = CPU(dev); @@ -9037,6 +9041,7 @@ static void ppc_cpu_class_init(ObjectClass *oc, void *data) device_class_set_parent_unrealize(dc, ppc_cpu_unrealize, &pcc->parent_unrealize); pcc->pvr_match = ppc_pvr_match_default; + pcc->has_work = cpu_has_work_default; device_class_set_props(dc, ppc_cpu_properties); device_class_set_parent_reset(dc, ppc_cpu_reset, &pcc->parent_reset); From patchwork Fri Sep 24 09:38:37 2021 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: 1532168 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=AXO4gF+q; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4HG6v85g7Sz9sXk for ; Fri, 24 Sep 2021 19:59:16 +1000 (AEST) Received: from localhost ([::1]:47544 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mThz8-0006RH-H2 for incoming@patchwork.ozlabs.org; Fri, 24 Sep 2021 05:59:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41668) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mThhk-0006G0-Fb; Fri, 24 Sep 2021 05:41:16 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:36562) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mThhi-0007s8-Ah; Fri, 24 Sep 2021 05:41:16 -0400 Received: by mail-wr1-x42c.google.com with SMTP id g16so25539548wrb.3; Fri, 24 Sep 2021 02:41:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IiP54nTlira6zI1808uaFu0plQ+4ScQiNyLo+fDpcgY=; b=AXO4gF+qgSWRA2JKjultQ78BzHu76xnUUkZiG16W7yPgFFryIvmaJq+DUHgRLD+BTh V/Kh5qZWGDxYbJyxpbPagrupYUXFmt7N1wUNxgxw9Ocjx8fZZIbNSRm7s/D085tgZCi+ q7ZU4rERW2XOmqXufzMiCiyoas/cvjab7SnTfp88AlZvzun7xDONmYrysKNuKFsU7Jlm /TScukXOyPoAXW9HwQUcvdh8dgMxhsx9JpdQfKxlTnh9lowfKpPIMYlx0Hs2hMQawZ58 18R/lIUQKKCBVpQ8XbNm7QmTrXH65o8Qg23FGR6QsQfHghi0ugjMAwVAjL73n6BMcMkf oKgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=IiP54nTlira6zI1808uaFu0plQ+4ScQiNyLo+fDpcgY=; b=Jwh+d0XE5o++cJAWPCU9CY0YkxQ3S7lWQh2JR2JIdjGdu/KFNBGdcVoXJIng4R1vBd zzaGIFxU5d82NEEfnR6aj7Pfs8IAdhzDQZ+I9UJJYGNrvmYR+GYVbasPstxSJELPnDuq 0qAU5b4/nd18AOSHPu8PBmnlpVKVsQW4XaCX8Avi6WGHLtBDNIVYdPVSMJek56saNRgw jpksqYTpJMYQQNSODqSKpAPxs7WO11ZLxeGlaXc13kA9FJAGtk606B5zxulvrApxdjcr +KKrT4B10thYzNy1qKmM8HG5yA271dFJhXQfse8a5GxnsLYdxm/rWwAApC1NIbXklG++ Zn7Q== X-Gm-Message-State: AOAM530ZfW5PDA15MTAciFqOeudO2eAgZwWvW/6KA36O1i3T6ag9afaA KKPRFA1+W1ZVABRu4Y2vGfllCEM1EUI= X-Google-Smtp-Source: ABdhPJwLoPEL9lNPWHYn4AgUdgkW7nURAVDCGaqEwjYE+NEHlda7Fnwa9n+rPU36kEj+hulZIjELxw== X-Received: by 2002:a5d:630a:: with SMTP id i10mr10568591wru.178.1632476471823; Fri, 24 Sep 2021 02:41:11 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id e2sm7640133wra.40.2021.09.24.02.41.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 02:41:11 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v6 30/40] target/ppc: Restrict has_work() handlers to sysemu and TCG Date: Fri, 24 Sep 2021 11:38:37 +0200 Message-Id: <20210924093847.1014331-31-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210924093847.1014331-1-f4bug@amsat.org> References: <20210924093847.1014331-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x42c.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "open list:PowerPC TCG CPUs" , Greg Kurz , Richard Henderson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Restrict PowerPCCPUClass::has_work() and ppc_cpu_has_work() - SysemuCPUOps::has_work() implementation - to TCG sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/ppc/cpu-qom.h | 4 +++- target/ppc/cpu_init.c | 24 ++++++++++++++++++------ 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/target/ppc/cpu-qom.h b/target/ppc/cpu-qom.h index 36110112506..ff2bafcde6f 100644 --- a/target/ppc/cpu-qom.h +++ b/target/ppc/cpu-qom.h @@ -188,8 +188,10 @@ struct PowerPCCPUClass { uint32_t flags; int bfd_mach; uint32_t l1_dcache_size, l1_icache_size; - bool (*has_work)(CPUState *cpu); #ifndef CONFIG_USER_ONLY +#ifdef CONFIG_TCG + bool (*has_work)(CPUState *cpu); +#endif /* CONFIG_TCG */ unsigned int gdb_num_sprs; const char *gdb_spr_xml; #endif diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index 2f7d262b176..5c134adeea9 100644 --- a/target/ppc/cpu_init.c +++ b/target/ppc/cpu_init.c @@ -7583,6 +7583,7 @@ static bool ppc_pvr_match_power7(PowerPCCPUClass *pcc, uint32_t pvr) return false; } +#if defined(CONFIG_TCG) && !defined(CONFIG_USER_ONLY) static bool cpu_has_work_POWER7(CPUState *cs) { PowerPCCPU *cpu = POWERPC_CPU(cs); @@ -7616,6 +7617,7 @@ static bool cpu_has_work_POWER7(CPUState *cs) return msr_ee && (cs->interrupt_request & CPU_INTERRUPT_HARD); } } +#endif /* CONFIG_TCG && !CONFIG_USER_ONLY */ POWERPC_FAMILY(POWER7)(ObjectClass *oc, void *data) { @@ -7629,7 +7631,6 @@ POWERPC_FAMILY(POWER7)(ObjectClass *oc, void *data) pcc->pcr_supported = PCR_COMPAT_2_06 | PCR_COMPAT_2_05; pcc->init_proc = init_proc_POWER7; pcc->check_pow = check_pow_nocheck; - pcc->has_work = cpu_has_work_POWER7; pcc->insns_flags = PPC_INSNS_BASE | PPC_ISEL | PPC_STRING | PPC_MFTB | PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES | PPC_FLOAT_FSQRT | PPC_FLOAT_FRSQRTE | @@ -7672,6 +7673,7 @@ POWERPC_FAMILY(POWER7)(ObjectClass *oc, void *data) pcc->lpcr_pm = LPCR_P7_PECE0 | LPCR_P7_PECE1 | LPCR_P7_PECE2; pcc->mmu_model = POWERPC_MMU_2_06; #if defined(CONFIG_SOFTMMU) + pcc->has_work = cpu_has_work_POWER7; pcc->hash64_opts = &ppc_hash64_opts_POWER7; pcc->lrg_decr_bits = 32; #endif @@ -7742,6 +7744,7 @@ static bool ppc_pvr_match_power8(PowerPCCPUClass *pcc, uint32_t pvr) return false; } +#if defined(CONFIG_TCG) && !defined(CONFIG_USER_ONLY) static bool cpu_has_work_POWER8(CPUState *cs) { PowerPCCPU *cpu = POWERPC_CPU(cs); @@ -7783,6 +7786,7 @@ static bool cpu_has_work_POWER8(CPUState *cs) return msr_ee && (cs->interrupt_request & CPU_INTERRUPT_HARD); } } +#endif /* CONFIG_TCG && !CONFIG_USER_ONLY */ POWERPC_FAMILY(POWER8)(ObjectClass *oc, void *data) { @@ -7796,7 +7800,6 @@ POWERPC_FAMILY(POWER8)(ObjectClass *oc, void *data) pcc->pcr_supported = PCR_COMPAT_2_07 | PCR_COMPAT_2_06 | PCR_COMPAT_2_05; pcc->init_proc = init_proc_POWER8; pcc->check_pow = check_pow_nocheck; - pcc->has_work = cpu_has_work_POWER8; pcc->insns_flags = PPC_INSNS_BASE | PPC_ISEL | PPC_STRING | PPC_MFTB | PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES | PPC_FLOAT_FSQRT | PPC_FLOAT_FRSQRTE | @@ -7846,6 +7849,7 @@ POWERPC_FAMILY(POWER8)(ObjectClass *oc, void *data) LPCR_P8_PECE3 | LPCR_P8_PECE4; pcc->mmu_model = POWERPC_MMU_2_07; #if defined(CONFIG_SOFTMMU) + pcc->has_work = cpu_has_work_POWER8; pcc->hash64_opts = &ppc_hash64_opts_POWER7; pcc->lrg_decr_bits = 32; pcc->n_host_threads = 8; @@ -7939,6 +7943,7 @@ static bool ppc_pvr_match_power9(PowerPCCPUClass *pcc, uint32_t pvr) return false; } +#if defined(CONFIG_TCG) && !defined(CONFIG_USER_ONLY) static bool cpu_has_work_POWER9(CPUState *cs) { PowerPCCPU *cpu = POWERPC_CPU(cs); @@ -7996,6 +8001,7 @@ static bool cpu_has_work_POWER9(CPUState *cs) return msr_ee && (cs->interrupt_request & CPU_INTERRUPT_HARD); } } +#endif /* CONFIG_TCG && !CONFIG_USER_ONLY */ POWERPC_FAMILY(POWER9)(ObjectClass *oc, void *data) { @@ -8010,7 +8016,6 @@ POWERPC_FAMILY(POWER9)(ObjectClass *oc, void *data) PCR_COMPAT_2_05; pcc->init_proc = init_proc_POWER9; pcc->check_pow = check_pow_nocheck; - pcc->has_work = cpu_has_work_POWER9; pcc->insns_flags = PPC_INSNS_BASE | PPC_ISEL | PPC_STRING | PPC_MFTB | PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES | PPC_FLOAT_FSQRT | PPC_FLOAT_FRSQRTE | @@ -8059,6 +8064,7 @@ POWERPC_FAMILY(POWER9)(ObjectClass *oc, void *data) pcc->lpcr_pm = LPCR_PDEE | LPCR_HDEE | LPCR_EEE | LPCR_DEE | LPCR_OEE; pcc->mmu_model = POWERPC_MMU_3_00; #if defined(CONFIG_SOFTMMU) + pcc->has_work = cpu_has_work_POWER9; /* segment page size remain the same */ pcc->hash64_opts = &ppc_hash64_opts_POWER7; pcc->radix_page_info = &POWER9_radix_page_info; @@ -8147,6 +8153,7 @@ static bool ppc_pvr_match_power10(PowerPCCPUClass *pcc, uint32_t pvr) return false; } +#if defined(CONFIG_TCG) && !defined(CONFIG_USER_ONLY) static bool cpu_has_work_POWER10(CPUState *cs) { PowerPCCPU *cpu = POWERPC_CPU(cs); @@ -8204,6 +8211,7 @@ static bool cpu_has_work_POWER10(CPUState *cs) return msr_ee && (cs->interrupt_request & CPU_INTERRUPT_HARD); } } +#endif /* CONFIG_TCG && !CONFIG_USER_ONLY */ POWERPC_FAMILY(POWER10)(ObjectClass *oc, void *data) { @@ -8219,7 +8227,6 @@ POWERPC_FAMILY(POWER10)(ObjectClass *oc, void *data) PCR_COMPAT_2_06 | PCR_COMPAT_2_05; pcc->init_proc = init_proc_POWER10; pcc->check_pow = check_pow_nocheck; - pcc->has_work = cpu_has_work_POWER10; pcc->insns_flags = PPC_INSNS_BASE | PPC_ISEL | PPC_STRING | PPC_MFTB | PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES | PPC_FLOAT_FSQRT | PPC_FLOAT_FRSQRTE | @@ -8271,6 +8278,7 @@ POWERPC_FAMILY(POWER10)(ObjectClass *oc, void *data) pcc->lpcr_pm = LPCR_PDEE | LPCR_HDEE | LPCR_EEE | LPCR_DEE | LPCR_OEE; pcc->mmu_model = POWERPC_MMU_3_00; #if defined(CONFIG_SOFTMMU) + pcc->has_work = cpu_has_work_POWER10; /* segment page size remain the same */ pcc->hash64_opts = &ppc_hash64_opts_POWER7; pcc->radix_page_info = &POWER10_radix_page_info; @@ -8786,6 +8794,7 @@ static void ppc_cpu_set_pc(CPUState *cs, vaddr value) cpu->env.nip = value; } +#if defined(CONFIG_TCG) && !defined(CONFIG_USER_ONLY) static bool cpu_has_work_default(CPUState *cs) { PowerPCCPU *cpu = POWERPC_CPU(cs); @@ -8801,6 +8810,7 @@ static bool ppc_cpu_has_work(CPUState *cs) return pcc->has_work(cs); } +#endif /* CONFIG_TCG && !CONFIG_USER_ONLY */ static void ppc_cpu_reset(DeviceState *dev) { @@ -9021,6 +9031,7 @@ static const struct TCGCPUOps ppc_tcg_ops = { .tlb_fill = ppc_cpu_tlb_fill, #ifndef CONFIG_USER_ONLY + .has_work = ppc_cpu_has_work, .cpu_exec_interrupt = ppc_cpu_exec_interrupt, .do_interrupt = ppc_cpu_do_interrupt, .cpu_exec_enter = ppc_cpu_exec_enter, @@ -9041,13 +9052,11 @@ static void ppc_cpu_class_init(ObjectClass *oc, void *data) device_class_set_parent_unrealize(dc, ppc_cpu_unrealize, &pcc->parent_unrealize); pcc->pvr_match = ppc_pvr_match_default; - pcc->has_work = cpu_has_work_default; device_class_set_props(dc, ppc_cpu_properties); device_class_set_parent_reset(dc, ppc_cpu_reset, &pcc->parent_reset); cc->class_by_name = ppc_cpu_class_by_name; - cc->has_work = ppc_cpu_has_work; cc->dump_state = ppc_cpu_dump_state; cc->set_pc = ppc_cpu_set_pc; cc->gdb_read_register = ppc_cpu_gdb_read_register; @@ -9078,6 +9087,9 @@ static void ppc_cpu_class_init(ObjectClass *oc, void *data) #ifdef CONFIG_TCG cc->tcg_ops = &ppc_tcg_ops; +#ifndef CONFIG_USER_ONLY + pcc->has_work = cpu_has_work_default; +#endif #endif /* CONFIG_TCG */ } From patchwork Fri Sep 24 09:38:38 2021 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: 1532186 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=YqJ30iDw; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4HG78c6Jvcz9sXk for ; Fri, 24 Sep 2021 20:10:56 +1000 (AEST) Received: from localhost ([::1]:49962 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mTiAQ-0001sp-KY for incoming@patchwork.ozlabs.org; Fri, 24 Sep 2021 06:10:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41696) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mThhr-0006Ro-EO; Fri, 24 Sep 2021 05:41:26 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:35554) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mThho-0007vY-2q; Fri, 24 Sep 2021 05:41:23 -0400 Received: by mail-wr1-x42a.google.com with SMTP id i23so25601893wrb.2; Fri, 24 Sep 2021 02:41:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KfwVihGSy9lOGZEBuM9IdCHEDMq8ZD4Rne15ZYj/c70=; b=YqJ30iDwZEN/xhsXgxnYpc93mFkXRjF4UhDX3Vc+hz2vW1BAo7amyqQkjeIFvAjR+n 1PsjfDm3VqDrYES0v0Atca54m2nY3jCt8dgosT5EOWmNg7BwT/AVpcUvb4RZ+mgQrTCs cePk37LXsnYYer+eEE40CfoKLtN6yaz2l5HsWko381LwMUG/XW72lLVLb87DXR3xjxx0 yuzfUzHR06owl7RwVzkg/8XWnkxNOp/GZWr46tXevq/ngwN8bXdv0F6+aUBoAIt7aiAt v43E5rAcm4Jf/qkXUNSfM/XjFiwpGQIjnDOcjinNHBsTDp3ZVhwpD7ZQH7vRAA1Et0Zm pQlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=KfwVihGSy9lOGZEBuM9IdCHEDMq8ZD4Rne15ZYj/c70=; b=t1jd5AqQJrKRfGfDRt1mm5kfhSNbmkqwaP9Ps7bHbF/8yaSIWUQklEtzLrI2hRBE1e kRGLdBHcWi477ZEE7fVhimEVrom3EM9blt4nbJEzgV55QMV4dqKj+KWUz0K73UkzUkbe Yv9zjusUF0ko1Pc4cWR3QUhSvD3EXfhHos8Pb3ig1KgU2aK5o10OEsfdgU+nnkmCeKmr dxN70mhk1McULkeLa7RPRis9qA2fye5qf2o4Imrbc/Xac3ZmxX7AtAF3uW3l2RfXgCbz qZtvwi/8VP6A2u9rOuIQQSJi+jY+BhoEZrV4SmSHYjAcZsC4/53whirHVlhZirvxYod9 I7og== X-Gm-Message-State: AOAM531tWqWnct2n3pFrW1MLVLST36+Y5KFTISj+av5LqoZCjv7iStql 8kPlHxET2RUQwA2i26wnyKQRSjjbFwU= X-Google-Smtp-Source: ABdhPJxA6MYtETK8+xbt66HYrfahWpY3+jiZaFuwAPT25Ut26aEOy7LLe9ax+5EBscg5761cQV6YcA== X-Received: by 2002:a5d:4522:: with SMTP id j2mr9959802wra.212.1632476476662; Fri, 24 Sep 2021 02:41:16 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id c9sm5920723wmb.41.2021.09.24.02.41.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 02:41:16 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v6 31/40] target/riscv: Restrict has_work() handler to sysemu and TCG Date: Fri, 24 Sep 2021 11:38:38 +0200 Message-Id: <20210924093847.1014331-32-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210924093847.1014331-1-f4bug@amsat.org> References: <20210924093847.1014331-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x42a.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "open list:RISC-V TCG CPUs" , Bin Meng , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Alistair Francis , Palmer Dabbelt Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Restrict has_work() to TCG sysemu. Reviewed-by: Richard Henderson Acked-by: Alistair Francis Signed-off-by: Philippe Mathieu-Daudé --- target/riscv/cpu.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 7c626d89cd7..ca76bc34d9b 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -335,9 +335,9 @@ static void riscv_cpu_synchronize_from_tb(CPUState *cs, env->pc = tb->pc; } +#if defined(CONFIG_TCG) && !defined(CONFIG_USER_ONLY) static bool riscv_cpu_has_work(CPUState *cs) { -#ifndef CONFIG_USER_ONLY RISCVCPU *cpu = RISCV_CPU(cs); CPURISCVState *env = &cpu->env; /* @@ -345,10 +345,8 @@ static bool riscv_cpu_has_work(CPUState *cs) * mode and delegation registers, but respect individual enables */ return (env->mip & env->mie) != 0; -#else - return true; -#endif } +#endif /* CONFIG_TCG && !CONFIG_USER_ONLY */ void restore_state_to_opc(CPURISCVState *env, TranslationBlock *tb, target_ulong *data) @@ -678,6 +676,7 @@ static const struct TCGCPUOps riscv_tcg_ops = { .tlb_fill = riscv_cpu_tlb_fill, #ifndef CONFIG_USER_ONLY + .has_work = riscv_cpu_has_work, .cpu_exec_interrupt = riscv_cpu_exec_interrupt, .do_interrupt = riscv_cpu_do_interrupt, .do_transaction_failed = riscv_cpu_do_transaction_failed, @@ -697,7 +696,6 @@ static void riscv_cpu_class_init(ObjectClass *c, void *data) device_class_set_parent_reset(dc, riscv_cpu_reset, &mcc->parent_reset); cc->class_by_name = riscv_cpu_class_by_name; - cc->has_work = riscv_cpu_has_work; cc->dump_state = riscv_cpu_dump_state; cc->set_pc = riscv_cpu_set_pc; cc->gdb_read_register = riscv_cpu_gdb_read_register; From patchwork Fri Sep 24 09:38:39 2021 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: 1532189 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=goNme+il; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4HG7FH3dfxz9ssP for ; Fri, 24 Sep 2021 20:14:59 +1000 (AEST) Received: from localhost ([::1]:60190 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mTiEL-0000xV-8o for incoming@patchwork.ozlabs.org; Fri, 24 Sep 2021 06:14:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41714) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mThht-0006Rs-4O for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:41:26 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:37588) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mThhq-0007zj-Ok for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:41:24 -0400 Received: by mail-wr1-x436.google.com with SMTP id t8so25561848wrq.4 for ; Fri, 24 Sep 2021 02:41:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=o/vqGSMOnhzvKGrld2aIeHhcVaK006Y9gzP+FF74z+I=; b=goNme+ilDkeL3ibbjtqRoaro9BqqE8qFef8w0FI182No1FhVxN71i2lnSQHCbOScHj LW2K94puGJzd7/juZXCS1GH1yaMrGZuYR4XzyLSoLjkjJK5N/1sTcLmVzELSWyja/+0C WUIAGzhWVuJhFzVQivmywnobh1hRcOA7QKyYzzqai0ufKWLc5wXk06UysAOCg799M0++ MfMpzcCrR4sp3yoyjq5Qj6Iw1ZZWMvuMqlOnZOokEPodSZCunCJ5MYbe8MacF69k+pmh JX9vceFAbVQBgZjVA5xcpZfb1QPQlj7CwRvZGwDKIza5c9CrwT/wjSaLGzS4ylZhG7Em NONg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=o/vqGSMOnhzvKGrld2aIeHhcVaK006Y9gzP+FF74z+I=; b=w31WPcu6uNgiKfAZSH8YI+8js3rI7TBxxFJjELHP10yqJ1IayJZi+0bPgMYgv7OkZS doeNKQ41++ciX7Y7zx0G/otacYjRQVZum10Yjl3n+1nbfCciQSh0Jsp9E/XMeA9BJN12 ivRIpra5eUDfL/JIMOiDKCprF4/ytmwfk4QEnJh6YFz50JGtMEP675D8siIwIdVxbyWu dZ6ruZQ+EfRFbBnOpGD2TsbBW9CW2itAz1PMjSpNF+4DXTwPy1+edgu4+rxIDNL1QMch AUl6u7l+i0arM+HTtMKV1Ur2wFzp/23GWF+BH40eQwpty+583xslDrGlYadYe5SXiccN YuAA== X-Gm-Message-State: AOAM531uCmCsT5XT2S2XGRUGsxjYiXXGve8ek/AZQWqZbmjjaD9rSjJe 58lSM2DkYg7wpuyz06TNLcnFDfz44LE= X-Google-Smtp-Source: ABdhPJyQ5Tyx8zX9LNARuketEA99kO/96w2sjS8/Po8E7AmaPexyGY+KGhcXjkUaF9qRx5vYYYTNGg== X-Received: by 2002:a1c:a94a:: with SMTP id s71mr1075179wme.32.1632476481344; Fri, 24 Sep 2021 02:41:21 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id j2sm7682289wrq.35.2021.09.24.02.41.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 02:41:20 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v6 32/40] target/rx: Restrict has_work() handler to sysemu Date: Fri, 24 Sep 2021 11:38:39 +0200 Message-Id: <20210924093847.1014331-33-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210924093847.1014331-1-f4bug@amsat.org> References: <20210924093847.1014331-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x436.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Yoshinori Sato Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Restrict has_work() to sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/rx/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/rx/cpu.c b/target/rx/cpu.c index 25a4aa2976d..ac6b40b2716 100644 --- a/target/rx/cpu.c +++ b/target/rx/cpu.c @@ -41,11 +41,13 @@ static void rx_cpu_synchronize_from_tb(CPUState *cs, cpu->env.pc = tb->pc; } +#if !defined(CONFIG_USER_ONLY) static bool rx_cpu_has_work(CPUState *cs) { return cs->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_FIR); } +#endif /* !CONFIG_USER_ONLY */ static void rx_cpu_reset(DeviceState *dev) { @@ -189,6 +191,7 @@ static const struct TCGCPUOps rx_tcg_ops = { .tlb_fill = rx_cpu_tlb_fill, #ifndef CONFIG_USER_ONLY + .has_work = rx_cpu_has_work, .cpu_exec_interrupt = rx_cpu_exec_interrupt, .do_interrupt = rx_cpu_do_interrupt, #endif /* !CONFIG_USER_ONLY */ @@ -206,7 +209,6 @@ static void rx_cpu_class_init(ObjectClass *klass, void *data) &rcc->parent_reset); cc->class_by_name = rx_cpu_class_by_name; - cc->has_work = rx_cpu_has_work; cc->dump_state = rx_cpu_dump_state; cc->set_pc = rx_cpu_set_pc; From patchwork Fri Sep 24 09:38:40 2021 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: 1532177 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=TRbCXATl; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4HG73y1V8mz9sXk for ; Fri, 24 Sep 2021 20:06:54 +1000 (AEST) Received: from localhost ([::1]:38592 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mTi6V-0002W9-TQ for incoming@patchwork.ozlabs.org; Fri, 24 Sep 2021 06:06:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41748) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mThhy-0006XY-39; Fri, 24 Sep 2021 05:41:30 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:46669) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mThhw-00083T-Gx; Fri, 24 Sep 2021 05:41:29 -0400 Received: by mail-wr1-x429.google.com with SMTP id t7so25386146wrw.13; Fri, 24 Sep 2021 02:41:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oUBogEzePDVOMR5F40RC1OgAVa089kvAJx/8ALSm6vg=; b=TRbCXATlimzfFn3xJILPImXwRPAEdONDFO7iEG7mXCPKW8VvkvvaQHGfk9cFP4vJff xXgaC3VM+jC0KyJLV1wCa67d0QDExIEI5aBqVi4FD+zfTsE3upWxOrCEhlwv6i9cfILw h9SBDMf7eZhTPMD+WplXb02QO2GAhPcedE2u8h+xjXBx9WkawcQkixMoT/j92wLfe+UE /JV227kiO4kMS5RwJv3VdxojqaLEjMdEe3xkxWUcEseZiPSsJAB9E2t2lJ7uVTOlVP46 0yQ1KQC6LrYiNDton2yFfnrmmrqyLlQ/SlaapnV28wpf1uX7YnN7mtvp4KZq2ESpEK2/ DIVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=oUBogEzePDVOMR5F40RC1OgAVa089kvAJx/8ALSm6vg=; b=7FvJuI0MdatprnIP58aObW5JfgV0w31T8wYWbdvTMF0AeS1vIQfgsNz3kZkoQwOoh1 44f80ZLgxFURY7xtrzeAX1WoN283+KgUMzCnJXIBas/Wg+wcMDLGCYXL1+y+UzdOlaTy ZOvqoMxF1+Tu2xj7RDfmoMGTiv2fVnus6XW9Y1dbUOmOE+VjMriz7doo+pH9JrMZS9f8 HmRs+LCLRVhIfHz/xaBXW2HNarSWtLEbjUbDJIgat/Zc0wObHyE/tJhoprL+cfAfny58 oFR7mB3iH8cxQo+lARb70JfQ/xDW6KnhR+Oyg3A++9Gza6oAdqRseTE0CIZLza1dNc9O Vohw== X-Gm-Message-State: AOAM530EgyzI4O+1Q8nVPJW/fS72Bz/JyrkB6x84tD4iEpUdzgx5In00 nny9yP5nc0LyVI8TNmcoDPJHlNR6uMw= X-Google-Smtp-Source: ABdhPJz+7nyxHF1nrxxG5t8WS9urjYReQYkBJ39tztYmgXsQ5JxMIjUgkRvK9B/q+rwq8Pq8lQIQuA== X-Received: by 2002:a05:600c:510a:: with SMTP id o10mr1042384wms.81.1632476486188; Fri, 24 Sep 2021 02:41:26 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id n14sm6141369wmc.38.2021.09.24.02.41.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 02:41:25 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v6 33/40] target/s390x: Restrict has_work() handler to sysemu and TCG Date: Fri, 24 Sep 2021 11:38:40 +0200 Message-Id: <20210924093847.1014331-34-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210924093847.1014331-1-f4bug@amsat.org> References: <20210924093847.1014331-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x429.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , David Hildenbrand , Cornelia Huck , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , "open list:S390 general arch..." Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Restrict has_work() to TCG sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/s390x/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index 7b7b05f1d3a..df8ade9021d 100644 --- a/target/s390x/cpu.c +++ b/target/s390x/cpu.c @@ -88,6 +88,7 @@ static void s390_cpu_set_pc(CPUState *cs, vaddr value) cpu->env.psw.addr = value; } +#if defined(CONFIG_TCG) && !defined(CONFIG_USER_ONLY) static bool s390_cpu_has_work(CPUState *cs) { S390CPU *cpu = S390_CPU(cs); @@ -104,6 +105,7 @@ static bool s390_cpu_has_work(CPUState *cs) return s390_cpu_has_int(cpu); } +#endif /* CONFIG_TCG && !CONFIG_USER_ONLY */ /* S390CPUClass::reset() */ static void s390_cpu_reset(CPUState *s, cpu_reset_type type) @@ -269,6 +271,7 @@ static const struct TCGCPUOps s390_tcg_ops = { .tlb_fill = s390_cpu_tlb_fill, #if !defined(CONFIG_USER_ONLY) + .has_work = s390_cpu_has_work, .cpu_exec_interrupt = s390_cpu_exec_interrupt, .do_interrupt = s390_cpu_do_interrupt, .debug_excp_handler = s390x_cpu_debug_excp_handler, @@ -292,7 +295,6 @@ static void s390_cpu_class_init(ObjectClass *oc, void *data) scc->reset = s390_cpu_reset; cc->class_by_name = s390_cpu_class_by_name, - cc->has_work = s390_cpu_has_work; cc->dump_state = s390_cpu_dump_state; cc->set_pc = s390_cpu_set_pc; cc->gdb_read_register = s390_cpu_gdb_read_register; From patchwork Fri Sep 24 09:38:41 2021 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: 1532191 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=O8O/BuCt; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4HG7Hh1ZbWz9sxS for ; Fri, 24 Sep 2021 20:17:04 +1000 (AEST) Received: from localhost ([::1]:37034 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mTiGL-0004Zs-R1 for incoming@patchwork.ozlabs.org; Fri, 24 Sep 2021 06:17:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41770) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mThi2-0006o1-TE for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:41:34 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:36566) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mThi0-00087c-JE for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:41:34 -0400 Received: by mail-wr1-x429.google.com with SMTP id g16so25542470wrb.3 for ; Fri, 24 Sep 2021 02:41:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DvtLk1KDYMk4Ooy/WV4tyGGjURyvQDa7DPky1rRpIYc=; b=O8O/BuCtEOsRv3EG/MV5m6RRBeFHeb/zYurn9WXZihmzcNZ/iE62/N7pPNJ2z6y/Lp OvR1k1hCbBL5obm6ba4zlW1+3Cvz4ACffwltL/w16wY0ZoK5wGt4EM6izo6H4JF0MkwV ebRDReS4A4kgKKnEUqU3eOvimx4hRDui1MNQQ5qimmzc+RLvkTNggbFqIuoobriBNotX xj0RzmC1/7Qe4zGicC9f21Wo+OBWaolvCwXuZDDvk/2/oKJ5T1KO4adVDfmomeSVee3w 5MMzvGNETaB001uuaZneUr4f5XlK2PHq9+VQeCr+g+OE5qj+N+5sLj+bMgN8/7itb5WW SQPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=DvtLk1KDYMk4Ooy/WV4tyGGjURyvQDa7DPky1rRpIYc=; b=cUQA/0TWgERBR9MqOJx44EQ1VN8vGPZTmRf+bBvIh1R2GER2ci9YO4mj+yuNPDdZkn 8JseJvPMaSZKurFo0a/2pkqvDhlnUX5wR987oom6WwAI0b/rCqu6OUCqlO1uUEZ7cFY+ oQ6SA5s1z48CG0SJBN4UnJ+TqyC+7TLtqcShrZ9N1xmqtsb/w6TqmSL2/JsbgHiSQjQa fCckHjST+Zu7IkqpMwNiaIFj9dYmLAIEM3NxETmQVTXkjDEzQySnx8AI0LYE7WtDmeRX SGcrXs89ks3HhMDL6Mfw5Yvu9YTsZ+SqeLr5JgeRMxLblXzdFbmp81TSGNSajebIyoyE SsLA== X-Gm-Message-State: AOAM530f4Bae1SCzU7vIUFSXt4orYgX3CEE/DvHLLZvsuH7v4r4RFfdy 8pMKQOgFjtc2OmEW4Xbk2mZU09eVNLc= X-Google-Smtp-Source: ABdhPJzNrU7LHvpCwWrtC7PGQEwHa0fyXmkhMcJnN4oz9SYBg7CWOoOkQE4RE77NglLogY3xpike3w== X-Received: by 2002:a1c:f713:: with SMTP id v19mr1035859wmh.188.1632476490917; Fri, 24 Sep 2021 02:41:30 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id l26sm11746319wmi.25.2021.09.24.02.41.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 02:41:30 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v6 34/40] target/sh4: Restrict has_work() handler to sysemu Date: Fri, 24 Sep 2021 11:38:41 +0200 Message-Id: <20210924093847.1014331-35-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210924093847.1014331-1-f4bug@amsat.org> References: <20210924093847.1014331-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x429.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Yoshinori Sato Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Restrict has_work() to sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/sh4/cpu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c index 2047742d03c..fb2116dc52e 100644 --- a/target/sh4/cpu.c +++ b/target/sh4/cpu.c @@ -58,13 +58,14 @@ 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 void superh_cpu_reset(DeviceState *dev) { CPUState *s = CPU(dev); @@ -239,6 +240,7 @@ static const struct TCGCPUOps superh_tcg_ops = { .tlb_fill = superh_cpu_tlb_fill, #ifndef CONFIG_USER_ONLY + .has_work = superh_cpu_has_work, .cpu_exec_interrupt = superh_cpu_exec_interrupt, .do_interrupt = superh_cpu_do_interrupt, .do_unaligned_access = superh_cpu_do_unaligned_access, @@ -258,7 +260,6 @@ static void superh_cpu_class_init(ObjectClass *oc, void *data) device_class_set_parent_reset(dc, superh_cpu_reset, &scc->parent_reset); cc->class_by_name = superh_cpu_class_by_name; - cc->has_work = superh_cpu_has_work; cc->dump_state = superh_cpu_dump_state; cc->set_pc = superh_cpu_set_pc; cc->gdb_read_register = superh_cpu_gdb_read_register; From patchwork Fri Sep 24 09:38:42 2021 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: 1532180 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=gqbZD1QY; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4HG76J18qnz9sXk for ; Fri, 24 Sep 2021 20:08:56 +1000 (AEST) Received: from localhost ([::1]:44464 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mTi8T-0006XK-U1 for incoming@patchwork.ozlabs.org; Fri, 24 Sep 2021 06:08:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41794) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mThi7-00073X-Tf for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:41:39 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:34783) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mThi5-0008B8-EO for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:41:38 -0400 Received: by mail-wr1-x42f.google.com with SMTP id t8so25641081wri.1 for ; Fri, 24 Sep 2021 02:41:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LjvVczq8n5tzr9drSBRznUr4y3SH1knsfynMe8Ogfbw=; b=gqbZD1QYHG/V+4FRZ+RsPkcPC6mtNJKoVwY8DNaJAY1Oo3Gmwh3hN0swaNYldC6mtE 2I2dcbFS35V7W3vN+iBxxuIxo75qc/jEn5dvYkRMsGj3hNBcKtR3OgBmv5jgu4pRSBjf pk+OClhKQq7bdH68FYVQXgygBIURTlnfitexMnylKUfu74Hvx0QEbhf7jbLEO2Sea0DN FNfro3QQnMLosH4I/97qVvLkTiCmOaXW6r/QhojFwEf9jutZ8brRKv9tchkp9CO0rTSH 0ooy8q1R5sn6Xc7JF5AyBmdxH7UkCSUKGDUCtzXeAFJUze/N3J+LkDUQC7UvhKG83eEL wDRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=LjvVczq8n5tzr9drSBRznUr4y3SH1knsfynMe8Ogfbw=; b=k/2ZN4S+8tDxDb2gGqIQjtGyv7/TVEOvz3L6r5ri9UtkCQ1Umf1YySHOTUCZA6NIm4 ShuvU0yw3f0B4FW1pBXxznS0vy+wZsQ4OJftJ00RIjZ9OZsfviAZZPVks9k+xCVevhxS Ct9TIwQhUWE263COOtrkieeddo2A5Cst5lvT+D4p5C0n4llwUL2rMQyagFrDUlbuGAXE CIthnGZfOsCYfcin/3XENsYFBWr1omV1oRyQuF7aiGXrl2s+LU7cuhFpuAgmKKR8HoWC V1Z7V9wq3EnN7GwmDGt6EjgI5C8491YKUOB30XPM3WIRd2Rcs+i2uTcvgAW2cUp60ApZ xf0w== X-Gm-Message-State: AOAM532lIJa+3s60S72omk0+ucswRk11WEYLDx7R4IxKMfBqlnaA7xXp BMfZIQFwHfL33KbGCh+R5Vj4p5H5G9A= X-Google-Smtp-Source: ABdhPJxTSOKRlGhxmppefEI6DDkH8tPZRl4LsiMD887WvwAqOCLsCo9OR2eguLu9mFjC0C/DOHXQ/Q== X-Received: by 2002:adf:f890:: with SMTP id u16mr10175704wrp.388.1632476495755; Fri, 24 Sep 2021 02:41:35 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id k26sm1170670wms.39.2021.09.24.02.41.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 02:41:35 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v6 35/40] target/sparc: Remove pointless use of CONFIG_TCG definition Date: Fri, 24 Sep 2021 11:38:42 +0200 Message-Id: <20210924093847.1014331-36-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210924093847.1014331-1-f4bug@amsat.org> References: <20210924093847.1014331-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x42f.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Cave-Ayland , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Artyom Tarasenko Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The SPARC target only support TCG acceleration. Remove the CONFIG_TCG definition introduced by mistake in commit 78271684719 ("cpu: tcg_ops: move to tcg-cpu-ops.h, keep a pointer in CPUClass"). Reported-by: Richard Henderson Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/sparc/cpu.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index 21dd27796d0..0d252cb5bdc 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -859,7 +859,6 @@ static const struct SysemuCPUOps sparc_sysemu_ops = { }; #endif -#ifdef CONFIG_TCG #include "hw/core/tcg-cpu-ops.h" static const struct TCGCPUOps sparc_tcg_ops = { @@ -874,7 +873,6 @@ static const struct TCGCPUOps sparc_tcg_ops = { .do_unaligned_access = sparc_cpu_do_unaligned_access, #endif /* !CONFIG_USER_ONLY */ }; -#endif /* CONFIG_TCG */ static void sparc_cpu_class_init(ObjectClass *oc, void *data) { From patchwork Fri Sep 24 09:38:43 2021 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: 1532162 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=dFTz6tKu; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4HG6p66KJSz9sRf for ; Fri, 24 Sep 2021 19:54:54 +1000 (AEST) Received: from localhost ([::1]:32780 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mThuu-0004tb-KH for incoming@patchwork.ozlabs.org; Fri, 24 Sep 2021 05:54:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41808) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mThiB-0007ED-DS for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:41:43 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:42896) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mThi9-0008Ea-Tn for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:41:43 -0400 Received: by mail-wr1-x429.google.com with SMTP id i24so9577948wrc.9 for ; Fri, 24 Sep 2021 02:41:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7nxEt9EN1rfUcFm1gYLqiVpIjc8wwfbzfO8vsuUKuDU=; b=dFTz6tKuqmjjhqyqNuCPczxGOwYdFlakFGou/jw4A3SDzLuyuFs1RB3axWLxZdMrxy EzdKAW1dlBWzshmaypU5tnJgPjFePz//avo8Wi1KJr/nppdWmK1evhVvTar7ASbHaBso x18I2QuHitrDhbtyTl329UIV31qU2Q8Ba97L+FhHeFa+ClTizP0fwvxBpUuQKI63dbNr bWfm1GHkbvl4M4RFwHafLuU9xzHBTx/AqORSfQyLqzgCdWhW7JZ5U0xl8E6li5hVMPvO xAuJofjZN59msYjrRXTK8tSU6ZW5twtxpXpRsbVc1rLLBAJIBN8q7UguEdWgLWJ7sBuN pubQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=7nxEt9EN1rfUcFm1gYLqiVpIjc8wwfbzfO8vsuUKuDU=; b=AzOt1Fv6j6d1nZ+0ZMziHqwZ7A+cfwrfisssACMM044gOTD39ykSB0qJ8hya35VdD1 qr4TE6mMCM8AMxiSCAjdq32SFXxwyFpHUlH2VIW4fwZHgCSmcwHpnfkoa/aUXLMWCWYR fudwZfkRPo8gFSrcJe73E1yMQK3a6uGNGE4mWna7X/zZjkC2dTIRqfBfFnmXhKqRy777 vKXmhc0ASKp2NDiLk07ffv4GIvF107gyRNd12X2lN+h57sErvZwybm/gGIHHbOXgJA2F 7ZxcoXsTAPbaqCLx2nr5o8leqbP/ewbzY6FrqqpurSuEae/oRO4J9NGxTCDmICR51uxl 2C5g== X-Gm-Message-State: AOAM532N/eoaCQNGrSIyGTPn/8QwwwaN5AVLsO5VhCgJaMpc87DN6rq/ ySmROMuue1xtc9mz6z3/WbojEReYDSA= X-Google-Smtp-Source: ABdhPJyhS/QR5fQzSy/c/qDhU3aoEvlxwAHNMtjhmWfeeh/9WdVeH7tonNo+YTDHjIlZwoGeFO1IZQ== X-Received: by 2002:a7b:c184:: with SMTP id y4mr1075809wmi.128.1632476500498; Fri, 24 Sep 2021 02:41:40 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id t18sm6364162wrv.39.2021.09.24.02.41.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 02:41:40 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v6 36/40] target/sparc: Restrict has_work() handler to sysemu Date: Fri, 24 Sep 2021 11:38:43 +0200 Message-Id: <20210924093847.1014331-37-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210924093847.1014331-1-f4bug@amsat.org> References: <20210924093847.1014331-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x429.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Cave-Ayland , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Artyom Tarasenko Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Restrict has_work() to sysemu. Reviewed-by: Richard Henderson 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 0d252cb5bdc..8d61bf15f6c 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -702,6 +702,7 @@ static void sparc_cpu_synchronize_from_tb(CPUState *cs, cpu->env.npc = tb->cs_base; } +#if !defined(CONFIG_USER_ONLY) static bool sparc_cpu_has_work(CPUState *cs) { SPARCCPU *cpu = SPARC_CPU(cs); @@ -710,6 +711,7 @@ static bool sparc_cpu_has_work(CPUState *cs) return (cs->interrupt_request & CPU_INTERRUPT_HARD) && cpu_interrupts_enabled(env); } +#endif /* !CONFIG_USER_ONLY */ static char *sparc_cpu_type_name(const char *cpu_model) { @@ -867,6 +869,7 @@ static const struct TCGCPUOps sparc_tcg_ops = { .tlb_fill = sparc_cpu_tlb_fill, #ifndef CONFIG_USER_ONLY + .has_work = sparc_cpu_has_work, .cpu_exec_interrupt = sparc_cpu_exec_interrupt, .do_interrupt = sparc_cpu_do_interrupt, .do_transaction_failed = sparc_cpu_do_transaction_failed, @@ -888,7 +891,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->dump_state = sparc_cpu_dump_state; #if !defined(TARGET_SPARC64) && !defined(CONFIG_USER_ONLY) cc->memory_rw_debug = sparc_cpu_memory_rw_debug; From patchwork Fri Sep 24 09:38:44 2021 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: 1532187 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=chUbqeJV; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4HG78d4gD7z9ssP for ; Fri, 24 Sep 2021 20:10:57 +1000 (AEST) Received: from localhost ([::1]:50042 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mTiAR-0001wE-Cx for incoming@patchwork.ozlabs.org; Fri, 24 Sep 2021 06:10:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41830) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mThiK-0007eM-Ex for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:41:52 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:41584) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mThiE-0008JI-Ol for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:41:52 -0400 Received: by mail-wr1-x435.google.com with SMTP id w29so25433603wra.8 for ; Fri, 24 Sep 2021 02:41:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zo8kftudnPOZgXxxzKZCu6JZDCUogG66dPAYCxpYeH4=; b=chUbqeJV+99AjzZ2+mWb6PHXxL7KV1IoRNF/wC+uVUh4JMDQ6+DrfIgieceLBCNV0y gRqWvQIdoPnmkPC0MjNEbNq3HhLsffeDQXOvgFY7IW9qPPAJ5P8/FXSzead+XE7v2V4Z VnLh3NUaBnMf+uJjcgBZKDE+SCLVZERmOu0K+yLqD3UqhUq5a0F72qut3HXWHqsQiBaV nK9AurxeUFi8cPgqTWj8I2UPUYFzwNCoBg9UvMLfHpuLCAvvclenYdIwTLaT5ajZuA63 GxxWbz3l+JKgmLmSA/evbleZwvOyrs9GMRCVt7jKiLA9GW32275/qgsVi5BhBfZx40bh NybQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=zo8kftudnPOZgXxxzKZCu6JZDCUogG66dPAYCxpYeH4=; b=CToQtcrsNjt4ApJKha5fTU/tNM3ziMF+b5oy3SWM7owotSmW9fT9t/kX6cW7fiJ+0u wS8qm5YviOJLCTq5FgRxehs6cqJo2Tr/TsZyxvTZdezQ7V3MmwpnB2CmcUlr3jzJmTgY y7HA9lXLX2R3j+oQpQ1enJM4p2dqD+1xXmvqz/BI04XrD8E/3WLHe9HaSsbRTfRyNsM/ 6WMwQIGg9l5vVKcnkEFTrca+1A9qEcRcJRBXXw2cLSEuJjGRbDECmV5Ls++8pSc4C2SJ UTtozkdDMfq4DoDhhtzfOqL0wp+cNIIskus8c6/7TYxPPFdqaCSf1elj98FZKDvJeOrQ uwsg== X-Gm-Message-State: AOAM531eqj+2JW5x//hpfyBk9vhU1PldroC+qqeQda8xcggDnyDqB080 av34KlIn1S8YUiMh2Z26KYuYgI0HhNg= X-Google-Smtp-Source: ABdhPJy1UoZIAFxZw7dsk5UXIWVHWrGa0sr0xKDp49LL/Sd1laHKtSJCf1n0E7mSfIOzxvMsWdDKgQ== X-Received: by 2002:a7b:cc18:: with SMTP id f24mr1091089wmh.8.1632476505294; Fri, 24 Sep 2021 02:41:45 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id 20sm12868821wme.46.2021.09.24.02.41.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 02:41:44 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v6 37/40] target/tricore: Restrict has_work() handler to sysemu Date: Fri, 24 Sep 2021 11:38:44 +0200 Message-Id: <20210924093847.1014331-38-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210924093847.1014331-1-f4bug@amsat.org> References: <20210924093847.1014331-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x435.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bastian Koppelmann , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Restrict has_work() to sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Bastian Koppelmann --- target/tricore/cpu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/target/tricore/cpu.c b/target/tricore/cpu.c index b95682b7f04..419fa624bd5 100644 --- a/target/tricore/cpu.c +++ b/target/tricore/cpu.c @@ -62,10 +62,12 @@ static void tricore_cpu_reset(DeviceState *dev) cpu_state_reset(env); } +#if !defined(CONFIG_USER_ONLY) static bool tricore_cpu_has_work(CPUState *cs) { return true; } +#endif /* !CONFIG_USER_ONLY */ static void tricore_cpu_realizefn(DeviceState *dev, Error **errp) { @@ -154,6 +156,9 @@ static const struct TCGCPUOps tricore_tcg_ops = { .initialize = tricore_tcg_init, .synchronize_from_tb = tricore_cpu_synchronize_from_tb, .tlb_fill = tricore_cpu_tlb_fill, +#if !defined(CONFIG_USER_ONLY) + .has_work = tricore_cpu_has_work, +#endif }; static void tricore_cpu_class_init(ObjectClass *c, void *data) @@ -167,7 +172,6 @@ static void tricore_cpu_class_init(ObjectClass *c, void *data) device_class_set_parent_reset(dc, tricore_cpu_reset, &mcc->parent_reset); cc->class_by_name = tricore_cpu_class_by_name; - cc->has_work = tricore_cpu_has_work; cc->gdb_read_register = tricore_cpu_gdb_read_register; cc->gdb_write_register = tricore_cpu_gdb_write_register; From patchwork Fri Sep 24 09:38:45 2021 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: 1532165 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=dBDB86fZ; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4HG6sF1GSDz9sXk for ; Fri, 24 Sep 2021 19:57:37 +1000 (AEST) Received: from localhost ([::1]:41282 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mThxW-0002Gz-V2 for incoming@patchwork.ozlabs.org; Fri, 24 Sep 2021 05:57:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41838) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mThiL-0007h6-8y for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:41:53 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:35567) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mThiJ-0008N3-KA for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:41:52 -0400 Received: by mail-wr1-x42d.google.com with SMTP id i23so25606782wrb.2 for ; Fri, 24 Sep 2021 02:41:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=F6iT0mYKdizTZwY+Alp0nWU9C8rVfDyZdw7MbXpCAAA=; b=dBDB86fZ4I+6YhlSnKFCUyV+E5I6CESO2Yhb3VsTCnU7ynWh2R3KYq00/dZswqNkc4 M0AZw7/0xpkuU32voGkSc++8bRVap7yzKqbCYzXPcIKQHYddwxN+aWPqPex8Rc+7e29R XTH0PTbzai2JRmUclzWVFHtf183LuB5MneiTvtzLhLRjyPL6jubA+1NhK4UD05KRzqO6 1qSZ2m8iEYbyMUO7NNypGAIdMOJ9miAV6BwSNVTxECplIa4KIf2MFp2ijy57g8vbYi3U Y+tb90dGbeYblJphJkfFPmzyUYdSGAJzXDVoHoLFxhefsll+ssqWWhMSxUjrXMQ3+UMn D7lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=F6iT0mYKdizTZwY+Alp0nWU9C8rVfDyZdw7MbXpCAAA=; b=iKvT0EJLXPOGS2Rw2FHNeFvITOwPi3avNpDTogOpj14YAdsoqsgY8x8UmXd2eE6L/D FqNPVUwUbmD416BXZJY2IsuByz2AUX0pjunNIpJZs3xPh4nHo3gB3MLw0sOOazaAXW04 7z/1w3tZFUKI0BVBIU5GY7pe7+pkRTwvlNsPezXKNvSEy5oRzqFUILkyej0haFKoeYmG rjdVSMUAroMxJnKBhJ2fDyA1HbW4h9TMPqcUwHXNeTeCceP/j5dt/SlPxoNzmUq6q51A SAhgwqsxD18TKhHVe2TvUrZc0OM/aF3oz0RAfj+ad7+AvV1k4sLJ8qHYldTF/8Cw2G9b k5xQ== X-Gm-Message-State: AOAM531tRIGXqIVJJGKFP1QI9FtDSTrFJ7UgabI4jQ5ejFWlAAHeDVDg tZt7lsjzPMHcU9Nq4blODx2W/70VocM= X-Google-Smtp-Source: ABdhPJwnkTVr3Q5tfhwJAThC97GfrX/zgjVO/4WH4iNbP6APdWExLamuKJQNfVdce6hy6ShO5G9pOQ== X-Received: by 2002:a1c:e915:: with SMTP id q21mr1062231wmc.180.1632476509956; Fri, 24 Sep 2021 02:41:49 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id n11sm5838101wmq.19.2021.09.24.02.41.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 02:41:49 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v6 38/40] target/xtensa: Restrict has_work() handler to sysemu Date: Fri, 24 Sep 2021 11:38:45 +0200 Message-Id: <20210924093847.1014331-39-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210924093847.1014331-1-f4bug@amsat.org> References: <20210924093847.1014331-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x42d.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Max Filippov , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Restrict has_work() to sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/xtensa/cpu.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index c1cbd03595e..5cb19a88819 100644 --- a/target/xtensa/cpu.c +++ b/target/xtensa/cpu.c @@ -43,18 +43,17 @@ static void xtensa_cpu_set_pc(CPUState *cs, vaddr value) cpu->env.pc = value; } +#ifndef CONFIG_USER_ONLY + static bool xtensa_cpu_has_work(CPUState *cs) { -#ifndef CONFIG_USER_ONLY XtensaCPU *cpu = XTENSA_CPU(cs); return !cpu->env.runstall && cpu->env.pending_irq_level; -#else - return true; -#endif } -#ifdef CONFIG_USER_ONLY +#else /* CONFIG_USER_ONLY*/ + static bool abi_call0; void xtensa_set_abi_call0(void) @@ -66,7 +65,8 @@ bool xtensa_abi_call0(void) { return abi_call0; } -#endif + +#endif /* CONFIG_USER_ONLY */ static void xtensa_cpu_reset(DeviceState *dev) { @@ -196,6 +196,7 @@ static const struct TCGCPUOps xtensa_tcg_ops = { .debug_excp_handler = xtensa_breakpoint_handler, #ifndef CONFIG_USER_ONLY + .has_work = xtensa_cpu_has_work, .cpu_exec_interrupt = xtensa_cpu_exec_interrupt, .do_interrupt = xtensa_cpu_do_interrupt, .do_transaction_failed = xtensa_cpu_do_transaction_failed, @@ -215,7 +216,6 @@ static void xtensa_cpu_class_init(ObjectClass *oc, void *data) device_class_set_parent_reset(dc, xtensa_cpu_reset, &xcc->parent_reset); cc->class_by_name = xtensa_cpu_class_by_name; - cc->has_work = xtensa_cpu_has_work; cc->dump_state = xtensa_cpu_dump_state; cc->set_pc = xtensa_cpu_set_pc; cc->gdb_read_register = xtensa_cpu_gdb_read_register; From patchwork Fri Sep 24 09:38:46 2021 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: 1532169 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=nrI+Wi5n; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4HG6w21fNcz9sXk for ; Fri, 24 Sep 2021 20:00:02 +1000 (AEST) Received: from localhost ([::1]:49804 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mThzr-0007uf-Uc for incoming@patchwork.ozlabs.org; Fri, 24 Sep 2021 05:59:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41870) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mThiP-0007xJ-Qv for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:41:57 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:42901) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mThiO-0008QW-5g for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:41:57 -0400 Received: by mail-wr1-x42a.google.com with SMTP id i24so9580119wrc.9 for ; Fri, 24 Sep 2021 02:41:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=p+FhEVuxYvtBhbZfLgBuFMc/Z1Zw1Ec9d9CUDDVANlA=; b=nrI+Wi5nhIdxAJ3i1HND91Xx//nMUpPaDkD4GsfEPgEfTnS4R+MN/5em3jlcTu4ohY iqJqzOrQxR9VcbhxYjd06ihV9qy0EoGep35c0ayMsWLTAjyDS2K8prE1ZZvME9lFhdU4 /wI1iQ0zKnVU0Vv9Wy0y0WmHNjCeKNpdYlxaDad/vp6kyJKOmkccNlRWPB/toN50NvMm r8sxxJrh5Qdq61qpGTJZkk/V8/bNtdtHd0v8jJdivkrioOu1A6y2wfnttH8onFJ2dK7k Xc2kROnMVzDSHa/KQ+B36fFMDDE/7GlPu4SAiSHtGb8dRI9eliy6T1PCKkBO/sNNme39 t3Iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=p+FhEVuxYvtBhbZfLgBuFMc/Z1Zw1Ec9d9CUDDVANlA=; b=kZc6CxkVlw3COce2fp3cTEZC3GIHN7poJlrXVy+6i+waF6iQRSvZJhVY/22eykFnoJ kTUpS2ki7VxDIcun3kxc8/qAO9fXEzaJDII/ktNuKSrzUiXCYGBHXcOGD5fzsumvFKfW N8a4M8m9B79ct+jbq1zsI79B51OcRtsesqlfIb+yBboRN8lHR8+kJVk+cPMmkZzEezYT y87fGERQ3G1FOXJEGSotUd0bowlByYdb6fH9+UhTu4Ijqwx4+JWRLHB6AwZ0wZsBB2gZ kuRGOmwv717W9ZnmZJUH4In2sCPJX+FuPAtId5M7YpiHlKwLSsFxhEh1njrhSCMnbjyf eY5A== X-Gm-Message-State: AOAM533cc5Y3Eo41S6KboEuWEeibX824LnQlHjQ+b1tuZ8tgktIMEekL scMTJkT21MgYBDqTnMwgTC36WRTrF4k= X-Google-Smtp-Source: ABdhPJz9tKPYztfReNR/f4qcvNF3lXMz5l1eh+YRosHTqsiiXY9RK89YXOnvDDVKxyzsvjrI3kAVXw== X-Received: by 2002:a1c:23cb:: with SMTP id j194mr1049741wmj.1.1632476514649; Fri, 24 Sep 2021 02:41:54 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id i67sm9220524wmi.41.2021.09.24.02.41.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 02:41:54 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v6 39/40] accel/tcg: Remove CPUClass::has_work() Date: Fri, 24 Sep 2021 11:38:46 +0200 Message-Id: <20210924093847.1014331-40-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210924093847.1014331-1-f4bug@amsat.org> References: <20210924093847.1014331-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x42a.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Eduardo Habkost Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Now that all TCG targets converted their CPUClass::has_work() handler to a TCGCPUOps::has_work() one, we can remove has_work from CPUClass. Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 2 -- accel/tcg/tcg-accel-ops.c | 3 --- 2 files changed, 5 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 114eb3b9b2c..c64709b898c 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -89,7 +89,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. Only used by TCG. * @memory_rw_debug: Callback for GDB memory access. * @dump_state: Callback for dumping state. * @get_arch_id: Callback for getting architecture-dependent CPU ID. @@ -132,7 +131,6 @@ struct CPUClass { void (*parse_features)(const char *typename, char *str, Error **errp); int reset_dump_flags; - bool (*has_work)(CPUState *cpu); int (*memory_rw_debug)(CPUState *cpu, vaddr addr, uint8_t *buf, int len, bool is_write); void (*dump_state)(CPUState *cpu, FILE *, int flags); diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c index cd44bb6d0d8..3c75ed2cccc 100644 --- a/accel/tcg/tcg-accel-ops.c +++ b/accel/tcg/tcg-accel-ops.c @@ -78,9 +78,6 @@ static bool tcg_cpu_has_work(CPUState *cpu) { CPUClass *cc = CPU_GET_CLASS(cpu); - if (cc->has_work) { - return cc->has_work(cpu); - } if (cc->tcg_ops->has_work) { return cc->tcg_ops->has_work(cpu); } From patchwork Fri Sep 24 09:38:47 2021 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: 1532193 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=UwDdJkXd; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 ozlabs.org (Postfix) with ESMTPS id 4HG7KP3Tlcz9sxS for ; Fri, 24 Sep 2021 20:18:33 +1000 (AEST) Received: from localhost ([::1]:39884 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mTiHn-0006Ud-8n for incoming@patchwork.ozlabs.org; Fri, 24 Sep 2021 06:18:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41884) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mThiU-00088j-12 for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:42:02 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:46000) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mThiS-0008U6-Lj for qemu-devel@nongnu.org; Fri, 24 Sep 2021 05:42:01 -0400 Received: by mail-wr1-x42c.google.com with SMTP id d21so25384457wra.12 for ; Fri, 24 Sep 2021 02:42:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lsD8NWGZdgfbGQhaRvFJOuKgMHvFJkt23n3sZARQWU8=; b=UwDdJkXdPu+UwIOLG7cF1DpN08NOVjUXh5QxZO3b8BlxRdAye0OJz2hLqKgxw0ZKDG PzPuRnVN0Hcwvs9ZnlPJBOVuyUiE5Wibc1gFbRerxlFnnfoCR6m5gcEaRGIRw6flshnx eKifOQnMKcSSPap9xcmf4wa0TYhT3HsYptzq8553VGvUn4ZHNZlKA4MnxYoP9K5hQV7R lLE/TCBgRrYvCvnP6+FbiCLac7cjuVYnGRwe7QyKDzOhYCfBflTL06U6GT3YPkIwozTj Kp3qDVZS0fvkxnYKCFUI2Ya3nOV56tP3mPcK8INiJEdk+MEH85+SQXa14dlfdHNGLro3 Fycg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=lsD8NWGZdgfbGQhaRvFJOuKgMHvFJkt23n3sZARQWU8=; b=vzcRaPNiK+otTAzANYUaKtGYWipPLvqvdMcdoAX2XbKI7eBMzSdnw94jHO6DN1KmOV NvLjoh/Lv0gF2Tpmpo0nRzLTjYYSLuOQzHVM0j2ZPYhZ1o5sAJXlmNJYsRD2YLtmWxJn nWE4imCX0tfQ4sXuIC+6mAJR10Y2rH5Mkw5Jmwe9RY+AMmfE+l8qllV29A8cOVhxA6p6 1MAkSXz7vCMV/pwH7BISY9HLjAdxZW0H92UyIcHMT2V1/Jqymwk/LIx9/65i+XvvKpJg XTXDLPEGY9Idc8UshXkuuE09djfF0wZiq6aaJvuYKei0v5WeEgM5tx8IpdC155BDiWw3 oZTQ== X-Gm-Message-State: AOAM531Y8yTZFk3BEk663Perh7tjC4glbJ1Y33D+ndBDBb59o69JPGUF IQAp3D+WH6YB4AmwFdFuBaH7LYSLhxM= X-Google-Smtp-Source: ABdhPJwRCbd+wpqeirpoZIHuJdD3JA83d7V/aSnH6KC/kwAqhcT7iG/DayNhWUkLO3DFjrX2xrvT/A== X-Received: by 2002:adf:ecd2:: with SMTP id s18mr10164901wro.99.1632476519278; Fri, 24 Sep 2021 02:41:59 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id y7sm5082791wrs.95.2021.09.24.02.41.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Sep 2021 02:41:58 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v6 40/40] accel/tcg: Simplify tcg_cpu_has_work() Date: Fri, 24 Sep 2021 11:38:47 +0200 Message-Id: <20210924093847.1014331-41-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210924093847.1014331-1-f4bug@amsat.org> References: <20210924093847.1014331-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x42c.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" All TCG targets implement the TCGCPUOps::has_work() handler. We can remove the non-NULL handler check in tcg_cpu_has_work(). Add an assertion in tcg_exec_realizefn() for future TCG targets. Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/cpu-exec.c | 4 ++++ accel/tcg/tcg-accel-ops.c | 5 +---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 5fd1ed34222..18c20e5759b 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -993,6 +993,10 @@ void tcg_exec_realizefn(CPUState *cpu, Error **errp) CPUClass *cc = CPU_GET_CLASS(cpu); if (!tcg_target_initialized) { + /* Mandatory non-NULL handlers */ + g_assert(cc->tcg_ops->initialize); + g_assert(cc->tcg_ops->has_work); + cc->tcg_ops->initialize(); tcg_target_initialized = true; } diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c index 3c75ed2cccc..6cd32f04cb9 100644 --- a/accel/tcg/tcg-accel-ops.c +++ b/accel/tcg/tcg-accel-ops.c @@ -78,10 +78,7 @@ static bool tcg_cpu_has_work(CPUState *cpu) { CPUClass *cc = CPU_GET_CLASS(cpu); - if (cc->tcg_ops->has_work) { - return cc->tcg_ops->has_work(cpu); - } - return false; + return cc->tcg_ops->has_work(cpu); } /* mask must never be zero, except for A20 change call */