From patchwork Sun Sep 26 22:26: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: 1533025 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=f2GnhHn0; 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HHgQT6vbPz9tjv for ; Mon, 27 Sep 2021 08:28:17 +1000 (AEST) Received: from localhost ([::1]:43166 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUcd5-0000N2-OB for incoming@patchwork.ozlabs.org; Sun, 26 Sep 2021 18:28:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59570) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUccJ-0000LS-7R for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:27:27 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:45798) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUccH-00058J-AK for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:27:26 -0400 Received: by mail-wr1-x42d.google.com with SMTP id d21so46364837wra.12 for ; Sun, 26 Sep 2021 15:27: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=2W0DjczmO00zs6me7cCuH7cvWlENeBJiJjnuJqxx7ic=; b=f2GnhHn0L/+gczIPwFeeDG/VOHGy5shwhm/t5bY+DsDjAvSW8ChtmWkwu09Cgz5iPY tuQ+ZfVRrO40T7ShLZMAsQB051MIrJPQXRsCSa3TdDsY0gWJ6YGPsucLcPF0UV7FOtOb jI9ZzH7Ed3KTRc3+Kt9YNmxlsOlisV977dMIioo3q1kGb/kkXrq8vX0t/VuqBP4NG44a K04Y2MloOxXxo1hly9FL/1M20pupCHRWYNBiJusc7vWr/QThxhz2BeqDIoYhTKSuoYDb cpK0JaDQ2Bqh2ni2qwTtpSzFmBgZK6fzlUhuX3LBj6sdtWkbDId8NwF06IgMrKMxdpvZ rdEw== 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=2W0DjczmO00zs6me7cCuH7cvWlENeBJiJjnuJqxx7ic=; b=0lqlW5k3PJFlzE3WxQ1DVF14K1jGLQv3QYsf8yF2M8JuO+uhX7LEIMwz8DAGenQMPN /onEkdLGwAFzEdYzGhdjFgjn9bk4kxc7hAP2VxFb5OTcZfrZKX5iuqD4EP65Ge9EqYrn O2uEB6nJtdVYzr5+OCHpoNZbkuIi/gU9ta7mjX7H3fMFUS5BByNLA289p1tfnIaou4Hg 7oyduzH7Hle9qpu61TiUILyxVBoGCajzK7HRUuV2MbSq28KCjjDce+fePU9Ro85uv6ul GOgdeJe7+pVE6ambaQ4iXxyaKdcaya6KvUNqgdtjiZl3JI94RFQ3wQd2bT8wkOjml5kp W30Q== X-Gm-Message-State: AOAM533dHDBIxEwGeN4xLIS2+OLZWkCXxiFkcX4MmpLMTPFetGS+x5lD OmoHpiDhdrogTntApOvRvVUi+u1Stx0= X-Google-Smtp-Source: ABdhPJwRJu/LGw8uWoWxq2vn5EWhb+hv8SBOYDggT1CHJPZNXu/cX9+Vg1G8Io6/GtsPy9ZyMSlCqw== X-Received: by 2002:a05:6000:1844:: with SMTP id c4mr23535886wri.355.1632695243746; Sun, 26 Sep 2021 15:27: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 a25sm18738909wmj.34.2021.09.26.15.27.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 15:27:23 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v8 01/40] accel: Simplify qemu_init_vcpu() Date: Mon, 27 Sep 2021 00:26:37 +0200 Message-Id: <20210926222716.1732932-2-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210926222716.1732932-1-f4bug@amsat.org> References: <20210926222716.1732932-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.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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" 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(). Reviewed-by: Richard Henderson 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 Sun Sep 26 22:26: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: 1533029 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=VrC3hwae; 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HHgTb56Chz9tjv for ; Mon, 27 Sep 2021 08:30:59 +1000 (AEST) Received: from localhost ([::1]:50988 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUcfh-0005kU-9r for incoming@patchwork.ozlabs.org; Sun, 26 Sep 2021 18:30:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59586) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUccN-0000Vt-FW for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:27:31 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:45005) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUccM-0005Bg-19 for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:27:31 -0400 Received: by mail-wr1-x436.google.com with SMTP id d6so46332936wrc.11 for ; Sun, 26 Sep 2021 15:27: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=tcpBP/9O11lxH2OkY3DQ1OAE3IFU4nJ2jfhNdgzdGjo=; b=VrC3hwaeTLX0Kxv3lfQQysV9PzI8O+brgKJIBlo92D0UgV66nXXvoj8v/CyhYS2OOO EGIj9LMFCQ2hHkFwwlVVP9qvyEptU6cvtsWIdrK57UY3U1jFJiUW9SIyp+5vdH7Upqry eKOUbjxnJ+YDjw5msGdo85oWsyDgK4NxGkqmeSKzDVSMbGyq4qdzcO/6+kfAGVyxstYY 8j9AnKlVRTuXsEWDhBHRFucZbQZ7Ud+ar7lyALa3rIDCUM3Z3XrX8JoLFvPEgQS6qxBh Z7hZvKAb2yoqGAfRVMv3aeFjQEzuH8GQ7JE3TIJDSfz5VcR6ya2eECYb78Ql2olW/Fik Knkg== 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=rCsOvzVNKJs/Ryzz619ss2mqk/zl+ZZLQhxlsPMjP1PcLfZYaYncenzaqTjvzvsowU NDGWecpzhaTSRFH2eRvVZUGl0iIuRzwR4aetZxda8rxHggIcbzqFBKy3vLlAya8hrK65 hApynEXGqzS35t+n6T0EhkJEezfU1ouN4jobS7z0ie1piHhgCIiJD0KVI58XA7EiLxb9 KvVps9e7rrr6irjUUoYcjJ0+69DPKEYuMOtOw51SlxwW04b5OwT8Ffg5MSfObOt4Ksja YdHoUskeU3HUzqE4AIWHU6cGb88dQIQSiqDLFjTdAh17TFbc8Z/IjCmi7Ui0gDGuMVmK ufOg== X-Gm-Message-State: AOAM5315WVqGuqU+HHzkCXEcPrAFLNBh/ij5h7aguyuVlJa5e7noS5OI xr8q915RGbP43/f4tKEuY994jNVhztU= X-Google-Smtp-Source: ABdhPJzFWnvMDXy1tAkMScNtbQaTQALGQxVxwGGiqTw84p9GDsoqfslCrBW60APRwQRYg9smqLdBPQ== X-Received: by 2002:a5d:6c69:: with SMTP id r9mr24946283wrz.78.1632695248403; Sun, 26 Sep 2021 15:27: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 d11sm7987590wrx.22.2021.09.26.15.27.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 15:27:28 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v8 02/40] hw/core: Restrict cpu_has_work() to sysemu Date: Mon, 27 Sep 2021 00:26:38 +0200 Message-Id: <20210926222716.1732932-3-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210926222716.1732932-1-f4bug@amsat.org> References: <20210926222716.1732932-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.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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" 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 Sun Sep 26 22:26: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: 1533033 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=gVJfOEkX; 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HHgXw2zzNz9tjv for ; Mon, 27 Sep 2021 08:33:52 +1000 (AEST) Received: from localhost ([::1]:59584 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUciU-00039h-4k for incoming@patchwork.ozlabs.org; Sun, 26 Sep 2021 18:33:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59606) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUccS-0000am-70 for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:27:36 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:44995) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUccQ-0005Gl-QH for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:27:35 -0400 Received: by mail-wr1-x42a.google.com with SMTP id d6so46333312wrc.11 for ; Sun, 26 Sep 2021 15:27:34 -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=gVJfOEkXTSUsxNlhV1JRo+YQwIVWWBBbogwpBC2yysQk8bL5nQchQhF4IG1Tvo4ij4 bEdD3LGt93PTBYsZu4n3E447UKXdm/KcPKMjX2mQhwy1BsU7vsltd9W+7GPC46sr4hdo l6DFlh1D3wGBylUYnvvPVJ040MfhdlWLcau7O+XIBEleaoenq8FyUuTR3etd3Xi/TYhu coP1LOtcIIwBDzVrPnuOEDqyrr17qhjQAlFKeyLn71uUvoKbppRv0hEj/zwnd4IQKOvi blHUhfnVp3z1CmQvLlF3ViUAu8rLx9mKE4bfzWAuC5BTNUsvj4DBasKhCdLA/GBkgekQ WQQA== 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=DDHtnB+z6isUjmepYyJVqSHlAf7mGUhqGPkS/Vws0A8PruM7wzmL9YmFhVDDagx3it xmacTCfg5l/ArJGyULv2NC36qd9VgAdJ/sRhK/a13A2otqBT8TkQzv7LbmIj+Nbxbezt dDgxGZDZ2oZ0SWBC0vDbnxzAwvKalvjapaRHlzo+VffGC20CTEIFdxzW/eWxI2T3COAk nKJOu6MiyWieTVyjyOXb97vb2e77mFmNze5tnafncbiaSxFKpnbXJO32Dm3jCxIaQWbX tulMnKuVhpLcSfhL2Dsah7ifgV1pxhnUt4XgTEvwgMJk413MLMqv03BYCVRTb9zZyBYQ daKA== X-Gm-Message-State: AOAM533yRZBLcR6mruHZgPOawN2Rv02W66OX571cZK6Sw3fCc6QjpCYG SAoAvGUn4Gr9nfK2BdXvJL8S03QaK18= X-Google-Smtp-Source: ABdhPJz72EI171N6YHxQ5n9FwI45sOtdylh9CkpZmwOPSAtw2PcS1dLdpQl28jSmJsD+Zix320HF4g== X-Received: by 2002:a1c:19c6:: with SMTP id 189mr10041556wmz.121.1632695253233; Sun, 26 Sep 2021 15:27:33 -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 20sm20499191wme.46.2021.09.26.15.27.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 15:27:32 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v8 03/40] hw/core: Un-inline cpu_has_work() Date: Mon, 27 Sep 2021 00:26:39 +0200 Message-Id: <20210926222716.1732932-4-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210926222716.1732932-1-f4bug@amsat.org> References: <20210926222716.1732932-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.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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" 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 Sun Sep 26 22:26: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: 1533037 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=BEwRKqrj; 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HHgc450c5z9sP7 for ; Mon, 27 Sep 2021 08:36:36 +1000 (AEST) Received: from localhost ([::1]:39918 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUcl7-0000Ui-5n for incoming@patchwork.ozlabs.org; Sun, 26 Sep 2021 18:36:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59628) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUccW-0000dD-MG for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:27:42 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:43602) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUccV-0005K5-6b for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:27:40 -0400 Received: by mail-wr1-x42c.google.com with SMTP id x20so1785242wrg.10 for ; Sun, 26 Sep 2021 15:27: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=0AqKBFC+aFLNQwO8nQ0Y0K7FTRMmlUnvtkKFuSqHBPM=; b=BEwRKqrjMQHMRTikiEs9+mKvi9rjtm0V5A4SrWuoplqEQFiL/6iUrE3XSinEPQaQBg 6NQ2/q5lTmt3TavNclLyxuCGQn/Us7IW10SI3G6Wu1T5Nd5iI3em8eDDsfNdndlq6evG xYVk4xqAcPYbX984a/zz4WXCOoVzXjJxmAJQRKKHHJk8/qsZCEwt26gsbS6VL3cp4vS9 yos1UrFt+ezV2WYp8sRp5vh5B6mq/b9SI4GRxqABFy3MZdBIgRZcHjTLqSwt5M48JFel fkE83fCGxR7hRuHTrhrvWUN/joWOCe+ymm6E4zC5Uu8noxQJ+Z8DcgCGGxh/3k/JEd0v TUpQ== 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=RKKftjoJneSdMIiz+O/pZmjoUwETBlly7LSAJRyZEuwqh7myAfIdTI2S34uyz8VolK m4Q0i7QSqSNfw4hjkzUvk5GnPotkmwmNzQVHMmPc7tWDkSQlk11HUGziMvhmQPtEOu5y 3pMSQKXVzDR83hG1Nom+K+Gm8aM88RjD0hNx9M2GCDaUcdadoQZfN4JHVOaQCzr5pqH9 2RgSBGDb4QwVg6Tnl54HQw9swVtIq7f/fLj3zZRqabdFVD5vkiUp4JGjsaCMiB12ROBC eq8rVVt3LYNKgEqrwMXJc2udrc0AuXlzbSAovsxMyoYfOLvWSzQSZoA41gtI5cq7zCSe a7Ug== X-Gm-Message-State: AOAM531GtectGLbRb4zj00M2TmE9wUngR1rW61HB/cMaeiypgTnwEkrp E/rd5Y7JW23P9JzwqYG230VpabC7vSs= X-Google-Smtp-Source: ABdhPJwd2etxjr1/6ZHzGJzBhyh49DQVM3lL60rMd7zDtv5jCtF2A0W9Y7tGVDWT06axWfuxsOiKWw== X-Received: by 2002:a05:600c:21d6:: with SMTP id x22mr13271735wmj.121.1632695257785; Sun, 26 Sep 2021 15:27: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 s2sm14428010wrn.77.2021.09.26.15.27.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 15:27:37 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v8 04/40] hw/core: Move cpu_common_has_work() to cpu_has_work() Date: Mon, 27 Sep 2021 00:26:40 +0200 Message-Id: <20210926222716.1732932-5-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210926222716.1732932-1-f4bug@amsat.org> References: <20210926222716.1732932-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.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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" 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é Reviewed-by: Richard Henderson --- 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 Sun Sep 26 22:26: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: 1533028 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=pzfCGttx; 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HHgTY4PVXz9tjv for ; Mon, 27 Sep 2021 08:30:57 +1000 (AEST) Received: from localhost ([::1]:50778 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUcff-0005cE-Ai for incoming@patchwork.ozlabs.org; Sun, 26 Sep 2021 18:30:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59640) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUccc-0000fP-8o for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:27:47 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:41685) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUcca-0005OF-59 for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:27:45 -0400 Received: by mail-wr1-x434.google.com with SMTP id w29so46359313wra.8 for ; Sun, 26 Sep 2021 15:27: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=ka2Zs6W/m1VUMtJW+H1oHcUfryePq3cXFIahmgjrmno=; b=pzfCGttxJjFHrz6CzdTeug1V7wBYecdbfYdES2RtB1/A5PEvAZy3jGXgsshet1oQhz xzNWcyjyO57PJwok1DIWDAQxLxIpNm/jjoVQXXIQottDFvCt1DPxAqK9yUoDyQ4AQv2F ZinlQ3IvWwJHwvR6mDlKj2HFyGHZlZmPuFOCbFjjcyHLqjPUgRxvIR9ZazJYIR0ISUmy FU3GXMDInNGZrOfSwBgpiY3sgbqxs+fHHzoQHRFk060zmM7YAYYerEVW5RVmXOKPbuzw 5kFM4iX+JfpLz0KXZ2pDMrYP14hbxlVRxZoberEI3qgTSrCc2Kw8dZlzYMWHtqVjocIU HDjA== 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=7Zk4Sa8udFu3eOY6DiUWHTa+Y24YrQskU43eUN2uDHT/ueIpibZGAFHdtJVEZbh9MY Grh0vvskMgvPDYha2xWgeWOpBIl01hsSGEtyPN1j+3rVCGIsu7v/i5GGS9C46hDSfeb0 wpYsoRO2fqTiPkoNF9XgFDzWv7OCg5KbALEMbvsz+ZDXp1V5auEZJF4mKKqtcoWb4Xd3 CMGEpZuIjq+xvAuIaI1hNRm4QGmD6y3kcvo5CDXIjx9w+ujlan72KMSb/R79EQ8S9dwA 1Rq20Z1ottofoSB3W9jBQpnokKx0HH43h4xSA8Z1nvXmJde/CgzMkX7At5+yh3/p7O/K bA2g== X-Gm-Message-State: AOAM532vFhig9piSyBg4G55SIPCqn3LJfOsP7sFjalQOMWa8uXlelnm+ aiDlkB+jE1gRbFdm9ofGX0TxBJv72dQ= X-Google-Smtp-Source: ABdhPJyaJpfbVN02fReKDqm7RY9CNNRdk78xdvEthkfFXhnDTPRucYvfhUAFoRRM1xfp/JFl+ysnIA== X-Received: by 2002:a1c:2b04:: with SMTP id r4mr13048636wmr.89.1632695262222; Sun, 26 Sep 2021 15:27: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 k17sm14911278wrq.7.2021.09.26.15.27.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 15:27:41 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v8 05/40] accel: Introduce AccelOpsClass::has_work() Date: Mon, 27 Sep 2021 00:26:41 +0200 Message-Id: <20210926222716.1732932-6-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210926222716.1732932-1-f4bug@amsat.org> References: <20210926222716.1732932-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.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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" Introduce an accelerator-specific has_work() handler. Eventually call it from cpu_has_work(). Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- 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 Sun Sep 26 22:26: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: 1533032 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=axH1gbBn; 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HHgXs6pBjz9tjv for ; Mon, 27 Sep 2021 08:33:48 +1000 (AEST) Received: from localhost ([::1]:59080 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUciP-0002pX-1c for incoming@patchwork.ozlabs.org; Sun, 26 Sep 2021 18:33:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59652) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUccf-0000hq-MV for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:27:49 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:34437) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUcce-0005RY-9I for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:27:49 -0400 Received: by mail-wr1-x42f.google.com with SMTP id t8so46609442wri.1 for ; Sun, 26 Sep 2021 15:27: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=D1NIBiKsJLet/LtgtEl9N8uYnLoHyxQP991kqXpIcyw=; b=axH1gbBnfyTyHMdOx5ecrp2+VnFyE6EmRNhA0XCtUgRzbykFuB+eJWOXwEuG2Y4Om/ hYxqbxeesqEBsKdfflVD+mR5zrszBdR14q+9TduMY3ivYswTUPwFquo4+Xy1shZWRrVG NM1GhM/196K68PBUrOg6feSDWbD0qXO3qBQHltHyIVMVVGOGEqbkj8qrAPSGcwMxxE6q ZvYUa5xxGoWNE5HQQ/cfvX6bjCo2w3erKCmlVw0eNWQmBAefLJphHxf8NUKDgPawZzs0 LiOF9NibpX8FChWhIYLyKkWAxHGQjBbS723DVa2I4qeSsmHlRdIrJD8FVUTXKAB1T+OP sXoA== 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=QqSiF0812qagFR1X9MghpNkGe2WR9oY039IFLKrsVE8hJTq9jQc1xajVdGc9wcZX2g PaCa5qcC1Ev6DLW5S4PeQfmUy3sATqvGxnPf4cJDvneoG3GXlKZ2Fvz8/G9X6+q7Nsxo lI+Lj54odkRayIbW31wiia0qf8tOBERTVdliHBM/eGc0ICcVVmuFXvYZG+4v2xPdv84u pDwzbavYstDo5XGlIWP3613bODgVgeN9ARJDR6ylD9cZJCleLneuB1bK2m8qd97WNvCF aM3b5UNXKdD2GoRnCuq2ujq8wpoKlRJ9qQva2rh19aikHgwV2ysfK0hcQ3v/ItrPbPqL t1EQ== X-Gm-Message-State: AOAM530TXRpt5bYGr4/uaakND/G6WKBG9xUFDzYYiI/lCUCyv587zii/ HNvP7LA3sq3H/Cv2tB7waNVyoQox7kw= X-Google-Smtp-Source: ABdhPJzK67hIDjeNv+lzivFJ0ut+sSlo8xcApaTg0LIaaCyYCwrTBRDuS9PpcvnA3L1X4SchDAt+eA== X-Received: by 2002:a1c:22c3:: with SMTP id i186mr12878915wmi.145.1632695266856; Sun, 26 Sep 2021 15:27: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 z12sm14726385wro.75.2021.09.26.15.27.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 15:27:46 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v8 06/40] accel/kvm: Implement AccelOpsClass::has_work() Date: Mon, 27 Sep 2021 00:26:42 +0200 Message-Id: <20210926222716.1732932-7-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210926222716.1732932-1-f4bug@amsat.org> References: <20210926222716.1732932-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.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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" 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 Sun Sep 26 22:26: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: 1533027 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=osZOzyl5; 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HHgRZ3P2Pz9tjv for ; Mon, 27 Sep 2021 08:29:14 +1000 (AEST) Received: from localhost ([::1]:46018 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUcdz-0002NL-W6 for incoming@patchwork.ozlabs.org; Sun, 26 Sep 2021 18:29:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59666) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUcck-0000r9-Bc for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:27:54 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:38620) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUcci-0005VH-Se for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:27:54 -0400 Received: by mail-wr1-x42f.google.com with SMTP id u18so46529052wrg.5 for ; Sun, 26 Sep 2021 15:27: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=vUe+1tkOVnIH977cfWQkm6Ao8Hfy7tcpnU7MaXPzIOo=; b=osZOzyl570nMTzc8yw2awwxE1MsWORyofZqC0UxcPWtKnIgde5fIzu34dWWxCNJwvE Rms1Ye+bCnucVMv3AhpxbmoX5QiBgzEBruq4TqHiOoA/0FcbKyAVRlRc3RDO0bsZOXKq yfrsF/W4PUHj9YSH8+sI13YxLZ6VHpYml0riV/jNTGo5n/+szgrBEJSfQN7vVoRfRkmt hd+X6iAti6UhsgU3zNzCFi9AzQFVmV7LUtOgiPKv+KBjPspkLV9yKxgJeWfh6Sc456dn f9AQGWsmLTvAzPcTso4tQxfNJHrmkXjyJWnBwcmTSvxtQPAk9ozWSfWlzj7pANKdXc1R u9Zg== 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=ECpDkop960UowhXr+TQ/8OkngmWYGTiPCFjzCaeOwdyb7EM6M0hLCfzW77CoFCU0Xa uwrHVM65SJj2/6Us+l1f7pBX+gjWb2qR5DWRyYnRF5LE8opFgVMwRvAFTmegm5iNntQM R6w8WRNYoY3I76dG5RiJL1QbE/LAU+9b/a0uznfpJqL/pYPhM/OTNR1Fj4Cn2jFfOYdv 6FiIHSVt+gxT4AjxQ4S1yGdJjr6ycAgwRwvyTot2smdCNpB6CeSBSLhe21pjCZm6m3jy l1WrFEKKBYX3GxImoBk5DGPMD2vwv8+AhePOPNSRV151PgoE9kwhOYArxez2ZicZNJBg pKGg== X-Gm-Message-State: AOAM530cI1SFdZOiP9oGyFSWGQw7qnNQHsv3QyfpNiuh9spjjcdyC5bn vfh91YKsLQCwfUnQPsTz+vrsSxMqWkA= X-Google-Smtp-Source: ABdhPJy2nDIc0bOSLZ9gSs8fB14NnUc66qIdOVI14E0smbIfjaQodDfkxrlvklf1xotUCP2kx6TGOg== X-Received: by 2002:adf:e649:: with SMTP id b9mr24756235wrn.309.1632695271540; Sun, 26 Sep 2021 15:27: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 o3sm15552836wra.52.2021.09.26.15.27.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 15:27:51 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v8 07/40] accel/whpx: Implement AccelOpsClass::has_work() Date: Mon, 27 Sep 2021 00:26:43 +0200 Message-Id: <20210926222716.1732932-8-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210926222716.1732932-1-f4bug@amsat.org> References: <20210926222716.1732932-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.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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" 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 Sun Sep 26 22:26: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: 1533036 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=QRuWnWT3; 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HHgbh4ySsz9tjv for ; Mon, 27 Sep 2021 08:36:16 +1000 (AEST) Received: from localhost ([::1]:39434 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUcko-0008VW-DA for incoming@patchwork.ozlabs.org; Sun, 26 Sep 2021 18:36:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59678) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUccp-00015X-2N for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:27:59 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:42775) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUccn-0005Yn-KT for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:27:58 -0400 Received: by mail-wr1-x435.google.com with SMTP id v17so3074967wrv.9 for ; Sun, 26 Sep 2021 15:27: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=unRoKxdhmIQ/3+a2J4b34FjTNk3kwzqzxXg2lM7z0e4=; b=QRuWnWT3WadM8I9r2IH3CQ/prDCEDvoUp5H8hsFGWpZLZQXAB7iJLGRPi8knZ3uSWj Pg1q3pNZPD4wUpnyqi9nWhx1sn0zmOvSaIM5Sl0jFVU9edSOr7cNaeO8oU3vmcGNWnqF WWe0NjN+MAgKAA2pxlIfLj18k34e6VTJ00SqsQkz9btkK5Q1YIDxv31Wz0moQTvBbscA 3eHfJskC6RgJUfvObFGBZL1TarbBX0+Lw2Gg3wgA1efFgl1tRd8P1O3zq/Kv/eyc6XHE hyaQIz1NYLZpQQXaOtN0Z7a+Tbbk8JjG05zzJcJJWt+TQDXmUoou6BBEiLqDx6EcCbE6 l3bw== 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=18jA278P1SuZa8FS35c89eTp4Kx7Dxuppqqm+yPy62l5NH1Ug2kL3YOnKmhQDeim2G 8FSRtyeW/YGSx8MoKLC8z/k5/XmszmN8HQbFy1E+Zo9hVE++7IIhzZS90MIWtNi03ymj 8nq8D7RqXgvWIszV9szjl+YuUrXdC8ykYbDrnGgdMRa3bsbIINgV6EmuuIelnLpkGNQE icQpQavr4wlshoTWSZB+m/rfeMqCbUty31NreHN+JHUC4W9kieeW3hsQakelE+9FcdGT OVkMxURzTO8fi4ROMHVPrEywwMj9wfYKo3fSswi4yQMmbOpds9r64wOMg75saY0L4pbl 9olQ== X-Gm-Message-State: AOAM530lqfuHPi+27AurugHVIFo4C0sCYJgv/1PIL5MZ/kLzvx4PcMVL 3sEinEmx/uemBpykS6/kuX7HQuGnCug= X-Google-Smtp-Source: ABdhPJwzLznoh1qV93O5PQXzyZv01yeV0Pmkn2BPP/uK4jxHogim/HGyVgAZNm4xnuKlN4MpHhb9ew== X-Received: by 2002:a05:6000:2cd:: with SMTP id o13mr23937397wry.193.1632695276171; Sun, 26 Sep 2021 15:27: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 o13sm18491519wri.53.2021.09.26.15.27.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 15:27:55 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v8 08/40] accel/hvf: Implement AccelOpsClass::has_work() Date: Mon, 27 Sep 2021 00:26:44 +0200 Message-Id: <20210926222716.1732932-9-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210926222716.1732932-1-f4bug@amsat.org> References: <20210926222716.1732932-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.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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" 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é Reviewed-by: Richard Henderson --- 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 Sun Sep 26 22:26: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: 1533031 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=l1osCv3M; 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HHgVc2LXfz9sW4 for ; Mon, 27 Sep 2021 08:31:52 +1000 (AEST) Received: from localhost ([::1]:54562 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUcgY-0008Ev-22 for incoming@patchwork.ozlabs.org; Sun, 26 Sep 2021 18:31:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59692) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUccu-0001I5-0L for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:28:04 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:33660) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUccs-0005ci-IC for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:28:03 -0400 Received: by mail-wr1-x434.google.com with SMTP id t18so46545105wrb.0 for ; Sun, 26 Sep 2021 15:28: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=I61ARzsVO4/KzAGYtcJMZn32sXSEJVm6F+jp7uLlVMM=; b=l1osCv3MPzqgSzoxrqidoFJvfUrpqdySR6e3d5PyocAsPBu8DRmKHIjGSrbwgzEYhA bR+tCqk514wbnVqQv0VfY/v2NvvtTVruunZ2eChdI/C/XB7KvWTH0OSeAauJsJDYzUAY YKBvptZ67wBuQBbav7u1xzoDkHxPQEoBjNkerx1d6BDW9PKyrhDLAOUIYpuM+eoqpW0a 6n1kS6DjEc4nwiK0MP5/lDIt8fbw/8JXmRPL6CkhiLoknT9hXoamDnYxYn14EcLCI18A dcZlpfQpxfV3OfTKUHjlf4gItf51SI2azsfLGmM5z3wctde7EQZuYsoCzDgblz88eqxX 3eNg== 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=uBKBNVSpXj4Hxe/VOujB+X9U13CVcnqDbfqHXCPndraiaN+me/ZSU2jKTkiV/cmmkB 4RvKb8x/Qr3oEuVEM1Ko4lGnIpmys0ej6F1h88xcM1+1ZqGlBi4wKS/mpDPOJs2HAAKB baWj2OJi6BUiZroMwslZ3lR8ZdDfN6QQVIsPSIq8UuPdczaBwPEqlZq6k1jHbIoFOhiI UqmPkzLgpemVhPmugCUpFqgpB/zPc6DpqEblVNKeHMTw6+nCtwEWZ0idZOgG2iEwUW6k Tt1fxNiAtSl96I6eHsCGtkltz0UCA6sQTaMh90dymSgXyGHg1GXwBP20XgP0by4tgXGZ GK7Q== X-Gm-Message-State: AOAM531QtdfbE8zxbB2rX0q2CsBi/Ymzt662776y30DifMvr9czJb9Br GAtXUOJyZiKszf5jyArbF2AG2Jva0EY= X-Google-Smtp-Source: ABdhPJxmPoo78Gq10X1qkG1+F6AOJR5/mKqsgSjopX2F9E8AKUc+XowymUi62g9Q1AyyCSqaqYnArQ== X-Received: by 2002:adf:d21b:: with SMTP id j27mr9077391wrh.33.1632695281066; Sun, 26 Sep 2021 15:28: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 z6sm17776552wmp.1.2021.09.26.15.28.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 15:28:00 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v8 09/40] accel/xen: Implement AccelOpsClass::has_work() Date: Mon, 27 Sep 2021 00:26:45 +0200 Message-Id: <20210926222716.1732932-10-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210926222716.1732932-1-f4bug@amsat.org> References: <20210926222716.1732932-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.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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" 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é Reviewed-by: Richard Henderson --- 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 Sun Sep 26 22:26: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: 1533041 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=p1q50X1i; 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HHgfc4vlYz9tjv for ; Mon, 27 Sep 2021 08:38:48 +1000 (AEST) Received: from localhost ([::1]:47882 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUcnF-00066Y-Ub for incoming@patchwork.ozlabs.org; Sun, 26 Sep 2021 18:38:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59706) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUccy-0001Td-9z for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:28:08 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:36666) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUccw-0005g9-UU for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:28:08 -0400 Received: by mail-wr1-x42c.google.com with SMTP id g16so46516103wrb.3 for ; Sun, 26 Sep 2021 15:28:06 -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=p1q50X1invMCdHbWySnroGfBro0IzBX3SAokQ52PVvE0ZT0Wj3fneFkMBn3HEYFBpY pxJnxr3OoVzMHskVrup2qTQgAvQPj3zpv5RrZdL/La49M6SJ6FaUOKM2wCLDw/2h/IsH O6TgensLqBINc5QDJOzFH0i7q9NMBoiFYmbRwb0AosiBocricGVbhmnVHU2MwWHB8Wxd bLeKvsl9hiNvBYtzya0s2g3hTI2hWvQEGohIsTqYPAz8cjBtwKWiskx4P+4hhg7IULH1 sH9RkQpfMDO703/GyWo+FkmSGgsqwnJu8Xoe0n6XVmRFGRSqAg0iGumCLQ/3Tc/nmXYS hgfw== 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=pUQwx00eH5q+HPemWwUfHmr7CnJ9PvbMC//m43Vp6WHto+dt5KJnBWomXArTB8VOqT ngfzfSKs/KMa7dOXTw3j1F22rkKciuH6GTRCTiXSL/3IkjdrjoJqI6c0kK2RKaN1D7Xl nDXx8kVVtwvQ/aCByUFdlhJoDBuNoeklbyZSkkMTgIQnJip1ZPaUO8g2aSplV7Spvg2H p5vyNGsg8GuB+4/65Hyidfaqu7sE+4N9gx2qUwN+19qAGMhejMfxy4OoNQEWSBRT8fAl njCXtaMCD0/3c+KTQSwGFTL9YQAF8AeojQj7N9cMqaU59oDdwUFejltmFQ+d/of1FGkC hrTQ== X-Gm-Message-State: AOAM5333wXidcX20W+7Wf0HVB7bPHVnwXWkCi7NoX6mFDSNCo/TuMcTW fDPdi15TtnFq6uAKak0LdTxm96s0PAk= X-Google-Smtp-Source: ABdhPJyJrnt7JB1iL+qPvwDLQlGRFZl6KezWSTiJYBlgvS8dqkbkejgKMY0bstYABHWB8Cm8v0eTDA== X-Received: by 2002:a05:600c:354a:: with SMTP id i10mr12468459wmq.77.1632695285592; Sun, 26 Sep 2021 15:28:05 -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 i67sm17801799wmi.41.2021.09.26.15.28.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 15:28:05 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v8 10/40] accel/hax: Implement AccelOpsClass::has_work() Date: Mon, 27 Sep 2021 00:26:46 +0200 Message-Id: <20210926222716.1732932-11-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210926222716.1732932-1-f4bug@amsat.org> References: <20210926222716.1732932-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.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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" 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é Reviewed-by: Richard Henderson --- 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 Sun Sep 26 22:26: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: 1533026 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=KDGXbEwV; 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HHgRC2qYhz9tjv for ; Mon, 27 Sep 2021 08:28:55 +1000 (AEST) Received: from localhost ([::1]:44928 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUcdh-0001cC-5w for incoming@patchwork.ozlabs.org; Sun, 26 Sep 2021 18:28:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59718) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUcd4-0001Zd-5b for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:28:14 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:34447) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUcd1-0005js-QB for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:28:13 -0400 Received: by mail-wr1-x435.google.com with SMTP id t8so46611328wri.1 for ; Sun, 26 Sep 2021 15:28:11 -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=KDGXbEwVEfj5iCcoPn9Y3LdzC65NTG4Yg+o1wg3KE4F6V2r7sG1pw1y+hkClw8QSY0 HIq384GOHKwpaJxwZ4K+0j9T0VhdNnANJrEGAxBwwyt2YvgzPZAljt5BY1aShQ7vWnBc 4P9JQPMU58SMDMM31dreg+d83Jo6G2bT6bLpiWE+xHDut6B0gCtJZAmLRYpMfJgZkli8 GfW5fMYrpdlK25RV3IBZkS6R1/lQRnhi/4ta1koEdv6LSbhSZOowUmZiYuZGWo2ebSNZ 4ZXWA7cT7fbgEzrxXofiB4SVIUR7CXDN3poqBnIcLjBDVRIp26gk/N0z+l/iWon6eihO uzwQ== 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=uIiu0T0OBZ4UMFp23ILnXNAPXOIyUiNJMHPy+MFPJ/WNyePCUXoAxJWU5oPLa2jyAQ gRxelW/LhGmUckej1GEu4/rP2cetj2KduJxnECKoHYLz5VkysLdMjX2QZE1TLVh8jcDq on3MKdRKIwqkOEoWTp3ECnNsCH0o9n2ujvxG/7AhfkNO3ORkGPBagtdPTWBpY93xUpU2 lkFTvDEW7P9zl5iSHzv0crGl8mz22UTgxcePi0IdPFPYVFvHObJyP5pCxDOND8hFRP0f XTekkSPIUGNuH2qQKTO+gzyN8tM69CQ3dBmRyi3YDExbvOsOg3HnW6NGcjICfrKDD+Gv MZZA== X-Gm-Message-State: AOAM530+5zStbAZKw8U5NtBVnMm1J/joocEa/ac/ZYZbH/hV+GL4mXEW UAD275AJuYV0hMH6tTgKl8b9kWX6Dus= X-Google-Smtp-Source: ABdhPJzQwXKTQ+GYGsOnuq6HO1/QCUPtf1iwdOiHMhh8t8rFgkc69ciZaLQ90Uen/ZBEHagX5ROPDg== X-Received: by 2002:a5d:648f:: with SMTP id o15mr24409074wri.338.1632695290386; Sun, 26 Sep 2021 15:28:10 -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 x5sm18522189wmk.32.2021.09.26.15.28.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 15:28:09 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v8 11/40] accel/nvmm: Implement AccelOpsClass::has_work() Date: Mon, 27 Sep 2021 00:26:47 +0200 Message-Id: <20210926222716.1732932-12-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210926222716.1732932-1-f4bug@amsat.org> References: <20210926222716.1732932-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.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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" 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: Richard Henderson --- 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 Sun Sep 26 22:26:48 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: 1533030 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=nK8j5q7s; 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HHgVJ3NcLz9sW4 for ; Mon, 27 Sep 2021 08:31:36 +1000 (AEST) Received: from localhost ([::1]:53216 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUcgH-0007MR-Q3 for incoming@patchwork.ozlabs.org; Sun, 26 Sep 2021 18:31:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59730) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUcd7-0001ew-WD for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:28:18 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:35732) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUcd6-0005ne-Kh for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:28:17 -0400 Received: by mail-wr1-x432.google.com with SMTP id i23so46572562wrb.2 for ; Sun, 26 Sep 2021 15:28:16 -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=aP21aGayxNLidjUWldaRN+0yZT8srWWtopHXNcPvGlE=; b=nK8j5q7s3lNrxn2ZCDxUrIuPEkSH/7y7u01mDGg/44cRc++4us6+nCNT71y5fi3NFr eR+ZaGDQhx2TE+mq7VmNNca/PpkVImdtgfOgx50yuLON2ClQpdlaz/0ZXsL5re2leAwS /6fpcUzIFGG9i4Hf8/e6Ay46MBPvDKHugAdMwJkEsl3eRlHl1c2quQU/dIx0Wjb1I4vR 0J7/Mqc3JQXBNEMPJtenzCNKyuku98xUMe9qkmLH3W9iLCGdvvnFczu0EBjTVDSeAkNX MeTVo/PA6US6SKxLJquLcyMGiIBsy3bUXSxng1YZJbaV4JO/i6iRUIOk7d/7huRXdZ5u 0V7g== 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=aP21aGayxNLidjUWldaRN+0yZT8srWWtopHXNcPvGlE=; b=dryHWveeopDaexy+t1MDC1o8QuL085m6VRmqT0U7MIFjTWVj+0/SPYwakzrW2F8qve nyhiumQ6xSNYV3aJuPkHvWdiNiqrlNv+qiHE7qD2m/vx9f9MDse2Gbi8Yavk/wClmFqh 0HHkXEfyUpzfYGJVROfj2Y+nj9kZDdA8CqCmIyUoC7+W1sxqjc9adpx4fDt/FAp+02xe eZsw2jVN30bQG7iq1QMoq/Y8aybPg+Rzdw3XVTlrtv5PmmuGWNnv2dloaqw/VRstkMFQ 3jih/VHiAMzPyLfxVLBFtV2Z9qc4swFqq/EvEep+h4gu1aJ+UrbHFFoDVk9mnIi2YsRQ GqHg== X-Gm-Message-State: AOAM5305qZhdhwsrPhBYLGvvkrSMSMbf+1A4SuYDORHvQoFCOA0hk8cy flOA6/lFSzW3FwJb6ASbot6w9aER6UI= X-Google-Smtp-Source: ABdhPJxVG3UVyimD7YFqZkBt1o2mVO1k3I3OoG7AUQos+QiFs08HhrrH54AU/rmX2HJtY7B55O2vpA== X-Received: by 2002:a05:600c:3b89:: with SMTP id n9mr12735670wms.186.1632695295288; Sun, 26 Sep 2021 15:28:15 -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 z17sm14413513wml.24.2021.09.26.15.28.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 15:28:14 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v8 12/40] accel/qtest: Implement AccelOpsClass::has_work() Date: Mon, 27 Sep 2021 00:26:48 +0200 Message-Id: <20210926222716.1732932-13-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210926222716.1732932-1-f4bug@amsat.org> References: <20210926222716.1732932-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.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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" Since there is no specific QTest handling for cpu_has_work() in cpu_thread_is_idle(), implement QTest has_work() handler as a simple 'return false' code. Besides, QTest is a "dummy" accelerator so not much can be done on vCPUs. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- accel/qtest/qtest.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/accel/qtest/qtest.c b/accel/qtest/qtest.c index 7e6b8110d52..eb5a17cef18 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) +{ + return false; +} + 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 Sun Sep 26 22:26:49 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: 1533042 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=OR3OPo45; 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HHgfn5rhjz9tjv for ; Mon, 27 Sep 2021 08:38:56 +1000 (AEST) Received: from localhost ([::1]:48476 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUcnM-0006UY-UC for incoming@patchwork.ozlabs.org; Sun, 26 Sep 2021 18:38:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59742) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUcdC-0001n4-VU for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:28:23 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:39827) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUcdB-0005rk-Gh for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:28:22 -0400 Received: by mail-wr1-x432.google.com with SMTP id r23so21136769wra.6 for ; Sun, 26 Sep 2021 15:28:21 -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=OR3OPo45aC2xhKChcrZz7za2Uk1gRl7+YVRHyKl4/fDo7VUbVpWL7BLLaZy15w6aGi H03Qa2hgDLL4UEw/IzYe9l5Zt5nEDKnLtEpKYohvsQclwEoIiVJczD9Ok8HuavRtEWiO /lTmvtPR8ymuzEnm4kFkuIygv2qyBtDczzPHJlugzP+rNSKrh+FZaYKtahEHxM2objv9 usUnIm6kIOwZoR568lGNB3mBuoqerdy3D/DnzZdAapnXPXn8AudH77U7fHRfamqATa4j cG3+nmf3S6MownvkNDjvY+LC7X2+ojavEJQHgCGJHqGmT9+Fex5qFbGxiuNhf2KVtHte J1Wg== 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=TFZmBl5K3T4znJWayPkBZTTMSmuegHfIOULKGqFEy4NzXUdMuLZ5laHUU5SR7o7i6o XL2wIFylDylXFSizaHOnD3PDxaZ7XgW6NIzUYRBJlNgtJVgnBaURSDtGXVJ9qe3+zRS2 YahOhlQdjKEij6dzuQfbfVIUafjdOusGnKckM82+1hZxiByAbPtw/rrTNZzM/Mz2NHD+ fIvljj8UPNtOghh4tyvR/eZrWc7ngrgfrCA2O5q6X3tIf3PlHn/TcLzTnezOFb/jgUXQ MLkOta4YXv4/P46orKgp61Al8e59XoxqHxrw92O9XDlYJv6ff6B7rge4QF73u1LbSOvc sX5A== X-Gm-Message-State: AOAM532a7pD4KJBz8skNNf1n8PPnmQDPgH46fL0fjrywZHCF2vLQ/GPl iDKckfxtw229PVjP4uDxSatPXPwVNSc= X-Google-Smtp-Source: ABdhPJyjdJ7eLF1HdNjB1R1s6RdIQh08bx09tZ2GkYBNLlR6eCuTx9u46IUXIrAQbsfKFitvqeWSJA== X-Received: by 2002:a05:6000:18a2:: with SMTP id b2mr24015945wri.342.1632695299896; Sun, 26 Sep 2021 15:28:19 -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 f8sm14727277wrx.15.2021.09.26.15.28.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 15:28:19 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v8 13/40] accel/tcg: Implement AccelOpsClass::has_work() Date: Mon, 27 Sep 2021 00:26:49 +0200 Message-Id: <20210926222716.1732932-14-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210926222716.1732932-1-f4bug@amsat.org> References: <20210926222716.1732932-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.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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" 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 Sun Sep 26 22:26:50 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: 1533045 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=VO89epEC; 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HHgjv331zz9ssP for ; Mon, 27 Sep 2021 08:41:39 +1000 (AEST) Received: from localhost ([::1]:56430 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUcq1-0003NH-4D for incoming@patchwork.ozlabs.org; Sun, 26 Sep 2021 18:41:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59754) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUcdH-0001wj-LI for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:28:27 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:45805) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUcdF-0005uq-Up for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:28:27 -0400 Received: by mail-wr1-x42b.google.com with SMTP id d21so46369819wra.12 for ; Sun, 26 Sep 2021 15:28:25 -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=VO89epECi1T9+YDxCkWYaV/al/dbXjdef8HSwscPIAQv3YG7q8w9eSSxonVH/y4UNQ wYeNa0sK2vX64T0SPIg+k1KklIfrhdoM+ziRNNQp3vVJegmqaL/JTB01LqsOO9M5gQZM knz4RshMQ7CXSq7mo5VlIYgJ5vwrgAa4jocCRv5drAI0IxfkItnf9pPHDspDK1kN+H/b PvxkQOQIS8rH1IeSDYNYCRj2cwZnKBS/TN0Hcg6m06MO1VJoUMYOH9fKMJtvL7qmhXOI /TT4h7QjJUgLt1ZFsDi4YlqFukIYe7NiZHogX3mms6rl5EHJQ92sjNusitcp01kh7XII GlZg== 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=CM+c6O8+d3+5HRE3wCF9gOyGh95ZWz64OXxmldwN3Lfd2ZZRiMv/zMOuxzFWtgsTzp K9E4dX/LXuy4QKxzh5X3XqWkP9Ndax869SMaXLB8LpSCkaVUFEEopD8080WFxAwYKxlQ xVsQ8mwAzuplJKleR9RuzcV70r1yCj4eoKV3ND0IPW9ONROQYKFNUCRw6Oq0pBIabjPs 4/hF1TXoKhHSALVbCRVpts5r0d1dpoX8lpipGyoJlqw4rM5qCpbmU+IdSqzEhvYqRVr0 R1OELOtg3of9FEOIR8KDt+XamuKZhXYi+S08QzoHwXKPLbNnhvtzGDhIoriD9erxeXsL l5Tw== X-Gm-Message-State: AOAM5303TYS5nGLjbqtHc2lyklxTOvg/lqVh6VgJB9p1Vp0smkFezBZL iD0jvKh0xl8bXD1jpvCochUbSD+pwkU= X-Google-Smtp-Source: ABdhPJx4Grbu+bnqpZdqpMlMhpH0SxlysDpUNKlhKe6LApT4A0XEZzYaucX9SR+lTa01aRlg9x7z7g== X-Received: by 2002:adf:e74b:: with SMTP id c11mr24838595wrn.101.1632695304452; Sun, 26 Sep 2021 15:28:24 -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 10sm17847838wmi.1.2021.09.26.15.28.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 15:28:24 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v8 14/40] accel: Simplify cpu_has_work() Date: Mon, 27 Sep 2021 00:26:50 +0200 Message-Id: <20210926222716.1732932-15-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210926222716.1732932-1-f4bug@amsat.org> References: <20210926222716.1732932-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x42b.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.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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" 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 Sun Sep 26 22:26:51 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: 1533035 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=eudP0goO; 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HHgYp4dLdz9tjv for ; Mon, 27 Sep 2021 08:34:38 +1000 (AEST) Received: from localhost ([::1]:34898 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUcjE-0005VC-9p for incoming@patchwork.ozlabs.org; Sun, 26 Sep 2021 18:34:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59766) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUcdL-00029G-UB for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:28:31 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:38623) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUcdK-0005zr-Ed for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:28:31 -0400 Received: by mail-wr1-x42c.google.com with SMTP id u18so46532212wrg.5 for ; Sun, 26 Sep 2021 15:28:30 -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=zpMC5xjCsBbH9RpT6gPVCF+edgca48PVAQbhvKWBiG4=; b=eudP0goO9ZnicrGuuChVGFg6VRAPLWGodTwx00qC7j8AcLXJSIARimyry/vy+znOwJ CMJImwD3fXnN5lZp0S7d4LkV/JY17ytV9l4LM2x/QiOKE6oIcv2CquijRI8PPigUfhiI Olll9jpBSM4s4OWVRPFISaHUPUq4dttnKLX5Fk1QpYWRVmlebffNsdYX+JCM4bRMVAUf JfGzzbem8MMtENFMsn173L1vB1+IziAi0sA/q0uJ57KQKUu6lB1+N4FE+bdMBmhkgFmF EBYO3jQCsY191Q7vfjWZ+oxDXFFGDxOxyvmuHTUIo8+mnj1D6KDWZCxOiUCGvUCcLSfZ mRIQ== 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=zpMC5xjCsBbH9RpT6gPVCF+edgca48PVAQbhvKWBiG4=; b=rwOoM+uTdc5vkJkUwKPTm4y49pkL3czlr1QIMu+ZNv3KxrGPdSwYFpRcT1Qq+at5AZ UWuzB75vJQH8FyaExQMJaQpFo7A3AE77IK5cUid2o0tIwKGnxAM9x81XfqQmaRACpGmM GufSPyBQZI0cQZafNBBEGTEjhlPVVq3Um0bIOHO/ODFEpiExSL3eNXaHV8VV6RDGsxAK knuPTW/iOo9GcBDcAbeBH76gINarm8EwSQGPQF+sabapReTOuljZ2vHiGUuroOjrsoKa IF8I7A8cVoMjWrLWQUY0geEsLgqeGLcgGroHitDLl3GT9XwZpJDyCISWSo5yxPhbK7Vp 4EtQ== X-Gm-Message-State: AOAM531g+od1IRp50DCxo+g7gZW86eQwJbUFFtIkEE/CuaWMbnkLMj72 U+2aKTmtI/pbr1eNuSJWhdfFvOD5srQ= X-Google-Smtp-Source: ABdhPJwLNShyheWFYRfshXozc0iYHKyHFbdhGxGeI5uiwhin6ygVnDncSgPIkqRJvBf0uIbngT2avQ== X-Received: by 2002:a7b:cc8d:: with SMTP id p13mr12720547wma.10.1632695308913; Sun, 26 Sep 2021 15:28: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 e2sm14921269wra.40.2021.09.26.15.28.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 15:28:28 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v8 15/40] accel/tcg: Introduce TCGCPUOps::has_work() Date: Mon, 27 Sep 2021 00:26:51 +0200 Message-Id: <20210926222716.1732932-16-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210926222716.1732932-1-f4bug@amsat.org> References: <20210926222716.1732932-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.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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" 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 6cbe17f2e6d..c19c507b23c 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 Sun Sep 26 22:26:52 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: 1533101 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=nyWcoBad; 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HHgn848dpz9tjv for ; Mon, 27 Sep 2021 08:44:27 +1000 (AEST) Received: from localhost ([::1]:36850 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUcsh-0000sP-KM for incoming@patchwork.ozlabs.org; Sun, 26 Sep 2021 18:44:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59778) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUcdQ-0002Pr-KL for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:28:36 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:45809) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUcdP-00063B-3r for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:28:36 -0400 Received: by mail-wr1-x42e.google.com with SMTP id d21so46370603wra.12 for ; Sun, 26 Sep 2021 15:28:34 -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=UE09P3+95R7azQiB3uAxKhFAUsJxXecPBFCz3ofDdJY=; b=nyWcoBadZ+pH8SsaCmOG3BSiKXQ9Y8mLrCl9+3L4g/sb1zi9YMV28pIRff0rp8phHk eLc0W159AE7lSRfU5YIXzl9CBy3eJioguy+5OptiG+7IefldrtL22EPWYvwO6KLI6nWI XW1oRpHwCLNif7xoKba0U5/rRsEjO2D1yP8+DcJ5sVP3FeI/sFgqJ/9uVl/OHpVJW0LE azccRPncLDsrSN43VFaDT7/nJJ/WhMz2NZZtucUqplFPXt4qfIHogmLiLYJOtLILbPUu WFUwVITszeRQ7v3pst12V9T7KwWspV5vYKDrnbgYmjvrgKBJpqSF3LDdXFykenafLUPJ hTDw== 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=UE09P3+95R7azQiB3uAxKhFAUsJxXecPBFCz3ofDdJY=; b=Kg1LQX4BzygvZneGrCEqfXqzJZJA8G4HOZzNCar+ZZ66PiL1adjiF89TXCBdX/2GZq PaFegbAcft9Bfp02gi66zoiPMooTWIFjI6GiS+N19dzIij/rkc45CArL0f/pnePKGJaX /o+IqlsjKTZhkEGsspVyfXMBrkDAxDJdlEhRu4ifXXOy+cInOjVt/lEM5GVhwz4R0n4R iLIMRdh4h/6RNJoXoRLzlQZGWJQdPyaZzkUf80IfBewSOeAtEJxoiOMehgx8WHS1v4N3 LqL/FaHFP1HIP6rJQj3vTd09vqHI68RqQwUUJQY8yyXXudwE41eBD0T29sOHUUQaPQva hDug== X-Gm-Message-State: AOAM531gkjHW1paEn18YVRlvfyle9aBhbtcTiY1vE0eDLTaOwYp5WH5Y xJT4Z+v1bK2dV9S9+n8WPSkNSFZxsP0= X-Google-Smtp-Source: ABdhPJwBdEZejMQzggbxY5t2LnMSIVuiO1V5gP6pPawrOr3W53f5ggIwRq5/DTr9GjO0tSMuzsqggw== X-Received: by 2002:a05:600c:2312:: with SMTP id 18mr11916668wmo.192.1632695313610; Sun, 26 Sep 2021 15:28:33 -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 g12sm1871783wmh.36.2021.09.26.15.28.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 15:28:33 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v8 16/40] target/arm: Explicit v7M cores use arm_cpu_has_work as CPUClass:has_work Date: Mon, 27 Sep 2021 00:26:52 +0200 Message-Id: <20210926222716.1732932-17-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210926222716.1732932-1-f4bug@amsat.org> References: <20210926222716.1732932-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.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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" 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 9fbb3649682..f20aeb97fa0 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 Sun Sep 26 22:26:53 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: 1533129 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=Qe0Mf9yE; 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HHgrl6w9Dz9tjv for ; Mon, 27 Sep 2021 08:47:35 +1000 (AEST) Received: from localhost ([::1]:43810 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUcvl-0005h5-PN for incoming@patchwork.ozlabs.org; Sun, 26 Sep 2021 18:47:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59806) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUcdU-0002cW-U4 for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:28:40 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:33658) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUcdT-00066p-EM for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:28:40 -0400 Received: by mail-wr1-x42b.google.com with SMTP id t18so46548245wrb.0 for ; Sun, 26 Sep 2021 15:28:39 -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=r6ZxEtcTtXMZRq7+nFZf7Av8uL6lok+sSg0IbMh7PU4=; b=Qe0Mf9yEZwjMz+ydJuf3ti9wMPQE6YwtWkrLuRMwtSWvRswAiHKvAno38Re+9ynLjy tGpx6CHu7lj5HuRsC9yZoGN9cZwfMEA79/uhkV8355pK88DzwmUI0yeyDnGzC56ILIMW QqgtyXhXb418Hc4L8mWppsAhzHJ39hS4/0op2Q3U1ArOfg1CBaNjKfKbutBm8n/OkRte y0635/iKpLNq10OFAofD7fHkeXpEMqu8FgGXUIc58Zd5f1EXNvB66A9q/cNgtCy3sFRe wZ49crC9QCx9duDuSNIhNGMmhy+gJu+k4RnAkmO+ypDJJGiGObWKmbY+las0LugnskYx Ml2w== 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=r6ZxEtcTtXMZRq7+nFZf7Av8uL6lok+sSg0IbMh7PU4=; b=DwyScuwLg/LZzps7JljzXaSbmoke2YVF5fQm+bb99qB8tVyA6tYTzRxX2+zWG65W7n Tvd/3T3JtHgiMuhl2flljsDFmtXtMiPXXeFaUCLgTLb7gSvYNkndNTMll+mZm60mWzqi hLTobKy1ij2WicHAqTO2KxCbUeEJd1rXUVwzRVL7rJ5C1lXtL48NvvEvGWrAZ4IuzXot 9+xjhv1gUvAfLP5lre2A0nqT/Enm+v2wUHeaVbqeJXbv8/3kVBoxDvh6I61xJYPiC4Ck 6bCrRR77yUrVrR0iHDLDEQexbMzMwGfM4DHjFzewqCAHvw0VqGrET00C6kcaYBLBNbgH Y1pA== X-Gm-Message-State: AOAM532gNDdAUWZj3GHOx0GmtMG5i+4IT7f7dARRYc082SqrWzoAq2wp Ab/CipSYSztJRs6PidkoRRYpYz3oz2M= X-Google-Smtp-Source: ABdhPJyiD0JWYAWHjgyS5g+bpRe47DYpSl3/WEG66YLxBkVuLFN0sgILQDL6i56Lqt81h3Ha15IsbA== X-Received: by 2002:a05:600c:1d18:: with SMTP id l24mr13333905wms.98.1632695318051; Sun, 26 Sep 2021 15:28:38 -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 j4sm15186040wrt.67.2021.09.26.15.28.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 15:28:37 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v8 17/40] target/arm: Restrict has_work() handler to sysemu and TCG Date: Mon, 27 Sep 2021 00:26:53 +0200 Message-Id: <20210926222716.1732932-18-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210926222716.1732932-1-f4bug@amsat.org> References: <20210926222716.1732932-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x42b.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.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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 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 f20aeb97fa0..18b3c2bf1ea 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 Sun Sep 26 22:26:54 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: 1533046 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=Lz1qhq/u; 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HHgkD2W6hz9ssP for ; Mon, 27 Sep 2021 08:41:56 +1000 (AEST) Received: from localhost ([::1]:56942 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUcqI-0003hU-4A for incoming@patchwork.ozlabs.org; Sun, 26 Sep 2021 18:41:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59818) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUcdZ-0002sk-VB for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:28:45 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:38625) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUcdY-0006AT-HR for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:28:45 -0400 Received: by mail-wr1-x42b.google.com with SMTP id u18so46533422wrg.5 for ; Sun, 26 Sep 2021 15:28: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=bWsdPZ7x9Zv9ulmzVLDInqOVNAhrwd+vJJnOs6jG4pU=; b=Lz1qhq/uC+KoKYHEK0XLdGXE+6OedOp7CtPzLrZMbklblzQg5mCutVwNKYMMj+2qsy c4fLcx+q5HSxWpbTbR4LbOLxLRJcr/W1nd45FUz7N7MBCOfOPe/b4/gpvd1aY7K6Biqq HcbKcv4U+qyJedhwNQYK94dmRrcuBgL1cpnAxEDv9DoOwkKWiPTnc1Ucg4RElpCegDnp WmTu0snU9Jkf+oG9WnGKmd4TOXulOlN/sIZsU7fhATofKMhT8Ccb/PPW3WRTyWPt9cAV tLyJgcMC0nbF1GUeuvFU1AynEaRwRXmScwO8az7UIRgaw5FxHEkopr1kSo5Z9jmydgPQ AjUg== 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=bWsdPZ7x9Zv9ulmzVLDInqOVNAhrwd+vJJnOs6jG4pU=; b=ql/9de7cllJ2GSYojJo+c56DldGpeOy2e8X9rabNJPcMTP5qKDMV37SUF0LrzwI820 jNfrr/PaWQUa3b0x8qyNFlkFcq7z56ruyln6e7zkLzhmCUECW+ZcahwfjGTTzT5MtNAA 5T0SYdqaPoUxsPdWbddz1Oybzj0JzmX+0Y6pnbqvzI/YJqhx32zFq5zt5KdBrEvqQAYn NThBBBmKt1S+riVW5BuDRaPBjAqvgl2CtgEH9JfCMHbGaQjB09/3CqHcHqBR2PS72lSo rZzuwnRydGH6+LJN4DOfW0Pvxo/aREy3XiCNGlzvIR6e6ya4FpPfiRZJJfVCK0RER8wq gteQ== X-Gm-Message-State: AOAM532dP5SPbmK4P7EiTWaMpbej3keAl0TSgh43gnzRCLWgVlrgzt1k +6UBtL9uvwxPlVNSt7f101nLXne3nsc= X-Google-Smtp-Source: ABdhPJwDYMt4yEfClFOFdcVVxIF/Fn5fCbl9IkMYlUQQYUSG92wS0+y2XgsM1Pyp8ecLhyMMJGboLQ== X-Received: by 2002:a05:6000:2af:: with SMTP id l15mr24655609wry.17.1632695322803; Sun, 26 Sep 2021 15:28: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 z8sm5193869wrm.63.2021.09.26.15.28.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 15:28:42 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v8 18/40] target/alpha: Restrict has_work() handler to sysemu Date: Mon, 27 Sep 2021 00:26:54 +0200 Message-Id: <20210926222716.1732932-19-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210926222716.1732932-1-f4bug@amsat.org> References: <20210926222716.1732932-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x42b.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.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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. Signed-off-by: Philippe Mathieu-Daudé --- target/alpha/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/alpha/cpu.c b/target/alpha/cpu.c index 93e16a2ffb4..1ca601cac5b 100644 --- a/target/alpha/cpu.c +++ b/target/alpha/cpu.c @@ -33,6 +33,7 @@ static void alpha_cpu_set_pc(CPUState *cs, vaddr value) cpu->env.pc = value; } +#if !defined(CONFIG_USER_ONLY) static bool alpha_cpu_has_work(CPUState *cs) { /* Here we are checking to see if the CPU should wake up from HALT. @@ -47,6 +48,7 @@ static bool alpha_cpu_has_work(CPUState *cs) | CPU_INTERRUPT_SMP | CPU_INTERRUPT_MCHK); } +#endif /* !CONFIG_USER_ONLY */ static void alpha_cpu_disas_set_info(CPUState *cpu, disassemble_info *info) { @@ -221,6 +223,7 @@ static const struct TCGCPUOps alpha_tcg_ops = { .tlb_fill = alpha_cpu_tlb_fill, #ifndef CONFIG_USER_ONLY + .has_work = alpha_cpu_has_work, .cpu_exec_interrupt = alpha_cpu_exec_interrupt, .do_interrupt = alpha_cpu_do_interrupt, .do_transaction_failed = alpha_cpu_do_transaction_failed, @@ -238,7 +241,6 @@ static void alpha_cpu_class_init(ObjectClass *oc, void *data) &acc->parent_realize); cc->class_by_name = alpha_cpu_class_by_name; - cc->has_work = alpha_cpu_has_work; cc->dump_state = alpha_cpu_dump_state; cc->set_pc = alpha_cpu_set_pc; cc->gdb_read_register = alpha_cpu_gdb_read_register; From patchwork Sun Sep 26 22:26:55 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: 1533102 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=gecrH13s; 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HHgnD0F41z9tjv for ; Mon, 27 Sep 2021 08:44:32 +1000 (AEST) Received: from localhost ([::1]:37248 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUcsn-0001BQ-Nq for incoming@patchwork.ozlabs.org; Sun, 26 Sep 2021 18:44:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59846) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUcdl-0003NV-LT for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:28:57 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:45008) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUcdc-0006Ds-Vl for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:28:57 -0400 Received: by mail-wr1-x42a.google.com with SMTP id d6so46339383wrc.11 for ; Sun, 26 Sep 2021 15:28:48 -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=esdj4T8w87yQQx5q0gedYQmjf/1Q5yjrjrc7iKp6hio=; b=gecrH13smwausK6V/DRNlOKZbmEp+oD/ny+JaRb9x6yq/TnzLzeaZHdtY72VbzjON8 lQ/INtdnMpvrsgMt1OvO08AtW/m+FKdl2spCtUHhx7a9lxF4yEk2MgAqfJ74t7YzFj1S W5ej/+xsozSbzIUz9dMc7bE1RqhP1c3wdwtHB/qySit0KnNHupwHWo5P8L4OfC9Bx5K7 At0MO5lrzGWfHNIjK+22GR3ctTcwj6yVgClZ7MrNzJWPTxufoGp/iXlMHXH8uTr/Em+y ztDUidKAngVjtyHeLoyV8OoijnQINTlPqKgR495B1eJB7pTQnHiFPjlynSHnhFckKVKc +Mcg== 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=esdj4T8w87yQQx5q0gedYQmjf/1Q5yjrjrc7iKp6hio=; b=x3Tg1JLNJmn7/IyKqMUE50TLdYQ4Sg3fJNdQTtHfvolNDnqcNPAJvDY6PczaeCU1aN 0+SI/qT7znOL34Ae4qppvrHaglQMn795nScrzaIFyXDfLx2OvkFxCETAdpvQWpkY+B77 Ri3JaAsx2cToubZ4ZaZJlANjJvzzVDMEu1c0Gd/VUKsgyPAtaM4kwUTtcBc1ckwKd1OJ CXTNPAJCNC6Fyao8G/qhZyAdiQ8hLgoFdbmviSFLckx08LlVoVh5ZiOnDpnR99YSZa49 h3dQQROBDnIJ5Z6dblW3+9EfIGMrvkt0Z3Y1qaLFV488q2ENogY+7QsGjE78yx0kzlgd J44A== X-Gm-Message-State: AOAM532AzHlg3UMVypz8Ts7gUdTgPWgaoF2iyThT97cGTUsf8A0p2mey DypDqyAFMhD1XU4B+7gvFWx4V3JmG8M= X-Google-Smtp-Source: ABdhPJyaGp3Sv9/X7ahP5iTmqxA+OFRT3tiHR6pN+PNuyKHrUXPyeGrkWvyeWu05KZAKHqKPVWObig== X-Received: by 2002:adf:e983:: with SMTP id h3mr24750995wrm.231.1632695327463; Sun, 26 Sep 2021 15:28:47 -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 s13sm1662078wmj.9.2021.09.26.15.28.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 15:28:47 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v8 19/40] target/avr: Restrict has_work() handler to sysemu Date: Mon, 27 Sep 2021 00:26:55 +0200 Message-Id: <20210926222716.1732932-20-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210926222716.1732932-1-f4bug@amsat.org> References: <20210926222716.1732932-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.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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 Reviewed-by: Michael Rolnik Signed-off-by: Philippe Mathieu-Daudé --- target/avr/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/avr/cpu.c b/target/avr/cpu.c index 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 Sun Sep 26 22:26:56 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: 1533040 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=CaHvRzc9; 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HHgcv0D0Bz9t6g for ; Mon, 27 Sep 2021 08:37:19 +1000 (AEST) Received: from localhost ([::1]:43308 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUclo-0002nI-N1 for incoming@patchwork.ozlabs.org; Sun, 26 Sep 2021 18:37:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59842) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUcdj-0003HI-4V for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:28:55 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:45809) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUcdh-0006Hw-Na for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:28:54 -0400 Received: by mail-wr1-x42b.google.com with SMTP id d21so46372250wra.12 for ; Sun, 26 Sep 2021 15:28:53 -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=CaHvRzc9OEUjh+VhqdSmYDRGncUTUtjOHahnwzwvNBGfaaFbfMQCQZIrDTapLhrW4i RVx1pyxEIl64Bw8BjQVyEA9AeN9WpEirTmKDgjpKLTUysn8yQyTKpV0jwX/dWlhJsaXH ZNW+ZYsKZxM1YFU45ELEIy5evxXwkxccUB5MJAjRew4b8+JJU9BGUF7Vj6AFUDjFBZ8B VvG3sfDTbuRXOrIVi3qoJ4JH9DEUk+GtdPqgTOUS36gk6mG9JTdY2gJGqweey8LqRtTg ifKpHr04h6WdQFsdwf6GNVrxxrD1dj1FbKZ9Ar83/6KvXrArJvz6Xzp0Ya8VJESXyow8 5a+Q== 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=zDnxvvhs2HG7hOLV9Jwd8DMD8lPAVkX+PX0uXxVwFrAtNdx61/dRfjIUeTCdae4tXA uulr6rwuZn3HcoL2XOAJeYVrcUBSRLSCVWp6RWmJJSgFxUK9ejGqT7Q7COoV5K8A+dzb qrGB9yQKupY8Q4eTgpd4sxK3aAkt2/BVgUzWip/G6uo8YebvRMRoaqcCsdSwwfPmdgoJ tymEzlt6LdOjIweg8ofDP2uQZMO3i+qqkBvXba3Ta848DoduApdrEBcYVI+zSNb7N2+h 5TKSZGCSX5ZVY2LxdxLnXhc00gYHTTwv1d7/9lp9dIxHbg0bGBAyRuQlfSdscxdRB/HU finA== X-Gm-Message-State: AOAM533oqVsR3XxCJA8D9iqMcMQCA0HuJYVEQazmf60JepF9HKhl5kHq pL5AoF+ESTxH/OTj4kVhgbEheBtq2/Y= X-Google-Smtp-Source: ABdhPJzXja2v4LLPPGDWb9/UMUA8/1QdkjShi4MBtTvUN/CLFyB/1XPtIsQzZnQo8IIUxQCM+Oze/g== X-Received: by 2002:a5d:6503:: with SMTP id x3mr24506219wru.76.1632695332185; Sun, 26 Sep 2021 15:28:52 -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 t11sm1878658wrz.65.2021.09.26.15.28.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 15:28:51 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v8 20/40] target/cris: Restrict has_work() handler to sysemu Date: Mon, 27 Sep 2021 00:26:56 +0200 Message-Id: <20210926222716.1732932-21-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210926222716.1732932-1-f4bug@amsat.org> References: <20210926222716.1732932-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x42b.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.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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/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 Sun Sep 26 22:26:57 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: 1533130 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=hKTY54pQ; 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HHgrw235Kz9tjv for ; Mon, 27 Sep 2021 08:47:44 +1000 (AEST) Received: from localhost ([::1]:44222 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUcvu-0005yF-2v for incoming@patchwork.ozlabs.org; Sun, 26 Sep 2021 18:47:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59858) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUcdn-0003VT-SC for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:29:00 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:45815) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUcdm-0006LS-C2 for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:28:59 -0400 Received: by mail-wr1-x431.google.com with SMTP id d21so46372687wra.12 for ; Sun, 26 Sep 2021 15:28: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=0ZgxjKAzE6UdfxxfzQvSE8AG7aSTa5UtgwXRgJWAVhA=; b=hKTY54pQUf9p8sCU+LT0l/n9Nuvnz8Dnxeq+61FnvOvhyqmRpiovoOQ3XfEa00vsue Dy9HsjL9vABcH22zmlSaChPAWaV3TfE712ZcfwlAKSwBF3cMRy0GAKlyvbEQmmGJxMXM cdZyF4GnRIOWZQj+rsW/hN9kqZNYnu8Tag1lLqqk+A/ig/5EwAUPS0t5PwF8QwdulKVa p9Wfuj/3wqB6rvD9YNTgqXWAX1l6FZazZykDSr7UvJwy5RlftAh9+i+pR8lne24Vm8UJ 3FjVI0LkAIEmtE3n+7oOGdmPXiHkjtLBICGpectl6Q5Pup406Z/GesgbyfcTaTCYWO+B kEgA== 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=0ZgxjKAzE6UdfxxfzQvSE8AG7aSTa5UtgwXRgJWAVhA=; b=HVqLU4PH0xOilx28rTy8ooN+uirw1kBzSMc/vSFuQsf/f4ILm7zV8WEaILSUMlBNfJ Yif0KryX50z100FejefE4u816EtjaAuR1X1qHeBeeITPCREDhSDjQbQc/lQIptiMcqH0 BN3pWSbnIPMnl3Kj6wYUHKa0tvfNa6vn9kJ+6tH0JfIQA0qWhqF5y4VPwTuUzifTmDih PjhMAeRQQlF9aePOtJDSdJrsVCuJRuArRY1sd5ylejAPXQEVvi1rO6nZsKOOHC+pPE1I aPrPFt1MfqRID/dExaKzLBub7w94Cd8fV4nUyIDjrqZuQgGUl4boe42BelXswq2lNmA0 NctA== X-Gm-Message-State: AOAM533+B5dbPC24kPKa79gjwgyQ5jisDp8ROmGuU+ZrNloW8bSVMQpb BLaTP466ZN768yuRfH5KqhDov4PWJ7Q= X-Google-Smtp-Source: ABdhPJxvhv9a7IWS+6OFo336SnZ1uq7uHzXnggWgqDSwenhzeAqcGZyPc4JE03TUsPJ8YifSiSy4eA== X-Received: by 2002:a7b:ce19:: with SMTP id m25mr12523678wmc.152.1632695336892; Sun, 26 Sep 2021 15:28: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 x9sm6164154wrv.82.2021.09.26.15.28.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 15:28:56 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v8 21/40] target/hexagon: Remove unused has_work() handler Date: Mon, 27 Sep 2021 00:26:57 +0200 Message-Id: <20210926222716.1732932-22-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210926222716.1732932-1-f4bug@amsat.org> References: <20210926222716.1732932-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.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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" 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 Reviewed-by: Taylor Simpson Signed-off-by: Philippe Mathieu-Daudé --- target/hexagon/cpu.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/target/hexagon/cpu.c b/target/hexagon/cpu.c index 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 Sun Sep 26 22:26:58 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: 1533132 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=QMR6BWfk; 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HHgvK1RMRz9tjv for ; Mon, 27 Sep 2021 08:49:49 +1000 (AEST) Received: from localhost ([::1]:50464 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUcxt-0001mS-Ry for incoming@patchwork.ozlabs.org; Sun, 26 Sep 2021 18:49:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59888) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUcdv-0003tV-VV for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:29:07 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:45010) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUcdr-0006PS-6z for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:29:07 -0400 Received: by mail-wr1-x429.google.com with SMTP id d6so46340490wrc.11 for ; Sun, 26 Sep 2021 15:29: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=HfPpeCahj5vQJxNuN5USHRZi30oEK/WxNT5N2Z+0tUI=; b=QMR6BWfkihxvHRKdBtjI/ktUWs4pukBuCgN6YRwtdpFPziTXlG6wZgFSFP3B1F0S/6 2LtUO8tPaLUaQ7bzzG66Efp12x3mntlluXz8XCoplSxbXBD8CL3U6rBFFZk54Ufj+RSv 2QX2dE82T+te2YFmYz1Yi9AWvZDWjfwGGsfiByd6JpHIPvQ4lxX3fsrhLd3V3cOnqNGQ Rp6KNVnYH5QW0APlvFl5cDY9Y1qQ3sRLhDKE6TA9frr2sYW0e/ROE59nQdaONSYzlukK uc3WLuBq0M0vu13TTeQ6YF4f/vPpeVTlQqVotK/LqQovYnVGFBcZFvKruc7MAbSCnkcG mB8g== 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=HfPpeCahj5vQJxNuN5USHRZi30oEK/WxNT5N2Z+0tUI=; b=ttThF01UL437KIMBtrMUDiVg2v6UeGwCkhdN+h9rB/1Y20Wwi+m2R/2Tf4tn+tTXNs Zch0AsjNbMbjX4+uGuFZV8UUVLaq3htVJ/nY0v4ef5gzsy10xIZIRzjtZ892Wb3cLC/z b52oOgK9fD4YanjbXWQfyAJDNzXFeL04PP+Mp9fu+7Q7N6XH0Xjjfgh+4fLTkBvZy9mk tB/PuyfrFAXkNLyZOkCpjTNnHEMSYlWzPpUs7clJBXlXuYaB+nBax8uXmQCbf89b6R7z Qyo3om/Z2UJevV8tAtn2/e0TiLNwpTepUY86I3WWWbKj5QNQGV6x7kDMyrJtxWM/A1fg dCQg== X-Gm-Message-State: AOAM532IBy581d+yiJrueTOdnAO/TZ5Nlm0b638i1VH07d2MVY3PvfH/ 2lJVfddB2xN5TzTOMaKutu4KNS+l78k= X-Google-Smtp-Source: ABdhPJynnOI0gVkf7pZg7+klBFZPE1PiOFQTEKnf7j27nU8YMVbzm/NGCCsScpfjaD/IMsDi4E2uTA== X-Received: by 2002:a1c:ed0a:: with SMTP id l10mr13455109wmh.140.1632695341638; Sun, 26 Sep 2021 15:29: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 s2sm6831181wru.3.2021.09.26.15.29.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 15:29:01 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v8 22/40] target/hppa: Restrict has_work() handler to sysemu Date: Mon, 27 Sep 2021 00:26:58 +0200 Message-Id: <20210926222716.1732932-23-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210926222716.1732932-1-f4bug@amsat.org> References: <20210926222716.1732932-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.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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: 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 89cba9d7a2c..000c2e7793a 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) { @@ -148,6 +150,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, @@ -164,7 +167,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 Sun Sep 26 22:26:59 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: 1533131 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=EqjMAlG/; 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HHgv70Q4qz9tjv for ; Mon, 27 Sep 2021 08:49:37 +1000 (AEST) Received: from localhost ([::1]:50044 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUcxi-0001VV-75 for incoming@patchwork.ozlabs.org; Sun, 26 Sep 2021 18:49:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59904) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUcdx-0003z2-Jr for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:29:09 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:46778) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUcdw-0006T7-4P for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:29:09 -0400 Received: by mail-wr1-x42b.google.com with SMTP id c21so16811212wrb.13 for ; Sun, 26 Sep 2021 15:29:07 -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=EqjMAlG/pSk2um+MA0SXVOkYxXLoIyeHiJdsma86EhXCN9QjRdu/5NZPJJ/9CvPupb Hf01BS0XA7GGYcn1exYEvVXkMWypwWPHuIH3wvXpG+19qCNnVxTmqMYdBi+iRUBSq+cK u8iyGT69TNdtgHfuf+9FGIpbgDwlNrCfXh5ZJTyCCe7ztna6oRVtxbnFipNTrZ7Eiq9/ GFGn/uRSUfLf/YPMO7J0lLDnMnG+33q7j3uvTOOZPpoI/0bWXrfjE/SZv31XBIDnK890 P7rg7GwWExjt3sns82QoFzxvtNtbj6jPhtIIczQFApeOKgvJ0QxhUQ3w2Wy6ZGiwsz/0 t+RA== 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=VMbOoKgjTZfbWh9mMKOKCca8hsJIYriOj2E0r6g00UhjRveFeDKchRzWfEGeN0hDvD 2xyausb+CXyYDBo5khI+4/pg753FW5BRKwlE6S7N8Uq+q1DKJOT/Wlp9U5JbrueU2Dgb /HBYIBISco3Lh5IbBGKJxVXd/iiVEnLbIiDxJa2Olg4IlFQaXTHh8hvghoGeiZRYDtPa 3qUnE0bwqnYbNajAm3JBjo+pUkksmmipPgrpNyIiLB6plcRq9+MQm1LtJwRrDL1jGAkr omjMsxHHwB9vji6qfvR/rgOeMWkWVuOMjdFQ3JYpsqDaFm32BPaMyfADcpY7HNHpBCrP gwLg== X-Gm-Message-State: AOAM530sqaL5ouR4UG06UJNz8prhzk3MKgij5ayMcqtUuf6DEaU9DF7v pTvZp1hRs9VfhvfjeNwVb5AGxyl6RNs= X-Google-Smtp-Source: ABdhPJwG6s3gEaSATqQ6TGjBELsRhm5cbSBOTIKXKGVGKHFANhlUGzS36no0tn+gIQdeKyJwmE9mWw== X-Received: by 2002:a1c:a78d:: with SMTP id q135mr13058660wme.36.1632695346743; Sun, 26 Sep 2021 15:29:06 -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 d8sm15797040wrv.80.2021.09.26.15.29.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 15:29:06 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v8 23/40] target/i386: Restrict has_work() handler to sysemu and TCG Date: Mon, 27 Sep 2021 00:26:59 +0200 Message-Id: <20210926222716.1732932-24-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210926222716.1732932-1-f4bug@amsat.org> References: <20210926222716.1732932-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x42b.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.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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 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 Sun Sep 26 22:27:00 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: 1533044 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=MZ+YNdm+; 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HHggg3FFPz9tjv for ; Mon, 27 Sep 2021 08:39:43 +1000 (AEST) Received: from localhost ([::1]:51878 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUco9-0000JV-7Q for incoming@patchwork.ozlabs.org; Sun, 26 Sep 2021 18:39:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59916) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUce2-0004D0-Dp for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:29:14 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:45022) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUce0-0006Wn-Un for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:29:14 -0400 Received: by mail-wr1-x434.google.com with SMTP id d6so46341330wrc.11 for ; Sun, 26 Sep 2021 15:29: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=2wVO/8lNTdglwVP+4rQ9px8jTQizKXJBfsXgcLc7jls=; b=MZ+YNdm+PPVCfa0H+PUCGt5o3W7MxmPlymM/4l1jkbLlyMs+g2/kLTd4PIdUHpi+YZ RSSQP9jXfiulCWqIa90EvJ1RSJl0o8ZUwJnFLkLxzX1FgPUyQ7V/myg52xuw7OH5ddCT oojF//rAWHjEhrNetc8/j9O4xSCcss/9P69byZa3akuJ0+64exRVh7V0DZcbas5Dj2fo XnaJI8wxjSO/c3jvnHsIqhoO46suRm8EzACD+tE9VSQWH2DW7JAf7qdUJ84NW2tsfDQN 9ZirBew5UdiG1Uv3CRT1jboahNm626thBBw0MnRHapSzweRmseq48mypMEByuf/k2De0 tuGg== 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=fZ4iLGHEq+3XD9MjZwuOZayfF91Lk3KINgqybUhnyWduEuJcxVGgcrVQzXS9SsK2Vm pdX6QI2OMzJIdATJg4w2RLHvD9lZcjbqkMC2u9H1lQEV83NgtdEcKrpB5QuMHfB37RiL 3QE2fupl5DD/+plZ4SWJt5LsXsezjpfhA4QRoTszsbEsyhyS6eETBNH7OBAtznQpN3kW +ZV1T2n+9efRsBwP91Hj6AL+WnG8+wIbPKdilboZEqBa+gJix8Kt0B/K3EvRAg2wApM1 EaHD02eZvPNqxpqI1DiJ6CxG9/kwxTfj7dviCxRIRVusKHQMHEM5xnzTdd69BlVxqDGi I+CQ== X-Gm-Message-State: AOAM531/dmSnFkzULv0qROeBrAs6UQnMNGs5iycCL+tlzRmaLL6NRwuW Qw679Wm/yY1GdfSB1WrwNUXxwTD+/AM= X-Google-Smtp-Source: ABdhPJz59Y48FUCOG1rvt7ODG0HO9JPAEY8fF5bjMDnfEhPoTVqkLnwC/KBxjkmaJCudzJQe7e1hJg== X-Received: by 2002:a7b:c4d2:: with SMTP id g18mr732304wmk.180.1632695351581; Sun, 26 Sep 2021 15:29: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 s10sm15013558wrg.42.2021.09.26.15.29.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 15:29:11 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v8 24/40] target/m68k: Restrict has_work() handler to sysemu Date: Mon, 27 Sep 2021 00:27:00 +0200 Message-Id: <20210926222716.1732932-25-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210926222716.1732932-1-f4bug@amsat.org> References: <20210926222716.1732932-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.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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/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 Sun Sep 26 22:27:01 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: 1533134 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=i0xNDxM2; 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HHgyc3JNZz9tjv for ; Mon, 27 Sep 2021 08:52:40 +1000 (AEST) Received: from localhost ([::1]:56732 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUd0g-00064R-8H for incoming@patchwork.ozlabs.org; Sun, 26 Sep 2021 18:52:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59930) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUce7-0004SQ-6o for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:29:19 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:45025) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUce5-0006aT-Nv for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:29:18 -0400 Received: by mail-wr1-x436.google.com with SMTP id d6so46341787wrc.11 for ; Sun, 26 Sep 2021 15:29: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=TotqMEN5DrXYEF17ne4DDCu2zSM8Bp20jLCGhp9+svs=; b=i0xNDxM2lC5uNHDingK/wwkKU1ZA3obK+2STrM6tW5jUqZ0loQqr35nCDSNdLGdEEK ojgVswKjFW/LFEqQP3JcbyvoOCnb5l2MlVW1BgFEXp6xezanPCa+XerY/aK4A41zHRdn G4Mq6A9Gb0wcBZ4BwOvIN5YFiVrLpY+xPsggJoQaRre0Y0PAc26RpE99j8msSuvq6hTD PTgb096vIoV5gjAXb+6D3vQQdtesTOwOdQ8ZkM1RePdaXdH/R1OhrvW8PzhZ+1WZXc2z 0kXlnMA5W7H6IKWZzWnADAAb0kBr7shl3oKHH7G5Ovc6GY/vZX7HgzNZzjLh2uZKgzNF jt4Q== 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=uS0Tkw+gvrAADYtJmIYRt0UlZx70XeS95RmLOmHPfyIxtMvNahfoJmUpKp/Gb5L1GQ DHvgJ9AXZgZYkf8JVDydcLJnwSl1TUpxYt1w63ESGoiwHeVMjGGFuKkozmeMuNqdU0DR 9YDsy6j/dgWFESRKFHhvKFkkXElTOlbWZsegjs4kFWulrg7vmHnOUCyyw5EKCHM4dXGg 6SIlIVpHgQEuM7ywvRr1Gq3iRs7IrcgENKbfDJGb7EsIA/54TJkkv+KxUDh0i2MtjJNp IluerN3GVtKRH7SwMNy3ZCS6vPQQKiiHhkKm+PiE5Lz4qa4pHm+lUXIAbidqs5x4dYX0 VjnA== X-Gm-Message-State: AOAM530+xeCuDSy3mzHzjC6lrHPBoh63K/9pUx9z8OgXqEGNrbt2ofNl HUdFs2VdZB4FR2O7/KcO879Y2mzVRyc= X-Google-Smtp-Source: ABdhPJyBmmhiYFymFJw/Q8uoeYHQ/zOPKphK5MnVhp7gsbYg990d4f3XCBBCt3b7agoQm8HdTq4o1g== X-Received: by 2002:a05:600c:1c1d:: with SMTP id j29mr7913851wms.49.1632695356306; Sun, 26 Sep 2021 15:29: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 l15sm18920117wme.42.2021.09.26.15.29.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 15:29:15 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v8 25/40] target/microblaze: Restrict has_work() handler to sysemu Date: Mon, 27 Sep 2021 00:27:01 +0200 Message-Id: <20210926222716.1732932-26-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210926222716.1732932-1-f4bug@amsat.org> References: <20210926222716.1732932-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.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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/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 Sun Sep 26 22:27:02 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: 1533136 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=UIUb7sad; 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HHh1z6NmJz9tjx for ; Mon, 27 Sep 2021 08:55:35 +1000 (AEST) Received: from localhost ([::1]:33210 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUd3V-0000qN-NA for incoming@patchwork.ozlabs.org; Sun, 26 Sep 2021 18:55:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59952) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUceB-0004go-N0 for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:29:23 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:39840) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUceA-0006eH-9q for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:29:23 -0400 Received: by mail-wr1-x436.google.com with SMTP id r23so21141795wra.6 for ; Sun, 26 Sep 2021 15:29:21 -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=UIUb7sadFgD6y+fxEmMOn2j4/DG7JfNdNLbPAn4weFjAjGdxF6vS4SyAJOsphHGkV5 i3MPqpOvlWUdAqpDfwgMem4myfmoH2x5m61HPGOokvXo/r+02jtvxL9Ct20TB7UhECTq q/NhAi7VrKwmOrusvphzuLU4rmfSk30loxsS4I9CsE4kuE9S+SMHQ8vIjRIuwk+zgXQ6 JujlKamU543yEFwTYX1MQgsGbV+2ND9xodKvK7q7NpA/CSgUoCZodxtS3vZi0z9fG3aQ cf+mwdsc4V7EzBHb43uW7yuumPQHjNIeoAvfrgBY9legGVeMzF9ypsOgVSRAQouAMvNq DZwA== 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=1sUf0yC7JsvtWE6Ds5caLBZUA9R+YWF5Ze1eyauV3dLHIktTk9ME2llhcDgeABv2+U DYjQMUmiANCRrMlZ+xG8UZC06qH3Qv0MjLwZkztFDD2gAD+zcBzLCODGQN/K3Ce3NyeE wPRCo0RNMn50zJypIAgreDVdCxwMZ93K74n63V2F+sj6kr1pol7576fxCN5JSNy8BLSU bikHZ4C7QEy7jFmm3/GpZZ4kwHIznFfziBSqtlZhYPvSWhNisZveNMwj0QVgzL9UEINL u5r4nvxWqMf4t/7enuSWUytW1eYFxj2tdb006qvxikBN41aSaSvz+HBnwgwt85SQQ2va PXTQ== X-Gm-Message-State: AOAM531ryEt29artRorjnQB6aIKtm2TrulDIHyOlYaXXjMfqJfG4pHu3 X6Of3bIphhbxKpx+Fr2XARPLm1t6fWA= X-Google-Smtp-Source: ABdhPJxyxdQVgGjMOqTZ71QJ47AdlF4Wx0l/CJfhjtQ42Jrj8/59+r+aM4Hu2gXjEIXTJ8kkQUTqBg== X-Received: by 2002:adf:a3c3:: with SMTP id m3mr24916339wrb.237.1632695360794; Sun, 26 Sep 2021 15:29:20 -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 v20sm15048016wra.73.2021.09.26.15.29.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 15:29:20 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v8 26/40] target/mips: Restrict has_work() handler to sysemu and TCG Date: Mon, 27 Sep 2021 00:27:02 +0200 Message-Id: <20210926222716.1732932-27-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210926222716.1732932-1-f4bug@amsat.org> References: <20210926222716.1732932-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.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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 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 Sun Sep 26 22:27:03 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: 1533138 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=nkS/LYcg; 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HHh4Y4Mmfz9t5m for ; Mon, 27 Sep 2021 08:57:49 +1000 (AEST) Received: from localhost ([::1]:37458 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUd5f-0003mA-EV for incoming@patchwork.ozlabs.org; Sun, 26 Sep 2021 18:57:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59966) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUceG-0004y3-Bz for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:29:28 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:43627) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUceE-0006hP-NR for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:29:28 -0400 Received: by mail-wr1-x434.google.com with SMTP id x20so1794485wrg.10 for ; Sun, 26 Sep 2021 15:29:26 -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=nkS/LYcg6s/akvHzRJmA5eDbGOYXvzR59XMuTYXRLEz16bltsJJUXLc7KHqruxgKuu YzlHL939T50KQNjrXH3fHV+0I2DYsHMmbudle1jZiyIRGgiVWnqwtbmNyZbOxQGNpAyh wAQPhqvxahZoqP9MY1SFlWlHdP7UnmA/JsmIoRx/s142flaFPrdyzGwtSzQT6EvZt1U1 AHlf08Dsf1/mnxxS86veWEng21L4Qw0pYQe+sJJoqYb6SKr3baUsFO9oov5Ctwr5+upa bTx2cJNeGVEFGtQ+jZigcN8/QekGZxsPp7HLKH1BEAV8PCHNGVmAG2JZUTQgZocYl4gM eiqA== 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=kWvuzyx1ur4bmF/QVQuqt5DnxvOevw35IvJHMik+cVzBKHohgPy6yksgObwvHe7Id6 Wfh6LO6uKVxGq92loS6/F7T5206m28tcqDz3UuG5eur4afNy9Ennzr2NM9ndvHtRpWZv yyj6hXmjGd9qWL2cepxxL86CRjJNHxf0NpF7g9gD/EGUbOAEYzTf49/bKoQ+BeVpSLG+ HjSzUR8bQZoT5YbKBtuutjjODyRHmeNel+/MQu2GdsvMfzPxuGx/xXQ25mLg2KDGK2/8 DpDHGwMyYgLHin6YUCLT60BRiJC6fDn389KcfDjCfjuV0yPFJCAfHVKdC7ppUujev9tU NrDg== X-Gm-Message-State: AOAM531Ck+8xSFAQ2MaXbeMkRzI/AMEY7paXUEymIiiQakexYYGGVyTb p1w2+rDJVgcmU/TbpFLnrVxhS8gPtmY= X-Google-Smtp-Source: ABdhPJyjL2QymzAMUKPhqHOn9hW5Jf7KI2SXIy40CCIE2uW4MrImB2CQbQVxZQdFY/XQHhtLJ/DOgg== X-Received: by 2002:adf:fcca:: with SMTP id f10mr24103741wrs.304.1632695365378; Sun, 26 Sep 2021 15:29:25 -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 j19sm14800281wra.92.2021.09.26.15.29.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 15:29:25 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v8 27/40] target/nios2: Restrict has_work() handler to sysemu Date: Mon, 27 Sep 2021 00:27:03 +0200 Message-Id: <20210926222716.1732932-28-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210926222716.1732932-1-f4bug@amsat.org> References: <20210926222716.1732932-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.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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/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 Sun Sep 26 22:27:04 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: 1533133 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=kl/O0kGg; 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HHgyM1M1qz9tjv for ; Mon, 27 Sep 2021 08:52:27 +1000 (AEST) Received: from localhost ([::1]:56500 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUd0S-0005vF-VK for incoming@patchwork.ozlabs.org; Sun, 26 Sep 2021 18:52:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59978) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUceK-0005DS-W4 for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:29:33 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:41695) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUceJ-0006lp-E6 for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:29:32 -0400 Received: by mail-wr1-x42c.google.com with SMTP id w29so46368374wra.8 for ; Sun, 26 Sep 2021 15:29:31 -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=kl/O0kGgHve1TC1A+zDj77iXst0/jtYnelSp9GQDHqiC+nLqDKBDKWYHHsBLfuNaG6 7u+dm+pGpC+gECczcWD2albt3VcfZHvRKTZQDlIK1fnPW1rguOCm1vY5YK6LqrD6RaTB EKLAtEundze3Ddhq6Y016cJ+KjJPs0vme0lk0uSv78P8GtRuKavuivxGqHqhHaNwdr7S K+z1rCV068v8cEtp5IKwIoAdBG/IjiwFWv1t9+E8Y/sO0u9fjGPLmonCehSRm2gkXMIg bGZXI7hWSO89rUsce560tIQE+HyswuJDHYQQ4QDM5trb/Vp3h7zCrAKhVU272t6z/Hhs FmgQ== 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=BwBwRJVRm+WzEnwukd9iL+txhVsc9GwAYcA0IbFkTlKpgfBD5KArE2fvV5AU0AQY9+ eguOBszFS2xBeL4k56yOq9nW9SGG8ISwX4u380xeeUVOAYJQhLsC8dfYIlrJ80X/Y2V2 ROr9HTOlIH0vZvGhTvFqsZ9m/pUa/NcQtB/AO8ul+0c1THVUR3y/hREhQmk0eYAaeVMF RDxKGGU6me0YZhAVQQ1AE2pTIJWitfcH0qfyUeybj85lE0gN4U7UzOdVTF24kUdcGYt+ cxWZCMDlQiSCHGf4fXpBIqNjBUeE+Hk91hCoaJyBo89pDSBlOwAggaofeTfaQBy6UYF0 DyHA== X-Gm-Message-State: AOAM530+AKPmEfMtEPPSREghEaKuGAzljI/5O5d3QaOKqTUzBbGnPF/b 33ILtbOWj+7zDZO39Jb3Zgw+RQFgPxM= X-Google-Smtp-Source: ABdhPJwQEyacHfYB81Ch5Pvu4bxG+dqGI3hVh/ob32JsG99r7gD0mfsxnNJG8VxFDf4J220rskqfDw== X-Received: by 2002:a05:6000:1103:: with SMTP id z3mr1512924wrw.312.1632695370068; Sun, 26 Sep 2021 15:29: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 r27sm12541351wrr.70.2021.09.26.15.29.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 15:29:29 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v8 28/40] target/openrisc: Restrict has_work() handler to sysemu Date: Mon, 27 Sep 2021 00:27:04 +0200 Message-Id: <20210926222716.1732932-29-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210926222716.1732932-1-f4bug@amsat.org> References: <20210926222716.1732932-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.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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/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 Sun Sep 26 22:27:05 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: 1533135 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=hCe0fCS4; 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HHh1y40wLz9tjv for ; Mon, 27 Sep 2021 08:55:33 +1000 (AEST) Received: from localhost ([::1]:33088 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUd3R-0000lG-PX for incoming@patchwork.ozlabs.org; Sun, 26 Sep 2021 18:55:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59990) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUceP-0005I4-MF for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:29:38 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:45824) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUceO-0006pP-0e for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:29:37 -0400 Received: by mail-wr1-x434.google.com with SMTP id d21so46375935wra.12 for ; Sun, 26 Sep 2021 15:29:35 -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=hCe0fCS4MOLhSwXTjcBRw4hAldZ1NJCy+uvUvygejf96gtPcF/y5JQ9D9WgCmg1u/K OWznFrolwmDnc/pTbOAuX3wxJGPUc8zgS3nx5kWkQ+2o3cVU+SbKbfReOADm3mXs1uTW REKInPjRrCmHM1i+NswEXMIst5aUVzqK8fnXyc0KcJSzkzzkIoq2rT1jaZtzdBQM06kH Sp8qL+QcNWIeoaJiClgQfW9DRhgQtIximReK1xdqkN6Ef6loHNzWyNdsiMjjBQpFtcSK EoG1ixUMlatT65yr41KndSMdrmL3KELZIxIteNmccZjIM2VZ/5pLM4ujGbi41zzKYgLp uS+A== 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=c5yH7mh/9yMElUlPjk6Y994/+Q+cZfQnq1q/kIXMkHU/awi3VpE6ZKQfW+BOrvv434 GMvIRxIPxtRMlGWSj+abLY/GUb/4md5GTS0TYF9vm5Q/goV9rOB0kSWuxs5bjLuaswVb 9E0g37h0mUcFmqQ/6GRsAFrZEONRSGlhY7t3fJX5KdP0VDi1czLa5UGbBMwHltWtkMZc WF5TEhU5q0xeDxta1Qzc1n9AOgIs2PLdve68rSxBs9MVEtffoJzaVKcHZb4HF7qUCy6Y 6zT8KAlBInuhdm7d2tvPgdOSpJ0XzObFDuG30iNuR77rf7tCGSglTAIGXL1C8kbk8hgx yRdQ== X-Gm-Message-State: AOAM532uV4ZJ502/AFqd7XVfmujoo9qkim1K0JfW+bN7bn81ihQHMSzo CsLvzGpRnJ0VnlWaZu2v2Az9NwNTyZI= X-Google-Smtp-Source: ABdhPJz/EK5OqLlhoi1NR9ti7v37hBrWrS44S4o/F652aagSMzpbUuyfWEFtemA3Kpk56nkow1zSGA== X-Received: by 2002:a1c:3b0a:: with SMTP id i10mr1495559wma.132.1632695374608; Sun, 26 Sep 2021 15:29:34 -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 g13sm14346201wmh.20.2021.09.26.15.29.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 15:29:34 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v8 29/40] target/ppc: Introduce PowerPCCPUClass::has_work() Date: Mon, 27 Sep 2021 00:27:05 +0200 Message-Id: <20210926222716.1732932-30-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210926222716.1732932-1-f4bug@amsat.org> References: <20210926222716.1732932-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.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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" 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 Sun Sep 26 22:27:06 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: 1533140 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=mfuxglTw; 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HHhBD5hbSz9sR4 for ; Mon, 27 Sep 2021 09:02:44 +1000 (AEST) Received: from localhost ([::1]:43244 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUdAP-0007oT-2y for incoming@patchwork.ozlabs.org; Sun, 26 Sep 2021 19:02:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60012) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUceW-0005Oj-A8 for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:29:45 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:34460) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUceS-0006tL-VG for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:29:43 -0400 Received: by mail-wr1-x434.google.com with SMTP id t8so46618700wri.1 for ; Sun, 26 Sep 2021 15:29:40 -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=mfuxglTwVl3wdKRMuIJO4I78DUezkg6M3uPXeqTkxuxRfb94WBp+dAmYl6aDxIURhA vgJTsvUtJbHFofuQek8A8nNkib6GVU7fRY1+744e4PGNMHqpW8NXAtuDrxf4wag9fge+ 1XggKZqUFjBPF5tbvq2OTrv6fJhnivo75IjDRLePrkWgDxE8GYmzxjemVbPb0bk9LWKi waC7nwYjaoqlG2HsKuEow9KWtscqXDUaE3dN5VZ9AsVFxnGZWZAJGdNRMtuUjWDWaMbT Zr7+8pPZCTapzTeohBlMsPoTMct+qFZOSeVL4adAL8c+wf5AjoHy3z32lxpgR/bbj1RU 4jVA== 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=Pqw89U6aFCmq1vrPuAJgyZiJjD8QiP0a/x3AIFlDTOraTz0KcOq1FZqHKSOmFIdDET N430+LV/3vEyXz0+IKECZBA54VaDyv0xV7I034dG9955OqiBEZxcaxYAbKpMsnogtqID aEc1zZvA/+5NxMLpvQSuvLHedeTuCb6rsSwjJOiHp+Myjs8BwyV8cYr4kctUAjqvsOjl 4EzXJ2yDUb22cUOPslLDqWYDvMBMNSHSPht19MGRn4HZww2h9/3DVr9GB3r/mKratxZD N+TP4c/gEuon5+s3r4qFkpmUcRgTjC8qV2ClJdOlnen83bT+8raHs6zQI8bQbzdWpewp 0aVw== X-Gm-Message-State: AOAM533tUS2LYXUnLiT2UMq+Etc3szxRnQTYHOMJjVpTsnKIOymc+f2x WXa3exY32cqKRSS9p915musyAkSo97A= X-Google-Smtp-Source: ABdhPJzBxkT7vYlgeCCoK/XGsGDSVZHzeF1rII+1qjdptzU/TcSsdNM5ZELaukfq078VIhOakAy+lg== X-Received: by 2002:a1c:9d83:: with SMTP id g125mr8927118wme.45.1632695379251; Sun, 26 Sep 2021 15:29:39 -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 i67sm17804374wmi.41.2021.09.26.15.29.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 15:29:38 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v8 30/40] target/ppc: Restrict has_work() handlers to sysemu and TCG Date: Mon, 27 Sep 2021 00:27:06 +0200 Message-Id: <20210926222716.1732932-31-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210926222716.1732932-1-f4bug@amsat.org> References: <20210926222716.1732932-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.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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 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 Sun Sep 26 22:27:07 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: 1533034 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=afeNVEQ6; 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HHgYS5lQyz9tjv for ; Mon, 27 Sep 2021 08:34:20 +1000 (AEST) Received: from localhost ([::1]:33514 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUciw-0004b7-Id for incoming@patchwork.ozlabs.org; Sun, 26 Sep 2021 18:34:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60030) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUceb-0005Q2-5S for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:29:49 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:43631) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUceY-0006xD-NX for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:29:48 -0400 Received: by mail-wr1-x434.google.com with SMTP id x20so1796097wrg.10 for ; Sun, 26 Sep 2021 15:29:44 -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=afeNVEQ6/xv8f96LyPIQNxPc4JquMWzJe+gKm30pdQyZDgucr4ZyS+o1h3KwcoL3OR 6o2rO04twhAImniaI6MubQ4dW1zYYR8rvwznfRf0sC6WKhGUUY9rWDXUHtqL6eAwnius 8SWjYksQ0SblM9QDx+Ht0sYpqHszxnOZXELQACQWrdZSmU9zkPL+ktLd8HOElOfkPlYJ 2j1FoSmK0jUB9uN//pqLqFAs7yXCQ/DbvzJBCqMXPhFa6WmlspSNOCQSLCY48/pMD/YJ H91wOU6e+mryYGSwqzgS6OnazJ57fNZ0yp+KtjraT/aTcrVxtr1qN4ymcMNENWJpTCSk QyuA== 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=ERTUbfUcdELCQ27SF8edE5uJ0exxelYujLVXQqRJjHHDpFfcpDlhyxFBGcYrNxPay6 BxIlrGxzS4B27Et7XTCzAVjY6Cgyuyc8gGv2HJUqIsaeJdaDrJoI9JLUl3rG/j6y/c4I b88zc5J2+4WxnYe7kSFv8p7T5P672MEVnqC+6SoPC7AiWCL3b3bgehDcWWCb/+9IYJO6 S0Img/RfLV6+ULZRHOgNUEgAeDhm7U01hsGRYiwR2mFhT34B2zFuqLYOyqycEOXFgpVf CnHIDrQHo6hWmooxYRltc/WaIcnQiBrcIhiOczxs85+7ctmHeDFxZv7xLh3xiDAK0Gq3 XIuA== X-Gm-Message-State: AOAM531lNSxntDgyI6Y6GlCzgHI2E8d/ozCj5xQ/c0MECAwqQKH4yhOv e/oz7iRE3vddGFDQOfU1JGZVobUgy70= X-Google-Smtp-Source: ABdhPJxWdmHzw3ThFvNEOG75CUKPNCriHiIdJNiEBbViGothiXzeZjBS6z1KY4ct+i4aMd4PY4omjg== X-Received: by 2002:adf:ded1:: with SMTP id i17mr24157375wrn.83.1632695383982; Sun, 26 Sep 2021 15:29:43 -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 o12sm14276600wms.15.2021.09.26.15.29.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 15:29:43 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v8 31/40] target/riscv: Restrict has_work() handler to sysemu and TCG Date: Mon, 27 Sep 2021 00:27:07 +0200 Message-Id: <20210926222716.1732932-32-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210926222716.1732932-1-f4bug@amsat.org> References: <20210926222716.1732932-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.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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 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 Sun Sep 26 22:27: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: 1533068 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=XNd8MKI/; 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HHglc3FL7z9tjv for ; Mon, 27 Sep 2021 08:43:08 +1000 (AEST) Received: from localhost ([::1]:60464 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUcrR-0006CB-U6 for incoming@patchwork.ozlabs.org; Sun, 26 Sep 2021 18:43:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60046) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUcee-0005SA-HS for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:29:54 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:34457) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUcec-00071K-6I for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:29:51 -0400 Received: by mail-wr1-x42f.google.com with SMTP id t8so46619351wri.1 for ; Sun, 26 Sep 2021 15:29:49 -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=XNd8MKI/q2Q4tkPh3KCDOt78/7GagcGlDD8vBUoFfiHY1/wBN5Y1H+0sP7j1m5pxta Aq3b98UYKmVPJxjj5ySPB/zOoHIk+xCZAaIfNdU7oFOuVMXU+6F0etpBoiCxdZ8xq2Up nsv9YK4e+4W7DyrShSWAQ0RpFxKZfyp5xl8F5iSyHfwp3imUL39HLhoTYQ8tDUznv5PH 7vkHHVKvGVh/64eNwhi8kcDi/Q5czXhYCTszgLsaMdBWGEm0zB+c3FZfuUDtIHT/NGx5 CB9d+FXh2xcnAAUhAonkRfo9uV3/0jeN0VRHw6uxTSom4NHaph51IEro2EK/HRvZtHdC OLiw== 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=7X8yA9ZzM5kDCQDQ3OS2XLn2dzsBSjKG2Xd3YbMaBQdPFAEUUTrxVShMQP6+3+Io98 4YygYlZ8o/O2EsU00iIiiO8NkPfGMIo5lxEmoFy9q3J0vaRkEEjXjkEgYGSF7Ei/aF8c exWy5RYj/TUWf3PwFb/tIliJOjHwU7zqjhp+MWvrWDzfU2FHlPEmMdiqzSiKoPNjK+91 bHz1RqHPY7viuPkldim0yHM3xil8G6Pt4Lbw63O1jlgCvRQdhzVgc2uM7tbmEPT0KcXR khZMCRbceEUNxOhi5KvNB8IgBkuUjpseIrm94IBBNO5aPYXW/s/EhBRo7cPdGkSsEAoW gtGA== X-Gm-Message-State: AOAM531IqwACq1Jrt0subiBcSXUp2zrbq0kfGlawjEZdnJPXzVNteuGn jDjvKWO+VNKsq+3EscrtwmkEgmY46jU= X-Google-Smtp-Source: ABdhPJxpeiqSvwN67DdkIiy/xz9sJwgULgG2GJU+8dS6U3Y/PoKWfKjSd58qKhvDex7kIZ8Mx/H8AQ== X-Received: by 2002:adf:a3c3:: with SMTP id m3mr24917528wrb.237.1632695388674; Sun, 26 Sep 2021 15:29:48 -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 i18sm15033279wrn.64.2021.09.26.15.29.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 15:29:48 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v8 32/40] target/rx: Restrict has_work() handler to sysemu Date: Mon, 27 Sep 2021 00:27:08 +0200 Message-Id: <20210926222716.1732932-33-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210926222716.1732932-1-f4bug@amsat.org> References: <20210926222716.1732932-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.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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/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 Sun Sep 26 22:27: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: 1533039 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=jsNC4UiF; 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HHgcf2Jncz9t6g for ; Mon, 27 Sep 2021 08:37:06 +1000 (AEST) Received: from localhost ([::1]:42050 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUclc-0001uL-3L for incoming@patchwork.ozlabs.org; Sun, 26 Sep 2021 18:37:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60058) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUcei-0005a3-7g for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:29:56 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:42793) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUceg-00075O-Kc for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:29:55 -0400 Received: by mail-wr1-x435.google.com with SMTP id v17so3084621wrv.9 for ; Sun, 26 Sep 2021 15:29:54 -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=ZAYjmxiur5f+p7A1SrpNSihQLXDhLnmlUZZ8rIaewhE=; b=jsNC4UiFCCOc2HUh0HNgZLNrEdz6P4qvQ0mAeYBhC7vOUFqJtVT+ZKTq+ommX2Gv/Z 5bCDDmm/W/ucFF7C1BKLiJKJYczgi6VI9KO+R60U0U+Bt1Vo9WD1amFz//cX9Jy4evbH PB2cnijxH3uXrPKjysxYQxRExv0a8RO9HtOeUzvYtJzN6AFLs1lbMT9biUI1PdjvtWdN B1OesHs76zxglJyP8j+TBiJQRM/O6wlgQDo8xgQXp2NmtJeTQz2lto6KZR3aJP2L0dnH v34IaWFzVpn11AKhqRR5Fv4xhHCcHZycB8fQTggHlTV0Nk+dke7RFQguVYESDlSoyUp/ IqHA== 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=ZAYjmxiur5f+p7A1SrpNSihQLXDhLnmlUZZ8rIaewhE=; b=4Vok4oTPMrdv1FAmSULRPyln0UrVHxb7jyfKZV81OyYhN74IAWcYmRn5nbwGLnJnao ajjLzm55b5SlUiKNzmNy3OEGl+limjF2r+f5MtPHW0jOzVqVcYMQ32FyVu2wFCADBk23 fxwenWmsbSeUlNyDejqASt5bnR8VEBOF0PG5xMPSzVsOJWGAzi9p5g3+B2ItWp85tuLa wtOfDBehbBCEUHyU5Jftmh+BJubAahUqmSbmCTnIGmsh8/ZOojgCMBO3xHby98iFHGv3 /hwVRQx3mASXmJ85VUe4lDulTZepupTLBy/wsmfbO0zdiN65EW05pJplR2Evsd255xAu f8iA== X-Gm-Message-State: AOAM531DGvAG0f3uwHTvxHIT31QoG3wViWP+n8VIvt19EB4xl5Q0XvAk k7vlmEl9/PxADEyZUxBVh5MCLnM4c58= X-Google-Smtp-Source: ABdhPJzbAkOWH+XnJWCqO/LwNB8D6EKgJcl2dCcLx9IwuEfNbvFMuIN9ekfL6d5CH0G8+h5/PTVYsQ== X-Received: by 2002:a05:6000:18ab:: with SMTP id b11mr24875417wri.131.1632695393269; Sun, 26 Sep 2021 15:29:53 -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 s13sm19176691wmc.47.2021.09.26.15.29.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 15:29:52 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v8 33/40] target/s390x: Restrict has_work() handler to sysemu and TCG Date: Mon, 27 Sep 2021 00:27:09 +0200 Message-Id: <20210926222716.1732932-34-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210926222716.1732932-1-f4bug@amsat.org> References: <20210926222716.1732932-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.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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 TCG sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- hw/intc/s390_flic.c | 15 ++++++++++++--- target/s390x/cpu.c | 4 +++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/hw/intc/s390_flic.c b/hw/intc/s390_flic.c index 74e02858d43..22bc38e9b4e 100644 --- a/hw/intc/s390_flic.c +++ b/hw/intc/s390_flic.c @@ -312,19 +312,28 @@ static void qemu_s390_inject_crw_mchk(S390FLICState *fs) bool qemu_s390_flic_has_service(QEMUS390FLICState *flic) { - /* called without lock via cc->has_work, will be validated under lock */ + /* + * Called without lock via TCGCPUOps::has_work, + * will be validated under lock. + */ return !!(flic->pending & FLIC_PENDING_SERVICE); } bool qemu_s390_flic_has_io(QEMUS390FLICState *flic, uint64_t cr6) { - /* called without lock via cc->has_work, will be validated under lock */ + /* + * Called without lock via TCGCPUOps::has_work, + * will be validated under lock. + */ return !!(flic->pending & CR6_TO_PENDING_IO(cr6)); } bool qemu_s390_flic_has_crw_mchk(QEMUS390FLICState *flic) { - /* called without lock via cc->has_work, will be validated under lock */ + /* + * Called without lock via TCGCPUOps::has_work, + * will be validated under lock. + */ return !!(flic->pending & FLIC_PENDING_MCHK_CR); } 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 Sun Sep 26 22:27: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: 1533043 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=W/2VdD7U; 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HHggL3VFSz9tjv for ; Mon, 27 Sep 2021 08:39:26 +1000 (AEST) Received: from localhost ([::1]:50646 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUcns-0007x3-75 for incoming@patchwork.ozlabs.org; Sun, 26 Sep 2021 18:39:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60074) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUcem-0005rF-Hb for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:30:00 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:36692) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUcel-000796-1y for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:30:00 -0400 Received: by mail-wr1-x434.google.com with SMTP id g16so46525499wrb.3 for ; Sun, 26 Sep 2021 15:29:58 -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=W/2VdD7UIKsXYPYqkrcazc7rNbJ/mpLgoXLXUg+txlI9WFcz0fACNZAn9yB1/8Y6bB 6NpgGsj75/iqhtYvYbTDmx5S2K+MXR920Un9v/ybIc//vGmYpRrg2v2vDRT/hb0C4RMH XhzOawRYwTBbr4QJzwi0y/TJjtBa+U/AtVc2fLPxMwTL0CfnYP0A9gB68NPuaKRdZWbk JOMravckf+9qPzqGulWqE3SX8q+00u7mxnn/043Xv6GGNn39gj7WqtKMATvD/EROnDr0 LF8/WO8VG+dvxSxKX0Ep2i93CvB1hXPS5gONei3CQJoMZyBPPgGkO/Mv/TuWYYKiyvRn sBfg== 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=bCNkgxySs0NFYFZDWUlAuMQJYzN+4FXXbCtEMWY8gwITU8qcFlqDsDWhfMXncOgvj1 QJ494t1uhrNXhgqQvI2F1OCzF8mrDQcUzBkAY1gdwUmUF+C9eGYbh0uAQt39ia4B1gZW CyHHopACUQ+j4hwpkQD67EZQb//SB9dQ9O+t6u2k8ovcLjl3Q0aY5biuLg+LXCSZSAq8 FV2tQHQbF3t0YImIhQsuT+MCqECZFnLABCQRknAhT1a3hPnLZqoCwNXE+QkxlSewsjoU FPAQGS7DdObtS2ebh6o02U8rXsNYHgJq1BoomCmLUV0Y6FyFPrkeUMMn4R0LukFa8dER GrnA== X-Gm-Message-State: AOAM532Mt/P86ggHD80V6YWEzYjvqfdOsgXzuBrz1C31PUBVlplf11SC UoXyYYbp6I5s9JadkS+Hhq1e9h3lVKY= X-Google-Smtp-Source: ABdhPJxej5VdZSnQV2wrEXelcFYizHjQvmtFi1ae1nbeQOCwcYb+gp4a+cBrLXBRS7RM0pb+CH80bg== X-Received: by 2002:a5d:5142:: with SMTP id u2mr7800603wrt.180.1632695397676; Sun, 26 Sep 2021 15:29:57 -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 s10sm15014717wrg.42.2021.09.26.15.29.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 15:29:57 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v8 34/40] target/sh4: Restrict has_work() handler to sysemu Date: Mon, 27 Sep 2021 00:27:10 +0200 Message-Id: <20210926222716.1732932-35-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210926222716.1732932-1-f4bug@amsat.org> References: <20210926222716.1732932-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.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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/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 Sun Sep 26 22:27: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: 1533141 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=Plli2p4R; 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HHhDT2Hz4z9tjx for ; Mon, 27 Sep 2021 09:04:41 +1000 (AEST) Received: from localhost ([::1]:47508 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUdCJ-0002ES-3V for incoming@patchwork.ozlabs.org; Sun, 26 Sep 2021 19:04:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60108) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUceu-0006EH-4K for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:30:08 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:37481) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUcep-0007EL-Qr for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:30:07 -0400 Received: by mail-wr1-x42a.google.com with SMTP id t8so46565509wrq.4 for ; Sun, 26 Sep 2021 15:30:03 -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=Plli2p4RgeCRhPsFN89Fs1h+89fzRWd8GEWmlE/eAvFyzN75Uh2lZEXjTp8c5bwVaL bXimWXCvfnrGi/pbLYoEXVB4bGpL32xIDTrTpqFOgqen5AUMtDzPVL9nlqflnlEkGi6F iHEYwOcgEmfw4myJxO4EOW8Yjiw9syeiloLKT16rgA1ctYa094b3+DPqKMPrMG72SysQ Yv5FtDZiCo70GPUS60sCpRKbOBE7NHQmFHCN4bWTJL0nzNYer+AG/3yF1ZbFfShFQh26 Nu9Fzm5G7w2U+Yk1YNnhUUgVeoMXeTZ7SqlIcsnRNy+ycfaI7BbGyoFvf0m0I2ioOMcP R53g== 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=f+iXskJwgaw3ipGAlln+lOM7iOvO8toErfpXt5oAf4/7+PaFhL0akCieTcEPUGcYWt XI4VLod37oJybv+q0LkCWEX97sMGvW9jtBOHBklnxhUdwv6SDqy9gXi5qXWqQy2qXNMX kco03nYuqbP4gkXWjvvsa6VG1A/F0GQ7XLJo+4QULcjoDIda4KE5+/AnlsyFnKxvRzR2 Nw47LaeWTkNLzVIsIDREoGrcGgZK99z9vIJglQBLFlHwT3QWhSUUDwrXbs2FohXV51OA KAt1++yazERJLg5ppR68oKouzkB0dsckcNNBZjPiJjwZeMoAFgiErWu4NilZ5We9+VKu ExfA== X-Gm-Message-State: AOAM532EZBoIOfYmli9od2xQFfGradvoKvflQErbM4234PpHlaCeuUlS DKHnFsxmPCAPFoKn9cPSykO80zFcdPs= X-Google-Smtp-Source: ABdhPJxK35w25ovSfVt4Px0Bb5inK2M68TKXZR/POoDgejvYEqnpHi1m+0dFrzGUx7nti8W3YW0mPg== X-Received: by 2002:adf:e646:: with SMTP id b6mr24465466wrn.153.1632695402245; Sun, 26 Sep 2021 15:30:02 -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 u5sm15966577wrg.57.2021.09.26.15.30.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 15:30:01 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v8 35/40] target/sparc: Remove pointless use of CONFIG_TCG definition Date: Mon, 27 Sep 2021 00:27:11 +0200 Message-Id: <20210926222716.1732932-36-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210926222716.1732932-1-f4bug@amsat.org> References: <20210926222716.1732932-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.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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" 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é Reviewed-by: Mark Cave-Ayland --- 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 Sun Sep 26 22:27: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: 1533056 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=pMi81WMX; 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HHgl41qVHz9tk2 for ; Mon, 27 Sep 2021 08:42:40 +1000 (AEST) Received: from localhost ([::1]:59152 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUcqz-0005Gk-VR for incoming@patchwork.ozlabs.org; Sun, 26 Sep 2021 18:42:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60140) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUcf0-0006QG-AD for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:30:14 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:34456) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUceu-0007HJ-Gm for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:30:14 -0400 Received: by mail-wr1-x42a.google.com with SMTP id t8so46621007wri.1 for ; Sun, 26 Sep 2021 15:30:07 -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=pMi81WMXuOJ3c0XLut1jrtULIRFuuA1n7UZn6OTU67Y/mqd94OA646JhXy8/Hkknvb SFOBui1hd4GFWkMGYVQVIadS208DrKaDoFood/usqkwVLuy3iMG8DdsrbodsDmVVT4hN BE+YNiHIf66rm3Ii81/+mgUTuB+3IJY8kIBdQaFldJJJtyX5YSt4fYEaQdnmKzYmyuzv n1TwtuyRXeTW3IPlPeoJOe90TVl5K9i7KrHlmyl2uIwsdKx0oz5uUXbdG2/GQWYkqoK8 GZ8hpX427Em0lklqf/EACVnTAPP96rwMMdEBj4oOcwLHyjbWbrEkjEBrwuRDjvERk1uy m5nQ== 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=VcDfEhWj/9EpBOzyzQqnK0GMyviYSABjvzbfsBTOOZ3G3xIfCGnbG+zrN/7U1/d1Og A3nK/mcaDKG8BrWVkyo4vkbx0CzR0q9vNE9vqoD8vgcbXYEkULSkNIaeflGHu6CKBXQP EVpPjPO96eIgve/SQpoQiE1+3eEj6gAEp0W4cHGRSMmHJgUg/d+5Wc2vaXEEo2SnRM1B FDrFcPfVUgoEV6ZOEtE/pgRrvN/5uaWW3l1LBsr32NccoChjPTdBcnBg3+awsMJTy8lS elw9z30F37Qa5lbIb34Z4GaCSdPXJN0fETb9GnRQQYrrX6F1F0hfZraxtYTJRlKZk33b zGFQ== X-Gm-Message-State: AOAM53313uMDZKi3zhuUbk/Eh1UHuk4ganuLpheXYwoV0j9Jc/4B97EA IjJp+VJsUVKyEq6T4N0x8DsvTUonp7E= X-Google-Smtp-Source: ABdhPJzHlRzczQIktgVmo/fNCX8UBVOM1527eKH1eyvjPtRTcl+15duLXSt2f3gA+qSqhiBfssSRaQ== X-Received: by 2002:adf:eb12:: with SMTP id s18mr1156680wrn.97.1632695407044; Sun, 26 Sep 2021 15:30: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 o17sm11538359wrs.25.2021.09.26.15.30.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 15:30:06 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v8 36/40] target/sparc: Restrict has_work() handler to sysemu Date: Mon, 27 Sep 2021 00:27:12 +0200 Message-Id: <20210926222716.1732932-37-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210926222716.1732932-1-f4bug@amsat.org> References: <20210926222716.1732932-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: 4 X-Spam_score: 0.4 X-Spam_bar: / X-Spam_report: (0.4 / 5.0 requ) DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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: 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é Reviewed-by: Mark Cave-Ayland --- 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 Sun Sep 26 22:27: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: 1533142 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=PpjUmsuZ; 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HHhHB1YHjz9tjx for ; Mon, 27 Sep 2021 09:07:00 +1000 (AEST) Received: from localhost ([::1]:51622 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUdEX-00056N-Av for incoming@patchwork.ozlabs.org; Sun, 26 Sep 2021 19:06:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60142) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUcf0-0006Qq-M8 for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:30:14 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:45826) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUcez-0007Lb-8n for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:30:14 -0400 Received: by mail-wr1-x42f.google.com with SMTP id d21so46379130wra.12 for ; Sun, 26 Sep 2021 15:30: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=1gsdxrxIkLL008ui7WH6lPMx1hd/4ygkSIHUg3uTtLo=; b=PpjUmsuZA+KYcyopDCxf73aGZ1pXnkPG7BtLPRmyG7WNbe5M9hIDP6d2qoECu8wrQo D5LBKtDl0euZIeCBi9f3G7UeyhIzbUUS0QJU33xmpnr+EaI3noqRwJ9WS4otst5/R9h+ GKQ99dZJWhzq+XZfn3l/sNA1M82/Qs6kMq710sJVLEWPP4c6TqapJYHUMaODaHnxWkIE JMeMh5Jg4hCbW+sLx7i1++DiknYuLKGRp1SlF94nrrAfodNg6d3svw3w7SxdFTJffaLh xq3FFhgbDVKyYnT5lZg1HVL8f9BTNowE8l1uvhlxh224SWwLl9tfIhu/PC0XgqtlrCmS bgTg== 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=1gsdxrxIkLL008ui7WH6lPMx1hd/4ygkSIHUg3uTtLo=; b=FVoZRaOFLESplaWvdjDBq+iz9Ar5JGcsKH2FjYW5DtZ/U4Sw6r9HOKQkMwUJ+DSBLx PrFiONgYMjMnLV7trb85HIeCcuAA/5d+FhygVitQWlw6XJntuJzZ+LcW3za00VWAT1jv qG4shVvhyfefAu8eznixk1yZVr8+qcHsd5HH6sGcjSxC3bFuV6ck7O0oKr351O7g9JjQ uMMoV76/H2AUHXkiNxdrFJhLkmFha5EBtoatOGCLAc5cevgTIXzrZEqM0ll2EU5YSdeq 1GN17C73b0ebPAA7nOmpjBCBYbasJERe/KJG8fkcAmd7UIgLH/2dAGQWcvsUTe4C/M6m 3afg== X-Gm-Message-State: AOAM533fl4vuqyFM5PrzUP+1qO6CWjVIXDoS+MTLEqrel1Y+zb5tuKvE WXYXog7nxYJJ1DYRNh4+Msy26D1om60= X-Google-Smtp-Source: ABdhPJzSoiVhoETIUZjTn+HRPlmlsO5sQXjJhJz0SSvcLI654NXR9Jt6xwjYKO/r9o9vIU17JZmx6w== X-Received: by 2002:a05:600c:40c4:: with SMTP id m4mr12658825wmh.100.1632695411857; Sun, 26 Sep 2021 15:30: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 b11sm8345335wmb.27.2021.09.26.15.30.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 15:30:11 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v8 37/40] target/tricore: Restrict has_work() handler to sysemu Date: Mon, 27 Sep 2021 00:27:13 +0200 Message-Id: <20210926222716.1732932-38-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210926222716.1732932-1-f4bug@amsat.org> References: <20210926222716.1732932-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.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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 Reviewed-by: Bastian Koppelmann Signed-off-by: Philippe Mathieu-Daudé --- 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 Sun Sep 26 22:27: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: 1533137 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=ev721cXx; 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HHh4T4PHBz9t5m for ; Mon, 27 Sep 2021 08:57:45 +1000 (AEST) Received: from localhost ([::1]:37404 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUd5b-0003kM-Do for incoming@patchwork.ozlabs.org; Sun, 26 Sep 2021 18:57:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60154) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUcf6-0006W0-1T for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:30:25 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:39841) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUcf4-0007Om-El for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:30:19 -0400 Received: by mail-wr1-x42d.google.com with SMTP id r23so21146185wra.6 for ; Sun, 26 Sep 2021 15:30: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=F6iT0mYKdizTZwY+Alp0nWU9C8rVfDyZdw7MbXpCAAA=; b=ev721cXxgLolbweNdRqxTm2+gWhZ3yh6MzUBsKacYgWM50dN3tYHjXAFDUZDC727yE oJ77JYxgjU4DFqSBwV1u/KUl2EHg0fK0dcAVXpsPdxsDrzfqppwMMa89h6QBqS3If6Qy 7f6VokE1vUPc5gznJ8FYBzemHd4WkJy+zFifLU8Qsgjx9HsgQpzPdC5Y8TexwFwE6DZk B+ICXKS6RkRMS2ZPi/rEVRB2CTZiXSMc9ZzUIhxxQkiNDLREZ91fKK8ByZewVSoCMu7z Yqt/Rewq7vRjv2R0J9pZKOr+JrbOdo1+Ho4bbGIN9z8n0wF/PT9qXvVIUtjibz88+iyE dSWg== 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=NvoCpEWVhIoWJZ7Y6G46vF0M8j8Z045T4QZOHnIU0FkqN7LIbQue0v0u2iSIl3IOn6 G0fGHCrdMoT/obHYAuRg+gJ9kdLFFbY5FN2vFJUR3APxC9KR0ztLavl5EF0HMDv+0eZs AgA899GWV8GMZMtJBWXThDFO+WpEaP0GFA6vP6X3UXdz5DmWLliwprSGR4DNwYQn4K5g pfuOpt3+vboJETbESEQzZHgkWMhXgEs6ASfejPOKc95fPqv4VeDgWAepE4p0RXqkCHzc XiXllm/4/0+kJ209D6l+JFJ22A2akthc4HOg3GOsO2xSkB4pixmnLxl8VY3D6JyyUpnx swaQ== X-Gm-Message-State: AOAM533Deh1pfTxaEi0UqwCPDq4RSJYTSuumonuyHH1g4qXl/88LmNJ6 VLU+eHwwvT3KjwLaSZmAdniXs0eO8ug= X-Google-Smtp-Source: ABdhPJyJ38w+VyaXiFQDbfOFpqzZ57HdmWtL+KR/j5RVZnUkREDAf6h7Gbbv1hDw4kLFo9Ty5g7/SQ== X-Received: by 2002:adf:f208:: with SMTP id p8mr24048662wro.379.1632695416775; Sun, 26 Sep 2021 15:30: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 i2sm377577wmo.14.2021.09.26.15.30.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 15:30:16 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v8 38/40] target/xtensa: Restrict has_work() handler to sysemu Date: Mon, 27 Sep 2021 00:27:14 +0200 Message-Id: <20210926222716.1732932-39-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210926222716.1732932-1-f4bug@amsat.org> References: <20210926222716.1732932-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.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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/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 Sun Sep 26 22:27: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: 1533143 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=DA1VubHw; 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HHhJp3Nrbz9tjx for ; Mon, 27 Sep 2021 09:08:26 +1000 (AEST) Received: from localhost ([::1]:54584 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUdFw-000759-8l for incoming@patchwork.ozlabs.org; Sun, 26 Sep 2021 19:08:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60166) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUcfB-0006Z9-Fu for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:30:27 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:36693) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUcfA-0007SM-2N for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:30:25 -0400 Received: by mail-wr1-x431.google.com with SMTP id g16so46527568wrb.3 for ; Sun, 26 Sep 2021 15:30: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=p+FhEVuxYvtBhbZfLgBuFMc/Z1Zw1Ec9d9CUDDVANlA=; b=DA1VubHwWduJoSwatuYzAl+vDf2LeRJU18jwlvUHUbi8s091WbGbU36cpcOTwaixe4 KuhXs2ZK+cS6MuzsW/eZUyKthgajldpt22XcUhJbnn/vZAM7xK7aeKS9EtvZ6SeWzBvC IShYGK963szVPJS/BCuVcksx8QIg1EA0h46dMLdb1qdJ9NkgIrjGaH0tJrdBw2f18pGA PHvIxHMhfDVBmt+YlHj0oSPjCc24r0DATvNaqBX4DfZBT/dyb8gYb3MaCErG8oFa8QVw OpjV4auRajZjoSq7G46WiZ5axmMdLdg55E+tVBR+OxhpJqLo9tzHde06/mkXKSzyNlcH XSvA== 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=qWcWQSGG2kxNhPugXD3O7HwM8qgfTb5RKyr9o3x92Yu4w7qLpcRxhBSXET5ReX+Kup POMzHVYUjqR+b+2uALpwR/6CXqjHlMoUbekig3rnZqzb3rqoS0KZER10ExqVhzYphguc 7fu8EiTtDOcmw3mAG4I9ksr5wQVv8xZ+i1wakkrqB0VAbLw3zwtq0BZ7TJtrKVhsHMiH 2bnEJFNfIgFyCfh9wGWw1Chs8CBi9dRefR29QjmWnym1IH8tk7X+5ktRM4smTTWSOImn ZRMKiR+UqPU9RPi1nA+Cme/11gX2dZZ5ogKxU09qGBdpZp9Q8G93yxmLd15Pd4dq85Cg sO8A== X-Gm-Message-State: AOAM533gu5x99E9WXTfiLGsIKCwvR6bvcSiSgqAhpSyBnSiHbFrLDIF0 kyaJq+eWKe7/rU8042JvVrb5cIEP2DA= X-Google-Smtp-Source: ABdhPJxn9+kIMyYEnwJy5Vir0YeesvqCj/gWyyw5X7h0ork5oY26Q/yM2W7ekViVqEYpvdbTVr7DDQ== X-Received: by 2002:a7b:cbce:: with SMTP id n14mr13047789wmi.169.1632695421297; Sun, 26 Sep 2021 15:30: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 v17sm14525662wrr.69.2021.09.26.15.30.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 15:30:20 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v8 39/40] accel/tcg: Remove CPUClass::has_work() Date: Mon, 27 Sep 2021 00:27:15 +0200 Message-Id: <20210926222716.1732932-40-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210926222716.1732932-1-f4bug@amsat.org> References: <20210926222716.1732932-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.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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" 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 Sun Sep 26 22:27: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: 1533139 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=UB1ZuHAE; 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4HHh8n6Z2Rz9sR4 for ; Mon, 27 Sep 2021 09:01:28 +1000 (AEST) Received: from localhost ([::1]:41630 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mUd9A-0006bB-VT for incoming@patchwork.ozlabs.org; Sun, 26 Sep 2021 19:01:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60178) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mUcfE-0006ZR-Lw for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:30:31 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:46788) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mUcfD-0007Vx-BQ for qemu-devel@nongnu.org; Sun, 26 Sep 2021 18:30:28 -0400 Received: by mail-wr1-x429.google.com with SMTP id c21so16817321wrb.13 for ; Sun, 26 Sep 2021 15:30:26 -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=L6ntqmXS7ifceLSpB74XEWOrQdhQXzlIYsRxqC94HM4=; b=UB1ZuHAEDwCOnYBJMXx5GsGLkCbYLg49aVp58+G3pqAKA2esQVSRgnBAvUuIb0+pkG fuLqDQB+qJRgmasVjKmx5cGyxqQvy+qGoA59A+9v1hvvPseTabM3pcDohu2RFE1zNDSo ysAa1NQyN1RxOADyBCWho5XegOTCuFxCxQkCufYJf6+3NdUpGpxSlNbFhJ5JaGt/zF3P G0zxbhh1/XIkXIbs/CIdH9FxAlt6M+YG5yU3w4QJu4gLOXLnEtQnJIQpQ7m6jV55urQc NqyqZNN1vDgpBywnj52pxlxz7h53LBQkspnzYVtu83OP6oB0+VC3GG+1++g8f5lO46zf ixgw== 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=L6ntqmXS7ifceLSpB74XEWOrQdhQXzlIYsRxqC94HM4=; b=OClTJjQCL3oYPu1y2X2MRYqn7M/tWkDvse4DNjxeSFEZ2w3NN3LLebRlRCsK1A47e9 56PVm7BNPbzUznWrIdxvVWR7txv6hG7aTChAhJ/zCmN8D+yB8PfO7T/e+uclEqgBVxUR +wg3NYbrGx/wWye/MwcsihVX14c1pde01KJ6dzw/SfPh1sBZw7/xWCpfy9+6/VWzlfML TehN4TJU6V6vCLkRdltLiESC1wrbF/gzhgd8T3D+ibaaTsdWQLg2IZLa49B+MY5ezWiT f33NkP69Pcz5qw7ETuGrakQbofrGOdjjnCWlAUNPGaPeIMyOYdr6u5UfBtTceO8BAVCl MwpA== X-Gm-Message-State: AOAM532syjzHhAFNDYdR/habxXhKSbIEGsOAgA4aU9hv92LmdCsQ7RcE Faa0dC2tjF80Pf+j4Ig/U6NDfGB7NpE= X-Google-Smtp-Source: ABdhPJwuprpBjTMgomoIinkBrGSQGzDEbyHdGIoi7a5I0stqV299IOSKI3PP7LgwVgKwg1yuAqmvrA== X-Received: by 2002:a05:600c:b47:: with SMTP id k7mr12796837wmr.103.1632695425998; Sun, 26 Sep 2021 15:30:25 -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 u5sm15967283wrg.57.2021.09.26.15.30.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Sep 2021 15:30:25 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v8 40/40] accel/tcg: Simplify tcg_cpu_has_work() Date: Mon, 27 Sep 2021 00:27:16 +0200 Message-Id: <20210926222716.1732932-41-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210926222716.1732932-1-f4bug@amsat.org> References: <20210926222716.1732932-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.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, 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" 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 | 6 ++++++ accel/tcg/tcg-accel-ops.c | 5 +---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 5fd1ed34222..d577a65237c 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -993,6 +993,12 @@ 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); +#ifndef CONFIG_USER_ONLY + g_assert(cc->tcg_ops->has_work); +#endif /* !CONFIG_USER_ONLY */ + 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 */