From patchwork Sat Sep 25 14:50: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: 1532725 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=OXTzlc0l; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HGsMs6HhTz9t4b for ; Sun, 26 Sep 2021 00:53:13 +1000 (AEST) Received: from localhost ([::1]:36400 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mU939-00008U-Am for incoming@patchwork.ozlabs.org; Sat, 25 Sep 2021 10:53:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42036) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mU91T-0007Pb-NM for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:51:28 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:41493) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mU91S-0004kF-16 for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:51:27 -0400 Received: by mail-wr1-x435.google.com with SMTP id w29so36381525wra.8 for ; Sat, 25 Sep 2021 07:51: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=5Bzxb+cyFW2fTjguo4+D1GgUMJzgo2oIaa6x4dhI9M8=; b=OXTzlc0l5v/r8uLvsReuOKdN3lsOY9J7V5T3b1v/C2sV26LnTKMFGdwfhFT/8vxdHS 0Go9INDMsXeMhAECUBjGHlV+KmHKaTRG3whAnRlP340XS5kD21J6RsxmCHDxoJ0xpd0z 62r8N2JZyHVq7NJ9YGL4ikGLjBRehYLzA4fdxms+0JLckSlv7SzCyGazecRWFfb1ZQq8 tp/8FyPVL+MvsuUtRHqveeae4+hW3drsKgbfJkAq/StOvPKmhPMePCJG4khmwgPW2K+j NNCtNQQG/7l88ca2Z27fPncaDZUz8L+ltujFdzRfBiOn7FAXP/U9CPfg7ndWnEwQ2Cam LHNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=5Bzxb+cyFW2fTjguo4+D1GgUMJzgo2oIaa6x4dhI9M8=; b=0dyrFTNXMdIsmNqmCcBLBrQSrN6JYhzzC5yTgVegQVnIk9cWEMBWSQlI5sh5CNwoqV j1JaTviWKRzLm2fGH/lPwCf9Citt6w+nr39tUElvfboYc+5IHzt/FJ7Ykje8HUmmAUtE bjCZ0iX7wn2R0eKgGUXuitwCmVqiMRmE3WLwkWFE0kptuGG77w3nHswK/3mEroO5AiSh mndiMz9pqfJafvpjMe2pHmmo0fQRyLRKFzj0lT0QOqTmNQrVe7AC3F9fs6c4Oa3Rh1nv XAiH0qRhVqfzeO9c4K/vHU7BKF7soIUMfwmPvK1aAk4DfIJPb+3itCnVE6S4ia/4Yq52 9j9w== X-Gm-Message-State: AOAM532ZpMaw3z1GR8pod6VPaBVf83m6lJx1IEQ4g1V/DzbT4k10cu0c Gevsfenyq23xTx7Hs662EgtcY8igK2k= X-Google-Smtp-Source: ABdhPJzq85pYyiQEMby/nqs+kxyz8pcpHVsgN5LX6GqmttvViHhfZs4diirSV8lBDozrvbI7Ug+nYA== X-Received: by 2002:a5d:6d81:: with SMTP id l1mr17809354wrs.404.1632581484389; Sat, 25 Sep 2021 07:51: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 j21sm11103624wrd.48.2021.09.25.07.51.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Sep 2021 07:51:23 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v7 01/40] accel: Simplify qemu_init_vcpu() Date: Sat, 25 Sep 2021 16:50:39 +0200 Message-Id: <20210925145118.1361230-2-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210925145118.1361230-1-f4bug@amsat.org> References: <20210925145118.1361230-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.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" cpus_register_accel() already checks for ops->create_vcpu_thread being non-NULL, so it is pointless to re-check for it in qemu_init_vcpu(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- 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 Sat Sep 25 14:50: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: 1532729 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=esE+aOjT; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HGsQt0QZqz9t4b for ; Sun, 26 Sep 2021 00:55:50 +1000 (AEST) Received: from localhost ([::1]:44450 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mU95f-0005jg-Ps for incoming@patchwork.ozlabs.org; Sat, 25 Sep 2021 10:55:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42048) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mU91Z-0007S8-B3 for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:51:34 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:36495) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mU91W-0004pf-OW for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:51:32 -0400 Received: by mail-wr1-x435.google.com with SMTP id g16so36512198wrb.3 for ; Sat, 25 Sep 2021 07:51: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=tcpBP/9O11lxH2OkY3DQ1OAE3IFU4nJ2jfhNdgzdGjo=; b=esE+aOjTLvFOR1pvVPn5Xd+dAbb4C2cXAr8kclKegqI/M9HwJTImfDcMx3CtJ98vYz xgYZmjlH1XsjuDYVIOPTrv8OFDzv77ubVJfdlrS6KX/Ta6/Hxa+MXt2tw1Qr7UHEVIw4 R/BmdqXFv6k6Cm8jd/FVJR2gXionuasqrd4Z+H+6Ymm71q2O4aB29klkNYDJsIIIGeAE akdkIYwHCp9bc7gimgaOfP8OO1jSGMc7YftPVfFbigVlHQ7ZGQEs2wO3QjnoNsZ/GybN gNRlac83LvG0JG7+FQ3AgVTg71P3duUiBTZfQIE6QicWs9wJHJxQDnMrSRIz7s2NjGcK u9jA== 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=rxCydRoZSZ1sljRz+iKOdTqCCEOmME5P5ZITcxIJtBkjYOUudMhi7g8k0AC+BKJsRJ Lmlz01Mv/F7THFH/EmMGoA18AHvtbIKkAr6vHYqF6bxIpzWbGazY1f4fD7zkpmkJlK+F Uo0WoG6MlLsSWuIRiRsYYU5wV4D/tqKh1Fb8K9PjZWcnNp1JeOprD4k/UvppGLoJoPiF 0nVCEg0vV1ruC8XVzHduKR3n6vQqoS34ghMrkWDcitJiyGar/+MV68UMjU0UZRVeOAnY jpmTZOGKwGsYEi3l743Uap2bgNMt5gSZDcx+N8KnkPqTxZs0gkIYhpqmHKoOUSSmMuHx LxSA== X-Gm-Message-State: AOAM532eMUg3O/qYL4nXJHSgRj9XUJJvlLU4DNHuLjbIhGGi7/DkNj3f S/rTVKOcQc7o3MgDCx1gOI7X4176fN8= X-Google-Smtp-Source: ABdhPJwrkJLVpF0GLIvMlPUAzZyE7HWCRtyIDcUjP87AjuIzpUJXDvac+99KVK3C8GDsbK1W0hznBg== X-Received: by 2002:a7b:cb49:: with SMTP id v9mr7146092wmj.76.1632581489243; Sat, 25 Sep 2021 07:51:29 -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 i67sm13683401wmi.41.2021.09.25.07.51.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Sep 2021 07:51:28 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v7 02/40] hw/core: Restrict cpu_has_work() to sysemu Date: Sat, 25 Sep 2021 16:50:40 +0200 Message-Id: <20210925145118.1361230-3-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210925145118.1361230-1-f4bug@amsat.org> References: <20210925145118.1361230-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.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Eduardo Habkost Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" cpu_has_work() is only called from system emulation code. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index bc864564cee..2bd563e221f 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -538,6 +538,22 @@ enum CPUDumpFlags { void cpu_dump_state(CPUState *cpu, FILE *f, int flags); #ifndef CONFIG_USER_ONLY +/** + * cpu_has_work: + * @cpu: The vCPU to check. + * + * Checks whether the CPU has work to do. + * + * Returns: %true if the CPU has work, %false otherwise. + */ +static inline bool cpu_has_work(CPUState *cpu) +{ + CPUClass *cc = CPU_GET_CLASS(cpu); + + g_assert(cc->has_work); + return cc->has_work(cpu); +} + /** * cpu_get_phys_page_attrs_debug: * @cpu: The CPU to obtain the physical page address for. @@ -636,22 +652,6 @@ CPUState *cpu_create(const char *typename); */ const char *parse_cpu_option(const char *cpu_option); -/** - * cpu_has_work: - * @cpu: The vCPU to check. - * - * Checks whether the CPU has work to do. - * - * Returns: %true if the CPU has work, %false otherwise. - */ -static inline bool cpu_has_work(CPUState *cpu) -{ - CPUClass *cc = CPU_GET_CLASS(cpu); - - g_assert(cc->has_work); - return cc->has_work(cpu); -} - /** * qemu_cpu_is_self: * @cpu: The vCPU to check against. From patchwork Sat Sep 25 14:50: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: 1532727 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=K165AtI6; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HGsPt2t2cz9t8j for ; Sun, 26 Sep 2021 00:54:58 +1000 (AEST) Received: from localhost ([::1]:41790 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mU94q-0003vr-5Y for incoming@patchwork.ozlabs.org; Sat, 25 Sep 2021 10:54:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42074) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mU91d-0007UK-EE for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:51:37 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:33486) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mU91b-0004wB-Ny for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:51:37 -0400 Received: by mail-wr1-x42a.google.com with SMTP id t18so36542537wrb.0 for ; Sat, 25 Sep 2021 07:51: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=Q67ayF6mp3x5mowVghP1HWubdfr0XK9yIREcYkI/kjw=; b=K165AtI6L5PwQLpWjUgAWiQ96IxBA3jAdkl7OsVzbu9c0tekwJvDBKvzqSrhHpqIiT 7G/lNrsC/MOUrZJr89jZUULetjLuPlol3FRXjdFVtrJT/qZ1TpQpIevD2fEhE+7KtOEs TjGBuEKzF2gTkzQf6zOOToEPYMo7ex1sBUDeNdBmoI6FMo0WgT0549JpdJYdSn7KzK1E THs7nob9bzgh4v+d2iF1XP/zjFHCsBrcVH1YCcra3GkHtx5Cn78kchA9xHS2j9QuSSnl VRCHNfICLFz35lLgaGgB0hpGsNSWJObzOPFHmazVZ2cHjxnQlbRCajxi5SO9B6oCETyY vZKQ== 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=cNh3MS6Wsr3o+tsOlupwKXlUhTth+REdYZhWl98chR7FyMVQuY3Rz+ftnrLw8+uU2s +XfMYvBbWDtWSgxwNqggZFSUtUYlVKgzgFMNQeBko1NI8U1oTXaZxCD+IrnVeuPlOQMr ioKHTk16TOsSu7I9phliji7BO/0VFgJRFzv2tyZlNGnVbngtygsX/EATWzehkzD+NI/g vxSmEfRt3KocBNwLUuiYLd9/MqtuJrhIwUndT00YGE6V2Xrc95WbUvcdCD8XHXJ2WuAC 4rp1Y/OqN9GDyrIryagMgDAox31I9Stti9Y9mcLxkI07URMwV2up9SfhlI0/prpR2Eu+ nP2A== X-Gm-Message-State: AOAM533WOA17jJttCZ0kg76Qz0WcF4tw8HAPlt3UaIr/1VzuuF2h466S dYcLo6FYjQriv5vg1AuTd5GVMD9BkiQ= X-Google-Smtp-Source: ABdhPJwoNo0yr9Xl5/g8pF7M2b4u7LMVRITjZFPwthVFeGjok2eci4VSyd/+f27acfMsyZXEgs3tfw== X-Received: by 2002:adf:f486:: with SMTP id l6mr16934537wro.375.1632581494184; Sat, 25 Sep 2021 07:51: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 z5sm17831428wmp.26.2021.09.25.07.51.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Sep 2021 07:51:33 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v7 03/40] hw/core: Un-inline cpu_has_work() Date: Sat, 25 Sep 2021 16:50:41 +0200 Message-Id: <20210925145118.1361230-4-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210925145118.1361230-1-f4bug@amsat.org> References: <20210925145118.1361230-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.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Eduardo Habkost Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" We want to make cpu_has_work() per-accelerator. Only declare its prototype and move its definition to softmmu/cpus.c. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 8 +------- softmmu/cpus.c | 8 ++++++++ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 2bd563e221f..e2dd171a13f 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -546,13 +546,7 @@ void cpu_dump_state(CPUState *cpu, FILE *f, int flags); * * Returns: %true if the CPU has work, %false otherwise. */ -static inline bool cpu_has_work(CPUState *cpu) -{ - CPUClass *cc = CPU_GET_CLASS(cpu); - - g_assert(cc->has_work); - return cc->has_work(cpu); -} +bool cpu_has_work(CPUState *cpu); /** * cpu_get_phys_page_attrs_debug: diff --git a/softmmu/cpus.c b/softmmu/cpus.c index 646326b24fd..6a05860f7fe 100644 --- a/softmmu/cpus.c +++ b/softmmu/cpus.c @@ -251,6 +251,14 @@ void cpu_interrupt(CPUState *cpu, int mask) } } +bool cpu_has_work(CPUState *cpu) +{ + CPUClass *cc = CPU_GET_CLASS(cpu); + + g_assert(cc->has_work); + return cc->has_work(cpu); +} + static int do_vm_stop(RunState state, bool send_stop) { int ret = 0; From patchwork Sat Sep 25 14:50: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: 1532736 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=VgGbYvr0; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HGsbw06PSz9sW8 for ; Sun, 26 Sep 2021 01:03:40 +1000 (AEST) Received: from localhost ([::1]:33626 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mU9DF-00015O-MM for incoming@patchwork.ozlabs.org; Sat, 25 Sep 2021 11:03:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42098) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mU91h-0007Xt-Pk for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:51:42 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:39596) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mU91g-0004zu-7x for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:51:41 -0400 Received: by mail-wr1-x435.google.com with SMTP id r23so11137366wra.6 for ; Sat, 25 Sep 2021 07:51: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=0AqKBFC+aFLNQwO8nQ0Y0K7FTRMmlUnvtkKFuSqHBPM=; b=VgGbYvr0zOUZ11vJzkJlKMILzL55l6ZQpg9wz0vVALAo+YpQSBtyttLYk4uZLw70K6 QFRzS1pjSxMpxKpmbF7efFCe88zrYnUdS4WePbe1p6td3Z8bJUHoarUxaccx8uHQZ6Zk emsGumLandXTuwIhRbt2x3eE/YN/a3daJg/Gv9wzyrVKVNMmossnMdFNJbYHd8xaeAWj Us/qadeN0jVSrocrs7WRWBSdDnredCI47pwoxpR3YdFBO2PAUvd/MegerPvrl14vbTPf slpQ1SKMCRXKYCOe9Tg0Bx9LYVZtYkWTHlKqajNVqQ03NrNAMAEJ13qxaz9YPZmNGKLV x2RA== 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=ySPY6E4vUnO0TqIiroXY+LKJj2sCdnWBYz40H2IfuzQVx0CRMW9oS9Leo3q70o9d+M yl0GQTN2DY0Zcep96shj+EEVNBE9WeXqjwQmZHTtdCI7KNk4f06UYEinMmA5o2/EVsXz dYyZXgr3oWaILHBSHc6h6aqfdGpnPvjOqVRydXCZf8Bc42OuGF4Y5L4P+KJTfufu/iwa pmQqEOXzKBvTM3SvjJyL5bC32nby8ETDzdkX34nvD3NbVKrVDnMlak3HXi/ADG7Mk+2w i+vAhh8519nBQCcD3UnyM0D0/uzwVY78XzR/fPhA7mZkzIsJCjgdFS+NWWe22HR/28ia NMdg== X-Gm-Message-State: AOAM532eZVBVjhELHthV/CSJmOIl5b8STqYAPyCTAhC2QDhgngOL+DFL 8Zje+VKZfa8k/an3ejzCf4AuEMLjbd8= X-Google-Smtp-Source: ABdhPJynwAAYE6uZr6+Ls3W+qh141dZhbxfysqzxFkctP0T3IxaM6Un9nQ8j/5Zrpt4YlEbojogeXg== X-Received: by 2002:a5d:440d:: with SMTP id z13mr17596133wrq.433.1632581498856; Sat, 25 Sep 2021 07:51: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 y11sm13690765wrg.18.2021.09.25.07.51.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Sep 2021 07:51:38 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v7 04/40] hw/core: Move cpu_common_has_work() to cpu_has_work() Date: Sat, 25 Sep 2021 16:50:42 +0200 Message-Id: <20210925145118.1361230-5-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210925145118.1361230-1-f4bug@amsat.org> References: <20210925145118.1361230-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.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" cpu_class_init() always register cpu_common_has_work() as CPUClass::has_work() handler, so the assertion check in cpu_has_work() is pointless. Since cpu_common_has_work() simply returns 'false', we can inline it in cpu_has_work(), improving the function readability. Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- hw/core/cpu-common.c | 6 ------ softmmu/cpus.c | 6 ++++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index e2f5a646046..5ed1ccdfdd5 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -143,11 +143,6 @@ static void cpu_common_reset(DeviceState *dev) } } -static bool cpu_common_has_work(CPUState *cs) -{ - return false; -} - ObjectClass *cpu_class_by_name(const char *typename, const char *cpu_model) { CPUClass *cc = CPU_CLASS(object_class_by_name(typename)); @@ -279,7 +274,6 @@ static void cpu_class_init(ObjectClass *klass, void *data) k->parse_features = cpu_common_parse_features; k->get_arch_id = cpu_common_get_arch_id; - k->has_work = cpu_common_has_work; k->gdb_read_register = cpu_common_gdb_read_register; k->gdb_write_register = cpu_common_gdb_write_register; set_bit(DEVICE_CATEGORY_CPU, dc->categories); diff --git a/softmmu/cpus.c b/softmmu/cpus.c index 6a05860f7fe..accb20f0589 100644 --- a/softmmu/cpus.c +++ b/softmmu/cpus.c @@ -255,8 +255,10 @@ bool cpu_has_work(CPUState *cpu) { CPUClass *cc = CPU_GET_CLASS(cpu); - g_assert(cc->has_work); - return cc->has_work(cpu); + if (cc->has_work && cc->has_work(cpu)) { + return true; + } + return false; } static int do_vm_stop(RunState state, bool send_stop) From patchwork Sat Sep 25 14:50: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: 1532731 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=buwpCuSS; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HGsTh4Xtzz9sW8 for ; Sun, 26 Sep 2021 00:58:16 +1000 (AEST) Received: from localhost ([::1]:50176 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mU982-0001Cj-E8 for incoming@patchwork.ozlabs.org; Sat, 25 Sep 2021 10:58:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42136) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mU91m-0007db-Fw for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:51:46 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:34768) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mU91l-00054S-2Q for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:51:46 -0400 Received: by mail-wr1-x42e.google.com with SMTP id t8so36606544wri.1 for ; Sat, 25 Sep 2021 07:51: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=ka2Zs6W/m1VUMtJW+H1oHcUfryePq3cXFIahmgjrmno=; b=buwpCuSSrgxmyCmmy7Xc7YQ0frby/3qBlNtyt2vmvtKTRBLv2D7XCYfmpxeABvUIHP wTWGKy8tmfncTEOsoD04c2mIkSWGa601Sj6PlSSUnXrmdcKLOLdVfRxcK2k6efZEjtmH sYGJ0h1dBt1khjd6gVdl5Qo5nDyIjJ/jdcYSayT25q3AAYFB0UXH+yWOmrS2S8fy3YTh 5hX9F10NmnoEMhXTqf2GuzM3rizARP9iXOAWhCvmIejmJD3VhWu7kQI3xm3pYY8gyIPY 4dXnJYI3YzSmE4keg/1QyKxFogm8yatnO39X690QJsQ57OXRwlHbCm10nK4gDwlv/+6c QPiQ== 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=o1nbGG1BxsK2Cx4EX4Hj2ynElt8KljSwu9S9XEPeIKUNcQwxvgWZJ4MzDCU3GHlbhS BB5pb+kLYURLaQoWL2ziTLGRMcM7R6cEMA7ogIUBpiGZuwNtBbYAjW0RlVmQ+srClYuN 5MU3siMwa0E/prt7qc9+lKx0PA93UP2WMRAkD4B40d8sbtcmJ+YuIJjv1kqjqzSaa3dG zdp3BqRRWHdt4Z+V64qOvY11IDJk9t/0+IWJp+OMqt/EDQo5fUUeO0fTCMq5b8L3zXfh IYEK6m0qeSpTLb286SWaauYoxTqI1aPo+FcoPHCUGSLajcgaDD8dmPeOfrpTxiVeYMNI yCsw== X-Gm-Message-State: AOAM5326e5uRURLxB+KfAwksdgDzd+316i/tOdNAtSEm1owbcjL6soCg xa4hi/ho+xzsDBtMehPRh2r4QOQSiEg= X-Google-Smtp-Source: ABdhPJyXRFwftRt+YBP8GlkHAiE6MH6iYZvm1+kXOgMvicF1vO9EMvcFJp6L2CbbquQZuUQEFPenKQ== X-Received: by 2002:a5d:4006:: with SMTP id n6mr8654106wrp.224.1632581503541; Sat, 25 Sep 2021 07:51: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 y6sm11342833wrp.46.2021.09.25.07.51.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Sep 2021 07:51:43 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v7 05/40] accel: Introduce AccelOpsClass::has_work() Date: Sat, 25 Sep 2021 16:50:43 +0200 Message-Id: <20210925145118.1361230-6-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210925145118.1361230-1-f4bug@amsat.org> References: <20210925145118.1361230-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.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Introduce an accelerator-specific has_work() handler. Eventually call it from cpu_has_work(). Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- include/sysemu/accel-ops.h | 5 +++++ softmmu/cpus.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/include/sysemu/accel-ops.h b/include/sysemu/accel-ops.h index 032f6979d76..de83f095f20 100644 --- a/include/sysemu/accel-ops.h +++ b/include/sysemu/accel-ops.h @@ -31,6 +31,11 @@ struct AccelOpsClass { void (*create_vcpu_thread)(CPUState *cpu); /* MANDATORY NON-NULL */ void (*kick_vcpu_thread)(CPUState *cpu); + /** + * @has_work: Callback for checking if there is work to do. + */ + bool (*has_work)(CPUState *cpu); + void (*synchronize_post_reset)(CPUState *cpu); void (*synchronize_post_init)(CPUState *cpu); void (*synchronize_state)(CPUState *cpu); diff --git a/softmmu/cpus.c b/softmmu/cpus.c index accb20f0589..85b06d3e685 100644 --- a/softmmu/cpus.c +++ b/softmmu/cpus.c @@ -258,6 +258,9 @@ bool cpu_has_work(CPUState *cpu) if (cc->has_work && cc->has_work(cpu)) { return true; } + if (cpus_accel->has_work && cpus_accel->has_work(cpu)) { + return true; + } return false; } From patchwork Sat Sep 25 14:50: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: 1532735 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=YOw2pv9e; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HGsZl4t0wz9t8j for ; Sun, 26 Sep 2021 01:02:39 +1000 (AEST) Received: from localhost ([::1]:58764 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mU9CH-0007FQ-FA for incoming@patchwork.ozlabs.org; Sat, 25 Sep 2021 11:02:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42158) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mU91r-0007ps-HA for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:51:51 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:41488) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mU91p-0005AN-QQ for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:51:51 -0400 Received: by mail-wr1-x42b.google.com with SMTP id w29so36383800wra.8 for ; Sat, 25 Sep 2021 07:51: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=D1NIBiKsJLet/LtgtEl9N8uYnLoHyxQP991kqXpIcyw=; b=YOw2pv9ebkj+SD6dyN66r1sz5ImWnhuE1/NU5zJ+fIQcn+D4ncRESVjKU58DS+dE9G UJAdGB+y1u1H7jg+2+BcMVUMovD1pwb/9xNI8oHPh4cnl1fJPGMoluC63jOLulGNIHzx Vgl/Ok6wivXRNjSWDIrJfQV+/UUS1WrTz0NVni3AYqZj8Qkxd1729D6ihq+OO/SP5Xrn k1ekZ8Kh4vaKb2IGL4F9TduJeD6bHWCC6atssDqBIDbJZ3sfA3YaWSO+Glb5LGVUNRDg dt2Nb6l4U0v1o4A4lFERu7AV0sYz9AYrtJ1vf3YskPLWVcMAJ0q+I1akov2isqhIxo+5 pZQQ== 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=WX6TO388M8yCpz20uhds8h7+/dlN/yefg8F8q0wtYOUhEG9SnNCNDbcwdyjyjPALrv UnxAA/VmxEpz/PxQOWIAQf7ulIAMeUqqNZLLRWXyudubHXiWcwsQJ1ztuwiN7OWtJ/rX JIR/2r9hDYF/r5nc1IGBqJeUrSYN1jjz7WT3JrcHkJ/5tFYlJkfp6Sk91ZIHJjjHHHqT eKdRBTDnVqc377xs2QuRKWM33x9RQXuOgIxd+sx8k/wGB8rvSigDZOkfO3eH8s5goTxL r9cGTF2yLwz2p9rKYoSGeUwEZm4ajFe4OP/C4h2986U1rTXui2fEq5fpn8XIP5rkYjeW rLng== X-Gm-Message-State: AOAM531wq/tW8mrQ6TEuJcNYfF9WGyTHnzohRIYxn5x0HRMWNJtgvV1x PUy+KbRfPhqATCuIlDe0yDQbM1ZmMg8= X-Google-Smtp-Source: ABdhPJwPXRuJQaR6gpTRqV/YE5q1tGhHLUEN8yWUd/qyt7m3JhVHHlWnvVf5F5l/T3Ktxkn3CgFDrA== X-Received: by 2002:a05:600c:2e46:: with SMTP id q6mr7286713wmf.182.1632581508227; Sat, 25 Sep 2021 07:51: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 m4sm13326459wrx.81.2021.09.25.07.51.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Sep 2021 07:51:47 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v7 06/40] accel/kvm: Implement AccelOpsClass::has_work() Date: Sat, 25 Sep 2021 16:50:44 +0200 Message-Id: <20210925145118.1361230-7-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210925145118.1361230-1-f4bug@amsat.org> References: <20210925145118.1361230-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.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , "open list:Overall KVM CPUs" Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Implement KVM has_work() handler in AccelOpsClass and remove it from cpu_thread_is_idle() since cpu_has_work() is already called. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- accel/kvm/kvm-accel-ops.c | 6 ++++++ softmmu/cpus.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/accel/kvm/kvm-accel-ops.c b/accel/kvm/kvm-accel-ops.c index 7516c67a3f5..6f4d5df3a0d 100644 --- a/accel/kvm/kvm-accel-ops.c +++ b/accel/kvm/kvm-accel-ops.c @@ -74,6 +74,11 @@ static void kvm_start_vcpu_thread(CPUState *cpu) cpu, QEMU_THREAD_JOINABLE); } +static bool kvm_cpu_has_work(CPUState *cpu) +{ + return kvm_halt_in_kernel(); +} + static void kvm_accel_ops_class_init(ObjectClass *oc, void *data) { AccelOpsClass *ops = ACCEL_OPS_CLASS(oc); @@ -83,6 +88,7 @@ static void kvm_accel_ops_class_init(ObjectClass *oc, void *data) ops->synchronize_post_init = kvm_cpu_synchronize_post_init; ops->synchronize_state = kvm_cpu_synchronize_state; ops->synchronize_pre_loadvm = kvm_cpu_synchronize_pre_loadvm; + ops->has_work = kvm_cpu_has_work; } static const TypeInfo kvm_accel_ops_type = { diff --git a/softmmu/cpus.c b/softmmu/cpus.c index 85b06d3e685..c9f54a09989 100644 --- a/softmmu/cpus.c +++ b/softmmu/cpus.c @@ -90,7 +90,7 @@ bool cpu_thread_is_idle(CPUState *cpu) return true; } if (!cpu->halted || cpu_has_work(cpu) || - kvm_halt_in_kernel() || whpx_apic_in_platform()) { + whpx_apic_in_platform()) { return false; } return true; From patchwork Sat Sep 25 14:50: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: 1532724 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=cFTB3ESm; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HGsMF1rBSz9t8j for ; Sun, 26 Sep 2021 00:52:41 +1000 (AEST) Received: from localhost ([::1]:35654 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mU92d-000843-2K for incoming@patchwork.ozlabs.org; Sat, 25 Sep 2021 10:52:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42176) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mU91w-00080c-9f for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:51:56 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:39595) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mU91u-0005Hg-Dw for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:51:55 -0400 Received: by mail-wr1-x430.google.com with SMTP id r23so11138388wra.6 for ; Sat, 25 Sep 2021 07:51: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=vUe+1tkOVnIH977cfWQkm6Ao8Hfy7tcpnU7MaXPzIOo=; b=cFTB3ESmBa5g++Km+6ljTw3n59qd039s9/U8dSV75WKTWjWrlSBq/wvuxMw0Xh11e2 D7297Z5rdev4+PL3pACGaECHoHpiHCjTADkvK7CfHisYMAkMiCkz/pBO2c5Q9oHeCoIo 8DP+r+l0f+DrUHNrLsKVf6ZQHh7vhRgVn1Nldc7Iqta3XOK4Vw/QoPvBQ6vwbF3u1cFD umR4MtQYqwNjBinnZUaMK9U2A3FaWmDLWZyqBifbu/Nq9uzIRQzhbvXJ18YEEnHUWP6o zEpKsVmoui9pfiOjJssVoJ/8USPU9q/IWX41rP9DuzeOuz96GN/ZwGbZaxFU8XwYHvZ6 OE/g== 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=Zz/fUGcKaaTMMU11fEy2qzVb6NOYryqpVuc580Ny+awaZIUsO8H/ra57CW6Wr1l+eJ CVWt+KRmp7FpEOmwOS9y2pPBhxBoNr+wMGvhWSZCdIuALNtevoa+ZhOGEPS4+Xc/ybcJ EJVtqRlZS9mNcU8IsNn9YLYGnVEhDQLEFg90HJAc0r3SEJFkpr4TR4N9wZJ/FAlXissF pWK7bEz4GwrC9j+pzePHhew0uwjI4bu6budStN652mxIhzZrxqfBK0M0s7IrI35MzfSK nNLPP3ETicDpbrZjG+30poMtLyhwUWSosYLw54U9k+7rRHSjHDqkJKF13JdvgvRzF+6f u0IA== X-Gm-Message-State: AOAM532TI+e6Wy/FAguR8s6EBHqSlZKecFbteJn+CjquNPTtVhzTIoyJ 9BN3f6vukPppjqSlVoq9mP/+1V+YUko= X-Google-Smtp-Source: ABdhPJxxzqfA7U9gvO6Wda5hURrjK93Ypdbdqy38aYqWnFSE9un1DgeSJk1R2QB8av3101pB1lxjtA== X-Received: by 2002:adf:fb44:: with SMTP id c4mr17630544wrs.179.1632581512924; Sat, 25 Sep 2021 07:51: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 z5sm17832274wmp.26.2021.09.25.07.51.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Sep 2021 07:51:52 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v7 07/40] accel/whpx: Implement AccelOpsClass::has_work() Date: Sat, 25 Sep 2021 16:50:45 +0200 Message-Id: <20210925145118.1361230-8-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210925145118.1361230-1-f4bug@amsat.org> References: <20210925145118.1361230-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x430.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Sunil Muthuswamy , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Implement WHPX has_work() handler in AccelOpsClass and remove it from cpu_thread_is_idle() since cpu_has_work() is already called. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- softmmu/cpus.c | 4 +--- target/i386/whpx/whpx-accel-ops.c | 6 ++++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/softmmu/cpus.c b/softmmu/cpus.c index c9f54a09989..5ffa02f9cef 100644 --- a/softmmu/cpus.c +++ b/softmmu/cpus.c @@ -41,7 +41,6 @@ #include "sysemu/replay.h" #include "sysemu/runstate.h" #include "sysemu/cpu-timers.h" -#include "sysemu/whpx.h" #include "hw/boards.h" #include "hw/hw.h" #include "trace.h" @@ -89,8 +88,7 @@ bool cpu_thread_is_idle(CPUState *cpu) if (cpu_is_stopped(cpu)) { return true; } - if (!cpu->halted || cpu_has_work(cpu) || - whpx_apic_in_platform()) { + if (!cpu->halted || cpu_has_work(cpu)) { return false; } return true; diff --git a/target/i386/whpx/whpx-accel-ops.c b/target/i386/whpx/whpx-accel-ops.c index 6bc47c53098..1f9c6d52c27 100644 --- a/target/i386/whpx/whpx-accel-ops.c +++ b/target/i386/whpx/whpx-accel-ops.c @@ -83,6 +83,11 @@ static void whpx_kick_vcpu_thread(CPUState *cpu) } } +static bool whpx_cpu_has_work(CPUState *cpu) +{ + return whpx_apic_in_platform(); +} + static void whpx_accel_ops_class_init(ObjectClass *oc, void *data) { AccelOpsClass *ops = ACCEL_OPS_CLASS(oc); @@ -94,6 +99,7 @@ static void whpx_accel_ops_class_init(ObjectClass *oc, void *data) ops->synchronize_post_init = whpx_cpu_synchronize_post_init; ops->synchronize_state = whpx_cpu_synchronize_state; ops->synchronize_pre_loadvm = whpx_cpu_synchronize_pre_loadvm; + ops->has_work = whpx_cpu_has_work; } static const TypeInfo whpx_accel_ops_type = { From patchwork Sat Sep 25 14:50: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: 1532739 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=ft5GFZkK; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HGsdN74JPz9sW8 for ; Sun, 26 Sep 2021 01:04:56 +1000 (AEST) Received: from localhost ([::1]:39260 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mU9EU-0004xn-Pj for incoming@patchwork.ozlabs.org; Sat, 25 Sep 2021 11:04:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42190) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mU922-00089p-5Q for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:52:02 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:46024) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mU91z-0005N8-10 for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:52:01 -0400 Received: by mail-wr1-x42a.google.com with SMTP id d21so36375438wra.12 for ; Sat, 25 Sep 2021 07:51: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=unRoKxdhmIQ/3+a2J4b34FjTNk3kwzqzxXg2lM7z0e4=; b=ft5GFZkKb5tuEPokb9Ek+0+A5ZgW2VFhekYV1f7EE5hq2yE+YvyVJNYcjFhCCZhbGb ILxRW22fWR3cQnXIfg97FgLHiIYGMDEZD1+JImhwKDkKzyjKcMLR6whiGRI0JQL6TrYp VA9hgIckq6e5QJkggO/8sAt66IIgHcRqHnk09tsRq83KqsKc+AFl5koPUgYactaRZC++ +/rn0as6gk/TfatH0G0BsBZxzvE1rBoun5bN95Wm4z6FFfbr+M5GUoPXL/GFMgD5UvUn cEResTSkuvhTw33Jwp0PpVNnLd0EDWznpltde6l+CZxvbt4/gkbZxypApyNtrjOzW7Dj XVzw== 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=tw1ulWq+Ebd9pLNG0nD1AxAmQRXLYAnjb4iIwddlzW83ply1iv9sli48qIXjxSgUlo ETSuorI1Q61A6VCDiM/8WtmQ9NkwviODj41Hr5Z/wwJ/TB5xG+qF8D97ug3Yw0pT2rBg QTkVQQ866pMKHNGn+vVj42HSoFtsC0IdbnjZbmQMxXYxuXlQo9H1Bl4Z/dIV08ymcr7Y NI/x66sxyZo0ynAKriFfyuh18ZnExRnldXN7Wd93iBTicuhLyh114MqU/a0tB2hkpZAt rKLjv+qc8pzigkk4NvCksP6rNl4+jJgvDLNCfun1pg/UvmH6KLjNHfnj1qzz4AclT586 4gUg== X-Gm-Message-State: AOAM530DVWOcm7PqDIsAd0BLDiqt2DAOZZIBrv7RypFT6Rxszyt5llmy Wh6hHz1joNjLNRCOhsJ+ZExCQsVIOWY= X-Google-Smtp-Source: ABdhPJxzi+tBxAEnmGk1ZVdKghIl6UcNQLPCNwNpmo9CizTuHSUS8CyrIdM5H+T9qEmC0rgw3A/umA== X-Received: by 2002:a05:6000:1379:: with SMTP id q25mr17140276wrz.280.1632581517631; Sat, 25 Sep 2021 07:51: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 j4sm11674264wrt.67.2021.09.25.07.51.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Sep 2021 07:51:57 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v7 08/40] accel/hvf: Implement AccelOpsClass::has_work() Date: Sat, 25 Sep 2021 16:50:46 +0200 Message-Id: <20210925145118.1361230-9-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210925145118.1361230-1-f4bug@amsat.org> References: <20210925145118.1361230-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.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Roman Bolshakov , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Cameron Esfahani Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Since there is no specific HVF handling for cpu_has_work() in cpu_thread_is_idle(), implement HVF has_work() handler as a simple 'return false' code. Signed-off-by: Philippe Mathieu-Daudé --- accel/hvf/hvf-accel-ops.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/accel/hvf/hvf-accel-ops.c b/accel/hvf/hvf-accel-ops.c index 93976f4ecea..ba7d4f20a35 100644 --- a/accel/hvf/hvf-accel-ops.c +++ b/accel/hvf/hvf-accel-ops.c @@ -454,6 +454,11 @@ static void hvf_start_vcpu_thread(CPUState *cpu) cpu, QEMU_THREAD_JOINABLE); } +static bool hvf_cpu_has_work(CPUState *cpu) +{ + return false; +} + static void hvf_accel_ops_class_init(ObjectClass *oc, void *data) { AccelOpsClass *ops = ACCEL_OPS_CLASS(oc); @@ -465,6 +470,7 @@ static void hvf_accel_ops_class_init(ObjectClass *oc, void *data) ops->synchronize_post_init = hvf_cpu_synchronize_post_init; ops->synchronize_state = hvf_cpu_synchronize_state; ops->synchronize_pre_loadvm = hvf_cpu_synchronize_pre_loadvm; + ops->has_work = hvf_cpu_has_work; }; static const TypeInfo hvf_accel_ops_type = { .name = ACCEL_OPS_NAME("hvf"), From patchwork Sat Sep 25 14:50: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: 1532728 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=G+GmU72z; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HGsQL5mSKz9t8j for ; Sun, 26 Sep 2021 00:55:22 +1000 (AEST) Received: from localhost ([::1]:43472 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mU95E-00056C-JJ for incoming@patchwork.ozlabs.org; Sat, 25 Sep 2021 10:55:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42202) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mU925-0008E5-4U for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:52:05 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:37665) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mU923-0005Sm-Kw for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:52:04 -0400 Received: by mail-wr1-x435.google.com with SMTP id t8so36536051wrq.4 for ; Sat, 25 Sep 2021 07:52: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=I61ARzsVO4/KzAGYtcJMZn32sXSEJVm6F+jp7uLlVMM=; b=G+GmU72zjpBNcQjaJkUxR7Hm9Y3LE8KiQt/SI3NeS6OLKULhwLAVtEcL4ZDR0Jag3I 9Iqu7RniWGbPuunBaeHSb4uaOW1HdC2SIyhodow0oCFW0XZoRHzN/zJPKDXAUsrTJYbM o0tDzvkIczPzHnDbHc0znNPAZVEXTt+qBGmRo4pyGYCa3HQJ83meRkO9SVxoKlo9UeJ1 nIqgFF+VvYvmGPzkpUox87plIThC0qe8NZE+3Q2d5FskCrFpydmZtE6Xb6AqInYZwrDa YbNDzLTFdcU1ZqZ6fDRMfqsaJAvDTGh4DXeDd8S8Htmyi/O/u1OIGLRJSsN5WaOPH7nW CM7g== 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=y+QRCZUBf/3uoctnn3NihU/cB/g5gLhIs1sQAF1qY99TQ1oFwFOzR4TuzuXwlRE3bg 1SsY/mBGR46NThSAlijsvYYBXvJ32PNNHzI+NhoiMJVDHLkKwdjnZ4ECjbathBl99viG ddNefxv/adgNs6mvrFJYpNHlxzyWdFb4AtusAeZi50QVyTiU4UeZkrO3Zi6brxDOuBK/ ajAtsS52B2X2kUbLXZHdyEOUVQfeYUBr05LIuU7xDniZyk+F1thsrZx+8VtTBzVvlxlF v+qWdV1AFhCFGCRo0IsfjOfy3o2zRrXvfjlbhTaz4eReI7N2HnnxsTFu25hCr/Wsr5Ei oiDg== X-Gm-Message-State: AOAM533rbQAG/tBQze8e4RxuwuDAJ7+Dq0RkQpdkZRJ+gexPwLCJnrj0 IwHHpc65NdNK4LTeUCt4163f6uPs6BM= X-Google-Smtp-Source: ABdhPJzkjnLgo6lRvy/ft690imOHBkl2yBKGxN4EX4PM++nl4LReYCioSoopkYZjVGMaG0ouAce+jg== X-Received: by 2002:a5d:6741:: with SMTP id l1mr17319095wrw.289.1632581522279; Sat, 25 Sep 2021 07:52: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 20sm16920479wme.46.2021.09.25.07.52.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Sep 2021 07:52:01 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v7 09/40] accel/xen: Implement AccelOpsClass::has_work() Date: Sat, 25 Sep 2021 16:50:47 +0200 Message-Id: <20210925145118.1361230-10-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210925145118.1361230-1-f4bug@amsat.org> References: <20210925145118.1361230-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.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Paul Durrant , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Anthony Perard , "open list:X86 Xen CPUs" Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Since there is no specific Xen handling for cpu_has_work() in cpu_thread_is_idle(), implement Xen has_work() handler as a simple 'return false' code. Acked-by: Paul Durrant Signed-off-by: Philippe Mathieu-Daudé --- accel/xen/xen-all.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/accel/xen/xen-all.c b/accel/xen/xen-all.c index 69aa7d018b2..fe5a37fa2e6 100644 --- a/accel/xen/xen-all.c +++ b/accel/xen/xen-all.c @@ -215,11 +215,17 @@ static const TypeInfo xen_accel_type = { .class_init = xen_accel_class_init, }; +static bool xen_cpu_has_work(CPUState *cpu) +{ + return false; +} + static void xen_accel_ops_class_init(ObjectClass *oc, void *data) { AccelOpsClass *ops = ACCEL_OPS_CLASS(oc); ops->create_vcpu_thread = dummy_start_vcpu_thread; + ops->has_work = xen_cpu_has_work; } static const TypeInfo xen_accel_ops_type = { From patchwork Sat Sep 25 14:50: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: 1532740 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=bkeg32cm; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HGsg62wwWz9t8j for ; Sun, 26 Sep 2021 01:06:26 +1000 (AEST) Received: from localhost ([::1]:42114 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mU9Fv-0006vd-TP for incoming@patchwork.ozlabs.org; Sat, 25 Sep 2021 11:06:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42224) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mU92A-0008LX-11 for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:52:10 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:36496) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mU928-0005XL-IE for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:52:09 -0400 Received: by mail-wr1-x42f.google.com with SMTP id g16so36515440wrb.3 for ; Sat, 25 Sep 2021 07:52:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dCLxbLnwCEUqojfStjhPo9ZalBzirYzUtLUPN9TYqi0=; b=bkeg32cm1g1cDL5Hz840hC10GacR3HaUV+H3qtoTwYs4zn0RAwCScYriOnXvHon0U9 0gp34aCY/s4IUS8T3dkVsSu2XXJMBM2RxiapTZHNYlo7EIT3anGmf+Wpx/rsWySC8ZLR 8YAWxrQoob8Xsioze1bPGrD5rNSRzJfkvHLwKx7rtHkGP4GPpO9voHXxgACghPuAlPkm KKRglJ3zqDfktRjl95CbDkAHKlJdREjHpw4SVnMb8kI8rHeZvNKqeabKEZxFwI3Yxov6 AYoMHujrVoPyqGYpNbkEAsWRviqZZ94wwstJKPuTAL9RrJXjOGm4CdvGKfc/M+F4+a9D UagA== 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=axP9G9kY5FI7hEaYb80Po5837tdTSfl/BiaC2E942HyLXlQxy2Z8kzgE4ss3xwuvTa KiZf6QiHYtGKBZEaJRYdO5PyTP3EmtEdZw4jAkhZWbYUfaywd9CGjmdDnSNyae8IC9ub YLU2n567TMuJyDRyCymHrejVWXbHCwCiclzzpOaXYrvCcOXImb01eo/TluiTCQiLUbRU selwq20Xg1c6mJAaZP5tnrXBP2kd9hOEPj9y2B9t/+FaR1jlkEVtTm9V29oPEbpCvdwM qzpfI0dcWApqqrmsEvFBC20xQibRBtaxitO61/EuSjMfY20RVgDhc0LKJP78QVqoFIk9 DRmw== X-Gm-Message-State: AOAM530lyrk0PouM7WbuaDdB4og2pht+g79ZaCSrRZABhI9R3xZ2mBPe HkKw5PWN+h3DenS8TWKGELmkFq4qzxg= X-Google-Smtp-Source: ABdhPJxLYejp8XydnQh03LskQRhp0++Hb69luky+TD2y7l4giH1o7MRjrlRABmmwsTGuVS6G+W36+A== X-Received: by 2002:a5d:6392:: with SMTP id p18mr17068385wru.372.1632581527063; Sat, 25 Sep 2021 07:52: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 z12sm3461932wmf.21.2021.09.25.07.52.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Sep 2021 07:52:06 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v7 10/40] accel/hax: Implement AccelOpsClass::has_work() Date: Sat, 25 Sep 2021 16:50:48 +0200 Message-Id: <20210925145118.1361230-11-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210925145118.1361230-1-f4bug@amsat.org> References: <20210925145118.1361230-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.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "open list:X86 HAXM CPUs" , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Colin Xu , Wenchao Wang Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Since there is no specific HAX handling for cpu_has_work() in cpu_thread_is_idle(), implement HAX has_work() handler as a simple 'return false' code. Signed-off-by: Philippe Mathieu-Daudé --- target/i386/hax/hax-accel-ops.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/target/i386/hax/hax-accel-ops.c b/target/i386/hax/hax-accel-ops.c index 136630e9b23..5407ba17eaf 100644 --- a/target/i386/hax/hax-accel-ops.c +++ b/target/i386/hax/hax-accel-ops.c @@ -74,6 +74,11 @@ static void hax_start_vcpu_thread(CPUState *cpu) #endif } +static bool hax_cpu_has_work(CPUState *cpu) +{ + return false; +} + static void hax_accel_ops_class_init(ObjectClass *oc, void *data) { AccelOpsClass *ops = ACCEL_OPS_CLASS(oc); @@ -85,6 +90,7 @@ static void hax_accel_ops_class_init(ObjectClass *oc, void *data) ops->synchronize_post_init = hax_cpu_synchronize_post_init; ops->synchronize_state = hax_cpu_synchronize_state; ops->synchronize_pre_loadvm = hax_cpu_synchronize_pre_loadvm; + ops->has_work = hax_cpu_has_work; } static const TypeInfo hax_accel_ops_type = { From patchwork Sat Sep 25 14:50: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: 1532743 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=MwgJW+yc; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HGsjG1SrTz9t1C for ; Sun, 26 Sep 2021 01:08:18 +1000 (AEST) Received: from localhost ([::1]:47684 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mU9Hj-0002NC-Ul for incoming@patchwork.ozlabs.org; Sat, 25 Sep 2021 11:08:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42252) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mU92E-00008I-O8 for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:52:14 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:35531) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mU92D-0005d2-8M for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:52:14 -0400 Received: by mail-wr1-x42e.google.com with SMTP id i23so36568526wrb.2 for ; Sat, 25 Sep 2021 07:52: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=tl5Shev5pC48yBd7v32jcWMdVT27BoRgDVkMAOt+xfs=; b=MwgJW+yc7cOusjtImkFrJ2gnNtX5tK9JtKttyALTt8MXdcgv5cew7qYCTAX+CotMag 1Ycbd5OTbO4hGdzinmZqax6dLZ0tgTssaA50jntUbIYxpr5feKiQ4DBCmsySC0HpguCh pMv3OyKKAgvWp/BFIjUBrNc8b1/DDuzXa8oxru0Vc8CmZMtONai9SfAzJv3PohPruCBX SlSnAex8v33qbEq5isQKK/SvwU9aQJeoI/lxQ4L8banpVypRjQkd8CE6dR/XSgP47Zzx anfUH0Y8gRs6BYkdl2k7RY4KosRaZrZE86aNrpJp/Rfq2MLXtlJFxLGfJs9ijIrQOVIh QMiw== 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=6P10YijR6w/p0N4Qg8NXsAPlSSt21T+JZ2HPRrDXAjCT99f0ES0ugWu/hv9linvM30 BAix3a7BkHmncxb/XCP4w2jZrlmXJ+lPw/zb9BWE5s39vSNtP1p7ncASk2RuThP1f8O6 riq/17YP495T1tN1Tgqy+am7ut9vZPx0AjL/MKgg6hiZEpOgz5C72GFmfEvFu6RTNbQt eelbDHQuk9wZQ1SuOYW5uSk+h60LWgzxR3KI7pCeInh+piXEJTFKvNFRFTXg1Ta1DIQz gzXNHrdgme+rWS19VWjlQQr3md/1h7ihBcHEyVkESbwNROi5bxY7t4PoijjiL/+a8m88 75jQ== X-Gm-Message-State: AOAM532yOJrGesZdpLYYN3RLspyZ6AuEoDB46PLJYbX6GFFpwtmeUc0z G6M5CGPk8ZtsDgJcj/D7kaWbNPIo5nM= X-Google-Smtp-Source: ABdhPJz++mxK0aLTrnAeo5+QdatxDLpyJgp9NJ9xzEfzSXd8t8Q7OcH6swtbzrZOARYj20kiuxwI2w== X-Received: by 2002:a1c:1c7:: with SMTP id 190mr7147880wmb.158.1632581531737; Sat, 25 Sep 2021 07:52: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 n26sm15815610wmi.43.2021.09.25.07.52.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Sep 2021 07:52:11 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v7 11/40] accel/nvmm: Implement AccelOpsClass::has_work() Date: Sat, 25 Sep 2021 16:50:49 +0200 Message-Id: <20210925145118.1361230-12-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210925145118.1361230-1-f4bug@amsat.org> References: <20210925145118.1361230-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.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Reinoud Zandijk , Kamil Rytarowski , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Since there is no specific NVMM handling for cpu_has_work() in cpu_thread_is_idle(), implement NVMM has_work() handler as a simple 'return false' code. Signed-off-by: Philippe Mathieu-Daudé --- 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 Sat Sep 25 14:50: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: 1532744 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=SaZX5+ax; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HGskT6NSFz9t1C for ; Sun, 26 Sep 2021 01:09:21 +1000 (AEST) Received: from localhost ([::1]:50478 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mU9Il-0004JS-Gd for incoming@patchwork.ozlabs.org; Sat, 25 Sep 2021 11:09:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42264) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mU92J-0000PM-Kq for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:52:19 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:36495) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mU92H-0005ho-VQ for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:52:19 -0400 Received: by mail-wr1-x42c.google.com with SMTP id g16so36516143wrb.3 for ; Sat, 25 Sep 2021 07:52: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=aLzuxgLTjxaUP4zi8sBdv28yd73Nm8j1vjkLU2rmh+g=; b=SaZX5+axWdoNAEqaVs6F8TD8N7AxIfwQMcVy+pxC7HPXxx/qpTmFNIS8cXDA5Pjkog QFSskgw9znaSWXpRbTcv75DFTxQm7oHnNvLyeuf8Xi1lf2hhlsGm9i/T2EW6XIB2pov+ 9eHNIR2LGkzGROfbBUquu/TePfTejG4R2FkG/Eujb++9lO9YQ2cHMOXtUxbWBBXHo04u khfjO6apBgrXhYn9uhYhRaLxaL88B/iJvV5wxP7j7wvepaOmqmSJIr+RR9VIwavB+jCA jxAtkacEp2dkZUd8OSKTISEe8b3v+wxGnTxzQ4d0M6lDuGXng4D7z/FWPGMssfqnIKjJ 4VOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=aLzuxgLTjxaUP4zi8sBdv28yd73Nm8j1vjkLU2rmh+g=; b=lPB/3D5lm8UXnnEvYE1zkNtFAwPt6j5dk1+fh4Vxjb8PMhmrwbZpmVXMbZD1yG6Blk uChKUXjlmEfpNHaVMrwED0CrEeg7hVx0C8FUOorgpAEBU6hXDuP3fjqZK7diBzVEZ8Eh Y7UmPLSCEyJ/C+scV8SdEM8uCkC2K/3td3WzLQY9FtWzFzb4wwsDtnBJRL7vrpAcazZT c4si3HgLJT++Y+KKv3ocNmYAuj7iVr0QeAyxy4LmrjGkH50eOwT1t7CawNGPH0KsCXHf Qg2V3xnJoq9/87SxKB4fZV2KH9xN/mOl7QufgaDPoRgsGwzjJ8SQsaiJt0wIujkQNCJK b9Rw== X-Gm-Message-State: AOAM530YNYmuYwHYFklE/ogphxzvR3GYol7zoOWuObt7SOzHRsIJo5ct Uvtz2XLqM/0EOSzWSn60lLg/nIjWplI= X-Google-Smtp-Source: ABdhPJzYPpUggr8HAA3tolud8uCGmSfmGWRHb6x82DTDa6g/c+WwUa8Abhdu1ikeiMFhIIjnDV6leA== X-Received: by 2002:a05:600c:4fd2:: with SMTP id o18mr7448821wmq.126.1632581536473; Sat, 25 Sep 2021 07:52: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 c14sm11255196wrd.50.2021.09.25.07.52.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Sep 2021 07:52:15 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v7 12/40] accel/qtest: Implement AccelOpsClass::has_work() Date: Sat, 25 Sep 2021 16:50:50 +0200 Message-Id: <20210925145118.1361230-13-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210925145118.1361230-1-f4bug@amsat.org> References: <20210925145118.1361230-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.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Paolo Bonzini , Thomas Huth , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Implement QTest has_work() handler in AccelOpsClass. Since no CPU are available under QTest accelerator, this function is not reachable. Signed-off-by: Philippe Mathieu-Daudé --- accel/qtest/qtest.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/accel/qtest/qtest.c b/accel/qtest/qtest.c index 7e6b8110d52..903c39ec1bf 100644 --- a/accel/qtest/qtest.c +++ b/accel/qtest/qtest.c @@ -47,12 +47,18 @@ static const TypeInfo qtest_accel_type = { }; module_obj(TYPE_QTEST_ACCEL); +static bool qtest_cpu_has_work(CPUState *cpu) +{ + g_assert_not_reached(); +} + static void qtest_accel_ops_class_init(ObjectClass *oc, void *data) { AccelOpsClass *ops = ACCEL_OPS_CLASS(oc); ops->create_vcpu_thread = dummy_start_vcpu_thread; ops->get_virtual_clock = qtest_get_virtual_clock; + ops->has_work = qtest_cpu_has_work; }; static const TypeInfo qtest_accel_ops_type = { From patchwork Sat Sep 25 14:50: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: 1532747 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=j68C4eLX; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HGsnK6vw7z9t1C for ; Sun, 26 Sep 2021 01:11:49 +1000 (AEST) Received: from localhost ([::1]:55880 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mU9L9-00086g-Lk for incoming@patchwork.ozlabs.org; Sat, 25 Sep 2021 11:11:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42276) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mU92O-0000Z9-8Y for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:52:24 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:39600) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mU92M-0005lt-OI for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:52:24 -0400 Received: by mail-wr1-x42f.google.com with SMTP id r23so11140850wra.6 for ; Sat, 25 Sep 2021 07:52: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=0BYMbs0TcChkwFeeNZ8rPK4jjNXuJ+c6QHnkutAyXs4=; b=j68C4eLX1ptTj7zfQFd+u5oWMMNmJjuwubIgPVg3jgvU+Jx7iFlxiSIckGd+XilbqJ dwhBoiyDb6TTRq6TwSG+UHVEgsFG91LomPTCdZoL7gFGRVadsFB3dixEDW8vWZ4KdIFr QCrQt1kAUJCCnp3lWxEQ/bAjmbLb7jdDbGbT6lLd4BIKlu4t/ugkbpB8AGxXuQu4KAPy HW+e8GsKlaaF/mm3FUd0mByab7IKFUc1MNIn0KXnOZlYWlMPoxtsDOFSn4emvdObpVkp xXF+pw71zj8cEagjeJA3mTNgn28/dBmmXUr/CmarcEKEjxVnbTss2BVlamPRTgHkKUSR dbvw== 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=ZHgbKCqyHvVTzZ4p9I5lq6ZY5JNX+8vxUTXuPHeHVJ1ZGy8G79TrpCvsAsoU99zqRv Q+8MQK8vTbKAq2qfkSjGs3MsYfk+zMPMuTFm75OcfLaO8OTrhn7tbJu/CO/36m/SwKNv EBUIFJekInmr+smA5rwFy3f6RBkCU7K5rIGYYSzkA7A0Ccu8aql73GkFO6m2msK0CvEJ kFvWIA9+pOES+KaV8fWO90DPLxcSL72/x9Lt5MJCI9G2MwCaJ2/nK9hVnAPaETe6d3/c cckb0v+4XiPRvGomN6OJkGr4pw5PxECrt2ZaS0ItymtPjzDp/fzFHqjMRHXBBpb3+1/s pteA== X-Gm-Message-State: AOAM5306H49CSHmcBi51y+5x1WEI0vcQVINg8SGY41sC4t8gPRT6lZyW YT0QUZ+ltS7QL+XdrnR3jS9u8MacB9k= X-Google-Smtp-Source: ABdhPJxKyaVifthI1g+m2oBAHRf5qkbeZ8vgKdV+UdodAIvdER+BrwwztYMxteSYTLcVkkwrUK/dPw== X-Received: by 2002:a5d:6450:: with SMTP id d16mr16980503wrw.40.1632581541369; Sat, 25 Sep 2021 07:52: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 q79sm538855wme.44.2021.09.25.07.52.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Sep 2021 07:52:20 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v7 13/40] accel/tcg: Implement AccelOpsClass::has_work() Date: Sat, 25 Sep 2021 16:50:51 +0200 Message-Id: <20210925145118.1361230-14-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210925145118.1361230-1-f4bug@amsat.org> References: <20210925145118.1361230-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.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Eduardo Habkost Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" All accelerators but TCG implement their AccelOpsClass::has_work() handler, meaning all the remaining CPUClass::has_work() ones are only reachable from TCG accelerator; and these has_work() handlers belong to TCGCPUOps. We will gradually move each target CPUClass::has_work() to TCGCPUOps in the following commits. For now, move the CPUClass::has_work() call to tcg_cpu_has_work(), the TCG AccelOpsClass::has_work() implementation. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 2 +- accel/tcg/tcg-accel-ops.c | 11 +++++++++++ softmmu/cpus.c | 5 ----- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index e2dd171a13f..114eb3b9b2c 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -89,7 +89,7 @@ struct SysemuCPUOps; * instantiatable CPU type. * @parse_features: Callback to parse command line arguments. * @reset_dump_flags: #CPUDumpFlags to use for reset logging. - * @has_work: Callback for checking if there is work to do. + * @has_work: Callback for checking if there is work to do. Only used by TCG. * @memory_rw_debug: Callback for GDB memory access. * @dump_state: Callback for dumping state. * @get_arch_id: Callback for getting architecture-dependent CPU ID. diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c index 1a8e8390bd6..ebaacff1842 100644 --- a/accel/tcg/tcg-accel-ops.c +++ b/accel/tcg/tcg-accel-ops.c @@ -73,6 +73,16 @@ int tcg_cpus_exec(CPUState *cpu) return ret; } +static bool tcg_cpu_has_work(CPUState *cpu) +{ + CPUClass *cc = CPU_GET_CLASS(cpu); + + if (cc->has_work) { + return cc->has_work(cpu); + } + return false; +} + /* mask must never be zero, except for A20 change call */ void tcg_handle_interrupt(CPUState *cpu, int mask) { @@ -108,6 +118,7 @@ static void tcg_accel_ops_init(AccelOpsClass *ops) ops->kick_vcpu_thread = rr_kick_vcpu_thread; ops->handle_interrupt = tcg_handle_interrupt; } + ops->has_work = tcg_cpu_has_work; } static void tcg_accel_ops_class_init(ObjectClass *oc, void *data) diff --git a/softmmu/cpus.c b/softmmu/cpus.c index 5ffa02f9cef..bb16a25bcef 100644 --- a/softmmu/cpus.c +++ b/softmmu/cpus.c @@ -251,11 +251,6 @@ void cpu_interrupt(CPUState *cpu, int mask) bool cpu_has_work(CPUState *cpu) { - CPUClass *cc = CPU_GET_CLASS(cpu); - - if (cc->has_work && cc->has_work(cpu)) { - return true; - } if (cpus_accel->has_work && cpus_accel->has_work(cpu)) { return true; } From patchwork Sat Sep 25 14:50: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: 1532733 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=DE4w4ld7; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HGsW10zcqz9sW8 for ; Sun, 26 Sep 2021 00:59:25 +1000 (AEST) Received: from localhost ([::1]:52008 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mU998-0002Sz-UG for incoming@patchwork.ozlabs.org; Sat, 25 Sep 2021 10:59:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42298) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mU92T-0000fM-3p for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:52:29 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:40538) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mU92R-0005pN-NT for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:52:28 -0400 Received: by mail-wr1-x436.google.com with SMTP id t28so23084737wra.7 for ; Sat, 25 Sep 2021 07:52:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cb3odcmCuQWoFCXt4iYOTDt5qWlPQnfLAh89ZyyxruA=; b=DE4w4ld7rRT7nzqPQAZUdpnJI44nhsZM71vrw8kOMxoZ8cl5cWTG7GT3dCZTJQI2Rc uTNuoWGJZ3rXMzIl8yN8R4ECnf7RjByaiQYYsgKXzCkdZ1IyO8sq5++hWSFJl2LmzSx5 oilHTxhb2G4xR2mZ/S+WIZQ1bSSwDMQ7yXdvdfkcyh3caUR8CQDGTzwiFNPlkHEr1YUt D2aUy3mCuVUAG9G6Ui02jmyeq8nqWmINtM29b33AgmjZz7kEEPAe+2wC3C0nmGDnaFvM uIWVu1rQ8A20JNKHZceqigRu++aqgfMAe5nlo8sl7upfZdYpCqHevl98gm+drF1dDk2U tE+w== 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=nC6vl/C9aH8owA7dRskin9LMzmJ6ya/Z3ePpTJeMlzjd1biu+jMPX6QWWq6qVGXmnP vcD3MlV3gh5giBjczzTgrD0DdXC+P5I5c+C+9ZolF2XEOsh1PLU0Fz52BLO1lbjKPouD f26hWdKUxLriOWlC50jH9TqSsrGjHjp43TdijRO5e77BXU1O9u3ANer7JppsU91USSYx JnBq8273ARC/QK59BpXcvWqJp1YGaA/O92tvBeB2OKHrTlAksfgftNgxQA2Rkx4w0gPq ix/YOtaI7gckXmckeH8sDQNP0rPxFIQk+DLQ9YrV29pgU+WJgV34W2J5kyqQBZx1snn+ VR9w== X-Gm-Message-State: AOAM5339OCDdOU5bswynHqe+9UP7eV+v+31vv5AHqb/euvP/H88MVrEq 9hQlfQ1dqX5+D1cm5Zd80B6HIGOGLEQ= X-Google-Smtp-Source: ABdhPJy/iQ6OqFZmRhbqPntWlhkYLyd9pw0x7+xi5UREpf7hFJFp9o6UHhlQgrYBYEYq1EkI/VjBhQ== X-Received: by 2002:a5d:59ae:: with SMTP id p14mr17862480wrr.278.1632581546133; Sat, 25 Sep 2021 07:52:26 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id y9sm18217307wmj.36.2021.09.25.07.52.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Sep 2021 07:52:25 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v7 14/40] accel: Simplify cpu_has_work() Date: Sat, 25 Sep 2021 16:50:52 +0200 Message-Id: <20210925145118.1361230-15-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210925145118.1361230-1-f4bug@amsat.org> References: <20210925145118.1361230-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.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Now that all accelerators implement a has_work() handler, we can simplify cpu_has_work() by removing the non-NULL handler check. Add an assertion in cpus_register_accel() for future accelerators. Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- softmmu/cpus.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/softmmu/cpus.c b/softmmu/cpus.c index bb16a25bcef..bbb83d5982a 100644 --- a/softmmu/cpus.c +++ b/softmmu/cpus.c @@ -251,10 +251,7 @@ void cpu_interrupt(CPUState *cpu, int mask) bool cpu_has_work(CPUState *cpu) { - if (cpus_accel->has_work && cpus_accel->has_work(cpu)) { - return true; - } - return false; + return cpus_accel->has_work(cpu); } static int do_vm_stop(RunState state, bool send_stop) @@ -613,6 +610,7 @@ void cpus_register_accel(const AccelOpsClass *ops) /* Mandatory non-NULL handlers */ assert(ops->create_vcpu_thread != NULL); + assert(ops->has_work != NULL); cpus_accel = ops; } From patchwork Sat Sep 25 14:50: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: 1532749 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=pro94nGa; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HGsrX6PjRz9t1C for ; Sun, 26 Sep 2021 01:14:36 +1000 (AEST) Received: from localhost ([::1]:35654 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mU9Nq-0005Gj-ND for incoming@patchwork.ozlabs.org; Sat, 25 Sep 2021 11:14:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42324) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mU92Y-0000kO-8v for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:52:34 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:41498) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mU92W-0005t5-4w for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:52:34 -0400 Received: by mail-wr1-x42c.google.com with SMTP id w29so36387467wra.8 for ; Sat, 25 Sep 2021 07:52: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=zpMC5xjCsBbH9RpT6gPVCF+edgca48PVAQbhvKWBiG4=; b=pro94nGaKjAJepwvuSNNOkQ5pBuLVB9iPlyaiginNHAUm6f+4oCWrtpNSa86Qs6DXL 6xSZW5+MxFw0istcKTqb3+cG/0il7na3bU8fvLvRMW7kI4sGQpggaAsUE6QcXD7yP2Ar zS7L0raKHyIm8KBz6QzRI6rTwQQOHcqoFCF7RiTZg1qf8ZM5paDtp7O1W855Qd3+ubp7 zwv2ricM1JWAtfN3X1CoSO5CR84/3QsIUdZCZfN6QbNE2VJ4HaBF7DAK5Q5Ez9o0yK7Z TMRVTv3XpB3dknzLvGCmxKlTL+k/tKvEKk6+ALA5N7BzSZZRDsgOIVuVfysr06XNe3v9 Lgww== 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=v3mH5FoThy/Bq738Z58jAm4qJCRRVHdo4/+Yku/pC1/DgbMjh64k6wRrewnewRpnI9 XJthHpaMCMsukDmRfuHL/FLk47eJEodJAoeDY56uRrY59+JffvO0edUFH3qIV5ribkwo RUH6hVQ5BMCodKeF4bnL2IoNfWqhiWMma4LsiAmQ2QbJ22qnfJn0151YH++dhYDwzht4 JXqsypK5zTtH+OMdZccSFfA7YtN1AbNYC6nqiZQ41k5PlcMzRCyVAgzqCget5PXFPZWL 1z/0uYuTZWqSeEs6v8waQDHeh2ZBX7sHUXhJawj0VDfYO38kONB6KnL+4y7vSPqxEsYS tf9Q== X-Gm-Message-State: AOAM531hipbzrVdIbrS63C8B1mktLhdv1AOsp/TdKk67tNVtAcFk8mrl I6U6cGZsRxIHtiRftJ1MddGRKn2VcJ0= X-Google-Smtp-Source: ABdhPJzgMSfnxXTcl9fy1mYuun+HkpZUdYaw/FGUCNXrtjVJjuXvkvfPuquQ52GiOu8b/0xZHcs6tA== X-Received: by 2002:a05:600c:350f:: with SMTP id h15mr7347895wmq.144.1632581550685; Sat, 25 Sep 2021 07:52: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 s2sm10977263wrn.77.2021.09.25.07.52.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Sep 2021 07:52:30 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v7 15/40] accel/tcg: Introduce TCGCPUOps::has_work() Date: Sat, 25 Sep 2021 16:50:53 +0200 Message-Id: <20210925145118.1361230-16-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210925145118.1361230-1-f4bug@amsat.org> References: <20210925145118.1361230-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.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Introduce a target-specific has_work() handler for TCG. Eventually call it from tcg_cpu_has_work(), our AccelOpsClass::has_work() handler. Inspired-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/tcg-cpu-ops.h | 4 ++++ accel/tcg/tcg-accel-ops.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/include/hw/core/tcg-cpu-ops.h b/include/hw/core/tcg-cpu-ops.h index 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 Sat Sep 25 14:50: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: 1532760 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=m8uSzJJW; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HGswN56YKz9t1C for ; Sun, 26 Sep 2021 01:17:56 +1000 (AEST) Received: from localhost ([::1]:43970 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mU9R4-0002ZL-Dx for incoming@patchwork.ozlabs.org; Sat, 25 Sep 2021 11:17:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42340) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mU92c-0000uz-RH; Sat, 25 Sep 2021 10:52:38 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:36503) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mU92b-0005wf-AG; Sat, 25 Sep 2021 10:52:38 -0400 Received: by mail-wr1-x430.google.com with SMTP id g16so36517851wrb.3; Sat, 25 Sep 2021 07:52:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UE09P3+95R7azQiB3uAxKhFAUsJxXecPBFCz3ofDdJY=; b=m8uSzJJW5RbcD9v9b60DsxXyfZ8QYa5zKCrKDSbEKmRpjpjCykjDR1iOwS025VCpI5 dvKNxMPoyGFGX1l6OQkuho7vDjhsD8N/+605Br3KKhh7JVh4iYRvAlmYhvl8aXx0+rEq KqArJgcaa2rUbO0jIM1Re+vP0yW7aEr7gRn3nQJ26UwV/slNVSVT+U+PmahlhvEnOAPy zXeozL9OsjqENrKfiX1rozhV32LX/ehCc2SJniHaqQQ0XeHk75F9qKhRQo63smQxQihB 8AK2qb53yI6Qn37olIzRB+J+RiDG52jGE/2XLAhPXfXL+fdoL85OygikxHVjDmgcliE6 MnQw== 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=7QROgOGMOgT/T7HKwg+X0pGHi5M+rHJRpvxniFrXQHx7bmfAT+Vt3dLsqLPgf4XywE DQf7crkp3lYPEzVnYAO4mpktq493/g1cbKCE7if0aFQgTJBB1hcXX5qK1ofEJ9ECWuqM zV0XLaFSvYs7vjktH/cdl3rZCQaD5EN0P2TE+bb/Kk9IbWdttB7s3d+pu7YRjCawKJMy hvZrOsP1fgXMz7CG1ksFmbGpfERaaPEMxuxC7sQXDRztccI8bX8ertbOgTX6WUOq9fGQ N97qE1FOFYJ4UMshiQbqUd287orYmK43tlPXdAr1FVsjofSgv6CyLsFQgORu77Y0JHfw tBiA== X-Gm-Message-State: AOAM531ri6XwnYlhODsvdeIsYUY+LOweYcJ3AkKh9jLaQYE3Mhzj364z EslMyGT4xvHEzag0ZfJFzzSz4S12Pi0= X-Google-Smtp-Source: ABdhPJyOLg57AmHUcQNdi7KECrCqsQlmtqA6jqOtdUamLcrKxYhFA3ap/TRSZNYmaVF75G8uOcY0FA== X-Received: by 2002:a5d:4d02:: with SMTP id z2mr18010911wrt.8.1632581555396; Sat, 25 Sep 2021 07:52:35 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id i2sm11055407wrq.78.2021.09.25.07.52.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Sep 2021 07:52:34 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v7 16/40] target/arm: Explicit v7M cores use arm_cpu_has_work as CPUClass:has_work Date: Sat, 25 Sep 2021 16:50:54 +0200 Message-Id: <20210925145118.1361230-17-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210925145118.1361230-1-f4bug@amsat.org> References: <20210925145118.1361230-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x430.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , "open list:ARM TCG CPUs" , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" ARM v7M cores inherit TYPE_ARM_CPU, so TYPE_ARM_CPU's class_init runs first and sets up most of the class fields, setting in particular the has_work handler to the generic arm_cpu_has_work(). Thus M-profile and A-profile share the same arm_cpu_has_work() function. Some of the checks the code there does are perhaps unnecessary for M-profile, but they're harmless. Since we want to move the has_work handler from CPUClass to TCGCPUOps, the next commit will be more explicit if we already register this handler in arm_v7m_class_init(). Since arm_cpu_has_work() is static to target/arm/cpu.c, we have to declare it in "internals.h" to be able to use it in target/arm/cpu_tcg.c. Suggested-by: Peter Maydell Signed-off-by: Philippe Mathieu-Daudé --- target/arm/internals.h | 2 ++ target/arm/cpu.c | 2 +- target/arm/cpu_tcg.c | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/target/arm/internals.h b/target/arm/internals.h index 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 Sat Sep 25 14:50: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: 1532764 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=eRQPfiwW; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HGt0C2Flkz9t8j for ; Sun, 26 Sep 2021 01:21:15 +1000 (AEST) Received: from localhost ([::1]:52726 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mU9UH-0008Tp-2V for incoming@patchwork.ozlabs.org; Sat, 25 Sep 2021 11:21:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42352) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mU92h-00017I-Lx; Sat, 25 Sep 2021 10:52:45 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:41504) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mU92g-00061N-5T; Sat, 25 Sep 2021 10:52:43 -0400 Received: by mail-wr1-x430.google.com with SMTP id w29so36388250wra.8; Sat, 25 Sep 2021 07:52:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=r6ZxEtcTtXMZRq7+nFZf7Av8uL6lok+sSg0IbMh7PU4=; b=eRQPfiwWBh8RHz/e2lyK8HgBHPIhG4W7iyEyn99sxIUf3zjaVHQWh12xeOHwYv36d3 RSSBrR2plnhJOJ9Zhzfan4tmSoIB2r5E1GXOEiAmbzGkjKcZILjxPG+lW5Zilns/hUWd W4JuO6KRmNqMqPc7R3zegPEMNXXWuqP0FZNWo9VNJiC8iSRJOMd4sxhLdU7ixcgOBVU6 UqZY5igpdYzrFTK727RTisOiisK6bBPKBfy2NGxX/nOIUa92636UY868tnoaXztnJHLa fALFfGs/bTDDgXg3g8k7/BfEA6XXtE2TWTvNHttNBIrs6HnfYV3Yp7HHTh5/XQawtlDf ln/w== 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=E88TLhuibt+qjbI5Szze/+bdjZHAa0+jnNDLRrHG+1btir8N231xF24UFBX4y5QJJl Muzm6j4woHKaBDOMJ/KnFjhY/ldzjleVy+f515n28jZYnt5HZ8DMxjw7slCWronlDV2T oDvIi2h8FhhSczj9gN5JFJOb6OcC3KfIhUQlMk55ZuaY2us+GLhbxAqVG5HwLzE0hKKF 08PsKKXaWJUU0s1rtzwNGJdu8COk9YWDTSWCF/IknDlywEUPosZBnx/1ZGPrBSqY5LF0 x0bhuiQ+P+z2E+6M7bNYvJ/jshMRlP+vfNPs6gBpHaVNyCAFktEXeraAp+z2h6Mh49GU LGIw== X-Gm-Message-State: AOAM530yRz1l0uX7sczEX6TE040HBJ9LwCK4y1vXSSEq+amE+XNqQv1F 6kWfw2fxeznqOtmMxUu/N93NdBoCL/0= X-Google-Smtp-Source: ABdhPJx1nS+ppyymlTbINjfjJVfbUMM8bAm7q2FIDb6yL5V/SbVPkIyMe4fEikpqd51MtBmMx77oIA== X-Received: by 2002:a7b:c442:: with SMTP id l2mr7593370wmi.131.1632581560483; Sat, 25 Sep 2021 07:52:40 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id n14sm9892246wmc.38.2021.09.25.07.52.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Sep 2021 07:52:40 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v7 17/40] target/arm: Restrict has_work() handler to sysemu and TCG Date: Sat, 25 Sep 2021 16:50:55 +0200 Message-Id: <20210925145118.1361230-18-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210925145118.1361230-1-f4bug@amsat.org> References: <20210925145118.1361230-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x430.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , "open list:ARM TCG CPUs" , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Restrict arm_cpu_has_work() and has_work() handler to TCG sysemu. Signed-off-by: Philippe Mathieu-Daudé --- target/arm/internals.h | 4 +++- target/arm/cpu.c | 7 +++++-- target/arm/cpu_tcg.c | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/target/arm/internals.h b/target/arm/internals.h index 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 Sat Sep 25 14:50: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: 1532726 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=Cksq2yuC; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HGsPb6Shnz9t4b for ; Sun, 26 Sep 2021 00:54:43 +1000 (AEST) Received: from localhost ([::1]:40564 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mU94b-00036d-Mn for incoming@patchwork.ozlabs.org; Sat, 25 Sep 2021 10:54:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42364) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mU92m-00019v-9S for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:52:49 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:39599) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mU92k-00064W-RT for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:52:48 -0400 Received: by mail-wr1-x429.google.com with SMTP id r23so11143042wra.6 for ; Sat, 25 Sep 2021 07:52:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bWsdPZ7x9Zv9ulmzVLDInqOVNAhrwd+vJJnOs6jG4pU=; b=Cksq2yuCp6td/OuLyG8ccivNvp1+E6LGgQDMV3lBxOCaAt4FiO8W/XTKzPZF2RHCIL kKACF6W0ZBRZ82yi6vgoWIgbn2nsQucr/Gp9wHgBbHA++KvqT+1WdaMctbl0syEkoA/K GNQWvGOGAZtZiC1E38gA0StwFfTga/mKHQGqtuobXN17ICje1mNw/xt8eTq3FphG4I6z IrigtgQ8uKy4koexICQwVktxIoSB5q2l2xUUBK8dtSw6YT2xOBMghKum3h7PtrjvisXe oLjBNL5py6MlAtezv1xzSW+Nb+xx6uVq83absR6Y+jUiQ6RLyvxG7/zEIbxbxnZ2GVXp 5k7Q== 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=ocUKx+sRX8lXm5+OKB7cZuSheFQDBTFueFFA/nhfOXzhSa/j5Xl7FkrcDsh+jQ6Z87 GWtq/TrLtLAIpDrPnmW2bN5gr3Ekt8CWb4uum/1iIXZDry9QdfGNqRCNyGlu+ndycztE JS/V4IekZPk4ns8kK9rMqYc8xAQMOnRJMmdGk7pq+J89aZNfqIKVRPDOcfWJjfYAGQ67 n006SsWaeteBSuTR1iWbzjLMIMW1/Yqpgo429LNpEenQEXP6qDhJeLfbhf9a4fyiB3Wx /bmTD4oMNAjzAVsTimRi3SaKIGNvqFuckZVCTIhRxK7j9JA76Kwfl9T7CxRCBeQk+CL5 cGWw== X-Gm-Message-State: AOAM530WX5KuOlVtLd7C16mP/4CgqDAULXVNFbzcXEkpB5wDWrepa2rx DmB7N5fiGoWRbgSyBbSneD200qB42bo= X-Google-Smtp-Source: ABdhPJz9lINzrUuspP9ImzmXh+Qif2eKXDfMUELYDmGVulvpCpqzY/hh9drkQpcYHEER3qwNtueWvQ== X-Received: by 2002:adf:ce89:: with SMTP id r9mr17367551wrn.238.1632581565365; Sat, 25 Sep 2021 07:52:45 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id 135sm16635464wma.32.2021.09.25.07.52.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Sep 2021 07:52:44 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v7 18/40] target/alpha: Restrict has_work() handler to sysemu Date: Sat, 25 Sep 2021 16:50:56 +0200 Message-Id: <20210925145118.1361230-19-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210925145118.1361230-1-f4bug@amsat.org> References: <20210925145118.1361230-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.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, 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 Sat Sep 25 14:50: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: 1532767 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=K7jLxmvq; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HGt2Y51v1z9t1C for ; Sun, 26 Sep 2021 01:23:17 +1000 (AEST) Received: from localhost ([::1]:33114 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mU9WF-0005pQ-6G for incoming@patchwork.ozlabs.org; Sat, 25 Sep 2021 11:23:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42380) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mU92r-0001CK-7G for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:52:54 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:37674) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mU92p-00068T-Hx for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:52:52 -0400 Received: by mail-wr1-x434.google.com with SMTP id t8so36540414wrq.4 for ; Sat, 25 Sep 2021 07:52:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=esdj4T8w87yQQx5q0gedYQmjf/1Q5yjrjrc7iKp6hio=; b=K7jLxmvqCN/iAR6NLt94tpMsCjtkZvoHmGq9pcXL4GqwBoQHtBOQI1FwtJbG30OegV 1xinWCbteDUwK8SgPK7No59Q6v2LuHugRmPs+Zm6y406qZMUS2MSsTNXaWCGB+Sebp7U Oo5+iZg8FIEuCHkKugLO51HwK5n+YjuKEKrT/anJL/7HIMtJTVXtT3h7H4qnl6Z9yYxc TtTPVEhSO1bleiZ3DVKDoXUJkmtKh6kYgn6GonNKy2TGUskEeCf6aJjWEGv7UyUPJmfB AAlH9n1cMXrDUd+3WEQFQaVpBjTycU7WnGxHbpolz82Kl2hlGBj9TdG/ihhbehMgY84b yCZw== 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=UNBazRdDLvveGPMBt7iwVou02Hj7BYvDxEyRhrEs/Vup5WYr380jo+DzBEYdK+mUec stm8RVMs/mkikkSPZyzTJpWfaXVfrlpMHMEkK6PFaFMxecexNrhP01xu+HlahzH/NC+Y LNu/Fua5gs1p+ALlzotpyzgbTYm/p/yUMnDCaz3uQht2Z2Fb6Gjwh+6ICNqcCAfu4qQ2 T0mQGGYSXo8aJXsfljqi4qaddunzwupxUNPQZdFxa2l2IUr+tuIkgU2n2qIkzeIjHC8L MKirnPS3j+nUTQGh6eX4XBEa8duk+UBBaSj3+ex9U7n9nk2J2Towjr0aCdUROXqnMaLv XiZw== X-Gm-Message-State: AOAM530KNnD17qTtFkY1HNjL4pDAgPe72H/3rB7qVUWMNNXLZz40FuKy kFIOYZPuU5LegVamAo0yQm4Kxt6tfMc= X-Google-Smtp-Source: ABdhPJy6rXV6+Wx3AZinkQiHkZ25/DaFQLwtVD5S/9zSsTwHY41sBHZUnMmz6j93cw90jyigXPWNeQ== X-Received: by 2002:a5d:4d0d:: with SMTP id z13mr17721352wrt.267.1632581570054; Sat, 25 Sep 2021 07:52:50 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id u25sm13134530wmm.5.2021.09.25.07.52.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Sep 2021 07:52:49 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v7 19/40] target/avr: Restrict has_work() handler to sysemu Date: Sat, 25 Sep 2021 16:50:57 +0200 Message-Id: <20210925145118.1361230-20-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210925145118.1361230-1-f4bug@amsat.org> References: <20210925145118.1361230-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.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Rolnik , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Restrict has_work() to sysemu. Reviewed-by: Richard Henderson 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 Sat Sep 25 14:50: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: 1532730 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=nRJyglE7; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HGsTF1ystz9sW8 for ; Sun, 26 Sep 2021 00:57:53 +1000 (AEST) Received: from localhost ([::1]:49128 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mU97e-0000Vr-Vo for incoming@patchwork.ozlabs.org; Sat, 25 Sep 2021 10:57:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42420) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mU92v-0001Dg-D8 for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:52:58 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:40539) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mU92t-0006Bq-Ug for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:52:57 -0400 Received: by mail-wr1-x431.google.com with SMTP id t28so23087030wra.7 for ; Sat, 25 Sep 2021 07:52:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BtkZfC3Jqv9BX8O65q6cSfCgutSi0wjc1sQe8Yf13mk=; b=nRJyglE7MxPyYLAE9RgIeaNBzNAySVw9An1ehiscKltjFimxzjvIx+FFF4j4mRLgDG A/EYpf3MVbx1P8DjNXaErJMVFnffuW4uhaM0ZRjnAxHHDLNQAkGsuMImc6yxSEtl6JKC vZ0QDWIe9q81gVMKkSYvKy9dF5c1eEeDYefmya6XakcmPTuP2YTwXj++xtAloZsqUV0t ADMFUgiiMHrOq74dIGz+pqpfCFO5BdT97hL5n0OuVLHaMQ4mi2ed0Wi3uhC/xYhQHacY 6jCGYN4g8Jro9CA5qWIJnCi0xvVLpYzXsvR1/YmrfK5smNN/10SgbYQFfCIYcIR+BGFp 5sEQ== 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=KD4DMct9Bf0ikeFnY0rvDTAWBUTFowdwBjC+vFZVfw+IHvr4P3dqXEjtXSBBKvvYOh NlzXNWUZrMw7wSFC9mzkCSExImP4xUkRrEzmxsl/5+4BHnThAJtNAK0uDsOOhugzSQOM taReg44G+C/DKMDX0Ceo/dtHT95o04rlvR1zsVo9vgQxPaxP0/bozzra+Ltqp5nUir2b IS6D7gm+p2yPAYOHfCodVZR3rVGPv0N7157ob+s7EAIxwDJdJVRcsp8Cat+JS2BrvYU8 G51+1OTK1vyBNHxsfAwdiFnlJTru+0j3xRqAmC3FBtHgd784rw6RTOlv8ttQhqjNTvf9 +0eQ== X-Gm-Message-State: AOAM531WcBRcp9kdfJCPk8qjTOEXkOnhwDvmltEGmavPQlxdk608rDz0 JHfXizKla/IHXolLHLBT8+qxg3d9sTA= X-Google-Smtp-Source: ABdhPJyzcavtFgwBCx0p9CkoHw+pX2ipfNLSkjlq82zfonYFb9v0G6WcKIfYP/RNnsAXL+xKqjUeaw== X-Received: by 2002:a5d:6590:: with SMTP id q16mr17959271wru.52.1632581574600; Sat, 25 Sep 2021 07:52:54 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id u14sm9934967wml.24.2021.09.25.07.52.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Sep 2021 07:52:54 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v7 20/40] target/cris: Restrict has_work() handler to sysemu Date: Sat, 25 Sep 2021 16:50:58 +0200 Message-Id: <20210925145118.1361230-21-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210925145118.1361230-1-f4bug@amsat.org> References: <20210925145118.1361230-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.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Edgar E. Iglesias" , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Restrict has_work() to sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/cris/cpu.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/target/cris/cpu.c b/target/cris/cpu.c index c2e7483f5bd..b2761f8b110 100644 --- a/target/cris/cpu.c +++ b/target/cris/cpu.c @@ -35,10 +35,12 @@ static void cris_cpu_set_pc(CPUState *cs, vaddr value) cpu->env.pc = value; } +#if !defined(CONFIG_USER_ONLY) static bool cris_cpu_has_work(CPUState *cs) { return cs->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_NMI); } +#endif /* !CONFIG_USER_ONLY */ static void cris_cpu_reset(DeviceState *dev) { @@ -208,6 +210,7 @@ static const struct TCGCPUOps crisv10_tcg_ops = { .tlb_fill = cris_cpu_tlb_fill, #ifndef CONFIG_USER_ONLY + .has_work = cris_cpu_has_work, .cpu_exec_interrupt = cris_cpu_exec_interrupt, .do_interrupt = crisv10_cpu_do_interrupt, #endif /* !CONFIG_USER_ONLY */ @@ -218,6 +221,7 @@ static const struct TCGCPUOps crisv32_tcg_ops = { .tlb_fill = cris_cpu_tlb_fill, #ifndef CONFIG_USER_ONLY + .has_work = cris_cpu_has_work, .cpu_exec_interrupt = cris_cpu_exec_interrupt, .do_interrupt = cris_cpu_do_interrupt, #endif /* !CONFIG_USER_ONLY */ @@ -294,7 +298,6 @@ static void cris_cpu_class_init(ObjectClass *oc, void *data) device_class_set_parent_reset(dc, cris_cpu_reset, &ccc->parent_reset); cc->class_by_name = cris_cpu_class_by_name; - cc->has_work = cris_cpu_has_work; cc->dump_state = cris_cpu_dump_state; cc->set_pc = cris_cpu_set_pc; cc->gdb_read_register = cris_cpu_gdb_read_register; From patchwork Sat Sep 25 14:50: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: 1532734 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=Xv+ym7tF; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HGsZZ3yrRz9sW8 for ; Sun, 26 Sep 2021 01:02:28 +1000 (AEST) Received: from localhost ([::1]:57826 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mU9C5-0006Ps-FP for incoming@patchwork.ozlabs.org; Sat, 25 Sep 2021 11:02:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42458) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mU930-0001Mu-Jh for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:53:02 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:39610) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mU92z-0006GL-0m for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:53:02 -0400 Received: by mail-wr1-x432.google.com with SMTP id r23so11144204wra.6 for ; Sat, 25 Sep 2021 07:53:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0ZgxjKAzE6UdfxxfzQvSE8AG7aSTa5UtgwXRgJWAVhA=; b=Xv+ym7tFfUBtgVA+01md7SX15qw7/TVE7TjaHK21gsp2KKRGntBjyGOLGxPGPkrdK2 uxme/6nVrD8Sp9NGxnGmC6dNVSl3ov35WUpHIwrE4QTUKbF1SID3UCNgRwrslwW2yKAH XNt5yXhaEdepuGTJQp6o8JpbTtzj+p3PU7TTRHTz0b5r4qsGVRyrW4gj1yq9C1wgvEMS YdCAoVbBM9kSAd9hEcQ4YwomxHhs7obAFsVIn5MpSFQLsfL6lv0xVEVWe5DycAM7bpfZ d58T0KK8RtEiIQ8uGmbF7Pzo0UoH/DjlTCb5+sKkeEfgrOO6uMuvaeQeCs8Pth+ucaJi 0H4w== 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=4UNKt828ynSi+F5W/g6gFpHqOfWmwm2fGL6xd4tlKFLwi2465UBNMedcdjcP03aG+Y Fkr87VZszv0qCzliHzlXJdNCnV201+ltf9+ZTHxnXbfgT2Kdakp8Cb/ym+/uP+OBdZYU rFhppUbN02RVUnjqlnIsj1J2u9HviXxqp/paOKZjgytpwpMEQoAbFdbSivYSjUYgrWK/ lVPFAgGe8kGX6uGh+6dUx7VtLycC+TfTgAXN0J/+uaj+LIIY08iCqujj0T3vCHZFZ1ZJ 0ZwyrzsoQRMZf9zeqlpUZzSVec9ZZFqgQicNTItT39Yh5j2wF2j7uOs/T0jqAvt2JDlf wPBQ== X-Gm-Message-State: AOAM533A1uk/l0Ngg7PU6r/5uIDH0jdVJChQCQLcnGycWXr9gNFpKLAK DsuD6i0RquTGr+qVzJxjfe/+DZHIEjQ= X-Google-Smtp-Source: ABdhPJz2f5tvfPyLDrCk7fzOlQAPXv0QRy4UqWF+B/SQYSlVQEZ0UtpAi9sdsGmNhq6dHGQe1I3ysA== X-Received: by 2002:a05:600c:350f:: with SMTP id h15mr7337102wmq.123.1632581579296; Sat, 25 Sep 2021 07:52:59 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id i203sm15757710wma.7.2021.09.25.07.52.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Sep 2021 07:52:58 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v7 21/40] target/hexagon: Remove unused has_work() handler Date: Sat, 25 Sep 2021 16:50:59 +0200 Message-Id: <20210925145118.1361230-22-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210925145118.1361230-1-f4bug@amsat.org> References: <20210925145118.1361230-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.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Taylor Simpson , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" has_work() is sysemu specific, and Hexagon target only provides a linux-user implementation. Remove the unused hexagon_cpu_has_work(). Reviewed-by: Richard Henderson 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 Sat Sep 25 14:51: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: 1532738 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=JxGUQMue; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HGsd73CDzz9sSn for ; Sun, 26 Sep 2021 01:04:43 +1000 (AEST) Received: from localhost ([::1]:38124 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mU9EH-0004BY-6G for incoming@patchwork.ozlabs.org; Sat, 25 Sep 2021 11:04:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42480) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mU935-0001Uv-Bh for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:53:07 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:37667) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mU933-0006JW-K8 for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:53:07 -0400 Received: by mail-wr1-x429.google.com with SMTP id t8so36541613wrq.4 for ; Sat, 25 Sep 2021 07:53:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HfPpeCahj5vQJxNuN5USHRZi30oEK/WxNT5N2Z+0tUI=; b=JxGUQMuetfSaBGKeLlcIL3OZlRzoaJ5FHGBSikdTTBoEephC3U754ToB95sJpG4ruG kG0JLXZAr5Fyc5rqrMgNYWbuX4Ws7KX6+RyyTIO1prsNE5RDEK1IReFPf6hiBmbYrmya +a54Q4HQf6JIF2RWXXo+VqJGigMde2qiiMZH5tHyAQQ1ECvD+75EIUg5PcfIY3B0nWQQ q2qCjEYn9LScruiBYG6nOfu/NP+7mohNzZE2fC2xGixXu2AwJvUqAQFW5Ygc4IhhGL9a hTMs8/trR2d6gSUn710JTfdPkM6zin/QVn5J6ehcBKsHM884eUdPERUXzEa+nwAl5qwO Pt9Q== 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=E0ItkMrBR8lSSxumeaWSShriFDhjdCiyPTiH6t6J6Age/tGPCuenj3+tq7sjInH5VM GyZ8CEKJ9vNj4dBT9h3cWhung9sM+bdkH4ZbHjMbNqS6x3Z7c7aF9zN7lgwuGsfbqVqo vjhc++FSuyaewncDPApJ4CfWkxDW0yiENkh2CL7HnGOlpcz1T0HTySSRxnQKE1QxAvs7 hEqetJwpkOXXeLaETS0yEQCBKNZ+bVs+JIQTimuWhdZjz6qwGpVxEJ8hhdjZaFyJ21Wq J6ul6Zr3yP/O29T0/jOa5aQ5QyF3DcJKE+w79hfPaYdRj77aq1zU6utsmmftfAfKxF/s ATdw== X-Gm-Message-State: AOAM531r+uQVcICupIGa3fgB6OBdegIZOMxieeMoooANYRrsfImG9aM2 EAuqdQ3x/6uTO5f6YTfvKnullpM5UU4= X-Google-Smtp-Source: ABdhPJy7FcwzuOUvnrrRfyu1LGONJrvvqjyzB5HU65iDPMQPtEWBk6Vf/T6YdKvAk7Crz8GliXpjYw== X-Received: by 2002:adf:e783:: with SMTP id n3mr8741836wrm.37.1632581584055; Sat, 25 Sep 2021 07:53:04 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id g143sm15704856wme.16.2021.09.25.07.53.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Sep 2021 07:53:03 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v7 22/40] target/hppa: Restrict has_work() handler to sysemu Date: Sat, 25 Sep 2021 16:51:00 +0200 Message-Id: <20210925145118.1361230-23-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210925145118.1361230-1-f4bug@amsat.org> References: <20210925145118.1361230-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.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Restrict has_work() to sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/hppa/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/hppa/cpu.c b/target/hppa/cpu.c index 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 Sat Sep 25 14:51: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: 1532737 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=Rl/Yl18A; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HGsbw0q2Zz9t8j for ; Sun, 26 Sep 2021 01:03:40 +1000 (AEST) Received: from localhost ([::1]:33624 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mU9DF-00015M-Sx for incoming@patchwork.ozlabs.org; Sat, 25 Sep 2021 11:03:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42492) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mU939-0001a1-Li for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:53:11 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:36509) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mU938-0006Nj-5R for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:53:11 -0400 Received: by mail-wr1-x430.google.com with SMTP id g16so36520418wrb.3 for ; Sat, 25 Sep 2021 07:53:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FoSlQqSQ8ZbPbrlQxUB8XNqV2UVRF3KYNvOO8ZgTpHU=; b=Rl/Yl18A4Zx6SpjTQGdOwjzsPYqEpDhRthDsAYY0zMbIqb/iKWcxDK9QURA9EJTMMz 4JA9JkLWKDI1dK8/IxhV/fcKAJk+8zCTuDy6r7gOQphNp04ZSqPpggT2MLUyPjm2NJ8m IKm4dXNNRRLwRo/oIu0BoJ+Vf2vmrYlS85QuiYG8qE2O4rcnxUrCdPKX0OUvc2SxvSxa +d9ibA2IuBDGTsBa3ugZje3NDKnO6rUjU9phRlPYs4ER+XAkG0UmRidSJyHa9pO2k9Kt hudo6wFE4f8p5xdN+jMu+oA0XbOdAVR52SjKKwN4tIj1GzeO9nFCwcNmOhmd6f2HCW1g 0xJA== 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=2hxxq/UI/M6WgKnu75fTVLNoWx528oMyilR8E58DqYPxAVNxvKTduF00yLe4MqEOZM I44qNHonOoxUIioyGGUR7d9UTog7hgUpnJp8FpjMkAdff8i8UuyDkPUS6uTC2GZvghqg 8ZbjfgV4NrUMAj/tdsoJt1S1WiQBDLJONbWnjxArmeqmV8cIHOweSGb4XFsT4mwauXZK 2UNXuDt2uuzDpTlHE3aYGkOaNT/25EEbbke5V1V3YkRW3l+TrgOpLd5k4AVNf+q0v7Ug 2VWOAbz1RsNI2dUFN4P00KaEb4j15rmbcaGIqK16c5QDdVV3+VQyRDMMNlU0KIxV6FOr I4Vg== X-Gm-Message-State: AOAM53230MZwVl3iWM/tSUyBLT3LZAq3bBh8poeA7kyKRc9dykosrsIJ gGiRCe4bCCk/EykWEDobdajF5v7e+I8= X-Google-Smtp-Source: ABdhPJzCqAbyKnOrT06dUXGEJagRVoY5PAMLcP598ID1Vl+lu20zEv7JWnE5erwmkax7Snuk3aacbA== X-Received: by 2002:adf:de86:: with SMTP id w6mr5874287wrl.287.1632581588807; Sat, 25 Sep 2021 07:53:08 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id i7sm4301335wrp.5.2021.09.25.07.53.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Sep 2021 07:53:08 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v7 23/40] target/i386: Restrict has_work() handler to sysemu and TCG Date: Sat, 25 Sep 2021 16:51:01 +0200 Message-Id: <20210925145118.1361230-24-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210925145118.1361230-1-f4bug@amsat.org> References: <20210925145118.1361230-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x430.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Eduardo Habkost Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Restrict has_work() to TCG sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/i386/cpu.c | 6 ------ target/i386/tcg/tcg-cpu.c | 8 +++++++- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 6b029f1bdf1..36a1c5f3fd2 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -6554,11 +6554,6 @@ int x86_cpu_pending_interrupt(CPUState *cs, int interrupt_request) return 0; } -static bool x86_cpu_has_work(CPUState *cs) -{ - return x86_cpu_pending_interrupt(cs, cs->interrupt_request) != 0; -} - static void x86_disas_set_info(CPUState *cs, disassemble_info *info) { X86CPU *cpu = X86_CPU(cs); @@ -6763,7 +6758,6 @@ static void x86_cpu_common_class_init(ObjectClass *oc, void *data) cc->class_by_name = x86_cpu_class_by_name; cc->parse_features = x86_cpu_parse_featurestr; - cc->has_work = x86_cpu_has_work; cc->dump_state = x86_cpu_dump_state; cc->set_pc = x86_cpu_set_pc; cc->gdb_read_register = x86_cpu_gdb_read_register; diff --git a/target/i386/tcg/tcg-cpu.c b/target/i386/tcg/tcg-cpu.c index 3ecfae34cb5..aef050d0898 100644 --- a/target/i386/tcg/tcg-cpu.c +++ b/target/i386/tcg/tcg-cpu.c @@ -55,6 +55,11 @@ static void x86_cpu_synchronize_from_tb(CPUState *cs, } #ifndef CONFIG_USER_ONLY +static bool x86_cpu_has_work(CPUState *cs) +{ + return x86_cpu_pending_interrupt(cs, cs->interrupt_request) != 0; +} + static bool x86_debug_check_breakpoint(CPUState *cs) { X86CPU *cpu = X86_CPU(cs); @@ -63,7 +68,7 @@ static bool x86_debug_check_breakpoint(CPUState *cs) /* RF disables all architectural breakpoints. */ return !(env->eflags & RF_MASK); } -#endif +#endif /* CONFIG_USER_ONLY */ #include "hw/core/tcg-cpu-ops.h" @@ -76,6 +81,7 @@ static const struct TCGCPUOps x86_tcg_ops = { #ifdef CONFIG_USER_ONLY .fake_user_interrupt = x86_cpu_do_interrupt, #else + .has_work = x86_cpu_has_work, .do_interrupt = x86_cpu_do_interrupt, .cpu_exec_interrupt = x86_cpu_exec_interrupt, .debug_excp_handler = breakpoint_handler, From patchwork Sat Sep 25 14:51: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: 1532768 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=WdHaR98b; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HGt646h3Pz9t1C for ; Sun, 26 Sep 2021 01:26:20 +1000 (AEST) Received: from localhost ([::1]:39890 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mU9ZC-0001yx-Lk for incoming@patchwork.ozlabs.org; Sat, 25 Sep 2021 11:26:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42504) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mU93E-0001hg-Ek for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:53:16 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:47091) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mU93C-0006Qk-Uo for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:53:16 -0400 Received: by mail-wr1-x433.google.com with SMTP id c21so6791455wrb.13 for ; Sat, 25 Sep 2021 07:53:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2wVO/8lNTdglwVP+4rQ9px8jTQizKXJBfsXgcLc7jls=; b=WdHaR98bEECTXPeNHifBn24cJqP5BxPwwYe6O1Yb0kTfnNMomo4cb3UeEQsUm+OTXt 3gcQ4Z3txzbSkJYBClC+yfLTJuggmlAHo9Qc9e8jlm4cBa4jLhkXKHYVWoZ4Zz5iAQHS GrtNf4Ot7/BGJeMjQtzWbaJe0Bzj0rcDCydp7sBd/o7/5ud+Osm7T9f0d4znwTcXTI8+ +OPzDQTYQgbEsiZwUhRouUABxppgeUV8puKI5NRRquhDejC3Xtc0svmkmjqCx6Dt/7iI R9pzgVli5D0ivFJkFtNL6TNt3Y/zByXSP3WXR78v5dyhnv7CQqn9BzeMqUSQIP9gi3x+ P5pQ== 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=M8ZK0FMgfm5ypus+ur9sOARVT0JHxXn8lK0oej7b0DKZG5KJF/TUKBvxhn7e/sjIeF 11HugmfQ0eiHU12+rz1SPyD4K3Mw4ZtWmlqyqY/uANpWfhej06QsUywO9JH7DHnkVLC8 lAKLldospPkXBkkh4G8DMP5dE7sTN9XTrpjbWiJOJPuKm0WWylnPGW2dx6fcfVVGGXmr U3enUykquyz5efw9OFulEYyPSqu+VxSZEt1kQOqRHBn+/qnYMK79/K0dkEfQYzqxwrTn eZv5O+gFJ9aY7jKxS7zbAX2znEfvNHpa9xtOyjzTh/BxcvlJGrQL3tTTJSF2lFb7xMrP j2lw== X-Gm-Message-State: AOAM531iuLpuy/fZWxQVlp8gZlW5TulpJWk/4d5T+uYRCzWg97VNTrEA xSE8GfJSQ7HQOkcV1b0fX/KQtl9naXM= X-Google-Smtp-Source: ABdhPJza9hyoTFHpoxhPwICXd2Y/7LrhGe/W93GuOg2NVL8wN4K+ZeH9tBA4jIlKT0mPnAYV0vZHYw== X-Received: by 2002:a5d:64e5:: with SMTP id g5mr17400439wri.282.1632581593499; Sat, 25 Sep 2021 07:53:13 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id c7sm14015808wmq.13.2021.09.25.07.53.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Sep 2021 07:53:12 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v7 24/40] target/m68k: Restrict has_work() handler to sysemu Date: Sat, 25 Sep 2021 16:51:02 +0200 Message-Id: <20210925145118.1361230-25-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210925145118.1361230-1-f4bug@amsat.org> References: <20210925145118.1361230-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x433.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Laurent Vivier Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Restrict has_work() to sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/m68k/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/m68k/cpu.c b/target/m68k/cpu.c index 66d22d11895..ad5d26b5c9e 100644 --- a/target/m68k/cpu.c +++ b/target/m68k/cpu.c @@ -31,10 +31,12 @@ static void m68k_cpu_set_pc(CPUState *cs, vaddr value) cpu->env.pc = value; } +#if !defined(CONFIG_USER_ONLY) static bool m68k_cpu_has_work(CPUState *cs) { return cs->interrupt_request & CPU_INTERRUPT_HARD; } +#endif /* !CONFIG_USER_ONLY */ static void m68k_set_feature(CPUM68KState *env, int feature) { @@ -518,6 +520,7 @@ static const struct TCGCPUOps m68k_tcg_ops = { .tlb_fill = m68k_cpu_tlb_fill, #ifndef CONFIG_USER_ONLY + .has_work = m68k_cpu_has_work, .cpu_exec_interrupt = m68k_cpu_exec_interrupt, .do_interrupt = m68k_cpu_do_interrupt, .do_transaction_failed = m68k_cpu_transaction_failed, @@ -535,7 +538,6 @@ static void m68k_cpu_class_init(ObjectClass *c, void *data) device_class_set_parent_reset(dc, m68k_cpu_reset, &mcc->parent_reset); cc->class_by_name = m68k_cpu_class_by_name; - cc->has_work = m68k_cpu_has_work; cc->dump_state = m68k_cpu_dump_state; cc->set_pc = m68k_cpu_set_pc; cc->gdb_read_register = m68k_cpu_gdb_read_register; From patchwork Sat Sep 25 14:51: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: 1532741 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=dLLQ9jqe; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HGsg709rkz9sW8 for ; Sun, 26 Sep 2021 01:06:27 +1000 (AEST) Received: from localhost ([::1]:42236 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mU9Fw-00070l-MG for incoming@patchwork.ozlabs.org; Sat, 25 Sep 2021 11:06:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42526) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mU93K-0001r6-8t for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:53:22 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:43561) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mU93I-0006WJ-I6 for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:53:21 -0400 Received: by mail-wr1-x431.google.com with SMTP id w17so36395937wrv.10 for ; Sat, 25 Sep 2021 07:53:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TotqMEN5DrXYEF17ne4DDCu2zSM8Bp20jLCGhp9+svs=; b=dLLQ9jqesSCiqaSohDdyIjtjEFP1BnRBr7sh6EQCAtO2UiR5d2olJpH46gocRuvKzQ fjQjGDngvQNOBB2SxyTNdwoNehKpSArDBjnvZqR/ZiaT9bwJafH6BwoxjwmoJCZASmuD twFjXwwKK9eJ8ilnZDlnlAnq9JiiEroAeyuOE5+FaTRALZmLYXcGkX1tXijfxdfcESts KE37YUgikhZNeErFR07Y85WyJWsJ9fEWUPvjGKnw3sohQsj92ilTiJw8VYHVTsLjRjL/ yoMzeUFhkiuvpHVljnYyxrrChh0JVmnpFy3wCVjnCKjjdIKSBi9L0gjGdy9zfUN9wQWu kvKQ== 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=cpYP40Y4VUP0MdcS4heIm3KuACypUbrZKltGnPEcS9pWnvZyh0bK+tx5nK6e1v1wkU LCKjfmMWOYUV9XoTksK+qwlAzy7Qmf57jBGc4dfgj2Hz7FjJT5U78PhOfDnXk0Itx26y uXAfVCoS01czpJJtI6jS9KUmhlZRNmL4soVIg9AzZYYxsohIMX+P3V+U3nwxGMfIMMcP g60Wcv0bl8rmEPkcRyApQwTBV0Kv4ocJPzrMTbByvAObLj2az+kI1wEgLjAZoxcxvC4/ XA4OCnRw7DtasYzClzJHIK8UsrwEwgFmiwlGjE8VQkaEOD/bO5XO//YqaH1TzJVEB/s2 rLvg== X-Gm-Message-State: AOAM531gsiH7rc6c/F7HkKOn3tsUQhv0rDGOM5jkTHiCBhSYlgPvdrQH a6nt8PPS0HxybxnxGkHJeteAnAHs5Tw= X-Google-Smtp-Source: ABdhPJxDf6bBJ6gtOR94BUA81N2bzDzutMbqGYGGp6xNiVAJT5uB+NEI+tRuBK0YV9P7obkWFW/klA== X-Received: by 2002:a05:600c:198e:: with SMTP id t14mr7555032wmq.124.1632581598440; Sat, 25 Sep 2021 07:53:18 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id b7sm13979439wrm.9.2021.09.25.07.53.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Sep 2021 07:53:17 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v7 25/40] target/microblaze: Restrict has_work() handler to sysemu Date: Sat, 25 Sep 2021 16:51:03 +0200 Message-Id: <20210925145118.1361230-26-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210925145118.1361230-1-f4bug@amsat.org> References: <20210925145118.1361230-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.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Edgar E. Iglesias" , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Restrict has_work() to sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/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 Sat Sep 25 14:51: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: 1532742 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=HNAlGShU; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HGshv18P9z9sW8 for ; Sun, 26 Sep 2021 01:07:57 +1000 (AEST) Received: from localhost ([::1]:46412 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mU9HO-0001Uf-6W for incoming@patchwork.ozlabs.org; Sat, 25 Sep 2021 11:07:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42548) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mU93N-00023P-Vz for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:53:26 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:34790) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mU93M-0006Z8-F0 for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:53:25 -0400 Received: by mail-wr1-x433.google.com with SMTP id t8so36614823wri.1 for ; Sat, 25 Sep 2021 07:53:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iR+hhecIhVQbqLgRtJRf7TAYJMYyVJckrOxOor2tvDk=; b=HNAlGShUBaXIHHNJ1tvDQ76+jvimHjnU+l1JquArWaP7lDWkPvlRPusz84wT9kIUhi tW/VEQgYTq3trLFG3vYk4EekXUfyN7v9aVZptCX5jEhMOHbLg8DbZu55eI7uLwX+T3an Ad5xEMjgSQfaI7NNL8ca9R8bvmI2OGXHILsFQJQ12L7DYS53ruI2sagNx46owkIDnyi2 dJomFVxgfYIyJt5bzBWa6Jnsk2j+oyVQVY6TCVT0KvzCSxECaqo/GUYiG/wmPiDxjemu nifwqS+njyavNuLabIanhfKTj5ckxzR8iDqCqUx1gcsrMBBtwoJzO8pSZ2SyA14aig7G 6S+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=iR+hhecIhVQbqLgRtJRf7TAYJMYyVJckrOxOor2tvDk=; b=A/cpJM789/JId2LKymRGIGybSvdlDO9SGqWIGvcXN8XlNRRX3nKoVZvYZrlSE4n0L6 fqy3cOUHs8mGE3PrdNdbtU0eTQ46f8OlwBYi611JdNYn0lMVz70jncqx2itpeNN65ptb i88A3X0BEwmX2Tz/TqSIsH+0pZKb2ctggm3nrVfMfWh4+IMdFuJWZGvJzNOM8qFAMKEb HwjZFifBEWdpGaSIQvpcK9OCHuNZAhOu+ni5AF0hVICO4z2XmS36EqrhxFA5ua0T5BmV BsQ+IvST24uNKKzP/fFpbnxXH4H3Wz+ALfQld/C0NvRJ5Et9DhaiXy4Mt3A5HSvR4PoM F3Bg== X-Gm-Message-State: AOAM530ctNmTn6Y9YOqpI4GVUux6AvF8z87iD5p6vQAh0Fs1P+LQZnJ7 rVdrb28u6ERZ9kai2+bUqHcLkriCK7g= X-Google-Smtp-Source: ABdhPJxi2Q3mMbzzfO0gtkBajSb+mnjc07GQQOja/IL0tLlvFzUvACr4d4LcesVmyPUVgv6qatOpwQ== X-Received: by 2002:a1c:48c:: with SMTP id 134mr6289159wme.137.1632581602985; Sat, 25 Sep 2021 07:53:22 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id x17sm11722568wrc.51.2021.09.25.07.53.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Sep 2021 07:53:22 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v7 26/40] target/mips: Restrict has_work() handler to sysemu and TCG Date: Sat, 25 Sep 2021 16:51:04 +0200 Message-Id: <20210925145118.1361230-27-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210925145118.1361230-1-f4bug@amsat.org> References: <20210925145118.1361230-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x433.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Aurelien Jarno , Aleksandar Rikalo Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Restrict has_work() to TCG sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/mips/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/mips/cpu.c b/target/mips/cpu.c index 00e0c55d0e4..3639c03f8ea 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -128,6 +128,7 @@ static void mips_cpu_set_pc(CPUState *cs, vaddr value) mips_env_set_pc(&cpu->env, value); } +#if defined(CONFIG_TCG) && !defined(CONFIG_USER_ONLY) static bool mips_cpu_has_work(CPUState *cs) { MIPSCPU *cpu = MIPS_CPU(cs); @@ -172,6 +173,7 @@ static bool mips_cpu_has_work(CPUState *cs) } return has_work; } +#endif /* CONFIG_TCG && !CONFIG_USER_ONLY */ #include "cpu-defs.c.inc" @@ -542,6 +544,7 @@ static const struct TCGCPUOps mips_tcg_ops = { .tlb_fill = mips_cpu_tlb_fill, #if !defined(CONFIG_USER_ONLY) + .has_work = mips_cpu_has_work, .cpu_exec_interrupt = mips_cpu_exec_interrupt, .do_interrupt = mips_cpu_do_interrupt, .do_transaction_failed = mips_cpu_do_transaction_failed, @@ -563,7 +566,6 @@ static void mips_cpu_class_init(ObjectClass *c, void *data) device_class_set_props(dc, mips_cpu_properties); cc->class_by_name = mips_cpu_class_by_name; - cc->has_work = mips_cpu_has_work; cc->dump_state = mips_cpu_dump_state; cc->set_pc = mips_cpu_set_pc; cc->gdb_read_register = mips_cpu_gdb_read_register; From patchwork Sat Sep 25 14:51: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: 1532746 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=RNIa0bGa; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HGsmy6y4Jz9t1C for ; Sun, 26 Sep 2021 01:11:30 +1000 (AEST) Received: from localhost ([::1]:54696 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mU9Kq-0007KM-Nb for incoming@patchwork.ozlabs.org; Sat, 25 Sep 2021 11:11:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42568) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mU93V-0002B1-92 for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:53:34 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:40539) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mU93R-0006dG-4e for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:53:32 -0400 Received: by mail-wr1-x42b.google.com with SMTP id t28so23089756wra.7 for ; Sat, 25 Sep 2021 07:53:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=acgjCaHCdDvDEO6aQNdNA165wsQFWfR3HbCbuPW+vnw=; b=RNIa0bGaEJmEjGxl2dcNE/eVPbU3L76Uljp1NtWy2tc8CVcv79owBmiDLaFArNy+IT oaWjnr+mR3GkoG4qVkP7x0WnCLPTAM2gf1aiB1ngS4B40L4yAvV5GDYv5ud/z8subW7q E97atOnU4c1/ZzBXOXJ/x5O2pDqlPg2S5FrLWt8N+RXIVf5eXlBwO6UT7VnFOZIy5kq+ Ad+iM1zi7gKATutqN9p0KmyyKSDasqC5yddVz7ZAwC9dp6k4pVi3IEKLpPZZazHKTXFU UA7hwMtHfkZEItuDuzJ5mGYdv1QItPRHzZdHHqjOIvLoOPlcGO01vG6SeSeMwhdPw7UA MFuQ== 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=tLL35tLeSVsDa8/i6Rzho5RVPVNKORweKB3AoLzL8YN5hZSFp2ZvtuLYFe9JFbq68t Z3p4UqceHLVaIIU59FoDF9rTsvw02yCrlHitIuvOc3Yoy8ExxKZcXKbhqm0G849dMb+Y LzaFcQaxMIoZBLSlUp9X7FGdILpYG/w4PiAAuVCJK9dF7yqHovP/RmQNHzT9i6Tv8A3d uK1DLP/YaU2Ln5j+MdiH/aC2qqnqQaJoGGHKZho4rFl0hVRjwzsooglewWZ7tB9/lXO+ V4DwplJjXOspqtagSDKkSelAzCqo1QUUd5lejkYvagwLbsv4IFh3ECW+VqC0xD4eDmfw UcJQ== X-Gm-Message-State: AOAM531G2daeUzJLHEHS556IqRPJtBpyUbUlKiOzkmaf6r9gQPDyO0Mi PuUbyKi3cv+6d91H2Yd2AAhXmzWH0pc= X-Google-Smtp-Source: ABdhPJz+So68TfvwENaaWg/o7/POth9+1B31X/38kUY4LqXICEmW58Gw0apG4INgAKcu96JMDcy4EA== X-Received: by 2002:adf:e643:: with SMTP id b3mr17427521wrn.299.1632581607691; Sat, 25 Sep 2021 07:53:27 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id k18sm11115199wrh.68.2021.09.25.07.53.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Sep 2021 07:53:27 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v7 27/40] target/nios2: Restrict has_work() handler to sysemu Date: Sat, 25 Sep 2021 16:51:05 +0200 Message-Id: <20210925145118.1361230-28-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210925145118.1361230-1-f4bug@amsat.org> References: <20210925145118.1361230-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.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marek Vasut , Chris Wulff , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Restrict has_work() to sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/nios2/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/nios2/cpu.c b/target/nios2/cpu.c index 947bb09bc1e..9938d7c2919 100644 --- a/target/nios2/cpu.c +++ b/target/nios2/cpu.c @@ -34,10 +34,12 @@ static void nios2_cpu_set_pc(CPUState *cs, vaddr value) env->regs[R_PC] = value; } +#if !defined(CONFIG_USER_ONLY) static bool nios2_cpu_has_work(CPUState *cs) { return cs->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_NMI); } +#endif /* !CONFIG_USER_ONLY */ static void nios2_cpu_reset(DeviceState *dev) { @@ -223,6 +225,7 @@ static const struct TCGCPUOps nios2_tcg_ops = { .tlb_fill = nios2_cpu_tlb_fill, #ifndef CONFIG_USER_ONLY + .has_work = nios2_cpu_has_work, .cpu_exec_interrupt = nios2_cpu_exec_interrupt, .do_interrupt = nios2_cpu_do_interrupt, .do_unaligned_access = nios2_cpu_do_unaligned_access, @@ -241,7 +244,6 @@ static void nios2_cpu_class_init(ObjectClass *oc, void *data) device_class_set_parent_reset(dc, nios2_cpu_reset, &ncc->parent_reset); cc->class_by_name = nios2_cpu_class_by_name; - cc->has_work = nios2_cpu_has_work; cc->dump_state = nios2_cpu_dump_state; cc->set_pc = nios2_cpu_set_pc; cc->disas_set_info = nios2_cpu_disas_set_info; From patchwork Sat Sep 25 14:51: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: 1532745 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=jKfdvjWA; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HGsl13fzpz9t1C for ; Sun, 26 Sep 2021 01:09:49 +1000 (AEST) Received: from localhost ([::1]:50612 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mU9JD-0004PS-9N for incoming@patchwork.ozlabs.org; Sat, 25 Sep 2021 11:09:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42582) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mU93Y-0002CL-5L for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:53:36 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:36508) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mU93W-0006gq-J2 for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:53:35 -0400 Received: by mail-wr1-x42a.google.com with SMTP id g16so36522506wrb.3 for ; Sat, 25 Sep 2021 07:53: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=h26pMLEnUsWrxMoqQtHQ2NCzZkcdqUGqN4k/9eCW+zM=; b=jKfdvjWAZz0YCnsbrfN09vqrq3pNkI2lrUpS40//xHnxIw/oYbiBuR1M+ezk0ZCc0C 586MjJQktIZHXqCtPCy42bO/ufoZ/J5wFywRm3cLM4VHJjXB64GY98hJeprHffsCMWlC VCsnqJk+JNHxHi4LG6QJ1kLcHUjslZjsudv0ZLKYGDLmr+qjcNrinIVe2BkgQosSeo0t +Buj3V7D2Wvp7eu9suCLinRtPFmWKtqJkybR7FLyQSnmOEGPZMpfu3Aa2M0ee7TDXyS4 9suaBetq1lwOV3jhI3dF3jCjgljGUU9M2xBYp2U0ZLwPW3Ng1iNSZmACdn8E+IWHjlF+ Neow== 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=X6Ke29jph5d9JPU3PS9V+f72CT9ZaWEx5+hfJhf9asK5wM8DxHZDqfrkkZDPzIkCaU pJpS0FIVivsndNa71U+6iVunnFdvgyIkFX0UgNWezoABFBhfYhDUsOZPDD0rw/7AH150 P+a1v4WPxNKPYwSWpnBIoNiEehwRprRPQkSLLO97JL8K0qsgHvMl1sxJUWvwgvjZdxhT 80c9YSD4GyMtORDFpfFYcArc2pYavh8uq6aeZDABU0P2dclP0PmJ9cTfhGbDLvVkIOTZ bqUW3zJEtb/ZcPvZM3q8OzlOoNm83eixhjpHJDTW6FqLm1EbEb3kzB+WfNSxJ1DDxits OaOw== X-Gm-Message-State: AOAM532RExnZxP8HV2U3k3xHtPpmDRxuHpumS7axtXSztMZbVgDUsrou SJzNL8E5HOpr9J8hnxh87ucHds5gPNo= X-Google-Smtp-Source: ABdhPJyi1xKJNp4X7lK8oP1DM1CyKIcblnLaMjCrR54fTG1lHkX0B1qvrju/5R6HDlGFj10SD7ei1A== X-Received: by 2002:adf:db4a:: with SMTP id f10mr4007202wrj.140.1632581613184; Sat, 25 Sep 2021 07:53: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 l21sm11545300wmh.31.2021.09.25.07.53.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Sep 2021 07:53:31 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v7 28/40] target/openrisc: Restrict has_work() handler to sysemu Date: Sat, 25 Sep 2021 16:51:06 +0200 Message-Id: <20210925145118.1361230-29-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210925145118.1361230-1-f4bug@amsat.org> References: <20210925145118.1361230-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.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stafford Horne , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Restrict has_work() to sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/openrisc/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/openrisc/cpu.c b/target/openrisc/cpu.c index 27cb04152f9..3c368a1bde7 100644 --- a/target/openrisc/cpu.c +++ b/target/openrisc/cpu.c @@ -30,11 +30,13 @@ static void openrisc_cpu_set_pc(CPUState *cs, vaddr value) cpu->env.dflag = 0; } +#if !defined(CONFIG_USER_ONLY) static bool openrisc_cpu_has_work(CPUState *cs) { return cs->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_TIMER); } +#endif /* !CONFIG_USER_ONLY */ static void openrisc_disas_set_info(CPUState *cpu, disassemble_info *info) { @@ -189,6 +191,7 @@ static const struct TCGCPUOps openrisc_tcg_ops = { .tlb_fill = openrisc_cpu_tlb_fill, #ifndef CONFIG_USER_ONLY + .has_work = openrisc_cpu_has_work, .cpu_exec_interrupt = openrisc_cpu_exec_interrupt, .do_interrupt = openrisc_cpu_do_interrupt, #endif /* !CONFIG_USER_ONLY */ @@ -205,7 +208,6 @@ static void openrisc_cpu_class_init(ObjectClass *oc, void *data) device_class_set_parent_reset(dc, openrisc_cpu_reset, &occ->parent_reset); cc->class_by_name = openrisc_cpu_class_by_name; - cc->has_work = openrisc_cpu_has_work; cc->dump_state = openrisc_cpu_dump_state; cc->set_pc = openrisc_cpu_set_pc; cc->gdb_read_register = openrisc_cpu_gdb_read_register; From patchwork Sat Sep 25 14:51: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: 1532748 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=Iiz4vQh/; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HGspv4cXCz9t14 for ; Sun, 26 Sep 2021 01:13:10 +1000 (AEST) Received: from localhost ([::1]:58690 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mU9MQ-0001dc-Nk for incoming@patchwork.ozlabs.org; Sat, 25 Sep 2021 11:13:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42618) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mU93e-0002KN-T9; Sat, 25 Sep 2021 10:53:42 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:44891) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mU93c-0006kC-7X; Sat, 25 Sep 2021 10:53:42 -0400 Received: by mail-wr1-x430.google.com with SMTP id d6so36342982wrc.11; Sat, 25 Sep 2021 07:53: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=7WPGnjIwDqq9FNiuzjIUo9e3oGnINOP8qAvzXoIP118=; b=Iiz4vQh/m+lhAO95wYxFN05EsZO6PTARpNzm5HlbcZlCXv0zBbPgjlpBKW0i9tOyNE RP0WY4YnokBM7SAof7fDjLljH00iGViqaacNbPQy0Y5hVdLF1oT0ft8+9ozkynQoMZd4 9g8c4Tpzo/SynMpBFQCpozVssqbSXgAKuxr3CF1JqNAI828s/PrQJNP7bWCXaBDyPI5o bulQrLTpygOUIBrsvBMO/QyidZfigzYHK1DU+ezAt/tmW03g1iJpDhVVP7z54uzo/Kdm BaBtb+hbqa8cD8af8tdAG7itWbrphK/OykAJUwqtbidndv8LygfmyDlwq1Os0Pl/VwVa wh6A== 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=j0CZCaCja+UbiPWU5vYfhBqionOXpiMzXEOiKjf2k71PN8mBpd3KL12DIiUfxbXA30 z+VpRealMoO6TMfEnmjAbsXp/XkhJZV2QiaSf19JeY/4aISaRGRddHF+9jBcllPblEnX 6kWk6+bDtJFH6Kj+ettTHveXVJsCoDOeORXc8UPO4oAqPiyo+oI3ua+KzJ+zghjlJjG3 ZkToCegGv8fXg2z8M4er/1HYilAEvRTPpJhLD2SNWdm1756L4oZeYL12dClbrg+2IlKK 6ofVXfjSFPC9msx0O7FBOTzepB7YyWjry1UGnAaoDaKX+viq3JSBCUMVeZzh52UCJyWC hYrA== X-Gm-Message-State: AOAM533pKG7gNoiVfzNgNpzjRVkWt2eNa4TrXnZrCiH0tiPDqq1dpLyQ n+u0eJhF2160jBJmbYVkvIWnZ1ykQks= X-Google-Smtp-Source: ABdhPJwszQjjnXnsiwMnGsLWmfMFJDb0i6N4HyFEVJ0rcCKX6VS8U592pjH05jYt/1cfzSlgS79udQ== X-Received: by 2002:a5d:4481:: with SMTP id j1mr17638463wrq.6.1632581618107; Sat, 25 Sep 2021 07:53: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 f1sm11616153wrc.66.2021.09.25.07.53.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Sep 2021 07:53:37 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v7 29/40] target/ppc: Introduce PowerPCCPUClass::has_work() Date: Sat, 25 Sep 2021 16:51:07 +0200 Message-Id: <20210925145118.1361230-30-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210925145118.1361230-1-f4bug@amsat.org> References: <20210925145118.1361230-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x430.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "open list:PowerPC TCG CPUs" , Greg Kurz , Richard Henderson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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 Sat Sep 25 14:51: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: 1532757 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=oa9N22ve; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HGssw2L5mz9t1C for ; Sun, 26 Sep 2021 01:15:48 +1000 (AEST) Received: from localhost ([::1]:38722 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mU9Oy-0007M0-Kl for incoming@patchwork.ozlabs.org; Sat, 25 Sep 2021 11:15:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42630) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mU93m-0002Z9-Pa; Sat, 25 Sep 2021 10:53:50 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:38840) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mU93g-0006oV-P6; Sat, 25 Sep 2021 10:53:46 -0400 Received: by mail-wr1-x42e.google.com with SMTP id u18so36547773wrg.5; Sat, 25 Sep 2021 07:53: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=IiP54nTlira6zI1808uaFu0plQ+4ScQiNyLo+fDpcgY=; b=oa9N22veagxHVmHotr3xEvh0pdMb0uSKgqnKR1v15a7I8NE3DfxoWbsyw4DBFZspI7 jAIociFOwzbZX0OC0DzztlZ3Bd63o9jtbmV1eNjUg5g+lwkM4C4fT8lnNDvvI4JCY0pb JuBL+n5N5DHcnaDXuAoeDBUHAF79oFI8mpBeUyuWb+KthCDIMwZ+DxqqipW0i6Os4vyY CMfFwfw4WvPflHgwguRmWAMhj8xk/7hvTu9OefUXHNS8YS0pioV7dY9KiYiPqAlKWKZf 3bE8qcnljbGvYgV/3s1ingfgfs0D1W3LlQjsfrrypkLlgcXOWZy1hLOuqWpld2JrvfWc MxmQ== 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=VoNcQPHjYCIjIT3bewsOOlgK0FWXRYOkT8m8BLu63CIqJrMKJVX3Q+fOlNjKO7qMnR Ii/r702cq/u6j8ZMLizlnsWyLyjS6kHI9dXehE7nhf5tBP+44nYzcQISWWEbHnq1AQjG h4dcIjzNQdvsgfH8iTzvBEMAo4Zy1651Q5WjHecJnVPRC1wWPUtLb7c6wovnk30QamHl ckK9f8l3/C45cmiOoc5mY1nWv1xApXsduZzbj+IvDk0LnMLm0LHUxD/qP6kCPxzP2hZH VYmJqOk+TUJGHqJa9bby2ku1s9BVjzbHlZ6Ux0+bCGw8zrVL3dBUHj2BgQ+cKNJeD1ih n2WA== X-Gm-Message-State: AOAM532+rWkdDICuL3ekAh0eRUgtohGPgjlPoq4yJEhL6M18JnoMEd3T gxivZANCybLf+msb84Lc4rWDOlPGnXI= X-Google-Smtp-Source: ABdhPJw0ZKv5G6qL/TsD0qZhdNETmr67E8gkLaWoXIQwbJfheOBtp9UTy7Ig0OZPSOtwh3h4gCNmcg== X-Received: by 2002:a05:600c:2109:: with SMTP id u9mr7226486wml.6.1632581622819; Sat, 25 Sep 2021 07:53: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 c132sm15873859wma.22.2021.09.25.07.53.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Sep 2021 07:53:42 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v7 30/40] target/ppc: Restrict has_work() handlers to sysemu and TCG Date: Sat, 25 Sep 2021 16:51:08 +0200 Message-Id: <20210925145118.1361230-31-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210925145118.1361230-1-f4bug@amsat.org> References: <20210925145118.1361230-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.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "open list:PowerPC TCG CPUs" , Greg Kurz , Richard Henderson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Restrict PowerPCCPUClass::has_work() and ppc_cpu_has_work() - SysemuCPUOps::has_work() implementation - to TCG sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/ppc/cpu-qom.h | 4 +++- target/ppc/cpu_init.c | 24 ++++++++++++++++++------ 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/target/ppc/cpu-qom.h b/target/ppc/cpu-qom.h index 36110112506..ff2bafcde6f 100644 --- a/target/ppc/cpu-qom.h +++ b/target/ppc/cpu-qom.h @@ -188,8 +188,10 @@ struct PowerPCCPUClass { uint32_t flags; int bfd_mach; uint32_t l1_dcache_size, l1_icache_size; - bool (*has_work)(CPUState *cpu); #ifndef CONFIG_USER_ONLY +#ifdef CONFIG_TCG + bool (*has_work)(CPUState *cpu); +#endif /* CONFIG_TCG */ unsigned int gdb_num_sprs; const char *gdb_spr_xml; #endif diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index 2f7d262b176..5c134adeea9 100644 --- a/target/ppc/cpu_init.c +++ b/target/ppc/cpu_init.c @@ -7583,6 +7583,7 @@ static bool ppc_pvr_match_power7(PowerPCCPUClass *pcc, uint32_t pvr) return false; } +#if defined(CONFIG_TCG) && !defined(CONFIG_USER_ONLY) static bool cpu_has_work_POWER7(CPUState *cs) { PowerPCCPU *cpu = POWERPC_CPU(cs); @@ -7616,6 +7617,7 @@ static bool cpu_has_work_POWER7(CPUState *cs) return msr_ee && (cs->interrupt_request & CPU_INTERRUPT_HARD); } } +#endif /* CONFIG_TCG && !CONFIG_USER_ONLY */ POWERPC_FAMILY(POWER7)(ObjectClass *oc, void *data) { @@ -7629,7 +7631,6 @@ POWERPC_FAMILY(POWER7)(ObjectClass *oc, void *data) pcc->pcr_supported = PCR_COMPAT_2_06 | PCR_COMPAT_2_05; pcc->init_proc = init_proc_POWER7; pcc->check_pow = check_pow_nocheck; - pcc->has_work = cpu_has_work_POWER7; pcc->insns_flags = PPC_INSNS_BASE | PPC_ISEL | PPC_STRING | PPC_MFTB | PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES | PPC_FLOAT_FSQRT | PPC_FLOAT_FRSQRTE | @@ -7672,6 +7673,7 @@ POWERPC_FAMILY(POWER7)(ObjectClass *oc, void *data) pcc->lpcr_pm = LPCR_P7_PECE0 | LPCR_P7_PECE1 | LPCR_P7_PECE2; pcc->mmu_model = POWERPC_MMU_2_06; #if defined(CONFIG_SOFTMMU) + pcc->has_work = cpu_has_work_POWER7; pcc->hash64_opts = &ppc_hash64_opts_POWER7; pcc->lrg_decr_bits = 32; #endif @@ -7742,6 +7744,7 @@ static bool ppc_pvr_match_power8(PowerPCCPUClass *pcc, uint32_t pvr) return false; } +#if defined(CONFIG_TCG) && !defined(CONFIG_USER_ONLY) static bool cpu_has_work_POWER8(CPUState *cs) { PowerPCCPU *cpu = POWERPC_CPU(cs); @@ -7783,6 +7786,7 @@ static bool cpu_has_work_POWER8(CPUState *cs) return msr_ee && (cs->interrupt_request & CPU_INTERRUPT_HARD); } } +#endif /* CONFIG_TCG && !CONFIG_USER_ONLY */ POWERPC_FAMILY(POWER8)(ObjectClass *oc, void *data) { @@ -7796,7 +7800,6 @@ POWERPC_FAMILY(POWER8)(ObjectClass *oc, void *data) pcc->pcr_supported = PCR_COMPAT_2_07 | PCR_COMPAT_2_06 | PCR_COMPAT_2_05; pcc->init_proc = init_proc_POWER8; pcc->check_pow = check_pow_nocheck; - pcc->has_work = cpu_has_work_POWER8; pcc->insns_flags = PPC_INSNS_BASE | PPC_ISEL | PPC_STRING | PPC_MFTB | PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES | PPC_FLOAT_FSQRT | PPC_FLOAT_FRSQRTE | @@ -7846,6 +7849,7 @@ POWERPC_FAMILY(POWER8)(ObjectClass *oc, void *data) LPCR_P8_PECE3 | LPCR_P8_PECE4; pcc->mmu_model = POWERPC_MMU_2_07; #if defined(CONFIG_SOFTMMU) + pcc->has_work = cpu_has_work_POWER8; pcc->hash64_opts = &ppc_hash64_opts_POWER7; pcc->lrg_decr_bits = 32; pcc->n_host_threads = 8; @@ -7939,6 +7943,7 @@ static bool ppc_pvr_match_power9(PowerPCCPUClass *pcc, uint32_t pvr) return false; } +#if defined(CONFIG_TCG) && !defined(CONFIG_USER_ONLY) static bool cpu_has_work_POWER9(CPUState *cs) { PowerPCCPU *cpu = POWERPC_CPU(cs); @@ -7996,6 +8001,7 @@ static bool cpu_has_work_POWER9(CPUState *cs) return msr_ee && (cs->interrupt_request & CPU_INTERRUPT_HARD); } } +#endif /* CONFIG_TCG && !CONFIG_USER_ONLY */ POWERPC_FAMILY(POWER9)(ObjectClass *oc, void *data) { @@ -8010,7 +8016,6 @@ POWERPC_FAMILY(POWER9)(ObjectClass *oc, void *data) PCR_COMPAT_2_05; pcc->init_proc = init_proc_POWER9; pcc->check_pow = check_pow_nocheck; - pcc->has_work = cpu_has_work_POWER9; pcc->insns_flags = PPC_INSNS_BASE | PPC_ISEL | PPC_STRING | PPC_MFTB | PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES | PPC_FLOAT_FSQRT | PPC_FLOAT_FRSQRTE | @@ -8059,6 +8064,7 @@ POWERPC_FAMILY(POWER9)(ObjectClass *oc, void *data) pcc->lpcr_pm = LPCR_PDEE | LPCR_HDEE | LPCR_EEE | LPCR_DEE | LPCR_OEE; pcc->mmu_model = POWERPC_MMU_3_00; #if defined(CONFIG_SOFTMMU) + pcc->has_work = cpu_has_work_POWER9; /* segment page size remain the same */ pcc->hash64_opts = &ppc_hash64_opts_POWER7; pcc->radix_page_info = &POWER9_radix_page_info; @@ -8147,6 +8153,7 @@ static bool ppc_pvr_match_power10(PowerPCCPUClass *pcc, uint32_t pvr) return false; } +#if defined(CONFIG_TCG) && !defined(CONFIG_USER_ONLY) static bool cpu_has_work_POWER10(CPUState *cs) { PowerPCCPU *cpu = POWERPC_CPU(cs); @@ -8204,6 +8211,7 @@ static bool cpu_has_work_POWER10(CPUState *cs) return msr_ee && (cs->interrupt_request & CPU_INTERRUPT_HARD); } } +#endif /* CONFIG_TCG && !CONFIG_USER_ONLY */ POWERPC_FAMILY(POWER10)(ObjectClass *oc, void *data) { @@ -8219,7 +8227,6 @@ POWERPC_FAMILY(POWER10)(ObjectClass *oc, void *data) PCR_COMPAT_2_06 | PCR_COMPAT_2_05; pcc->init_proc = init_proc_POWER10; pcc->check_pow = check_pow_nocheck; - pcc->has_work = cpu_has_work_POWER10; pcc->insns_flags = PPC_INSNS_BASE | PPC_ISEL | PPC_STRING | PPC_MFTB | PPC_FLOAT | PPC_FLOAT_FSEL | PPC_FLOAT_FRES | PPC_FLOAT_FSQRT | PPC_FLOAT_FRSQRTE | @@ -8271,6 +8278,7 @@ POWERPC_FAMILY(POWER10)(ObjectClass *oc, void *data) pcc->lpcr_pm = LPCR_PDEE | LPCR_HDEE | LPCR_EEE | LPCR_DEE | LPCR_OEE; pcc->mmu_model = POWERPC_MMU_3_00; #if defined(CONFIG_SOFTMMU) + pcc->has_work = cpu_has_work_POWER10; /* segment page size remain the same */ pcc->hash64_opts = &ppc_hash64_opts_POWER7; pcc->radix_page_info = &POWER10_radix_page_info; @@ -8786,6 +8794,7 @@ static void ppc_cpu_set_pc(CPUState *cs, vaddr value) cpu->env.nip = value; } +#if defined(CONFIG_TCG) && !defined(CONFIG_USER_ONLY) static bool cpu_has_work_default(CPUState *cs) { PowerPCCPU *cpu = POWERPC_CPU(cs); @@ -8801,6 +8810,7 @@ static bool ppc_cpu_has_work(CPUState *cs) return pcc->has_work(cs); } +#endif /* CONFIG_TCG && !CONFIG_USER_ONLY */ static void ppc_cpu_reset(DeviceState *dev) { @@ -9021,6 +9031,7 @@ static const struct TCGCPUOps ppc_tcg_ops = { .tlb_fill = ppc_cpu_tlb_fill, #ifndef CONFIG_USER_ONLY + .has_work = ppc_cpu_has_work, .cpu_exec_interrupt = ppc_cpu_exec_interrupt, .do_interrupt = ppc_cpu_do_interrupt, .cpu_exec_enter = ppc_cpu_exec_enter, @@ -9041,13 +9052,11 @@ static void ppc_cpu_class_init(ObjectClass *oc, void *data) device_class_set_parent_unrealize(dc, ppc_cpu_unrealize, &pcc->parent_unrealize); pcc->pvr_match = ppc_pvr_match_default; - pcc->has_work = cpu_has_work_default; device_class_set_props(dc, ppc_cpu_properties); device_class_set_parent_reset(dc, ppc_cpu_reset, &pcc->parent_reset); cc->class_by_name = ppc_cpu_class_by_name; - cc->has_work = ppc_cpu_has_work; cc->dump_state = ppc_cpu_dump_state; cc->set_pc = ppc_cpu_set_pc; cc->gdb_read_register = ppc_cpu_gdb_read_register; @@ -9078,6 +9087,9 @@ static void ppc_cpu_class_init(ObjectClass *oc, void *data) #ifdef CONFIG_TCG cc->tcg_ops = &ppc_tcg_ops; +#ifndef CONFIG_USER_ONLY + pcc->has_work = cpu_has_work_default; +#endif #endif /* CONFIG_TCG */ } From patchwork Sat Sep 25 14:51: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: 1532769 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=q3KZqQlO; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HGt9n4BWrz9t1C for ; Sun, 26 Sep 2021 01:29:31 +1000 (AEST) Received: from localhost ([::1]:49244 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mU9cG-0008Mo-Em for incoming@patchwork.ozlabs.org; Sat, 25 Sep 2021 11:29:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42652) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mU93p-0002ie-6L; Sat, 25 Sep 2021 10:53:53 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:43572) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mU93n-0006rl-JC; Sat, 25 Sep 2021 10:53:52 -0400 Received: by mail-wr1-x436.google.com with SMTP id w17so36398676wrv.10; Sat, 25 Sep 2021 07:53: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=KfwVihGSy9lOGZEBuM9IdCHEDMq8ZD4Rne15ZYj/c70=; b=q3KZqQlOBjDrcaSJm4Jwy/KKXubL22+x6kNrUoAW6U2VUx7YhIvaWaOxHNy8W5i6RM u6D+CVwGpINqvsrOpKYrenY9GbQsx7v3DAg9xy7yPRt1TjSZwCOugHiavJfSG8ehBPl8 NNE3J1C/EHej7Mh9gFKeNfEUlDGAYtwMQ4O7zJ+3Wk4sdJkMBhLtluXvM3PrHj3w8dAf J7eLX4eRCDAEacU3B2ffgQJUVNbBnvszQMSX3Ds+fdW257t1kBttlSyXNJlKaaAFX+h9 40GH+h2BmlmCRGuUr8M6QUYrmAl87R+c4U+QJ/p/GIuXE4XY+qSfXlnJX+W90m07OkPF H4nQ== 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=nCmsDwKqlJ+7dKHxwOc11o5nQ6XPfwsS9H64fHzMDW2q8sLbJwrKwPc+dj0uWRbs06 rcEZwXCDpLl2jn8SdG8TJqBPELoSVTHuJqdOjehFHYJl9EXiPBgQ5DPkiGNoe2W/Vyiq GpwOW7lhUWjZIv/35/+tnkNfR9iZnueP16DbPrXBhPg8Om7OJvg7BpLyuiAUtbaoW1v5 KNIesUGQmamuJr5HKwdI3Jz+zF5ppPgoyU9xjJFEzvt0Ob8YIPYgtFOM7NX1kQQwpduf PwBtUMBhCFBv/BkI+/LEw3zBkSoTl1nYjRbPJsLfX63bB1bk9R2s20PdK/zMs+Sfaz+W OaQA== X-Gm-Message-State: AOAM5301TIz3yi1gW7nvXlIo6P/Ffpy+bI6PGfqf0SJdVrGxN+uUCwD3 ygdUfdGfF4rUG9pMmj2oRDxCdYOpVdw= X-Google-Smtp-Source: ABdhPJxqug8MHgewM08Hx5zuahM8mlKGvykQPPGxQ89lo5QLD8hB3WieG+KWNK3urSrVZReA6jD8yA== X-Received: by 2002:a05:600c:a05:: with SMTP id z5mr7342567wmp.73.1632581627608; Sat, 25 Sep 2021 07:53: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 m4sm15948511wml.28.2021.09.25.07.53.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Sep 2021 07:53:47 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v7 31/40] target/riscv: Restrict has_work() handler to sysemu and TCG Date: Sat, 25 Sep 2021 16:51:09 +0200 Message-Id: <20210925145118.1361230-32-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210925145118.1361230-1-f4bug@amsat.org> References: <20210925145118.1361230-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.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "open list:RISC-V TCG CPUs" , Bin Meng , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Alistair Francis , Palmer Dabbelt Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Restrict has_work() to TCG sysemu. Reviewed-by: Richard Henderson Acked-by: Alistair Francis Signed-off-by: Philippe Mathieu-Daudé --- target/riscv/cpu.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 7c626d89cd7..ca76bc34d9b 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -335,9 +335,9 @@ static void riscv_cpu_synchronize_from_tb(CPUState *cs, env->pc = tb->pc; } +#if defined(CONFIG_TCG) && !defined(CONFIG_USER_ONLY) static bool riscv_cpu_has_work(CPUState *cs) { -#ifndef CONFIG_USER_ONLY RISCVCPU *cpu = RISCV_CPU(cs); CPURISCVState *env = &cpu->env; /* @@ -345,10 +345,8 @@ static bool riscv_cpu_has_work(CPUState *cs) * mode and delegation registers, but respect individual enables */ return (env->mip & env->mie) != 0; -#else - return true; -#endif } +#endif /* CONFIG_TCG && !CONFIG_USER_ONLY */ void restore_state_to_opc(CPURISCVState *env, TranslationBlock *tb, target_ulong *data) @@ -678,6 +676,7 @@ static const struct TCGCPUOps riscv_tcg_ops = { .tlb_fill = riscv_cpu_tlb_fill, #ifndef CONFIG_USER_ONLY + .has_work = riscv_cpu_has_work, .cpu_exec_interrupt = riscv_cpu_exec_interrupt, .do_interrupt = riscv_cpu_do_interrupt, .do_transaction_failed = riscv_cpu_do_transaction_failed, @@ -697,7 +696,6 @@ static void riscv_cpu_class_init(ObjectClass *c, void *data) device_class_set_parent_reset(dc, riscv_cpu_reset, &mcc->parent_reset); cc->class_by_name = riscv_cpu_class_by_name; - cc->has_work = riscv_cpu_has_work; cc->dump_state = riscv_cpu_dump_state; cc->set_pc = riscv_cpu_set_pc; cc->gdb_read_register = riscv_cpu_gdb_read_register; From patchwork Sat Sep 25 14:51: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: 1532759 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=bDq37a/l; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HGstk0pQZz9t1C for ; Sun, 26 Sep 2021 01:16:30 +1000 (AEST) Received: from localhost ([::1]:40132 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mU9Pf-0008Hn-Oe for incoming@patchwork.ozlabs.org; Sat, 25 Sep 2021 11:16:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42686) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mU93r-0002ro-IG for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:53:55 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:35559) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mU93p-0006vq-WE for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:53:55 -0400 Received: by mail-wr1-x434.google.com with SMTP id i23so36577578wrb.2 for ; Sat, 25 Sep 2021 07:53: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=o/vqGSMOnhzvKGrld2aIeHhcVaK006Y9gzP+FF74z+I=; b=bDq37a/lE37CTk+jAcFOz8DtR7um/Nas8YPLtoPubNP0GVjmacrXEmmp82NEhryl3L XtpAGISmw5dsRbMYJZFrjqdfdhV8SF1VLkSBCv91yXv7i3qmk9JEsVh6l/MGB2bR5vZm CbPWNSh/UORzJ0zexmLNPEXdvF1UFuCqdxJxY29cNboldwZymlZrDFu6V5rLxCffjtHg 5ycRMSx8pSO0J3g1f+WoRM+46Fmn3cojWN7m283oGRAz9Z7exfLry7lf9BSskc7t4FF4 DaYnrJaMcXqgQgLydbqHfVqN/S8aSnXqdoyEvtvMYKLc2I/0km1XJqMXh2oSRVIBzrH1 hQMg== 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=Y98U/wsDGNc525j+KYtIHQxcWKDrqR4NVtw7nGrt45JJhpN0inCDYou9GZw0nqnn3P XPbnIJcYIKnZfsOdzeTx335w0/PfbWr90qFOjlIk5lnKAQ7iGftujAfUyOikHuHCUCcv dvuBf567OlF+mo0Ue/ZgY4eQdpEmbXb98DfqwYWtn0x7uoaLBVnBN+HpIEwlCXkgAhR7 XhvJWMxAlrL7VyOYDNwvrAnL5TbeNJ6dgTUwk9yTn//fdUAW7J2VZYAjlmkyzttfSWOE Epc3zi/slveoph3UbYY9IN3nfuR4wqyKo2/1d2aLQ0IWn9auuPrlTFW+VBSJk/o/Fswf 1E3w== X-Gm-Message-State: AOAM533JAXu3FwEST2iTRHdv1x4G5xQtrJJd3HwrnBzU5Jt6cSmMQ/vS lH45CAM/928Qk57f2gzo9d4if00zu+4= X-Google-Smtp-Source: ABdhPJxqRk3Iz8r3gtAsPOe/BWHkD0LluDyj+kPazr3JUmal6maIuI6kPTDUDx0mvo2M5WIfPpjimg== X-Received: by 2002:a05:6000:1b90:: with SMTP id r16mr17805204wru.250.1632581632326; Sat, 25 Sep 2021 07:53: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 a75sm12144010wmd.4.2021.09.25.07.53.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Sep 2021 07:53:51 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v7 32/40] target/rx: Restrict has_work() handler to sysemu Date: Sat, 25 Sep 2021 16:51:10 +0200 Message-Id: <20210925145118.1361230-33-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210925145118.1361230-1-f4bug@amsat.org> References: <20210925145118.1361230-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.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Yoshinori Sato Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Restrict has_work() to sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/rx/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/rx/cpu.c b/target/rx/cpu.c index 25a4aa2976d..ac6b40b2716 100644 --- a/target/rx/cpu.c +++ b/target/rx/cpu.c @@ -41,11 +41,13 @@ static void rx_cpu_synchronize_from_tb(CPUState *cs, cpu->env.pc = tb->pc; } +#if !defined(CONFIG_USER_ONLY) static bool rx_cpu_has_work(CPUState *cs) { return cs->interrupt_request & (CPU_INTERRUPT_HARD | CPU_INTERRUPT_FIR); } +#endif /* !CONFIG_USER_ONLY */ static void rx_cpu_reset(DeviceState *dev) { @@ -189,6 +191,7 @@ static const struct TCGCPUOps rx_tcg_ops = { .tlb_fill = rx_cpu_tlb_fill, #ifndef CONFIG_USER_ONLY + .has_work = rx_cpu_has_work, .cpu_exec_interrupt = rx_cpu_exec_interrupt, .do_interrupt = rx_cpu_do_interrupt, #endif /* !CONFIG_USER_ONLY */ @@ -206,7 +209,6 @@ static void rx_cpu_class_init(ObjectClass *klass, void *data) &rcc->parent_reset); cc->class_by_name = rx_cpu_class_by_name; - cc->has_work = rx_cpu_has_work; cc->dump_state = rx_cpu_dump_state; cc->set_pc = rx_cpu_set_pc; From patchwork Sat Sep 25 14:51: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: 1532762 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=aQxsRYQI; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HGsyB2xdvz9t1C for ; Sun, 26 Sep 2021 01:19:30 +1000 (AEST) Received: from localhost ([::1]:47318 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mU9SY-0004oY-PY for incoming@patchwork.ozlabs.org; Sat, 25 Sep 2021 11:19:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42714) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mU93w-0003At-Ly; Sat, 25 Sep 2021 10:54:00 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:42935) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mU93v-0006zi-4A; Sat, 25 Sep 2021 10:54:00 -0400 Received: by mail-wr1-x436.google.com with SMTP id i24so20541343wrc.9; Sat, 25 Sep 2021 07:53: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=ZAYjmxiur5f+p7A1SrpNSihQLXDhLnmlUZZ8rIaewhE=; b=aQxsRYQIMX8vJbc7+lkGv7kE8uACN+7zrjpIq2yWAjSL8UvPXbHELavSQ9c9vi8Z7B BW3Dg2azlaaDlsw288fesgycwhPhWqxCXvCEPDpBRmsmo0gQegoANT3NAWTAaBNqDYzy uVAYOBukMyJFT0opo4hq5CEtygQh4lgV0HcVpf6wsEkaNn065NnbIxEhKVzmq6+m/w9v LEkzDKA8qPB/1np09OThfB8I6FLDhKt/S0rU6zHFmlDAXCB4vVWi9BOH62tOo+gPXYBQ bHYosYwl7U0Qiw+LsO9/oFHYXOwEJ8v+IDeJ1cLVE4K0wlzySH34d7pf4M4kqnOjyhCu a9Ow== 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=cDZvRi/SGz8xtUjYeHrg7Yir7svJKH548VHqZzt2oDHuZ3exUCUVuepW581MZQ7avq D7ydnv3lCznNM9dRuuSO/tXMi+yuJSlHsWvHWHlnoMBjzwxEP6Uy16clgXygKyvn0UwU Bd+wpSjMb1E8GopX68IwS22vsPvw/f8md/TvMAW/rjn5Gw57ly5bAUUUI2gSP3FXRPhI SEED/75djhND+Pu3pa1dBWmz3N1qE5U2FykM3PVJ3B8DJGivjSjzm0jEHbUbBH8HAGCq K4/BEXMqCdE1DmYMw3nfVdQ2eisPVf6OKxsfSqB8t9Ln+mG9s18VIDDk4Vtgvw1XbI2E h8qA== X-Gm-Message-State: AOAM531eNsk36YoTBEeSxCoi9UpoJAjd3TQz7IsrhQdKhoS/IEG11yOL dhnnyGun9X1K2by87IsJxJGSMTXhH1E= X-Google-Smtp-Source: ABdhPJzLqwLC9wkrI46iPIBPW/hBXnGqEP5zHnqRLbDFPrkBdvJsIbHHen+DjFsKWtWpCby8aG488Q== X-Received: by 2002:a7b:c048:: with SMTP id u8mr7108728wmc.113.1632581637285; Sat, 25 Sep 2021 07:53: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 z17sm11127651wml.24.2021.09.25.07.53.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Sep 2021 07:53:56 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v7 33/40] target/s390x: Restrict has_work() handler to sysemu and TCG Date: Sat, 25 Sep 2021 16:51:11 +0200 Message-Id: <20210925145118.1361230-34-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210925145118.1361230-1-f4bug@amsat.org> References: <20210925145118.1361230-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.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , David Hildenbrand , Cornelia Huck , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Halil Pasic , Christian Borntraeger , "open list:S390 general arch..." Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Restrict has_work() to TCG sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- 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 Sat Sep 25 14:51: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: 1532770 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=WTi905Fp; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HGtKC6YFbz9t1Q for ; Sun, 26 Sep 2021 01:35:59 +1000 (AEST) Received: from localhost ([::1]:37862 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mU9iX-000323-NV for incoming@patchwork.ozlabs.org; Sat, 25 Sep 2021 11:35:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42740) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mU940-0003Pj-Ob for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:54:04 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:42934) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mU93z-00073n-8B for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:54:04 -0400 Received: by mail-wr1-x434.google.com with SMTP id i24so20541724wrc.9 for ; Sat, 25 Sep 2021 07:54: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=DvtLk1KDYMk4Ooy/WV4tyGGjURyvQDa7DPky1rRpIYc=; b=WTi905FpEEnUQcX06Ip2tGfdx6sVAeY9HE/khlNtUjaQKEDDAK5xzfNe5G+hy+wn2A hIxpf3e4bHJ8L9/MJmElJtEi5vR0iVva6n3Gbb96v8SsWzvGagNO8RXzJTLZmtm5kb+k VndcziOT8ZU3/viei6IbkXRDu4Jk28s+E5Q1jcw8NFXhtgOAeVdRX+MVt0F/ZVGwrrYK V0/tI57JxW/a7pvLORlrIVeKQcOUqzV0HYMDZ3FIJ9dTzXzFEtFd44E9ATmT0yCY5kN7 goahmA8WfxSA2/CD/2KB9n2yg2BDSyuxKkvxzOpP3xV7ikGxzq1T8CKq4j0bM2ErXCUz zhxg== 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=II9WccopvKzzjpgH564+EDGDkHwS2bW28nSNtTCOo219OeC+3LdGkfagbsDMvErsyA Z/aS6p7mecrXiN9LzpMSpaxkTEYkb6rDhzgAIcnC63osCnxoDyjYU9FsGDYDzYv7Fp9O CGLfXuX7YawRzu1IqAHRCWAZVY1FJFhtmhhWQPQnqdRH9Ndwo5Gqk9J9Rn9JHQcbXL3S 6roqHdbHYWHi2KNM/LrXXdQaq21zUysVtx3uJxxqWLlwNZhuV4716npZRapJzlo3e/9Q GGUBLqPht81wjILTeCwsTaOxz7/YT244ujDdUPAZ+zpMVkNQS204wy0FILsDQzYvuGPJ iXOQ== X-Gm-Message-State: AOAM531QK6ttRMRBzYiTenFed09TJs4O3jVPX7IyI0Eert4tE5pQqnTK dsTLlMi53oVzugAvf0IMlkCh4Eb7ezE= X-Google-Smtp-Source: ABdhPJz5XHzAMYoT32gRDCI021c8L/UcZiPR82gZZ/bxBgvXUiPTwUgz93zGxW44yxkILqCsz7wqkA== X-Received: by 2002:a05:6000:1a85:: with SMTP id f5mr18011282wry.25.1632581641853; Sat, 25 Sep 2021 07:54: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 i18sm11441097wrn.64.2021.09.25.07.54.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Sep 2021 07:54:01 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v7 34/40] target/sh4: Restrict has_work() handler to sysemu Date: Sat, 25 Sep 2021 16:51:12 +0200 Message-Id: <20210925145118.1361230-35-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210925145118.1361230-1-f4bug@amsat.org> References: <20210925145118.1361230-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.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Yoshinori Sato Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Restrict has_work() to sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/sh4/cpu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c index 2047742d03c..fb2116dc52e 100644 --- a/target/sh4/cpu.c +++ b/target/sh4/cpu.c @@ -58,13 +58,14 @@ static bool superh_io_recompile_replay_branch(CPUState *cs, } return false; } -#endif static bool superh_cpu_has_work(CPUState *cs) { return cs->interrupt_request & CPU_INTERRUPT_HARD; } +#endif /* !CONFIG_USER_ONLY */ + static void superh_cpu_reset(DeviceState *dev) { CPUState *s = CPU(dev); @@ -239,6 +240,7 @@ static const struct TCGCPUOps superh_tcg_ops = { .tlb_fill = superh_cpu_tlb_fill, #ifndef CONFIG_USER_ONLY + .has_work = superh_cpu_has_work, .cpu_exec_interrupt = superh_cpu_exec_interrupt, .do_interrupt = superh_cpu_do_interrupt, .do_unaligned_access = superh_cpu_do_unaligned_access, @@ -258,7 +260,6 @@ static void superh_cpu_class_init(ObjectClass *oc, void *data) device_class_set_parent_reset(dc, superh_cpu_reset, &scc->parent_reset); cc->class_by_name = superh_cpu_class_by_name; - cc->has_work = superh_cpu_has_work; cc->dump_state = superh_cpu_dump_state; cc->set_pc = superh_cpu_set_pc; cc->gdb_read_register = superh_cpu_gdb_read_register; From patchwork Sat Sep 25 14:51: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: 1532771 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=QiljUGdm; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HGtMN5Ttsz9t1Q for ; Sun, 26 Sep 2021 01:37:52 +1000 (AEST) Received: from localhost ([::1]:44214 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mU9kM-0007ae-ID for incoming@patchwork.ozlabs.org; Sat, 25 Sep 2021 11:37:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42754) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mU945-0003g0-E0 for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:54:09 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:43573) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mU944-00076e-0W for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:54:09 -0400 Received: by mail-wr1-x433.google.com with SMTP id w17so36400095wrv.10 for ; Sat, 25 Sep 2021 07:54: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=LjvVczq8n5tzr9drSBRznUr4y3SH1knsfynMe8Ogfbw=; b=QiljUGdm0PKQEXCkCNn340fVhtc5Zbn+wi8S6fwpUS0jh7tELuzVyXlWoJbZCo6vPO FMPH6IigiKzQZFC+/SDbfglQa7O8ORZ1dU8jOF+BVNJC4PAd0rYGT+uaWefVptQ6c9Eh 69Oc9ZmcLbWWtiNMz1uLt5UJMvfiTVarOPR0ajuWKeHRNK3LmdFZ4O+sAtaizLelLuBT DM0SnQQJf3KTpJ5Yx+a6vLy1Yqzg8Eu+KS0gcT5d9zOjqpGfaURv472vW+ixzq4FnANf t0GxC9NvVCYgb2IC96nReE575U12b5Kc1OzGdtLCNIQjbZCvdOpyoeU6eNk2cjCW6vgQ n3fw== 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=Wqr1WtHwUbJvIaKaqg4AYwbKrDbA9XUZtVccvvuL8Xhxl3OvKOOyU0x97ldwAh9BvX u8agQfEvAO4Y6a3UKb778K3F8lqRSQreWGSrHJeaRtkxrMtwmgwNV2Z/1FyaSjrIDwug vAMORY+0TYQ1Zu0UkVt3Ppol0+PUfbzihIKqfGMecFNyD0bd+AWLTjxi+c+39cYojz8I S0iqRfD3wZHoAXcXW9TqTXLBQXS8f9q2IJaOeMNLZky8HvLO3bISK0l3KSpkoTgP+VLM LDxW5zyIHVHJQRcUS7u+T1z8fUwsFGebnOgu3V0BAEpPemcV9MkEySRa6KgaZ1cYB13X NEaA== X-Gm-Message-State: AOAM532IX29g2mpvuoj8bCweFV5jHkimF1CPwUbjGnYI7kgl5ZwtMeBw L8184QYs1xptI0I8KfVdojLoHJCr0LQ= X-Google-Smtp-Source: ABdhPJzTNnxPD6KolsrTO1Z3gTTabWnSOPpByyFJ7/q1/yTu3F2/RsCi2e5SEWuH4tvfEswqMj+FMQ== X-Received: by 2002:a05:600c:3585:: with SMTP id p5mr7460106wmq.88.1632581646483; Sat, 25 Sep 2021 07:54: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 x14sm11522211wmc.10.2021.09.25.07.54.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Sep 2021 07:54:06 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v7 35/40] target/sparc: Remove pointless use of CONFIG_TCG definition Date: Sat, 25 Sep 2021 16:51:13 +0200 Message-Id: <20210925145118.1361230-36-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210925145118.1361230-1-f4bug@amsat.org> References: <20210925145118.1361230-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x433.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Cave-Ayland , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Artyom Tarasenko Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The SPARC target only support TCG acceleration. Remove the CONFIG_TCG definition introduced by mistake in commit 78271684719 ("cpu: tcg_ops: move to tcg-cpu-ops.h, keep a pointer in CPUClass"). Reported-by: Richard Henderson Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/sparc/cpu.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index 21dd27796d0..0d252cb5bdc 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -859,7 +859,6 @@ static const struct SysemuCPUOps sparc_sysemu_ops = { }; #endif -#ifdef CONFIG_TCG #include "hw/core/tcg-cpu-ops.h" static const struct TCGCPUOps sparc_tcg_ops = { @@ -874,7 +873,6 @@ static const struct TCGCPUOps sparc_tcg_ops = { .do_unaligned_access = sparc_cpu_do_unaligned_access, #endif /* !CONFIG_USER_ONLY */ }; -#endif /* CONFIG_TCG */ static void sparc_cpu_class_init(ObjectClass *oc, void *data) { From patchwork Sat Sep 25 14:51: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: 1532763 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=ijLH+UQo; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HGsyV6lgfz9t8j for ; Sun, 26 Sep 2021 01:19:46 +1000 (AEST) Received: from localhost ([::1]:48914 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mU9Sq-0005t1-MS for incoming@patchwork.ozlabs.org; Sat, 25 Sep 2021 11:19:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42788) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mU94A-0003zO-CQ for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:54:14 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:33526) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mU948-0007BA-SM for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:54:14 -0400 Received: by mail-wr1-x436.google.com with SMTP id t18so36556238wrb.0 for ; Sat, 25 Sep 2021 07:54: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=7nxEt9EN1rfUcFm1gYLqiVpIjc8wwfbzfO8vsuUKuDU=; b=ijLH+UQoiCfmfrFOgh3gjvCnCVH6BEyy/QyDaJrrsVftBfqqTteorWngyySf0my8m2 MSTaV0cMNPL56uf+I3ixMj438bXjoxhh3hmQGH897aturmyVcCQ00xqw1OEjD3ZXiTvD phXRoOO9iNNjxvrdZI1kcQNEnhD0Amch//vi3WU+BkTZZjQJcyfZv38meq/zn6On2x/L 8FpQ543uFSlPOa1HrcocR5WDKiIFTLVvCnmIzk7n7hJgRy6JLFJu6awLp4xdbLP451Xc K5maObG/0kq2ZuqW7L+HBAWR7mbFTm4RNJs8DPt/UovB5XOg/S5khZE4UeH1ZyIdtyJ7 HWHg== 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=0/QexLyLXQPLIYZR9Df/tUTs3LgiTAN7T3v4yEvZq/lXfWY3Ymbe2l+o+Lu/YuE4wv /AH4MWI8ejIo6Y9bOyD69uPR//9/qFrbGOv3xv9K0DqrJBIrh89PWrx4m1hyMZ7ghwq+ 9XDDT1B5ErB9aDGpujN9CcmFJHyTKBI7fylW2k0xtoi84qUFiCKJRAFvwF4CLgU3xX9+ uHjg7Qa0OkpE75zoXzD2tjXqo+cGqPDtRqo2hsBSbzA5XU4/Dj7eUcQB308ZDgKEE9dm 7e2ej3Lpkzb5ghuekl9pSS+PO6pdLGDXMXkXnaA66UJDglqhjx22vXJ/B8Z6zohxu6vg m8sA== X-Gm-Message-State: AOAM5303YwW+XI7SmSMlQJdC2T4rye4dlPlN9diZleWm/R8f+YatykD0 Vg8YKr+Jrjxsq+22/7tdomCO2XRAMts= X-Google-Smtp-Source: ABdhPJw09UagsrFkhlht0hUTqy24dAnkUnWy7RPE1pO3uphUrcJt0CS4LBBrPvE/3w+9kB0ickDcDA== X-Received: by 2002:a05:600c:4ca2:: with SMTP id g34mr7260753wmp.193.1632581651449; Sat, 25 Sep 2021 07:54: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 q7sm11963610wrc.55.2021.09.25.07.54.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Sep 2021 07:54:10 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v7 36/40] target/sparc: Restrict has_work() handler to sysemu Date: Sat, 25 Sep 2021 16:51:14 +0200 Message-Id: <20210925145118.1361230-37-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210925145118.1361230-1-f4bug@amsat.org> References: <20210925145118.1361230-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.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Cave-Ayland , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Artyom Tarasenko Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Restrict has_work() to sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/sparc/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index 0d252cb5bdc..8d61bf15f6c 100644 --- a/target/sparc/cpu.c +++ b/target/sparc/cpu.c @@ -702,6 +702,7 @@ static void sparc_cpu_synchronize_from_tb(CPUState *cs, cpu->env.npc = tb->cs_base; } +#if !defined(CONFIG_USER_ONLY) static bool sparc_cpu_has_work(CPUState *cs) { SPARCCPU *cpu = SPARC_CPU(cs); @@ -710,6 +711,7 @@ static bool sparc_cpu_has_work(CPUState *cs) return (cs->interrupt_request & CPU_INTERRUPT_HARD) && cpu_interrupts_enabled(env); } +#endif /* !CONFIG_USER_ONLY */ static char *sparc_cpu_type_name(const char *cpu_model) { @@ -867,6 +869,7 @@ static const struct TCGCPUOps sparc_tcg_ops = { .tlb_fill = sparc_cpu_tlb_fill, #ifndef CONFIG_USER_ONLY + .has_work = sparc_cpu_has_work, .cpu_exec_interrupt = sparc_cpu_exec_interrupt, .do_interrupt = sparc_cpu_do_interrupt, .do_transaction_failed = sparc_cpu_do_transaction_failed, @@ -888,7 +891,6 @@ static void sparc_cpu_class_init(ObjectClass *oc, void *data) cc->class_by_name = sparc_cpu_class_by_name; cc->parse_features = sparc_cpu_parse_features; - cc->has_work = sparc_cpu_has_work; cc->dump_state = sparc_cpu_dump_state; #if !defined(TARGET_SPARC64) && !defined(CONFIG_USER_ONLY) cc->memory_rw_debug = sparc_cpu_memory_rw_debug; From patchwork Sat Sep 25 14:51: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: 1532765 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=k0Sz8yUM; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HGt151fFmz9t1C for ; Sun, 26 Sep 2021 01:22:01 +1000 (AEST) Received: from localhost ([::1]:55060 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mU9V0-0001Zt-UV for incoming@patchwork.ozlabs.org; Sat, 25 Sep 2021 11:21:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42820) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mU94F-0004J8-BO for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:54:19 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:43571) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mU94D-0007Fb-PI for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:54:19 -0400 Received: by mail-wr1-x42f.google.com with SMTP id w17so36401008wrv.10 for ; Sat, 25 Sep 2021 07:54: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=1gsdxrxIkLL008ui7WH6lPMx1hd/4ygkSIHUg3uTtLo=; b=k0Sz8yUMSYMZ/8xbOcsrvFMQprsY5D03rEsFNB2SQrgBVNb1hlFa+knUz/kDL9rLzB dfjHNMc/FhWae7ujFy7ax7mfJigJkTDMLq0tmSe81MQwosJj/BZh8wGeN4fA+w9eB87r O5pH97URLpbLocqAAsaP+HxILpmT/CZQKi5aKNLToB9ZGUlvmRaiaZchfmerR6jM7Dqd /WrfQS4z3bXJDxDE6tBbry22Ttayhx2Nota+dx/O0FkBjuz0nRq/pbwkOUin78OnU89P nAH+xJG10ZI2+/DJ+72z0Kq33KWyIJLtBBqwPEs9WEVyifLf/a4kec76NlmT5PtNA6a/ 0Kkg== 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=IH1Sf1qN/TRLsLmm3r10gFbCvscz+pjqW6klOMjAbrcxrRiVvyZp48Y0j6UzEVhzzi IEBS5SAv3x3bQextnKBECEZ1tzc0tP0wlqJjZozJnSVoFVVxgs6gYMrpgzeTuUZHMu2S uzg5mlO+SFgtH/s+YhQlHQG9Wm0dLLmBtFBSc7MtI5GfWyp43G0KDl3N3ibC9K7GPji6 bV+rbN4+2r7EjFVAJG0YUYao9Ijiz9EBCO1WOevcyIrbVHaXm+nDvqZ/zEBMEqtx08K2 553v/28Efbkt3OuJMlXjuThEb1tlXzNMkfWpvXitFwORl/KAI6n4lJO0W3kF3GMPsVE1 lJFg== X-Gm-Message-State: AOAM531tSq1amerOkcLJ50kBvldbkYY4o7SMhGml7H0o2EcLHnSZaq/e Og+MPcj7CHfND2vl7zfW3gLt2KhtA0g= X-Google-Smtp-Source: ABdhPJzPfotxBBSzEU+E5O4FEXBLyWmWJLpARs2ee9fo32q/153reG1jvVpj6DyJlVWk+Y5sHF6OwQ== X-Received: by 2002:a05:6000:160c:: with SMTP id u12mr17585287wrb.128.1632581656243; Sat, 25 Sep 2021 07:54: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 w5sm11286457wra.87.2021.09.25.07.54.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Sep 2021 07:54:15 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v7 37/40] target/tricore: Restrict has_work() handler to sysemu Date: Sat, 25 Sep 2021 16:51:15 +0200 Message-Id: <20210925145118.1361230-38-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210925145118.1361230-1-f4bug@amsat.org> References: <20210925145118.1361230-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.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, 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: Bastian Koppelmann , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Restrict has_work() to sysemu. Reviewed-by: Richard Henderson 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 Sat Sep 25 14:51: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: 1532758 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=qWU4MvPZ; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HGstK42TFz9t1C for ; Sun, 26 Sep 2021 01:16:09 +1000 (AEST) Received: from localhost ([::1]:39076 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mU9PK-0007aV-6X for incoming@patchwork.ozlabs.org; Sat, 25 Sep 2021 11:16:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42832) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mU94L-0004Xr-Ex for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:54:27 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:40556) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mU94I-0007JT-Px for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:54:24 -0400 Received: by mail-wr1-x431.google.com with SMTP id t28so23094372wra.7 for ; Sat, 25 Sep 2021 07:54: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=F6iT0mYKdizTZwY+Alp0nWU9C8rVfDyZdw7MbXpCAAA=; b=qWU4MvPZ5d33fFily2WsBp0lCIJ+9dZ12jEywn0YcLYbvd5J2IibCyiwEeldXAKvpB SG6zpIGxHY6wsdaEcZ4pIWIAzZyvCdmQUMGMeetakI5dFUiCdrlNFoHB7o7U7crJDfOr oI1B+OOn9bSRpFNxCzBOLu7TPhrcACUBh2IjGaJgJsnTH5UnmM6c6JzxmrOtWiKWJ94E 5jHf0dFjS9Y3RGNYfal8jO18q6uISzRVSFBhwEUPoG/BvvyiTF23CmQABch0+9EIBeVf zI3SEeC6sNVDYknfowSrC3vz6FZDwRw54qT+ous3m/PtPBJJAUnfXbok/bsMdyO6cu/S 0oeA== 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=1h/7Q+AjSWO4FX3znsLZYT9tkj6UicswGkuZuesxup3eCeOPGW3A4Q4cRnG76hAMPt A9y4nHrO1EFgGhTAgeTcpVbTqQsXKy+6GDSOlRI1y/Noe65w2oxmB9/aD6sbxdq0hakh 144pjDXuijLtyN99Ob3LGJU9DyTVDp05OwuAbEQf0C6olGcJbFLZ2UMh3uNb3RWLnjIy 9wxRMTIgEcFnlnixhRd4Ov68PRj7JhTiD1V751t+hTzGmFN7qAINH5njZMs26uJsSdpg tQ8nbtY0ptndDVl3rUkhM1iTrJySvMPo438v36ijlF9q5ihmqhYWT/mjvtTM/MXwQw9P 9Yfg== X-Gm-Message-State: AOAM531hsUDrNQLJ/YyEAYnoMVZS5uzrpQG2tElwByndt+JHdQdFDTDz WXx3tpU+BfPhshvlZqnxHt1+QlDPY3A= X-Google-Smtp-Source: ABdhPJxZynzoTzWQihn5d1/8CIHagvpHrrcMrbwJB7uTwH04XrWwsKQIaT+4S8bQqpVBis8GozBtIQ== X-Received: by 2002:adf:e906:: with SMTP id f6mr2689169wrm.207.1632581661371; Sat, 25 Sep 2021 07:54: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 v17sm1325275wro.34.2021.09.25.07.54.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Sep 2021 07:54:20 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v7 38/40] target/xtensa: Restrict has_work() handler to sysemu Date: Sat, 25 Sep 2021 16:51:16 +0200 Message-Id: <20210925145118.1361230-39-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210925145118.1361230-1-f4bug@amsat.org> References: <20210925145118.1361230-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.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Max Filippov , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Restrict has_work() to sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/xtensa/cpu.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index c1cbd03595e..5cb19a88819 100644 --- a/target/xtensa/cpu.c +++ b/target/xtensa/cpu.c @@ -43,18 +43,17 @@ static void xtensa_cpu_set_pc(CPUState *cs, vaddr value) cpu->env.pc = value; } +#ifndef CONFIG_USER_ONLY + static bool xtensa_cpu_has_work(CPUState *cs) { -#ifndef CONFIG_USER_ONLY XtensaCPU *cpu = XTENSA_CPU(cs); return !cpu->env.runstall && cpu->env.pending_irq_level; -#else - return true; -#endif } -#ifdef CONFIG_USER_ONLY +#else /* CONFIG_USER_ONLY*/ + static bool abi_call0; void xtensa_set_abi_call0(void) @@ -66,7 +65,8 @@ bool xtensa_abi_call0(void) { return abi_call0; } -#endif + +#endif /* CONFIG_USER_ONLY */ static void xtensa_cpu_reset(DeviceState *dev) { @@ -196,6 +196,7 @@ static const struct TCGCPUOps xtensa_tcg_ops = { .debug_excp_handler = xtensa_breakpoint_handler, #ifndef CONFIG_USER_ONLY + .has_work = xtensa_cpu_has_work, .cpu_exec_interrupt = xtensa_cpu_exec_interrupt, .do_interrupt = xtensa_cpu_do_interrupt, .do_transaction_failed = xtensa_cpu_do_transaction_failed, @@ -215,7 +216,6 @@ static void xtensa_cpu_class_init(ObjectClass *oc, void *data) device_class_set_parent_reset(dc, xtensa_cpu_reset, &xcc->parent_reset); cc->class_by_name = xtensa_cpu_class_by_name; - cc->has_work = xtensa_cpu_has_work; cc->dump_state = xtensa_cpu_dump_state; cc->set_pc = xtensa_cpu_set_pc; cc->gdb_read_register = xtensa_cpu_gdb_read_register; From patchwork Sat Sep 25 14:51:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1532766 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=j2XKcvZj; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HGt1X6VGyz9t1C for ; Sun, 26 Sep 2021 01:22:24 +1000 (AEST) Received: from localhost ([::1]:56506 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mU9VO-0002ah-H2 for incoming@patchwork.ozlabs.org; Sat, 25 Sep 2021 11:22:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42864) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mU94R-0004dt-IH for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:54:31 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:46595) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mU94O-0007Nm-Om for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:54:31 -0400 Received: by mail-wr1-x434.google.com with SMTP id c21so6797854wrb.13 for ; Sat, 25 Sep 2021 07:54:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=p+FhEVuxYvtBhbZfLgBuFMc/Z1Zw1Ec9d9CUDDVANlA=; b=j2XKcvZjAzhbF0iXh1wHoimnzK7MTcasZiXgGUDBIw24aQkysZpZV2MgjkdvCQaqqB uvmyElm74VQUVie93oSPhaseqL1alTXdcYvvpm7YDSbt249dKlqfFL6WTX7EenuptBjZ 9WhNhhKr1XFI8+BTCXM9VmbMFhIOiMCHyeTfBHeLXleTUpUv3PQ/LGkXUaxAHujJbm3W xyZnPFTls1bGWelGTcb5BQIlHW/umcbs0QrgfrG4x+1TT6/Eoo8dQR9gHgFVhj+lNfRk C/i30R73O83Xy2w1GlS9ziojb4DslJe/IHVHFiFV9YaXZ9p48+4hiQN8wH3u9UFaW7AF MeNg== 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=gO/DBOFLasc8KpciIuX5DwmLJDMkC6c2ue9G5zs4Pvd6EzOm6n9ge9DBtXZOKxPbgS HnwzbmQsaROXMXTRbS8IW+8DvSMmc6lc4TXrconDKJrF8C3bfuLYeJ6oNVXn91nsrvGg 4DogpkCC2IC6k0ZWlpZf0NRSXdS4z7AVKPSKY42sntB46zclZnCfI2KtRP/XnzhlkYYd sNRUiP5551K0lglCDlB5m0fxzXtvzs9nwVWzBm0LrcNAgbJvzlp4FQA07KQvqzuR2pXo P1EvcxPVmKeJTuhvh+5fHR1Xwkt42HNliZfuZDG4FhNIcar/dSd76RATkiJDnxKtjUQ+ k/gA== X-Gm-Message-State: AOAM530rzxCsa1l3sLXvtAWYWxky1GTZZzBRy51al4o+Hlo2WCDqKzyI 8DVELZnDxZzWaPBfyWIlZcoPcK6mTCk= X-Google-Smtp-Source: ABdhPJw8KBnY91I/w/nFC+xmJ1P2SRFfjejZY8DVCqC6ojyqeRXr6WksgOhHl4teltZayCtSxnIkGg== X-Received: by 2002:a7b:c766:: with SMTP id x6mr7293341wmk.53.1632581666382; Sat, 25 Sep 2021 07:54:26 -0700 (PDT) Received: from x1w.. (118.red-83-35-24.dynamicip.rima-tde.net. [83.35.24.118]) by smtp.gmail.com with ESMTPSA id j4sm11680888wrt.67.2021.09.25.07.54.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Sep 2021 07:54:25 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v7 39/40] accel/tcg: Remove CPUClass::has_work() Date: Sat, 25 Sep 2021 16:51:17 +0200 Message-Id: <20210925145118.1361230-40-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210925145118.1361230-1-f4bug@amsat.org> References: <20210925145118.1361230-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.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Eduardo Habkost Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Now that all TCG targets converted their CPUClass::has_work() handler to a TCGCPUOps::has_work() one, we can remove has_work from CPUClass. Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 2 -- accel/tcg/tcg-accel-ops.c | 3 --- 2 files changed, 5 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 114eb3b9b2c..c64709b898c 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -89,7 +89,6 @@ struct SysemuCPUOps; * instantiatable CPU type. * @parse_features: Callback to parse command line arguments. * @reset_dump_flags: #CPUDumpFlags to use for reset logging. - * @has_work: Callback for checking if there is work to do. Only used by TCG. * @memory_rw_debug: Callback for GDB memory access. * @dump_state: Callback for dumping state. * @get_arch_id: Callback for getting architecture-dependent CPU ID. @@ -132,7 +131,6 @@ struct CPUClass { void (*parse_features)(const char *typename, char *str, Error **errp); int reset_dump_flags; - bool (*has_work)(CPUState *cpu); int (*memory_rw_debug)(CPUState *cpu, vaddr addr, uint8_t *buf, int len, bool is_write); void (*dump_state)(CPUState *cpu, FILE *, int flags); diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c index cd44bb6d0d8..3c75ed2cccc 100644 --- a/accel/tcg/tcg-accel-ops.c +++ b/accel/tcg/tcg-accel-ops.c @@ -78,9 +78,6 @@ static bool tcg_cpu_has_work(CPUState *cpu) { CPUClass *cc = CPU_GET_CLASS(cpu); - if (cc->has_work) { - return cc->has_work(cpu); - } if (cc->tcg_ops->has_work) { return cc->tcg_ops->has_work(cpu); } From patchwork Sat Sep 25 14:51:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 1532772 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=XXmlP6cL; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4HGtNb1DcNz9t1Q for ; Sun, 26 Sep 2021 01:38:55 +1000 (AEST) Received: from localhost ([::1]:47294 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mU9lN-0001fw-01 for incoming@patchwork.ozlabs.org; Sat, 25 Sep 2021 11:38:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42878) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mU94T-0004fJ-No for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:54:34 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:40557) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mU94S-0007RI-EB for qemu-devel@nongnu.org; Sat, 25 Sep 2021 10:54:33 -0400 Received: by mail-wr1-x430.google.com with SMTP id t28so23095178wra.7 for ; Sat, 25 Sep 2021 07:54:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=L6ntqmXS7ifceLSpB74XEWOrQdhQXzlIYsRxqC94HM4=; b=XXmlP6cLFpZrFEwpSQpqLjkIeoXbqru4Jzhp3Pae/ZVwAcQVcE5kqnZ25vCtt3IK5C ujgZIx0F+BjhHfFArQMuZYhqrCwjLe6kxBt0m1BR1jqSzhko5KaxNOQH4y5l7qXjwrLB zNERBOP+Or7Lhuhj8dV+OBUbvGy7UMgnyHAfa08ltO4yuqQ41InTJzmnUASj5Q9BwORP loxtfZ5/NXAqQprsPM6JeboJVjWHvbaE+59lEmgcVR5CMXl56SntlcqiuqoPInaKLAhb rTWpeHqhT2Em7d7MW3WAdjZZzDwr2LB/8SMoD52fY4ULB4/wKfW7WokQvN8bUW0pxoZ2 XbCw== 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=ViFxlRgxGTX8AfIDOeXwTrYyPKjccjZgOYYs/NTCzRq3YBghK4UEDu1WCMiLV/PKB1 nr8Bru5r9XX6gzmZNLQB5kKs8aQc1Fm78/vju7LSWoeYUOponYbTgCxQgA86+nvWG/VW BEKt4ss7ps925UktnzVU/IemkEJgIMyF2Szg1VEe8bO3GGK5V9vWDKaJsfg8Fu8jtas7 vzfPaexdt7hwuHAMoplFNKCMJTWmy8s+CduivYamNxKPWeNhZnOpOJqf0VtVb6ZWQ8Dt Z5qrzvZsM08fEmzzRDlPlOC0uokEuHTtLWUVMSdeR7qx0pPNUzVca4Oovbgyt3ywzDH6 rwVw== X-Gm-Message-State: AOAM5323LvCd0uUF47AJEStA3NK1OZZQGjZl7hxhMiOaNEvmKHamA5Dv fglPwxfRzneqlOFXFNkur8bN0SnAfXE= X-Google-Smtp-Source: ABdhPJxrqfAIyw96x1bvkCaCx6I8daOxiy5ZHNxF76Bp8IK2BEuJbPZ6vgedWh16WWOKz/ApMNYYtA== X-Received: by 2002:a1c:7413:: with SMTP id p19mr7418733wmc.98.1632581671055; Sat, 25 Sep 2021 07:54:31 -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 f9sm108882wmf.3.2021.09.25.07.54.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Sep 2021 07:54:30 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v7 40/40] accel/tcg: Simplify tcg_cpu_has_work() Date: Sat, 25 Sep 2021 16:51:18 +0200 Message-Id: <20210925145118.1361230-41-f4bug@amsat.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210925145118.1361230-1-f4bug@amsat.org> References: <20210925145118.1361230-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x430.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.248, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" All TCG targets implement the TCGCPUOps::has_work() handler. We can remove the non-NULL handler check in tcg_cpu_has_work(). Add an assertion in tcg_exec_realizefn() for future TCG targets. Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/cpu-exec.c | 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 */