From nobody Sat May 4 07:03:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16304123932391000.1415236012652; Tue, 31 Aug 2021 05:19:53 -0700 (PDT) Received: from localhost ([::1]:53362 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mL2k3-0007Uq-Fx for importer@patchew.org; Tue, 31 Aug 2021 08:19:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59700) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2gZ-0003jL-Hi for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:16:15 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:23460) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2gV-000582-Jn for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:16:15 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-470-OzDvGCrbNuqQrndV3ZgBnA-1; Tue, 31 Aug 2021 08:16:06 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 837B9100F766; Tue, 31 Aug 2021 12:16:03 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AD98C60843; Tue, 31 Aug 2021 12:15:46 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 1DB3C1800939; Tue, 31 Aug 2021 14:15:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630412171; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LK4fnylC73dEzKTJly+qoqoxWFfW8wdmNlU+K3NKCGU=; b=QJ3qCreJff5lJ4BnO2CLKo2os/KQ5k/vxmuQmbgyDayXMVFCnOr4ZQfKlPVYr/jY4aukoM DFbQzdCLA5ID9QnkbViZBbQYQJ90h/3jYnaXGNU2z3PaNpRVYAUHaiyPrCqfNvh8qvkaxT BMD8v5CUZjVum4Fq+GCr7kQj2dSZLRE= X-MC-Unique: OzDvGCrbNuqQrndV3ZgBnA-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 01/29] build: temporarily disable modular tcg Date: Tue, 31 Aug 2021 14:15:17 +0200 Message-Id: <20210831121545.2874233-2-kraxel@redhat.com> In-Reply-To: <20210831121545.2874233-1-kraxel@redhat.com> References: <20210831121545.2874233-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) DKIMWL_WL_HIGH=-0.391, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , "Michael S. Tsirkin" , Bin Meng , David Hildenbrand , Aleksandar Rikalo , Peter Xu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Filippov , Alistair Francis , Gerd Hoffmann , "Edgar E. Iglesias" , Alexandre Iooss , Huacai Chen , Halil Pasic , Christian Borntraeger , Palmer Dabbelt , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Eduardo Habkost , Richard Henderson , Greg Kurz , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Stafford Horne , =?UTF-8?q?Alex=20Benn=C3=A9e?= , David Gibson , qemu-riscv@nongnu.org, Bastian Koppelmann , Cornelia Huck , Laurent Vivier , qemu-ppc@nongnu.org, Paolo Bonzini , Mahmoud Mandour , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1630412394847100001 Content-Type: text/plain; charset="utf-8" Allows more fine-grained patches without breaking bisecting. Signed-off-by: Gerd Hoffmann --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index bf6378481250..e83aa4f5c3c9 100644 --- a/meson.build +++ b/meson.build @@ -94,7 +94,7 @@ endif =20 modular_tcg =3D [] # Darwin does not support references to thread-local variables in modules -if targetos !=3D 'darwin' +if false #targetos !=3D 'darwin' modular_tcg =3D ['i386-softmmu', 'x86_64-softmmu'] endif =20 --=20 2.31.1 From nobody Sat May 4 07:03:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1630412694535862.7140175619843; Tue, 31 Aug 2021 05:24:54 -0700 (PDT) Received: from localhost ([::1]:34532 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mL2ov-00069W-Gb for importer@patchew.org; Tue, 31 Aug 2021 08:24:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59830) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2gm-0004Js-Gb for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:16:28 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:39092) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2gj-0005Fa-FV for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:16:28 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-412-uUgAP4dpMYGGp8VVJqFsvA-1; Tue, 31 Aug 2021 08:16:23 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2E8D580198A; Tue, 31 Aug 2021 12:16:20 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4C86818A49; Tue, 31 Aug 2021 12:16:05 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 2EF88180093A; Tue, 31 Aug 2021 14:15:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630412184; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Zlsq4UMzdEMYv0Xvm4eAWbgRSDl8tyA0ndz30DB3qMY=; b=JUZTnnclJOok56a1bKgrySzDwCVlpCE6NN6I5Dnsx9uPedHqDTaEKd0cYHJ3JAZIFp5+AG SIRxktNdio/tvmSg58WRfBBiMwkJEOotknV0B9aVnE9r8QPQQmLylCcHFmNn/pa8E9Cl36 6sjFOeaXNjqLV4GHqgAWaKXleeWEP2I= X-MC-Unique: uUgAP4dpMYGGp8VVJqFsvA-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 02/29] plugins: register qemu_plugin_opts using opts_init() Date: Tue, 31 Aug 2021 14:15:18 +0200 Message-Id: <20210831121545.2874233-3-kraxel@redhat.com> In-Reply-To: <20210831121545.2874233-1-kraxel@redhat.com> References: <20210831121545.2874233-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , "Michael S. Tsirkin" , Bin Meng , David Hildenbrand , Aleksandar Rikalo , Peter Xu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Filippov , Alistair Francis , Gerd Hoffmann , "Edgar E. Iglesias" , Alexandre Iooss , Huacai Chen , Halil Pasic , Christian Borntraeger , Palmer Dabbelt , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Eduardo Habkost , Richard Henderson , Greg Kurz , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Stafford Horne , =?UTF-8?q?Alex=20Benn=C3=A9e?= , David Gibson , qemu-riscv@nongnu.org, Bastian Koppelmann , Cornelia Huck , Laurent Vivier , qemu-ppc@nongnu.org, Paolo Bonzini , Mahmoud Mandour , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1630412695069100001 Content-Type: text/plain; charset="utf-8" Removes the need for an explicit qemu_plugin_add_opts() call. Signed-off-by: Gerd Hoffmann --- include/qemu/plugin.h | 7 ------- linux-user/main.c | 2 +- plugins/loader.c | 9 ++++++++- softmmu/vl.c | 1 - 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/include/qemu/plugin.h b/include/qemu/plugin.h index 9a8438f6836c..57bdcdecdb42 100644 --- a/include/qemu/plugin.h +++ b/include/qemu/plugin.h @@ -37,13 +37,6 @@ struct qemu_plugin_desc; typedef QTAILQ_HEAD(, qemu_plugin_desc) QemuPluginList; =20 #ifdef CONFIG_PLUGIN -extern QemuOptsList qemu_plugin_opts; - -static inline void qemu_plugin_add_opts(void) -{ - qemu_add_opts(&qemu_plugin_opts); -} - void qemu_plugin_opt_parse(const char *optarg, QemuPluginList *head); int qemu_plugin_load_list(QemuPluginList *head, Error **errp); =20 diff --git a/linux-user/main.c b/linux-user/main.c index 37ed50d98e2e..f9d2c6e2de31 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -661,7 +661,7 @@ int main(int argc, char **argv, char **envp) cpu_model =3D NULL; =20 qemu_add_opts(&qemu_trace_opts); - qemu_plugin_add_opts(); + module_call_init(MODULE_INIT_OPTS); =20 optind =3D parse_args(argc, argv); =20 diff --git a/plugins/loader.c b/plugins/loader.c index 05df40398d62..71b03721dffc 100644 --- a/plugins/loader.c +++ b/plugins/loader.c @@ -53,7 +53,7 @@ struct qemu_plugin_parse_arg { struct qemu_plugin_desc *curr; }; =20 -QemuOptsList qemu_plugin_opts =3D { +static QemuOptsList qemu_plugin_opts =3D { .name =3D "plugin", .implied_opt_name =3D "file", .head =3D QTAILQ_HEAD_INITIALIZER(qemu_plugin_opts.head), @@ -403,3 +403,10 @@ void plugin_reset_uninstall(qemu_plugin_id_t id, plugin_reset_destroy(data); } } + +static void plugin_register_config(void) +{ + qemu_add_opts(&qemu_plugin_opts); +} +opts_init(plugin_register_config); +module_opts("plugin"); diff --git a/softmmu/vl.c b/softmmu/vl.c index ea05bb39c501..c29a58dee8a0 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -2736,7 +2736,6 @@ void qemu_init(int argc, char **argv, char **envp) qemu_add_opts(&qemu_global_opts); qemu_add_opts(&qemu_mon_opts); qemu_add_opts(&qemu_trace_opts); - qemu_plugin_add_opts(); qemu_add_opts(&qemu_option_rom_opts); qemu_add_opts(&qemu_accel_opts); qemu_add_opts(&qemu_mem_opts); --=20 2.31.1 From nobody Sat May 4 07:03:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1630412757866775.9601259012035; Tue, 31 Aug 2021 05:25:57 -0700 (PDT) Received: from localhost ([::1]:38092 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mL2pw-0008WR-PV for importer@patchew.org; Tue, 31 Aug 2021 08:25:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59892) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2gp-0004Ti-9A for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:16:31 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:42752) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2gk-0005Gh-EC for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:16:30 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-216-LcTDRZKuPgG3_DKTa2xJ1A-1; Tue, 31 Aug 2021 08:16:24 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 52DEA760C1; Tue, 31 Aug 2021 12:16:21 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E6C5D27089; Tue, 31 Aug 2021 12:16:05 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 3A43A180093C; Tue, 31 Aug 2021 14:15:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630412185; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YD248Ndk1lvDxS9aNusHF44nRWrj2+qYvJ28h1pffcE=; b=HeWmkqVSj6qK29DrdavjCIQ1s3/ybSnuJpeRiCmKwt7nQDg4zofOuYHUPGU57bOSfPBzTK VcvqXwIYrll0xFE5kv/PJdKJvTz9hpYsk+pZRO1Gj2F0DSK1TLNuwQiToDO0fULus/Yfcx mqyLI21BtLLojgtPFCLFlEFFE3n1boo= X-MC-Unique: LcTDRZKuPgG3_DKTa2xJ1A-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 03/29] tcg/module: move hmp.c to module Date: Tue, 31 Aug 2021 14:15:19 +0200 Message-Id: <20210831121545.2874233-4-kraxel@redhat.com> In-Reply-To: <20210831121545.2874233-1-kraxel@redhat.com> References: <20210831121545.2874233-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , "Michael S. Tsirkin" , Bin Meng , David Hildenbrand , Aleksandar Rikalo , Peter Xu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Filippov , Alistair Francis , Gerd Hoffmann , "Edgar E. Iglesias" , Alexandre Iooss , Huacai Chen , Halil Pasic , Christian Borntraeger , Palmer Dabbelt , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Eduardo Habkost , Richard Henderson , Greg Kurz , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Stafford Horne , =?UTF-8?q?Alex=20Benn=C3=A9e?= , David Gibson , qemu-riscv@nongnu.org, Bastian Koppelmann , Cornelia Huck , Laurent Vivier , qemu-ppc@nongnu.org, Paolo Bonzini , Mahmoud Mandour , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1630412759773100001 Content-Type: text/plain; charset="utf-8" Can be built modular without problems. Signed-off-by: Gerd Hoffmann --- accel/tcg/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accel/tcg/meson.build b/accel/tcg/meson.build index 137a1a44cc0a..d4df7681a811 100644 --- a/accel/tcg/meson.build +++ b/accel/tcg/meson.build @@ -15,7 +15,6 @@ specific_ss.add_all(when: 'CONFIG_TCG', if_true: tcg_ss) =20 specific_ss.add(when: ['CONFIG_SOFTMMU', 'CONFIG_TCG'], if_true: files( 'cputlb.c', - 'hmp.c', )) =20 tcg_module_ss.add(when: ['CONFIG_SOFTMMU', 'CONFIG_TCG'], if_true: files( @@ -23,4 +22,5 @@ tcg_module_ss.add(when: ['CONFIG_SOFTMMU', 'CONFIG_TCG'],= if_true: files( 'tcg-accel-ops-mttcg.c', 'tcg-accel-ops-icount.c', 'tcg-accel-ops-rr.c', + 'hmp.c', )) --=20 2.31.1 From nobody Sat May 4 07:03:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1630412438118828.8701294893441; Tue, 31 Aug 2021 05:20:38 -0700 (PDT) Received: from localhost ([::1]:54706 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mL2km-0000GK-VM for importer@patchew.org; Tue, 31 Aug 2021 08:20:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60040) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2h4-0004d1-Cy for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:16:46 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:54098) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2h0-0005Qd-KW for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:16:45 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-174-7RjnT5wVMEqx9TWNGWV4lA-1; Tue, 31 Aug 2021 08:16:40 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4F68A760C7; Tue, 31 Aug 2021 12:16:37 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C6F3F1001281; Tue, 31 Aug 2021 12:16:21 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 45A47180093D; Tue, 31 Aug 2021 14:15:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630412202; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yIyj7/u3W3N3RozuL2ZT76lwvBJPxZBhD9UN/m86jgk=; b=VK7v0h0ypuOlMge3m1VTcK2chiFzI18KC8zPwMuQsKhY3TXkEKuztBYj3d31XiWC2AOwS6 R9kmfMDI60/RJDxcYFqcWW4jJR1wJLS2pLyGLyrjavl1581rlQzzmFfN07VRBWnODNhAV8 XKgbePWVq2biQqtDve+t0fY0AfNZWtE= X-MC-Unique: 7RjnT5wVMEqx9TWNGWV4lA-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 04/29] tcg/module: move cputlb.c to module Date: Tue, 31 Aug 2021 14:15:20 +0200 Message-Id: <20210831121545.2874233-5-kraxel@redhat.com> In-Reply-To: <20210831121545.2874233-1-kraxel@redhat.com> References: <20210831121545.2874233-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) DKIMWL_WL_HIGH=-0.391, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , "Michael S. Tsirkin" , Bin Meng , David Hildenbrand , Aleksandar Rikalo , Peter Xu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Filippov , Alistair Francis , Gerd Hoffmann , "Edgar E. Iglesias" , Alexandre Iooss , Huacai Chen , Halil Pasic , Christian Borntraeger , Palmer Dabbelt , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Eduardo Habkost , Richard Henderson , Greg Kurz , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Stafford Horne , =?UTF-8?q?Alex=20Benn=C3=A9e?= , David Gibson , qemu-riscv@nongnu.org, Bastian Koppelmann , Cornelia Huck , Laurent Vivier , qemu-ppc@nongnu.org, Paolo Bonzini , Mahmoud Mandour , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1630412440615100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann --- accel/tcg/meson.build | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/accel/tcg/meson.build b/accel/tcg/meson.build index d4df7681a811..57e4ef12da23 100644 --- a/accel/tcg/meson.build +++ b/accel/tcg/meson.build @@ -13,14 +13,11 @@ tcg_ss.add(when: 'CONFIG_SOFTMMU', if_false: files('use= r-exec-stub.c')) tcg_ss.add(when: 'CONFIG_PLUGIN', if_true: [files('plugin-gen.c'), libdl]) specific_ss.add_all(when: 'CONFIG_TCG', if_true: tcg_ss) =20 -specific_ss.add(when: ['CONFIG_SOFTMMU', 'CONFIG_TCG'], if_true: files( - 'cputlb.c', -)) - tcg_module_ss.add(when: ['CONFIG_SOFTMMU', 'CONFIG_TCG'], if_true: files( 'tcg-accel-ops.c', 'tcg-accel-ops-mttcg.c', 'tcg-accel-ops-icount.c', 'tcg-accel-ops-rr.c', 'hmp.c', + 'cputlb.c', )) --=20 2.31.1 From nobody Sat May 4 07:03:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1630412955186926.5465239839797; Tue, 31 Aug 2021 05:29:15 -0700 (PDT) Received: from localhost ([::1]:48260 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mL2t8-0006sk-6D for importer@patchew.org; Tue, 31 Aug 2021 08:29:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60064) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2h6-0004gn-6K for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:16:48 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:51443) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2h1-0005Ql-1l for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:16:47 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-537-YMNlV6tiOL2Xs9s8p5GZJA-1; Tue, 31 Aug 2021 08:16:41 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 493EA87D544; Tue, 31 Aug 2021 12:16:37 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C883A1007611; Tue, 31 Aug 2021 12:16:22 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 50865180093E; Tue, 31 Aug 2021 14:15:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630412202; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hbozBWdpIYVrrkXyxTYUX7mJn1/ZDDgcNXOzYDgphu4=; b=jFZX4mFpE6HNrb7IAWYcaQZr+dgrTtYJzywThyI0PjGUnuazfpAN23XZSMMJrZp7zQ9fVn xvTK9tnc9PDVaMiLUV3ljEhZi5JXg6v3P6WxyQexBSX4+rxy7OUpB0El41XOrD/2Cny96C CwLk3rmCUdTd+vV3blkw+ShARXs4/FA= X-MC-Unique: YMNlV6tiOL2Xs9s8p5GZJA-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 05/29] tcg/module: move tcg_ss to module [accel/tcg] Date: Tue, 31 Aug 2021 14:15:21 +0200 Message-Id: <20210831121545.2874233-6-kraxel@redhat.com> In-Reply-To: <20210831121545.2874233-1-kraxel@redhat.com> References: <20210831121545.2874233-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) DKIMWL_WL_HIGH=-0.391, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , "Michael S. Tsirkin" , Bin Meng , David Hildenbrand , Aleksandar Rikalo , Peter Xu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Filippov , Alistair Francis , Gerd Hoffmann , "Edgar E. Iglesias" , Alexandre Iooss , Huacai Chen , Halil Pasic , Christian Borntraeger , Palmer Dabbelt , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Eduardo Habkost , Richard Henderson , Greg Kurz , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Stafford Horne , =?UTF-8?q?Alex=20Benn=C3=A9e?= , David Gibson , qemu-riscv@nongnu.org, Bastian Koppelmann , Cornelia Huck , Laurent Vivier , qemu-ppc@nongnu.org, Paolo Bonzini , Mahmoud Mandour , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1630412957695100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann --- accel/tcg/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accel/tcg/meson.build b/accel/tcg/meson.build index 57e4ef12da23..6471fe7832d7 100644 --- a/accel/tcg/meson.build +++ b/accel/tcg/meson.build @@ -11,7 +11,7 @@ tcg_ss.add(files( tcg_ss.add(when: 'CONFIG_USER_ONLY', if_true: files('user-exec.c')) tcg_ss.add(when: 'CONFIG_SOFTMMU', if_false: files('user-exec-stub.c')) tcg_ss.add(when: 'CONFIG_PLUGIN', if_true: [files('plugin-gen.c'), libdl]) -specific_ss.add_all(when: 'CONFIG_TCG', if_true: tcg_ss) +tcg_module_ss.add_all(when: 'CONFIG_TCG', if_true: tcg_ss) =20 tcg_module_ss.add(when: ['CONFIG_SOFTMMU', 'CONFIG_TCG'], if_true: files( 'tcg-accel-ops.c', --=20 2.31.1 From nobody Sat May 4 07:03:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1630412499865552.6477738746854; Tue, 31 Aug 2021 05:21:39 -0700 (PDT) Received: from localhost ([::1]:58386 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mL2lm-0003Ar-QK for importer@patchew.org; Tue, 31 Aug 2021 08:21:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60106) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2h8-0004ks-HR for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:16:51 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:57810) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2h2-0005RX-Uy for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:16:49 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-15-sZ_UXZ4VPdSYTbzg-3WcJQ-1; Tue, 31 Aug 2021 08:16:43 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3B3D4760C1; Tue, 31 Aug 2021 12:16:39 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DD9EF1001281; Tue, 31 Aug 2021 12:16:38 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 5BE60180093F; Tue, 31 Aug 2021 14:15:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630412204; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jukTgOTUEMS4x77F2TCNXG7jp7vcP0QVcACeKswLeM4=; b=hDl/Cu7S5c6qzLvm4z/yGGMviNt+UyxqIZFPg5XOaJ1/dB1bZaEliUN9VuEWN39gJ1NBhs 7BnRXknBkBMjcwIwy92XA6D0DtIXG1DIpZUBSclvF5LPxLSS0RiENeoDeWOsBVQqLBY9xI A/mcGrN3U2n5bjFQ8UJfid2D2RV2hwo= X-MC-Unique: sZ_UXZ4VPdSYTbzg-3WcJQ-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 06/29] tcg/module: move tcg_ss to module [tcg] Date: Tue, 31 Aug 2021 14:15:22 +0200 Message-Id: <20210831121545.2874233-7-kraxel@redhat.com> In-Reply-To: <20210831121545.2874233-1-kraxel@redhat.com> References: <20210831121545.2874233-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , "Michael S. Tsirkin" , Bin Meng , David Hildenbrand , Aleksandar Rikalo , Peter Xu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Filippov , Alistair Francis , Gerd Hoffmann , "Edgar E. Iglesias" , Alexandre Iooss , Huacai Chen , Halil Pasic , Christian Borntraeger , Palmer Dabbelt , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Eduardo Habkost , Richard Henderson , Greg Kurz , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Stafford Horne , =?UTF-8?q?Alex=20Benn=C3=A9e?= , David Gibson , qemu-riscv@nongnu.org, Bastian Koppelmann , Cornelia Huck , Laurent Vivier , qemu-ppc@nongnu.org, Paolo Bonzini , Mahmoud Mandour , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1630412502169100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann --- tcg/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcg/meson.build b/tcg/meson.build index c4c63b19d4ed..f1d7b898b1cd 100644 --- a/tcg/meson.build +++ b/tcg/meson.build @@ -17,4 +17,4 @@ if get_option('tcg_interpreter') specific_ss.add(files('tci.c')) endif =20 -specific_ss.add_all(when: 'CONFIG_TCG', if_true: tcg_ss) +tcg_module_ss.add_all(when: 'CONFIG_TCG', if_true: tcg_ss) --=20 2.31.1 From nobody Sat May 4 07:03:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1630412716490327.0678626601716; Tue, 31 Aug 2021 05:25:16 -0700 (PDT) Received: from localhost ([::1]:36520 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mL2pH-0007U3-G4 for importer@patchew.org; Tue, 31 Aug 2021 08:25:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60178) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2hH-0004sh-Qn for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:16:59 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:44765) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2hD-0005bJ-TP for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:16:59 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-241-L97Ruv1RMa-DvmyGBTuIMw-1; Tue, 31 Aug 2021 08:16:54 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AF2D3800482; Tue, 31 Aug 2021 12:16:50 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D9410197FC; Tue, 31 Aug 2021 12:16:38 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 68AFB1800980; Tue, 31 Aug 2021 14:15:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630412215; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=st8LyVaIC9LZtCDOeqjCn0qsWGxdj7MtONbXC66eiAE=; b=IL6AH1z8tqgie03VLkPm2xomunb4v8fnAG0UF34mfh9ChvAousWayBU9wit+L4nkD/w0D8 Gjj/Kw6NdkXZ8IaEfRjXaXGzO0saIrEDrU/9XPhy3GhJjygg/VVRgux7yEsFDrHGsZtBDZ yQKVAmoiL2NbA4IJ1wdGKvJYOuYGmPY= X-MC-Unique: L97Ruv1RMa-DvmyGBTuIMw-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 07/29] tcg/module: move files to module [target/i386/tcg] Date: Tue, 31 Aug 2021 14:15:23 +0200 Message-Id: <20210831121545.2874233-8-kraxel@redhat.com> In-Reply-To: <20210831121545.2874233-1-kraxel@redhat.com> References: <20210831121545.2874233-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , "Michael S. Tsirkin" , Bin Meng , David Hildenbrand , Aleksandar Rikalo , Peter Xu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Filippov , Alistair Francis , Gerd Hoffmann , "Edgar E. Iglesias" , Alexandre Iooss , Huacai Chen , Halil Pasic , Christian Borntraeger , Palmer Dabbelt , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Eduardo Habkost , Richard Henderson , Greg Kurz , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Stafford Horne , =?UTF-8?q?Alex=20Benn=C3=A9e?= , David Gibson , qemu-riscv@nongnu.org, Bastian Koppelmann , Cornelia Huck , Laurent Vivier , qemu-ppc@nongnu.org, Paolo Bonzini , Mahmoud Mandour , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1630412717895100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann --- target/i386/tcg/meson.build | 9 +++++++-- target/i386/tcg/sysemu/meson.build | 5 ++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/target/i386/tcg/meson.build b/target/i386/tcg/meson.build index f9110e890c8a..7bbe3d926975 100644 --- a/target/i386/tcg/meson.build +++ b/target/i386/tcg/meson.build @@ -1,4 +1,7 @@ -i386_ss.add(when: 'CONFIG_TCG', if_true: files( +i386_softmmu_ss.add(when: 'CONFIG_TCG', if_false: files('tcg-stub.c')) + +files_ss =3D ss.source_set() +files_ss.add(when: 'CONFIG_TCG', if_true: files( 'bpt_helper.c', 'cc_helper.c', 'excp_helper.c', @@ -9,7 +12,9 @@ i386_ss.add(when: 'CONFIG_TCG', if_true: files( 'mpx_helper.c', 'seg_helper.c', 'tcg-cpu.c', - 'translate.c'), if_false: files('tcg-stub.c')) + 'translate.c')) +tcg_module_ss.add_all(when: 'TARGET_I386', if_true: files_ss) +tcg_module_ss.add_all(when: 'TARGET_X86_64', if_true: files_ss) =20 subdir('sysemu') subdir('user') diff --git a/target/i386/tcg/sysemu/meson.build b/target/i386/tcg/sysemu/me= son.build index 2e444e766a5b..50bfd5094787 100644 --- a/target/i386/tcg/sysemu/meson.build +++ b/target/i386/tcg/sysemu/meson.build @@ -1,4 +1,5 @@ -i386_softmmu_ss.add(when: ['CONFIG_TCG', 'CONFIG_SOFTMMU'], if_true: files( +files_ss =3D ss.source_set() +files_ss.add(when: ['CONFIG_TCG', 'CONFIG_SOFTMMU'], if_true: files( 'tcg-cpu.c', 'smm_helper.c', 'excp_helper.c', @@ -8,3 +9,5 @@ i386_softmmu_ss.add(when: ['CONFIG_TCG', 'CONFIG_SOFTMMU'],= if_true: files( 'svm_helper.c', 'seg_helper.c', )) +tcg_module_ss.add_all(when: 'TARGET_I386', if_true: files_ss) +tcg_module_ss.add_all(when: 'TARGET_X86_64', if_true: files_ss) --=20 2.31.1 From nobody Sat May 4 07:03:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1630412920980457.5666539583933; Tue, 31 Aug 2021 05:28:40 -0700 (PDT) Received: from localhost ([::1]:46190 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mL2sZ-0005XD-Uo for importer@patchew.org; Tue, 31 Aug 2021 08:28:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60222) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2hK-0004yO-Tn for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:17:05 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:54560) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2hJ-0005eZ-Co for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:17:02 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-466-B6x6kO9zP5CsLTS4yCDhZA-1; Tue, 31 Aug 2021 08:16:59 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C7E9A869EC9; Tue, 31 Aug 2021 12:16:55 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B39F85DF2F; Tue, 31 Aug 2021 12:16:40 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 73CE21800991; Tue, 31 Aug 2021 14:15:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630412220; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4cHILTFEO+nUdl3l0iUFX7QIAFD2fALvSFNx8yIq3Sk=; b=TCWLITZol86Az9f4COXrFhDbz/AdHYaVnwJeZFaFWZK9VJdML+zrOD3R9l47o6n4r9qV7m cPUS+gUW8rdKpcWXrBOHhve+gC+AE4tjdm+3KRuV2E8mjmU9Lhu2Lxt8J0/KRAnYB16lQr 1yGyfSQpBUq5KAwXP7NWZKe5iUsa7j8= X-MC-Unique: B6x6kO9zP5CsLTS4yCDhZA-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 08/29] move cpu-exec-common.c from tcg module to core qemu [accel/tcg] Date: Tue, 31 Aug 2021 14:15:24 +0200 Message-Id: <20210831121545.2874233-9-kraxel@redhat.com> In-Reply-To: <20210831121545.2874233-1-kraxel@redhat.com> References: <20210831121545.2874233-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , "Michael S. Tsirkin" , Bin Meng , David Hildenbrand , Aleksandar Rikalo , Peter Xu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Filippov , Alistair Francis , Gerd Hoffmann , "Edgar E. Iglesias" , Alexandre Iooss , Huacai Chen , Halil Pasic , Christian Borntraeger , Palmer Dabbelt , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Eduardo Habkost , Richard Henderson , Greg Kurz , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Stafford Horne , =?UTF-8?q?Alex=20Benn=C3=A9e?= , David Gibson , qemu-riscv@nongnu.org, Bastian Koppelmann , Cornelia Huck , Laurent Vivier , qemu-ppc@nongnu.org, Paolo Bonzini , Mahmoud Mandour , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1630412922053100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann --- accel/tcg/meson.build | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/accel/tcg/meson.build b/accel/tcg/meson.build index 6471fe7832d7..ec74e17a8285 100644 --- a/accel/tcg/meson.build +++ b/accel/tcg/meson.build @@ -1,7 +1,10 @@ +specific_ss.add(when: 'CONFIG_TCG', if_true: files( + 'cpu-exec-common.c', +)) + tcg_ss =3D ss.source_set() tcg_ss.add(files( 'tcg-all.c', - 'cpu-exec-common.c', 'cpu-exec.c', 'tcg-runtime-gvec.c', 'tcg-runtime.c', --=20 2.31.1 From nobody Sat May 4 07:03:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 163041284226378.1865530862342; Tue, 31 Aug 2021 05:27:22 -0700 (PDT) Received: from localhost ([::1]:42196 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mL2rJ-0002oD-5c for importer@patchew.org; Tue, 31 Aug 2021 08:27:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60334) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2hY-0005AC-Rp for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:17:17 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:36281) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2hX-0005lZ-7A for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:17:16 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-13-RISZKiG8O1CaodTctAuQpg-1; Tue, 31 Aug 2021 08:17:13 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4AD3F92500; Tue, 31 Aug 2021 12:17:10 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BC23E226E9; Tue, 31 Aug 2021 12:16:53 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 82B5B1800992; Tue, 31 Aug 2021 14:15:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630412234; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Kj6LlpYEBQqdR9FwoSkyHmihGdt25q73/5GxAYqyAUU=; b=Jz2Tid1io9jxsgBLIt0zsIWPT8BBcpT38Gn8IgqwkIr3yPBHx97DuAOqak3VgwAEkJThh6 B3EIADQRwdwoitu+H359d0u8FZ1kJoEcP2HsrWmSM7YR8+wELZFgmTVXR/SZXaW4RQOFxy SVReCqRs7Ms4rWQXGcgGi+qUaJYIO9E= X-MC-Unique: RISZKiG8O1CaodTctAuQpg-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 09/29] tcg/module: add tcg-module.[ch] infrastructure Date: Tue, 31 Aug 2021 14:15:25 +0200 Message-Id: <20210831121545.2874233-10-kraxel@redhat.com> In-Reply-To: <20210831121545.2874233-1-kraxel@redhat.com> References: <20210831121545.2874233-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , "Michael S. Tsirkin" , Bin Meng , David Hildenbrand , Aleksandar Rikalo , Peter Xu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Filippov , Alistair Francis , Gerd Hoffmann , "Edgar E. Iglesias" , Alexandre Iooss , Huacai Chen , Halil Pasic , Christian Borntraeger , Palmer Dabbelt , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Eduardo Habkost , Richard Henderson , Greg Kurz , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Stafford Horne , =?UTF-8?q?Alex=20Benn=C3=A9e?= , David Gibson , qemu-riscv@nongnu.org, Bastian Koppelmann , Cornelia Huck , Laurent Vivier , qemu-ppc@nongnu.org, Paolo Bonzini , Mahmoud Mandour , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1630412843851100001 Content-Type: text/plain; charset="utf-8" Add TCGModuleOps struct, empty for now, followup patches will fill it. This struct has pointers for tcg functions which are called by core qemu. The struct is initialized (at compile time) with pointers to stub functions. When the tcg module loads it will update the function pointers to point to the real functions instead. Signed-off-by: Gerd Hoffmann --- include/tcg/tcg-module.h | 8 ++++++++ accel/tcg/tcg-module.c | 5 +++++ accel/tcg/meson.build | 4 ++++ 3 files changed, 17 insertions(+) create mode 100644 include/tcg/tcg-module.h create mode 100644 accel/tcg/tcg-module.c diff --git a/include/tcg/tcg-module.h b/include/tcg/tcg-module.h new file mode 100644 index 000000000000..7e87aecb2357 --- /dev/null +++ b/include/tcg/tcg-module.h @@ -0,0 +1,8 @@ +#ifndef TCG_MODULE_H +#define TCG_MODULE_H + +struct TCGModuleOps { +}; +extern struct TCGModuleOps tcg; + +#endif /* TCG_MODULE_H */ diff --git a/accel/tcg/tcg-module.c b/accel/tcg/tcg-module.c new file mode 100644 index 000000000000..e864fb20c141 --- /dev/null +++ b/accel/tcg/tcg-module.c @@ -0,0 +1,5 @@ +#include "qemu/osdep.h" +#include "tcg/tcg-module.h" + +struct TCGModuleOps tcg =3D { +}; diff --git a/accel/tcg/meson.build b/accel/tcg/meson.build index ec74e17a8285..93cbbf9f3926 100644 --- a/accel/tcg/meson.build +++ b/accel/tcg/meson.build @@ -1,3 +1,7 @@ +specific_ss.add(files( + 'tcg-module.c', +)) + specific_ss.add(when: 'CONFIG_TCG', if_true: files( 'cpu-exec-common.c', )) --=20 2.31.1 From nobody Sat May 4 07:03:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 163041298782359.55902580588588; Tue, 31 Aug 2021 05:29:47 -0700 (PDT) Received: from localhost ([::1]:51200 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mL2te-0000PJ-Mq for importer@patchew.org; Tue, 31 Aug 2021 08:29:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60492) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2ho-0005K0-6j for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:17:33 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:60089) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2hg-0005qg-80 for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:17:30 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-565-4GzA-E_ENkmnKBhoiJux7A-1; Tue, 31 Aug 2021 08:17:21 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EF9F518A0F33; Tue, 31 Aug 2021 12:17:17 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 93FAA5C1A1; Tue, 31 Aug 2021 12:17:00 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id AB5831800994; Tue, 31 Aug 2021 14:15:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630412242; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WVJXkv7PnGVo+pfS2DbdHeSNClsu8AfddP/bwIs4fak=; b=BhBeqOrgSRlUOgwAvv9lwKk+RDVlD9OXw4V/ZiCLWXnn/LVbbSE9rsPeLushPBeMmAD8XJ w+ghtmFgy0WO07+nIDb9sh9keslSyksjoWk8p+0Lsh6jqFkCzo0Ykzawb6JmGnoQWHDjOu hs6+DouAGO1n9a8rNfA1uRVQKR3u+RU= X-MC-Unique: 4GzA-E_ENkmnKBhoiJux7A-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 10/29] tcg_funcs: Add tlb_flush to TCGModuleOps Date: Tue, 31 Aug 2021 14:15:26 +0200 Message-Id: <20210831121545.2874233-11-kraxel@redhat.com> In-Reply-To: <20210831121545.2874233-1-kraxel@redhat.com> References: <20210831121545.2874233-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) DKIMWL_WL_HIGH=-0.391, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , "Michael S. Tsirkin" , Bin Meng , David Hildenbrand , Aleksandar Rikalo , Peter Xu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Filippov , Alistair Francis , Gerd Hoffmann , "Edgar E. Iglesias" , Alexandre Iooss , Huacai Chen , Halil Pasic , Christian Borntraeger , Palmer Dabbelt , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Eduardo Habkost , Richard Henderson , Greg Kurz , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Stafford Horne , =?UTF-8?q?Alex=20Benn=C3=A9e?= , David Gibson , qemu-riscv@nongnu.org, Bastian Koppelmann , Cornelia Huck , Laurent Vivier , qemu-ppc@nongnu.org, Paolo Bonzini , Mahmoud Mandour , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1630412988649100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann --- include/exec/exec-all.h | 4 +--- include/tcg/tcg-module.h | 1 + accel/tcg/cpu-exec-common.c | 8 ++++++++ accel/tcg/cputlb.c | 7 +++++++ accel/tcg/tcg-module.c | 5 +++++ accel/tcg/translate-all.c | 8 -------- cpu.c | 2 +- softmmu/physmem.c | 6 +++--- target/arm/helper.c | 22 +++++++++++----------- target/i386/helper.c | 8 ++++---- target/i386/machine.c | 2 +- target/i386/tcg/fpu_helper.c | 2 +- target/i386/tcg/misc_helper.c | 2 +- target/mips/sysemu/cp0.c | 2 +- target/s390x/gdbstub.c | 2 +- target/s390x/sigp.c | 2 +- 16 files changed, 47 insertions(+), 36 deletions(-) diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 5d1b6d80fbd3..ddb1ab797978 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -25,6 +25,7 @@ #include "exec/cpu_ldst.h" #endif #include "sysemu/cpu-timers.h" +#include "tcg/tcg-module.h" =20 /* allow to see translation results - the slowdown should be negligible, s= o we leave it */ #define DEBUG_DISAS @@ -337,9 +338,6 @@ static inline void tlb_flush_page_all_cpus_synced(CPUSt= ate *src, target_ulong addr) { } -static inline void tlb_flush(CPUState *cpu) -{ -} static inline void tlb_flush_all_cpus(CPUState *src_cpu) { } diff --git a/include/tcg/tcg-module.h b/include/tcg/tcg-module.h index 7e87aecb2357..b94bfdd362ed 100644 --- a/include/tcg/tcg-module.h +++ b/include/tcg/tcg-module.h @@ -2,6 +2,7 @@ #define TCG_MODULE_H =20 struct TCGModuleOps { + void (*tlb_flush)(CPUState *cpu); }; extern struct TCGModuleOps tcg; =20 diff --git a/accel/tcg/cpu-exec-common.c b/accel/tcg/cpu-exec-common.c index be6fe45aa5a8..777ad00befc8 100644 --- a/accel/tcg/cpu-exec-common.c +++ b/accel/tcg/cpu-exec-common.c @@ -81,3 +81,11 @@ void cpu_loop_exit_atomic(CPUState *cpu, uintptr_t pc) cpu->exception_index =3D EXCP_ATOMIC; cpu_loop_exit_restore(cpu, pc); } + +/* This is a wrapper for common code that can not use CONFIG_SOFTMMU */ +void tcg_flush_softmmu_tlb(CPUState *cs) +{ +#ifdef CONFIG_SOFTMMU + tcg.tlb_flush(cs); +#endif +} diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index b1e5471f949f..40c3d1b65ac5 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -2767,3 +2767,10 @@ uint64_t cpu_ldq_code(CPUArchState *env, abi_ptr add= r) TCGMemOpIdx oi =3D make_memop_idx(MO_TEQ, cpu_mmu_index(env, true)); return full_ldq_code(env, addr, oi, 0); } + +static void tcg_module_ops_tlb(void) +{ + tcg.tlb_flush =3D tlb_flush; +} + +type_init(tcg_module_ops_tlb); diff --git a/accel/tcg/tcg-module.c b/accel/tcg/tcg-module.c index e864fb20c141..a1e5728c8c1b 100644 --- a/accel/tcg/tcg-module.c +++ b/accel/tcg/tcg-module.c @@ -1,5 +1,10 @@ #include "qemu/osdep.h" #include "tcg/tcg-module.h" =20 +static void update_cpu_stub(CPUState *cpu) +{ +} + struct TCGModuleOps tcg =3D { + .tlb_flush =3D update_cpu_stub, }; diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index bbfcfb698c07..c7547cd923b4 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -2463,11 +2463,3 @@ int page_unprotect(target_ulong address, uintptr_t p= c) return 0; } #endif /* CONFIG_USER_ONLY */ - -/* This is a wrapper for common code that can not use CONFIG_SOFTMMU */ -void tcg_flush_softmmu_tlb(CPUState *cs) -{ -#ifdef CONFIG_SOFTMMU - tlb_flush(cs); -#endif -} diff --git a/cpu.c b/cpu.c index e1799a15bcf5..26277f387baf 100644 --- a/cpu.c +++ b/cpu.c @@ -51,7 +51,7 @@ static int cpu_common_post_load(void *opaque, int version= _id) /* 0x01 was CPU_INTERRUPT_EXIT. This line can be removed when the version_id is increased. */ cpu->interrupt_request &=3D ~0x01; - tlb_flush(cpu); + tcg.tlb_flush(cpu); =20 /* loadvm has just updated the content of RAM, bypassing the * usual mechanisms that ensure we flush TBs for writes to diff --git a/softmmu/physmem.c b/softmmu/physmem.c index 23e77cb77153..dd17f80120dc 100644 --- a/softmmu/physmem.c +++ b/softmmu/physmem.c @@ -589,7 +589,7 @@ static void tcg_iommu_unmap_notify(IOMMUNotifier *n, IO= MMUTLBEntry *iotlb) if (!notifier->active) { return; } - tlb_flush(notifier->cpu); + tcg.tlb_flush(notifier->cpu); notifier->active =3D false; /* We leave the notifier struct on the list to avoid reallocating it l= ater. * Generally the number of IOMMUs a CPU deals with will be small. @@ -796,7 +796,7 @@ int cpu_watchpoint_insert(CPUState *cpu, vaddr addr, va= ddr len, if (len <=3D in_page) { tlb_flush_page(cpu, addr); } else { - tlb_flush(cpu); + tcg.tlb_flush(cpu); } =20 if (watchpoint) @@ -2654,7 +2654,7 @@ static void tcg_commit(MemoryListener *listener) */ d =3D address_space_to_dispatch(cpuas->as); qatomic_rcu_set(&cpuas->memory_dispatch, d); - tlb_flush(cpuas->cpu); + tcg.tlb_flush(cpuas->cpu); } =20 static void memory_map_init(void) diff --git a/target/arm/helper.c b/target/arm/helper.c index a7ae78146d4b..0da65edd78cd 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -674,7 +674,7 @@ static void dacr_write(CPUARMState *env, const ARMCPReg= Info *ri, uint64_t value) ARMCPU *cpu =3D env_archcpu(env); =20 raw_write(env, ri, value); - tlb_flush(CPU(cpu)); /* Flush TLB as domain not tracked in TLB */ + tcg.tlb_flush(CPU(cpu)); /* Flush TLB as domain not tracked in TLB */ } =20 static void fcse_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t = value) @@ -685,7 +685,7 @@ static void fcse_write(CPUARMState *env, const ARMCPReg= Info *ri, uint64_t value) /* Unlike real hardware the qemu TLB uses virtual addresses, * not modified virtual addresses, so this causes a TLB flush. */ - tlb_flush(CPU(cpu)); + tcg.tlb_flush(CPU(cpu)); raw_write(env, ri, value); } } @@ -701,7 +701,7 @@ static void contextidr_write(CPUARMState *env, const AR= MCPRegInfo *ri, * format) this register includes the ASID, so do a TLB flush. * For PMSA it is purely a process ID and no action is needed. */ - tlb_flush(CPU(cpu)); + tcg.tlb_flush(CPU(cpu)); } raw_write(env, ri, value); } @@ -758,7 +758,7 @@ static void tlbiall_write(CPUARMState *env, const ARMCP= RegInfo *ri, if (tlb_force_broadcast(env)) { tlb_flush_all_cpus_synced(cs); } else { - tlb_flush(cs); + tcg.tlb_flush(cs); } } =20 @@ -785,7 +785,7 @@ static void tlbiasid_write(CPUARMState *env, const ARMC= PRegInfo *ri, if (tlb_force_broadcast(env)) { tlb_flush_all_cpus_synced(cs); } else { - tlb_flush(cs); + tcg.tlb_flush(cs); } } =20 @@ -3840,7 +3840,7 @@ static void pmsav7_write(CPUARMState *env, const ARMC= PRegInfo *ri, } =20 u32p +=3D env->pmsav7.rnr[M_REG_NS]; - tlb_flush(CPU(cpu)); /* Mappings may have changed - purge! */ + tcg.tlb_flush(CPU(cpu)); /* Mappings may have changed - purge! */ *u32p =3D value; } =20 @@ -3982,7 +3982,7 @@ static void vmsa_ttbcr_write(CPUARMState *env, const = ARMCPRegInfo *ri, /* With LPAE the TTBCR could result in a change of ASID * via the TTBCR.A1 bit, so do a TLB flush. */ - tlb_flush(CPU(cpu)); + tcg.tlb_flush(CPU(cpu)); } /* Preserve the high half of TCR_EL1, set via TTBCR2. */ value =3D deposit64(tcr->raw_tcr, 0, 32, value); @@ -4008,7 +4008,7 @@ static void vmsa_tcr_el12_write(CPUARMState *env, con= st ARMCPRegInfo *ri, TCR *tcr =3D raw_ptr(env, ri); =20 /* For AArch64 the A1 bit could result in a change of ASID, so TLB flu= sh. */ - tlb_flush(CPU(cpu)); + tcg.tlb_flush(CPU(cpu)); tcr->raw_tcr =3D value; } =20 @@ -4019,7 +4019,7 @@ static void vmsa_ttbr_write(CPUARMState *env, const A= RMCPRegInfo *ri, if (cpreg_field_is_64bit(ri) && extract64(raw_read(env, ri) ^ value, 48, 16) !=3D 0) { ARMCPU *cpu =3D env_archcpu(env); - tlb_flush(CPU(cpu)); + tcg.tlb_flush(CPU(cpu)); } raw_write(env, ri, value); } @@ -5035,7 +5035,7 @@ static void sctlr_write(CPUARMState *env, const ARMCP= RegInfo *ri, raw_write(env, ri, value); =20 /* This may enable/disable the MMU, so do a TLB flush. */ - tlb_flush(CPU(cpu)); + tcg.tlb_flush(CPU(cpu)); =20 if (ri->type & ARM_CP_SUPPRESS_TB_END) { /* @@ -5574,7 +5574,7 @@ static void do_hcr_write(CPUARMState *env, uint64_t v= alue, uint64_t valid_mask) * HCR_DCT enables tagging on (disabled) stage1 translation */ if ((env->cp15.hcr_el2 ^ value) & (HCR_VM | HCR_PTW | HCR_DC | HCR_DCT= )) { - tlb_flush(CPU(cpu)); + tcg.tlb_flush(CPU(cpu)); } env->cp15.hcr_el2 =3D value; =20 diff --git a/target/i386/helper.c b/target/i386/helper.c index 533b29cb91b6..100add713c5d 100644 --- a/target/i386/helper.c +++ b/target/i386/helper.c @@ -103,7 +103,7 @@ void x86_cpu_set_a20(X86CPU *cpu, int a20_state) =20 /* when a20 is changed, all the MMU mappings are invalid, so we must flush everything */ - tlb_flush(cs); + tcg.tlb_flush(cs); env->a20_mask =3D ~(1 << 20) | (a20_state << 20); } } @@ -116,7 +116,7 @@ void cpu_x86_update_cr0(CPUX86State *env, uint32_t new_= cr0) qemu_log_mask(CPU_LOG_MMU, "CR0 update: CR0=3D0x%08x\n", new_cr0); if ((new_cr0 & (CR0_PG_MASK | CR0_WP_MASK | CR0_PE_MASK)) !=3D (env->cr[0] & (CR0_PG_MASK | CR0_WP_MASK | CR0_PE_MASK))) { - tlb_flush(CPU(cpu)); + tcg.tlb_flush(CPU(cpu)); } =20 #ifdef TARGET_X86_64 @@ -156,7 +156,7 @@ void cpu_x86_update_cr3(CPUX86State *env, target_ulong = new_cr3) if (env->cr[0] & CR0_PG_MASK) { qemu_log_mask(CPU_LOG_MMU, "CR3 update: CR3=3D" TARGET_FMT_lx "\n", new_cr3); - tlb_flush(env_cpu(env)); + tcg.tlb_flush(env_cpu(env)); } } =20 @@ -170,7 +170,7 @@ void cpu_x86_update_cr4(CPUX86State *env, uint32_t new_= cr4) if ((new_cr4 ^ env->cr[4]) & (CR4_PGE_MASK | CR4_PAE_MASK | CR4_PSE_MASK | CR4_SMEP_MASK | CR4_SMAP_MASK | CR4_LA57_MASK)) { - tlb_flush(env_cpu(env)); + tcg.tlb_flush(env_cpu(env)); } =20 /* Clear bits we're going to recompute. */ diff --git a/target/i386/machine.c b/target/i386/machine.c index f6f094f1c938..571e98853c64 100644 --- a/target/i386/machine.c +++ b/target/i386/machine.c @@ -383,7 +383,7 @@ static int cpu_post_load(void *opaque, int version_id) env->dr[7] =3D dr7 & ~(DR7_GLOBAL_BP_MASK | DR7_LOCAL_BP_MASK); cpu_x86_update_dr7(env, dr7); } - tlb_flush(cs); + tcg.tlb_flush(cs); return 0; } =20 diff --git a/target/i386/tcg/fpu_helper.c b/target/i386/tcg/fpu_helper.c index cdd8e9f9471f..eddf0bb9dfc4 100644 --- a/target/i386/tcg/fpu_helper.c +++ b/target/i386/tcg/fpu_helper.c @@ -2874,7 +2874,7 @@ void helper_xrstor(CPUX86State *env, target_ulong ptr= , uint64_t rfbm) } if (env->pkru !=3D old_pkru) { CPUState *cs =3D env_cpu(env); - tlb_flush(cs); + tcg.tlb_flush(cs); } } } diff --git a/target/i386/tcg/misc_helper.c b/target/i386/tcg/misc_helper.c index baffa5d7ba9a..dc974dad6acc 100644 --- a/target/i386/tcg/misc_helper.c +++ b/target/i386/tcg/misc_helper.c @@ -142,5 +142,5 @@ void helper_wrpkru(CPUX86State *env, uint32_t ecx, uint= 64_t val) } =20 env->pkru =3D val; - tlb_flush(cs); + tcg.tlb_flush(cs); } diff --git a/target/mips/sysemu/cp0.c b/target/mips/sysemu/cp0.c index bae37f515bf8..f966991c7cc9 100644 --- a/target/mips/sysemu/cp0.c +++ b/target/mips/sysemu/cp0.c @@ -81,7 +81,7 @@ void cpu_mips_store_status(CPUMIPSState *env, target_ulon= g val) #if defined(TARGET_MIPS64) if ((env->CP0_Status ^ old) & (old & (7 << CP0St_UX))) { /* Access to at least one of the 64-bit segments has been disabled= */ - tlb_flush(env_cpu(env)); + tcg.tlb_flush(env_cpu(env)); } #endif if (ase_mt_available(env)) { diff --git a/target/s390x/gdbstub.c b/target/s390x/gdbstub.c index a5d69d0e0bc5..b60bdc1fbded 100644 --- a/target/s390x/gdbstub.c +++ b/target/s390x/gdbstub.c @@ -191,7 +191,7 @@ static int cpu_write_c_reg(CPUS390XState *env, uint8_t = *mem_buf, int n) case S390_C0_REGNUM ... S390_C15_REGNUM: env->cregs[n] =3D ldtul_p(mem_buf); if (tcg_enabled()) { - tlb_flush(env_cpu(env)); + tcg.tlb_flush(env_cpu(env)); } cpu_synchronize_post_init(env_cpu(env)); return 8; diff --git a/target/s390x/sigp.c b/target/s390x/sigp.c index d57427ced84d..d2c0b877cee4 100644 --- a/target/s390x/sigp.c +++ b/target/s390x/sigp.c @@ -294,7 +294,7 @@ static void sigp_set_prefix(CPUState *cs, run_on_cpu_da= ta arg) } =20 cpu->env.psa =3D addr; - tlb_flush(cs); + tcg.tlb_flush(cs); cpu_synchronize_post_init(cs); si->cc =3D SIGP_CC_ORDER_CODE_ACCEPTED; } --=20 2.31.1 From nobody Sat May 4 07:03:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16304133011469.17149030049984; Tue, 31 Aug 2021 05:35:01 -0700 (PDT) Received: from localhost ([::1]:33438 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mL2yh-0007rY-UX for importer@patchew.org; Tue, 31 Aug 2021 08:34:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60498) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2ho-0005KF-9f for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:17:33 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:22071) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2hl-0005tI-Bv for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:17:32 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-244-DI9j00UwNqaHj1X1ViOXig-1; Tue, 31 Aug 2021 08:17:27 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 82DEB8799F6; Tue, 31 Aug 2021 12:17:24 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7C66B6E0B0; Tue, 31 Aug 2021 12:17:12 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id BFDB91800996; Tue, 31 Aug 2021 14:15:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630412248; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=u8gQuk7Fsh4A8/jNqxyM7TcDlDRogwWS1f9ob5Kg95g=; b=OX7llnh4P5jZj2omtybcH8fde6qsRwPFO3/Ip00ZatKfQ43at1OrAZK0evJtnUmrqAnJna tl/Cm8NUDRqDhQh8Ub2hjkwOboAWxgHYDhlDIFibSJ67djFq03UAkYKegwZmJnCuVkv5x9 rG2r6G4FZxet8ElEK5wegc+FbHIXSEg= X-MC-Unique: DI9j00UwNqaHj1X1ViOXig-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 11/29] tcg_funcs: Add tlb_flush_page to TCGModuleOps Date: Tue, 31 Aug 2021 14:15:27 +0200 Message-Id: <20210831121545.2874233-12-kraxel@redhat.com> In-Reply-To: <20210831121545.2874233-1-kraxel@redhat.com> References: <20210831121545.2874233-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , "Michael S. Tsirkin" , Bin Meng , David Hildenbrand , Aleksandar Rikalo , Peter Xu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Filippov , Alistair Francis , Gerd Hoffmann , "Edgar E. Iglesias" , Alexandre Iooss , Huacai Chen , Halil Pasic , Christian Borntraeger , Palmer Dabbelt , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Eduardo Habkost , Richard Henderson , Greg Kurz , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Stafford Horne , =?UTF-8?q?Alex=20Benn=C3=A9e?= , David Gibson , qemu-riscv@nongnu.org, Bastian Koppelmann , Cornelia Huck , Laurent Vivier , qemu-ppc@nongnu.org, Paolo Bonzini , Mahmoud Mandour , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1630413302869100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann --- include/exec/exec-all.h | 3 --- include/tcg/tcg-module.h | 3 +++ accel/tcg/cputlb.c | 1 + accel/tcg/tcg-module.c | 5 +++++ softmmu/physmem.c | 4 ++-- target/arm/helper.c | 4 ++-- 6 files changed, 13 insertions(+), 7 deletions(-) diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index ddb1ab797978..43d89699e989 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -328,9 +328,6 @@ static inline void tlb_init(CPUState *cpu) static inline void tlb_destroy(CPUState *cpu) { } -static inline void tlb_flush_page(CPUState *cpu, target_ulong addr) -{ -} static inline void tlb_flush_page_all_cpus(CPUState *src, target_ulong add= r) { } diff --git a/include/tcg/tcg-module.h b/include/tcg/tcg-module.h index b94bfdd362ed..a903e3ee62c0 100644 --- a/include/tcg/tcg-module.h +++ b/include/tcg/tcg-module.h @@ -1,8 +1,11 @@ #ifndef TCG_MODULE_H #define TCG_MODULE_H =20 +#include "exec/exec-all.h" + struct TCGModuleOps { void (*tlb_flush)(CPUState *cpu); + void (*tlb_flush_page)(CPUState *cpu, target_ulong addr); }; extern struct TCGModuleOps tcg; =20 diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index 40c3d1b65ac5..1fcdb71a10a0 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -2771,6 +2771,7 @@ uint64_t cpu_ldq_code(CPUArchState *env, abi_ptr addr) static void tcg_module_ops_tlb(void) { tcg.tlb_flush =3D tlb_flush; + tcg.tlb_flush_page =3D tlb_flush_page; } =20 type_init(tcg_module_ops_tlb); diff --git a/accel/tcg/tcg-module.c b/accel/tcg/tcg-module.c index a1e5728c8c1b..4d62160628bd 100644 --- a/accel/tcg/tcg-module.c +++ b/accel/tcg/tcg-module.c @@ -5,6 +5,11 @@ static void update_cpu_stub(CPUState *cpu) { } =20 +static void tlb_flush_page_stub(CPUState *cpu, target_ulong addr) +{ +} + struct TCGModuleOps tcg =3D { .tlb_flush =3D update_cpu_stub, + .tlb_flush_page =3D tlb_flush_page_stub, }; diff --git a/softmmu/physmem.c b/softmmu/physmem.c index dd17f80120dc..8fa5376de1c9 100644 --- a/softmmu/physmem.c +++ b/softmmu/physmem.c @@ -794,7 +794,7 @@ int cpu_watchpoint_insert(CPUState *cpu, vaddr addr, va= ddr len, =20 in_page =3D -(addr | TARGET_PAGE_MASK); if (len <=3D in_page) { - tlb_flush_page(cpu, addr); + tcg.tlb_flush_page(cpu, addr); } else { tcg.tlb_flush(cpu); } @@ -825,7 +825,7 @@ void cpu_watchpoint_remove_by_ref(CPUState *cpu, CPUWat= chpoint *watchpoint) { QTAILQ_REMOVE(&cpu->watchpoints, watchpoint, entry); =20 - tlb_flush_page(cpu, watchpoint->vaddr); + tcg.tlb_flush_page(cpu, watchpoint->vaddr); =20 g_free(watchpoint); } diff --git a/target/arm/helper.c b/target/arm/helper.c index 0da65edd78cd..6aa38cde15fe 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -772,7 +772,7 @@ static void tlbimva_write(CPUARMState *env, const ARMCP= RegInfo *ri, if (tlb_force_broadcast(env)) { tlb_flush_page_all_cpus_synced(cs, value); } else { - tlb_flush_page(cs, value); + tcg.tlb_flush_page(cs, value); } } =20 @@ -799,7 +799,7 @@ static void tlbimvaa_write(CPUARMState *env, const ARMC= PRegInfo *ri, if (tlb_force_broadcast(env)) { tlb_flush_page_all_cpus_synced(cs, value); } else { - tlb_flush_page(cs, value); + tcg.tlb_flush_page(cs, value); } } =20 --=20 2.31.1 From nobody Sat May 4 07:03:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1630412909491582.9338710372402; Tue, 31 Aug 2021 05:28:29 -0700 (PDT) Received: from localhost ([::1]:45632 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mL2sO-00059k-EZ for importer@patchew.org; Tue, 31 Aug 2021 08:28:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60604) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2i0-0005g9-6L for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:17:44 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:21544) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2hw-00060x-HG for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:17:43 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-500-_EFdG9kxMsWr87DesJQqTQ-1; Tue, 31 Aug 2021 08:17:38 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B564192502; Tue, 31 Aug 2021 12:17:35 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9EEC8104B4C2; Tue, 31 Aug 2021 12:17:19 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id D296A1800998; Tue, 31 Aug 2021 14:15:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630412259; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LErq3Y4Hjmoq8Xi3S1zeN4MywBbURDL36GQs5umBzmQ=; b=QqQjQ0dOeuwdWEcEmPLIb5itvSGRGU+P0Mli+6czEafDQsHnRM1w5rRJrZ8YmKLCXoW6K4 8Kw5RrI0QjIs217biwKemw/v5JVN9KXJdxhGdCBP955LPT8FYX9yHJoQBELusIBPNq0GZp yK9FzN4haX10Vj/1XllKUIS/Ui8mzSE= X-MC-Unique: _EFdG9kxMsWr87DesJQqTQ-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 12/29] tcg_funcs: Add tlb_reset_dirty to TCGModuleOps Date: Tue, 31 Aug 2021 14:15:28 +0200 Message-Id: <20210831121545.2874233-13-kraxel@redhat.com> In-Reply-To: <20210831121545.2874233-1-kraxel@redhat.com> References: <20210831121545.2874233-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) DKIMWL_WL_HIGH=-0.391, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , "Michael S. Tsirkin" , Bin Meng , David Hildenbrand , Aleksandar Rikalo , Peter Xu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Filippov , Alistair Francis , Gerd Hoffmann , "Edgar E. Iglesias" , Alexandre Iooss , Huacai Chen , Halil Pasic , Christian Borntraeger , Palmer Dabbelt , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Eduardo Habkost , Richard Henderson , Greg Kurz , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Stafford Horne , =?UTF-8?q?Alex=20Benn=C3=A9e?= , David Gibson , qemu-riscv@nongnu.org, Bastian Koppelmann , Cornelia Huck , Laurent Vivier , qemu-ppc@nongnu.org, Paolo Bonzini , Mahmoud Mandour , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1630412910917100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann --- include/exec/exec-all.h | 1 - include/tcg/tcg-module.h | 3 +++ accel/tcg/cputlb.c | 3 ++- accel/tcg/tcg-module.c | 9 +++++++++ softmmu/physmem.c | 2 +- 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 43d89699e989..27fc489c57b5 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -691,7 +691,6 @@ tb_page_addr_t get_page_addr_code(CPUArchState *env, ta= rget_ulong addr); tb_page_addr_t get_page_addr_code_hostp(CPUArchState *env, target_ulong ad= dr, void **hostp); =20 -void tlb_reset_dirty(CPUState *cpu, ram_addr_t start1, ram_addr_t length); void tlb_set_dirty(CPUState *cpu, target_ulong vaddr); =20 MemoryRegionSection * diff --git a/include/tcg/tcg-module.h b/include/tcg/tcg-module.h index a903e3ee62c0..a14dcdb002db 100644 --- a/include/tcg/tcg-module.h +++ b/include/tcg/tcg-module.h @@ -6,6 +6,9 @@ struct TCGModuleOps { void (*tlb_flush)(CPUState *cpu); void (*tlb_flush_page)(CPUState *cpu, target_ulong addr); +#if defined(CONFIG_SOFTMMU) + void (*tlb_reset_dirty)(CPUState *cpu, ram_addr_t start1, ram_addr_t l= ength); +#endif }; extern struct TCGModuleOps tcg; =20 diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index 1fcdb71a10a0..fa9c9064848c 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -1004,7 +1004,7 @@ static inline void copy_tlb_helper_locked(CPUTLBEntry= *d, const CPUTLBEntry *s) * We must take tlb_c.lock to avoid racing with another vCPU update. The o= nly * thing actually updated is the target TLB entry ->addr_write flags. */ -void tlb_reset_dirty(CPUState *cpu, ram_addr_t start1, ram_addr_t length) +static void tlb_reset_dirty(CPUState *cpu, ram_addr_t start1, ram_addr_t l= ength) { CPUArchState *env; =20 @@ -2772,6 +2772,7 @@ static void tcg_module_ops_tlb(void) { tcg.tlb_flush =3D tlb_flush; tcg.tlb_flush_page =3D tlb_flush_page; + tcg.tlb_reset_dirty =3D tlb_reset_dirty; } =20 type_init(tcg_module_ops_tlb); diff --git a/accel/tcg/tcg-module.c b/accel/tcg/tcg-module.c index 4d62160628bd..febf4e49981c 100644 --- a/accel/tcg/tcg-module.c +++ b/accel/tcg/tcg-module.c @@ -9,7 +9,16 @@ static void tlb_flush_page_stub(CPUState *cpu, target_ulon= g addr) { } =20 +#if defined(CONFIG_SOFTMMU) +static void tlb_reset_dirty_stub(CPUState *cpu, ram_addr_t start1, ram_add= r_t length) +{ +} +#endif + struct TCGModuleOps tcg =3D { .tlb_flush =3D update_cpu_stub, .tlb_flush_page =3D tlb_flush_page_stub, +#if defined(CONFIG_SOFTMMU) + .tlb_reset_dirty =3D tlb_reset_dirty_stub, +#endif }; diff --git a/softmmu/physmem.c b/softmmu/physmem.c index 8fa5376de1c9..8b27827c533d 100644 --- a/softmmu/physmem.c +++ b/softmmu/physmem.c @@ -1015,7 +1015,7 @@ static void tlb_reset_dirty_range_all(ram_addr_t star= t, ram_addr_t length) assert(block =3D=3D qemu_get_ram_block(end - 1)); start1 =3D (uintptr_t)ramblock_ptr(block, start - block->offset); CPU_FOREACH(cpu) { - tlb_reset_dirty(cpu, start1, length); + tcg.tlb_reset_dirty(cpu, start1, length); } } =20 --=20 2.31.1 From nobody Sat May 4 07:03:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16304130813721013.7603038710077; Tue, 31 Aug 2021 05:31:21 -0700 (PDT) Received: from localhost ([::1]:54392 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mL2vA-0002bk-9e for importer@patchew.org; Tue, 31 Aug 2021 08:31:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60692) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2i5-0005wm-Cc for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:17:49 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:45288) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2i3-00066P-LL for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:17:49 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-476-cOXVx2-rPHmP1KuEi-nyVw-1; Tue, 31 Aug 2021 08:17:45 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D535718C89DD; Tue, 31 Aug 2021 12:17:42 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 36784282DC; Tue, 31 Aug 2021 12:17:26 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id E378318009CB; Tue, 31 Aug 2021 14:15:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630412267; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WQiK4bWtRrqmM36pafXOjhA9xBq0N4cfLs1R/Rm2l08=; b=Ims33BzMeUvmEXd/ERQuJnRFH3sr40v+o1u0t2mNKzbNfoQRcIxBND062xr4NyAj09j9GM l6ieTyNcZSyoszGrI52hoXqvbVXHaSk1dabvk/NJcligpzagcWzxd5VOwHfy5eMfi4/2Wm x+1g0jeDDPFHtKoqQ52AHlmc/KIOjBk= X-MC-Unique: cOXVx2-rPHmP1KuEi-nyVw-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 13/29] tcg_funcs: Add tlb_plugin_lookup to TCGModuleOps Date: Tue, 31 Aug 2021 14:15:29 +0200 Message-Id: <20210831121545.2874233-14-kraxel@redhat.com> In-Reply-To: <20210831121545.2874233-1-kraxel@redhat.com> References: <20210831121545.2874233-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , "Michael S. Tsirkin" , Bin Meng , David Hildenbrand , Aleksandar Rikalo , Peter Xu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Filippov , Alistair Francis , Gerd Hoffmann , "Edgar E. Iglesias" , Alexandre Iooss , Huacai Chen , Halil Pasic , Christian Borntraeger , Palmer Dabbelt , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Eduardo Habkost , Richard Henderson , Greg Kurz , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Stafford Horne , =?UTF-8?q?Alex=20Benn=C3=A9e?= , David Gibson , qemu-riscv@nongnu.org, Bastian Koppelmann , Cornelia Huck , Laurent Vivier , qemu-ppc@nongnu.org, Paolo Bonzini , Mahmoud Mandour , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1630413083151100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann --- include/tcg/tcg-module.h | 2 ++ accel/tcg/cputlb.c | 3 +++ accel/tcg/tcg-module.c | 7 +++++++ plugins/api.c | 4 ++-- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/include/tcg/tcg-module.h b/include/tcg/tcg-module.h index a14dcdb002db..159cbd3e7ce6 100644 --- a/include/tcg/tcg-module.h +++ b/include/tcg/tcg-module.h @@ -8,6 +8,8 @@ struct TCGModuleOps { void (*tlb_flush_page)(CPUState *cpu, target_ulong addr); #if defined(CONFIG_SOFTMMU) void (*tlb_reset_dirty)(CPUState *cpu, ram_addr_t start1, ram_addr_t l= ength); + bool (*tlb_plugin_lookup)(CPUState *cpu, target_ulong addr, int mmu_id= x, + bool is_store, struct qemu_plugin_hwaddr *da= ta); #endif }; extern struct TCGModuleOps tcg; diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index fa9c9064848c..6a7872dff488 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -2773,6 +2773,9 @@ static void tcg_module_ops_tlb(void) tcg.tlb_flush =3D tlb_flush; tcg.tlb_flush_page =3D tlb_flush_page; tcg.tlb_reset_dirty =3D tlb_reset_dirty; +#ifdef CONFIG_PLUGIN + tcg.tlb_plugin_lookup =3D tlb_plugin_lookup; +#endif } =20 type_init(tcg_module_ops_tlb); diff --git a/accel/tcg/tcg-module.c b/accel/tcg/tcg-module.c index febf4e49981c..db3d3e9e9318 100644 --- a/accel/tcg/tcg-module.c +++ b/accel/tcg/tcg-module.c @@ -13,6 +13,12 @@ static void tlb_flush_page_stub(CPUState *cpu, target_ul= ong addr) static void tlb_reset_dirty_stub(CPUState *cpu, ram_addr_t start1, ram_add= r_t length) { } + +static bool tlb_plugin_lookup_stub(CPUState *cpu, target_ulong addr, int m= mu_idx, + bool is_store, struct qemu_plugin_hwadd= r *data) +{ + return false; +} #endif =20 struct TCGModuleOps tcg =3D { @@ -20,5 +26,6 @@ struct TCGModuleOps tcg =3D { .tlb_flush_page =3D tlb_flush_page_stub, #if defined(CONFIG_SOFTMMU) .tlb_reset_dirty =3D tlb_reset_dirty_stub, + .tlb_plugin_lookup =3D tlb_plugin_lookup_stub, #endif }; diff --git a/plugins/api.c b/plugins/api.c index 2d521e6ba825..12b4cb914320 100644 --- a/plugins/api.c +++ b/plugins/api.c @@ -280,8 +280,8 @@ struct qemu_plugin_hwaddr *qemu_plugin_get_hwaddr(qemu_= plugin_meminfo_t info, unsigned int mmu_idx =3D info >> TRACE_MEM_MMU_SHIFT; hwaddr_info.is_store =3D info & TRACE_MEM_ST; =20 - if (!tlb_plugin_lookup(cpu, vaddr, mmu_idx, - info & TRACE_MEM_ST, &hwaddr_info)) { + if (!tcg.tlb_plugin_lookup(cpu, vaddr, mmu_idx, + info & TRACE_MEM_ST, &hwaddr_info)) { error_report("invalid use of qemu_plugin_get_hwaddr"); return NULL; } --=20 2.31.1 From nobody Sat May 4 07:03:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16304132788291002.5365880584015; Tue, 31 Aug 2021 05:34:38 -0700 (PDT) Received: from localhost ([::1]:59820 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mL2yL-0006Wr-Rp for importer@patchew.org; Tue, 31 Aug 2021 08:34:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60656) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2i1-0005k8-Sb for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:17:45 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:20321) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2hz-000632-6y for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:17:45 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-199-e_b-rrf6PoCAL8m62aXggA-1; Tue, 31 Aug 2021 08:17:41 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EE2BF8799E0; Tue, 31 Aug 2021 12:17:37 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6CDD91007611; Tue, 31 Aug 2021 12:17:37 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 0733718009CC; Tue, 31 Aug 2021 14:15:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630412262; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cCmd4O4HkpJQDqHqb3kEpsKWXrKqloX8kyxaEEA97UM=; b=LJlmvVsGaPJy8rRVlpzFPRD0z+tTkwleM+41CH1lc5WsPQM6q6kEenlwlRDvuXyJz2n0C2 FtiGcqiTMewUPcAONvpDbVx2F5UpIGkmEZpGwEMkDNcmc+x/S0rZvEmaYI/c8xc69DcYyM 2EIPRh2+iBTo797CVStPjXyqEZC5dog= X-MC-Unique: e_b-rrf6PoCAL8m62aXggA-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 14/29] tcg_funcs:Add tcg_exec_{realizefn, unrealizefn} to TCGModuleOps Date: Tue, 31 Aug 2021 14:15:30 +0200 Message-Id: <20210831121545.2874233-15-kraxel@redhat.com> In-Reply-To: <20210831121545.2874233-1-kraxel@redhat.com> References: <20210831121545.2874233-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , "Michael S. Tsirkin" , Bin Meng , David Hildenbrand , Aleksandar Rikalo , Peter Xu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Filippov , Alistair Francis , Gerd Hoffmann , "Edgar E. Iglesias" , Alexandre Iooss , Huacai Chen , Halil Pasic , Christian Borntraeger , Palmer Dabbelt , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Eduardo Habkost , Richard Henderson , Greg Kurz , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Stafford Horne , =?UTF-8?q?Alex=20Benn=C3=A9e?= , David Gibson , qemu-riscv@nongnu.org, Bastian Koppelmann , Cornelia Huck , Laurent Vivier , qemu-ppc@nongnu.org, Paolo Bonzini , Mahmoud Mandour , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1630413280878100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann --- include/exec/cpu-all.h | 2 -- include/tcg/tcg-module.h | 2 ++ accel/tcg/cpu-exec.c | 12 ++++++++++-- accel/tcg/tcg-module.c | 6 ++++++ cpu.c | 4 ++-- 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index 32cfb634c6a0..c2bfd0ea1de1 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -440,8 +440,6 @@ void dump_opcount_info(void); #ifdef CONFIG_TCG /* accel/tcg/cpu-exec.c */ int cpu_exec(CPUState *cpu); -void tcg_exec_realizefn(CPUState *cpu, Error **errp); -void tcg_exec_unrealizefn(CPUState *cpu); #endif /* CONFIG_TCG */ =20 /* Returns: 0 on success, -1 on error */ diff --git a/include/tcg/tcg-module.h b/include/tcg/tcg-module.h index 159cbd3e7ce6..5dd4deb9ed57 100644 --- a/include/tcg/tcg-module.h +++ b/include/tcg/tcg-module.h @@ -11,6 +11,8 @@ struct TCGModuleOps { bool (*tlb_plugin_lookup)(CPUState *cpu, target_ulong addr, int mmu_id= x, bool is_store, struct qemu_plugin_hwaddr *da= ta); #endif + void (*tcg_exec_unrealizefn)(CPUState *cpu); + void (*tcg_exec_realizefn)(CPUState *cpu, Error **errp); }; extern struct TCGModuleOps tcg; =20 diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index e5c0ccd1a2ab..d41d1d2bd24f 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -981,7 +981,7 @@ int cpu_exec(CPUState *cpu) return ret; } =20 -void tcg_exec_realizefn(CPUState *cpu, Error **errp) +static void tcg_exec_realizefn(CPUState *cpu, Error **errp) { static bool tcg_target_initialized; CPUClass *cc =3D CPU_GET_CLASS(cpu); @@ -999,7 +999,7 @@ void tcg_exec_realizefn(CPUState *cpu, Error **errp) } =20 /* undo the initializations in reverse order */ -void tcg_exec_unrealizefn(CPUState *cpu) +static void tcg_exec_unrealizefn(CPUState *cpu) { #ifndef CONFIG_USER_ONLY tcg_iommu_free_notifier_list(cpu); @@ -1031,3 +1031,11 @@ void dump_drift_info(void) } =20 #endif /* !CONFIG_USER_ONLY */ + +static void tcg_module_ops_exec(void) +{ + tcg.tcg_exec_realizefn =3D tcg_exec_realizefn; + tcg.tcg_exec_unrealizefn =3D tcg_exec_unrealizefn; +} + +type_init(tcg_module_ops_exec); diff --git a/accel/tcg/tcg-module.c b/accel/tcg/tcg-module.c index db3d3e9e9318..36c1df564f31 100644 --- a/accel/tcg/tcg-module.c +++ b/accel/tcg/tcg-module.c @@ -21,6 +21,10 @@ static bool tlb_plugin_lookup_stub(CPUState *cpu, target= _ulong addr, int mmu_idx } #endif =20 +static void tcg_exec_realizefn_stub(CPUState *cpu, Error **errp) +{ +} + struct TCGModuleOps tcg =3D { .tlb_flush =3D update_cpu_stub, .tlb_flush_page =3D tlb_flush_page_stub, @@ -28,4 +32,6 @@ struct TCGModuleOps tcg =3D { .tlb_reset_dirty =3D tlb_reset_dirty_stub, .tlb_plugin_lookup =3D tlb_plugin_lookup_stub, #endif + .tcg_exec_realizefn =3D tcg_exec_realizefn_stub, + .tcg_exec_unrealizefn =3D update_cpu_stub, }; diff --git a/cpu.c b/cpu.c index 26277f387baf..d1c9f68a26e7 100644 --- a/cpu.c +++ b/cpu.c @@ -140,7 +140,7 @@ void cpu_exec_realizefn(CPUState *cpu, Error **errp) #ifdef CONFIG_TCG /* NB: errp parameter is unused currently */ if (tcg_enabled()) { - tcg_exec_realizefn(cpu, errp); + tcg.tcg_exec_realizefn(cpu, errp); } #endif /* CONFIG_TCG */ =20 @@ -172,7 +172,7 @@ void cpu_exec_unrealizefn(CPUState *cpu) #ifdef CONFIG_TCG /* NB: errp parameter is unused currently */ if (tcg_enabled()) { - tcg_exec_unrealizefn(cpu); + tcg.tcg_exec_unrealizefn(cpu); } #endif /* CONFIG_TCG */ =20 --=20 2.31.1 From nobody Sat May 4 07:03:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1630413325746903.7584610745298; Tue, 31 Aug 2021 05:35:25 -0700 (PDT) Received: from localhost ([::1]:35204 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mL2z6-0000bA-MK for importer@patchew.org; Tue, 31 Aug 2021 08:35:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60760) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2iE-0006AF-4P for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:17:59 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:52851) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2iC-0006Ap-55 for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:17:57 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-170-eUvZnfpuNuWlnb5UWdblpQ-1; Tue, 31 Aug 2021 08:17:54 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 673F3106F6EC; Tue, 31 Aug 2021 12:17:51 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6B33B5D6D5; Tue, 31 Aug 2021 12:17:39 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 2AB2B18009D5; Tue, 31 Aug 2021 14:15:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630412275; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XEVn3MubDcXSDC4bhzn6yl2MS+ELh+ql7Nha2IQz6ks=; b=ihkoXakAEh4CvWA6jyEwfopj5sxT5TXAPwZ0xplGUtMPXJouRdeHuz3eqdN4V3dzyAlt+4 6ZJTGQ9lY15xNiR39nQNQWRbcxVN9NzBbAoW/gWBM68F4QqGAsOd2opDLdd/gN+WOOdPme IlWOAB23uE/WEQbl/mpkkLSLVatPT6o= X-MC-Unique: eUvZnfpuNuWlnb5UWdblpQ-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 15/29] tcg_funcs: Add tb_flush to TCGModuleOps Date: Tue, 31 Aug 2021 14:15:31 +0200 Message-Id: <20210831121545.2874233-16-kraxel@redhat.com> In-Reply-To: <20210831121545.2874233-1-kraxel@redhat.com> References: <20210831121545.2874233-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , "Michael S. Tsirkin" , Bin Meng , David Hildenbrand , Aleksandar Rikalo , Peter Xu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Filippov , Alistair Francis , Gerd Hoffmann , "Edgar E. Iglesias" , Alexandre Iooss , Huacai Chen , Halil Pasic , Christian Borntraeger , Palmer Dabbelt , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Eduardo Habkost , Richard Henderson , Greg Kurz , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Stafford Horne , =?UTF-8?q?Alex=20Benn=C3=A9e?= , David Gibson , qemu-riscv@nongnu.org, Bastian Koppelmann , Cornelia Huck , Laurent Vivier , qemu-ppc@nongnu.org, Paolo Bonzini , Mahmoud Mandour , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1630413328165100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann Acked-by: Greg Kurz --- include/exec/exec-all.h | 1 - include/tcg/tcg-module.h | 1 + accel/stubs/tcg-stub.c | 4 ---- accel/tcg/tcg-module.c | 1 + accel/tcg/translate-all.c | 9 ++++++++- cpu.c | 2 +- gdbstub.c | 4 ++-- hw/ppc/spapr_hcall.c | 2 +- linux-user/mmap.c | 2 +- linux-user/syscall.c | 4 ++-- plugins/core.c | 2 +- plugins/loader.c | 2 +- target/alpha/sys_helper.c | 2 +- target/riscv/csr.c | 2 +- 14 files changed, 21 insertions(+), 17 deletions(-) diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 27fc489c57b5..7dc6f498a7e4 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -572,7 +572,6 @@ void tb_invalidate_phys_range(target_ulong start, targe= t_ulong end); #else void tb_invalidate_phys_addr(AddressSpace *as, hwaddr addr, MemTxAttrs att= rs); #endif -void tb_flush(CPUState *cpu); void tb_phys_invalidate(TranslationBlock *tb, tb_page_addr_t page_addr); TranslationBlock *tb_htable_lookup(CPUState *cpu, target_ulong pc, target_ulong cs_base, uint32_t flags, diff --git a/include/tcg/tcg-module.h b/include/tcg/tcg-module.h index 5dd4deb9ed57..003581b0718c 100644 --- a/include/tcg/tcg-module.h +++ b/include/tcg/tcg-module.h @@ -13,6 +13,7 @@ struct TCGModuleOps { #endif void (*tcg_exec_unrealizefn)(CPUState *cpu); void (*tcg_exec_realizefn)(CPUState *cpu, Error **errp); + void (*tb_flush)(CPUState *cpu); }; extern struct TCGModuleOps tcg; =20 diff --git a/accel/stubs/tcg-stub.c b/accel/stubs/tcg-stub.c index d8162673ae8d..e7651d035f28 100644 --- a/accel/stubs/tcg-stub.c +++ b/accel/stubs/tcg-stub.c @@ -13,10 +13,6 @@ #include "qemu/osdep.h" #include "exec/exec-all.h" =20 -void tb_flush(CPUState *cpu) -{ -} - void tlb_set_dirty(CPUState *cpu, target_ulong vaddr) { } diff --git a/accel/tcg/tcg-module.c b/accel/tcg/tcg-module.c index 36c1df564f31..7600951fd20b 100644 --- a/accel/tcg/tcg-module.c +++ b/accel/tcg/tcg-module.c @@ -34,4 +34,5 @@ struct TCGModuleOps tcg =3D { #endif .tcg_exec_realizefn =3D tcg_exec_realizefn_stub, .tcg_exec_unrealizefn =3D update_cpu_stub, + .tb_flush =3D update_cpu_stub, }; diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index c7547cd923b4..1d258e89fc81 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -1003,7 +1003,7 @@ done: } } =20 -void tb_flush(CPUState *cpu) +static void tb_flush(CPUState *cpu) { if (tcg_enabled()) { unsigned tb_flush_count =3D qatomic_mb_read(&tb_ctx.tb_flush_count= ); @@ -2463,3 +2463,10 @@ int page_unprotect(target_ulong address, uintptr_t p= c) return 0; } #endif /* CONFIG_USER_ONLY */ + +static void tcg_module_ops_tb(void) +{ + tcg.tb_flush =3D tb_flush; +} + +type_init(tcg_module_ops_tb); diff --git a/cpu.c b/cpu.c index d1c9f68a26e7..ce96b3591a9c 100644 --- a/cpu.c +++ b/cpu.c @@ -58,7 +58,7 @@ static int cpu_common_post_load(void *opaque, int version= _id) * memory we've translated code from. So we must flush all TBs, * which will now be stale. */ - tb_flush(cpu); + tcg.tb_flush(cpu); =20 return 0; } diff --git a/gdbstub.c b/gdbstub.c index 5d8e6ae3cd9b..c2c6901b77b6 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -2796,7 +2796,7 @@ static void gdb_vm_state_change(void *opaque, bool ru= nning, RunState state) } else { trace_gdbstub_hit_break(); } - tb_flush(cpu); + tcg.tb_flush(cpu); ret =3D GDB_SIGNAL_TRAP; break; case RUN_STATE_PAUSED: @@ -3135,7 +3135,7 @@ gdb_handlesig(CPUState *cpu, int sig) =20 /* disable single step if it was enabled */ cpu_single_step(cpu, 0); - tb_flush(cpu); + tcg.tb_flush(cpu); =20 if (sig !=3D 0) { snprintf(buf, sizeof(buf), "S%02x", target_signal_to_gdb(sig)); diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c index 0e9a5b2e4053..732e79cca0ad 100644 --- a/hw/ppc/spapr_hcall.c +++ b/hw/ppc/spapr_hcall.c @@ -292,7 +292,7 @@ static target_ulong h_page_init(PowerPCCPU *cpu, SpaprM= achineState *spapr, if (kvm_enabled()) { kvmppc_icbi_range(cpu, pdst, len); } else { - tb_flush(CPU(cpu)); + tcg.tb_flush(CPU(cpu)); } } =20 diff --git a/linux-user/mmap.c b/linux-user/mmap.c index 0e103859fed8..85cb03e176c1 100644 --- a/linux-user/mmap.c +++ b/linux-user/mmap.c @@ -461,7 +461,7 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, in= t target_prot, CPUState *cpu =3D thread_cpu; if (!(cpu->tcg_cflags & CF_PARALLEL)) { cpu->tcg_cflags |=3D CF_PARALLEL; - tb_flush(cpu); + tcg.tb_flush(cpu); } } =20 diff --git a/linux-user/syscall.c b/linux-user/syscall.c index ccd3892b2df7..6ab3009bc98b 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -4513,7 +4513,7 @@ static inline abi_ulong do_shmat(CPUArchState *cpu_en= v, */ if (!(cpu->tcg_cflags & CF_PARALLEL)) { cpu->tcg_cflags |=3D CF_PARALLEL; - tb_flush(cpu); + tcg.tb_flush(cpu); } =20 if (shmaddr) @@ -6376,7 +6376,7 @@ static int do_fork(CPUArchState *env, unsigned int fl= ags, abi_ulong newsp, */ if (!(cpu->tcg_cflags & CF_PARALLEL)) { cpu->tcg_cflags |=3D CF_PARALLEL; - tb_flush(cpu); + tcg.tb_flush(cpu); } =20 /* we create a new CPU instance. */ diff --git a/plugins/core.c b/plugins/core.c index 6b2490f97328..ee3ad26b354c 100644 --- a/plugins/core.c +++ b/plugins/core.c @@ -514,7 +514,7 @@ void qemu_plugin_user_exit(void) } } =20 - tb_flush(current_cpu); + tcg.tb_flush(current_cpu); =20 CPU_FOREACH(cpu) { qemu_plugin_disable_mem_helpers(cpu); diff --git a/plugins/loader.c b/plugins/loader.c index 71b03721dffc..21e94a7509dc 100644 --- a/plugins/loader.c +++ b/plugins/loader.c @@ -364,7 +364,7 @@ static void plugin_flush_destroy(CPUState *cpu, run_on_= cpu_data arg) struct qemu_plugin_reset_data *data =3D arg.host_ptr; =20 g_assert(cpu_in_exclusive_context(cpu)); - tb_flush(cpu); + tcg.tb_flush(cpu); plugin_reset_destroy(data); } =20 diff --git a/target/alpha/sys_helper.c b/target/alpha/sys_helper.c index 25f6cb88940d..bad37d35e342 100644 --- a/target/alpha/sys_helper.c +++ b/target/alpha/sys_helper.c @@ -55,7 +55,7 @@ void helper_tbis(CPUAlphaState *env, uint64_t p) =20 void helper_tb_flush(CPUAlphaState *env) { - tb_flush(env_cpu(env)); + tcg.tb_flush(env_cpu(env)); } =20 void helper_halt(uint64_t restart) diff --git a/target/riscv/csr.c b/target/riscv/csr.c index 9a4ed18ac597..46603475e57b 100644 --- a/target/riscv/csr.c +++ b/target/riscv/csr.c @@ -610,7 +610,7 @@ static RISCVException write_misa(CPURISCVState *env, in= t csrno, =20 /* flush translation cache */ if (val !=3D env->misa) { - tb_flush(env_cpu(env)); + tcg.tb_flush(env_cpu(env)); } =20 env->misa =3D val; --=20 2.31.1 From nobody Sat May 4 07:03:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1630413565844499.71641629755334; Tue, 31 Aug 2021 05:39:25 -0700 (PDT) Received: from localhost ([::1]:45010 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mL32y-0007WN-Qt for importer@patchew.org; Tue, 31 Aug 2021 08:39:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60930) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2iR-0006UQ-L7 for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:18:11 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:44365) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2iM-0006HL-15 for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:18:11 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-429-QBhQlV_lNJKLWdZ5fb88KA-1; Tue, 31 Aug 2021 08:18:04 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 57011100806C; Tue, 31 Aug 2021 12:18:00 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 79BA71007611; Tue, 31 Aug 2021 12:17:44 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 3BCC018009D7; Tue, 31 Aug 2021 14:15:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630412285; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZUHp1O8zge7EEgmI1RbTuLgi2O/FujTQAqW5ywVE9jo=; b=L9ZV/8lMSp6p4SLet3kc7Ned2DBi34BlxFRkxTliv25DVv4stn47eaJrpxrxPI7jRTp2LF QNbIscrrEhIbXDE6sLI78XqK0IW+6SxTM3KKZxsCEh+x05QFTUHU4Io043+A5mZEIFq6LK VbOZ+wiC1EWSExoiJECrlSI2HS164Ik= X-MC-Unique: QBhQlV_lNJKLWdZ5fb88KA-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 16/29] tcg: use tb_page_addr_t for tb_invalidate_phys_range() Date: Tue, 31 Aug 2021 14:15:32 +0200 Message-Id: <20210831121545.2874233-17-kraxel@redhat.com> In-Reply-To: <20210831121545.2874233-1-kraxel@redhat.com> References: <20210831121545.2874233-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) DKIMWL_WL_HIGH=-0.391, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , "Michael S. Tsirkin" , Bin Meng , David Hildenbrand , Aleksandar Rikalo , Peter Xu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Filippov , Alistair Francis , Gerd Hoffmann , "Edgar E. Iglesias" , Alexandre Iooss , Huacai Chen , Halil Pasic , Christian Borntraeger , Palmer Dabbelt , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Eduardo Habkost , Richard Henderson , Greg Kurz , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Stafford Horne , =?UTF-8?q?Alex=20Benn=C3=A9e?= , David Gibson , qemu-riscv@nongnu.org, Bastian Koppelmann , Cornelia Huck , Laurent Vivier , qemu-ppc@nongnu.org, Paolo Bonzini , Mahmoud Mandour , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1630413566488100001 Content-Type: text/plain; charset="utf-8" The tb_page_addr_t type was added to avoid #ifdefs for SOFTMMU (uses ram_addr_t) vs. USER_ONLY (uses target_ulong), and tb_invalidate_phys_range() never was updated for some reason. So do that now. Signed-off-by: Gerd Hoffmann --- include/exec/exec-all.h | 4 ++-- include/exec/ram_addr.h | 2 -- accel/tcg/translate-all.c | 6 +----- cpu.c | 2 +- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 7dc6f498a7e4..9cb8337acee1 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -567,11 +567,11 @@ uint32_t curr_cflags(CPUState *cpu); =20 /* TranslationBlock invalidate API */ #if defined(CONFIG_USER_ONLY) -void tb_invalidate_phys_addr(target_ulong addr); -void tb_invalidate_phys_range(target_ulong start, target_ulong end); +void tb_invalidate_phys_addr(tb_page_addr_t addr); #else void tb_invalidate_phys_addr(AddressSpace *as, hwaddr addr, MemTxAttrs att= rs); #endif +void tb_invalidate_phys_range(tb_page_addr_t start, tb_page_addr_t end); void tb_phys_invalidate(TranslationBlock *tb, tb_page_addr_t page_addr); TranslationBlock *tb_htable_lookup(CPUState *cpu, target_ulong pc, target_ulong cs_base, uint32_t flags, diff --git a/include/exec/ram_addr.h b/include/exec/ram_addr.h index 551876bed041..ae34f63b8f7e 100644 --- a/include/exec/ram_addr.h +++ b/include/exec/ram_addr.h @@ -145,8 +145,6 @@ static inline void qemu_ram_block_writeback(RAMBlock *b= lock) #define DIRTY_CLIENTS_ALL ((1 << DIRTY_MEMORY_NUM) - 1) #define DIRTY_CLIENTS_NOCODE (DIRTY_CLIENTS_ALL & ~(1 << DIRTY_MEMORY_COD= E)) =20 -void tb_invalidate_phys_range(ram_addr_t start, ram_addr_t end); - static inline bool cpu_physical_memory_get_dirty(ram_addr_t start, ram_addr_t length, unsigned client) diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 1d258e89fc81..57bb921bd3ba 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -1802,11 +1802,7 @@ void tb_invalidate_phys_page_range(tb_page_addr_t st= art, tb_page_addr_t end) * * Called with mmap_lock held for user-mode emulation. */ -#ifdef CONFIG_SOFTMMU -void tb_invalidate_phys_range(ram_addr_t start, ram_addr_t end) -#else -void tb_invalidate_phys_range(target_ulong start, target_ulong end) -#endif +void tb_invalidate_phys_range(tb_page_addr_t start, tb_page_addr_t end) { struct page_collection *pages; tb_page_addr_t next; diff --git a/cpu.c b/cpu.c index ce96b3591a9c..e8baec294b06 100644 --- a/cpu.c +++ b/cpu.c @@ -219,7 +219,7 @@ const char *parse_cpu_option(const char *cpu_option) } =20 #if defined(CONFIG_USER_ONLY) -void tb_invalidate_phys_addr(target_ulong addr) +void tb_invalidate_phys_addr(tb_page_addr_t addr) { mmap_lock(); tb_invalidate_phys_page_range(addr, addr + 1); --=20 2.31.1 From nobody Sat May 4 07:03:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1630413568336186.7172102174095; Tue, 31 Aug 2021 05:39:28 -0700 (PDT) Received: from localhost ([::1]:42488 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mL32J-0005ic-Jm for importer@patchew.org; Tue, 31 Aug 2021 08:38:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60878) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2iO-0006KV-UL for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:18:09 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:44457) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2iL-0006H5-UZ for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:18:08 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-469-cYZepCxIMVyGkTckoaK2fw-1; Tue, 31 Aug 2021 08:18:03 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5F1A392509; Tue, 31 Aug 2021 12:18:00 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 08C61104B4C2; Tue, 31 Aug 2021 12:17:53 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 4AE3718009D9; Tue, 31 Aug 2021 14:15:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630412285; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Df/cS+Kk2RDhFNkjyLEWK9DtQT8M40JsvdVaLc7r9J8=; b=GChTyPXR8eRh340cc+ET0uFsKeLOaYfIAIoPpU8jlm93aILx5+Dxv9ImqJNasduhHIDYlW wYdkXGkZJtkFGRJojcuAass+x9Hq75vZn9UeC3FhjG0vY1JgJ7YJ74OCOBbvyTKSZqElZq gBnTP3PBnr3C8CuEFVccuZ3e4HhOPP0= X-MC-Unique: cYZepCxIMVyGkTckoaK2fw-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 17/29] tcg: drop tb_invalidate_phys_page_range() Date: Tue, 31 Aug 2021 14:15:33 +0200 Message-Id: <20210831121545.2874233-18-kraxel@redhat.com> In-Reply-To: <20210831121545.2874233-1-kraxel@redhat.com> References: <20210831121545.2874233-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) DKIMWL_WL_HIGH=-0.391, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , "Michael S. Tsirkin" , Bin Meng , David Hildenbrand , Aleksandar Rikalo , Peter Xu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Filippov , Alistair Francis , Gerd Hoffmann , "Edgar E. Iglesias" , Alexandre Iooss , Huacai Chen , Halil Pasic , Christian Borntraeger , Palmer Dabbelt , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Eduardo Habkost , Richard Henderson , Greg Kurz , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Stafford Horne , =?UTF-8?q?Alex=20Benn=C3=A9e?= , David Gibson , qemu-riscv@nongnu.org, Bastian Koppelmann , Cornelia Huck , Laurent Vivier , qemu-ppc@nongnu.org, Paolo Bonzini , Mahmoud Mandour , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1630413570475100001 Content-Type: text/plain; charset="utf-8" tb_invalidate_phys_range() can be used instead. Signed-off-by: Gerd Hoffmann --- include/exec/translate-all.h | 1 - accel/tcg/translate-all.c | 25 ------------------------- cpu.c | 4 ++-- 3 files changed, 2 insertions(+), 28 deletions(-) diff --git a/include/exec/translate-all.h b/include/exec/translate-all.h index a557b4e2bb9e..f313542cdae1 100644 --- a/include/exec/translate-all.h +++ b/include/exec/translate-all.h @@ -29,7 +29,6 @@ void page_collection_unlock(struct page_collection *set); void tb_invalidate_phys_page_fast(struct page_collection *pages, tb_page_addr_t start, int len, uintptr_t retaddr); -void tb_invalidate_phys_page_range(tb_page_addr_t start, tb_page_addr_t en= d); void tb_check_watchpoint(CPUState *cpu, uintptr_t retaddr); =20 #ifdef CONFIG_USER_ONLY diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 57bb921bd3ba..3a3a60575141 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -1768,31 +1768,6 @@ tb_invalidate_phys_page_range__locked(struct page_co= llection *pages, #endif } =20 -/* - * Invalidate all TBs which intersect with the target physical address ran= ge - * [start;end[. NOTE: start and end must refer to the *same* physical page. - * 'is_cpu_write_access' should be true if called from a real cpu write - * access: the virtual CPU will exit the current TB if code is modified in= side - * this TB. - * - * Called with mmap_lock held for user-mode emulation - */ -void tb_invalidate_phys_page_range(tb_page_addr_t start, tb_page_addr_t en= d) -{ - struct page_collection *pages; - PageDesc *p; - - assert_memory_lock(); - - p =3D page_find(start >> TARGET_PAGE_BITS); - if (p =3D=3D NULL) { - return; - } - pages =3D page_collection_lock(start, end); - tb_invalidate_phys_page_range__locked(pages, p, start, end, 0); - page_collection_unlock(pages); -} - /* * Invalidate all TBs which intersect with the target physical address ran= ge * [start;end[. NOTE: start and end may refer to *different* physical page= s. diff --git a/cpu.c b/cpu.c index e8baec294b06..b8ac817cb3fd 100644 --- a/cpu.c +++ b/cpu.c @@ -222,7 +222,7 @@ const char *parse_cpu_option(const char *cpu_option) void tb_invalidate_phys_addr(tb_page_addr_t addr) { mmap_lock(); - tb_invalidate_phys_page_range(addr, addr + 1); + tb_invalidate_phys_range(addr, addr + 1); mmap_unlock(); } #else @@ -243,7 +243,7 @@ void tb_invalidate_phys_addr(AddressSpace *as, hwaddr a= ddr, MemTxAttrs attrs) return; } ram_addr =3D memory_region_get_ram_addr(mr) + addr; - tb_invalidate_phys_page_range(ram_addr, ram_addr + 1); + tb_invalidate_phys_range(ram_addr, ram_addr + 1); } #endif =20 --=20 2.31.1 From nobody Sat May 4 07:03:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1630414005836154.55760380459128; Tue, 31 Aug 2021 05:46:45 -0700 (PDT) Received: from localhost ([::1]:33896 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mL3A4-0002Ue-MW for importer@patchew.org; Tue, 31 Aug 2021 08:46:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32840) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2ii-0007RQ-Av for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:18:28 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:41887) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2ie-0006R0-5y for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:18:28 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-230-msmcjnuyPZiwNAIB0-x4dA-1; Tue, 31 Aug 2021 08:18:22 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BDECD87D572; Tue, 31 Aug 2021 12:18:18 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0A26660FB8; Tue, 31 Aug 2021 12:18:02 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 615E818009DA; Tue, 31 Aug 2021 14:15:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630412303; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pe1VnmXeX4WMdsVT7ST1+j8I7UtCzPwZFsJViammQWw=; b=d8ZNwiqyTZKvBY47PUnHGcdWvXdUJpiKJx09mJJCsiANa3F91IySYH9s9I9L5r9U5CphOk ImmebX9OBpXG9HZxLJGdpvDB0wXXw4BgMJVD+b+1hsHin3V7SbKe3vnsJuwpg1ksxBZyRR FlqSgu1ejTlE7T6vObqCl2X6ZZSKkA8= X-MC-Unique: msmcjnuyPZiwNAIB0-x4dA-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 18/29] tcg_funcs: Add tb_invalidate_phys_range to TCGModuleOps Date: Tue, 31 Aug 2021 14:15:34 +0200 Message-Id: <20210831121545.2874233-19-kraxel@redhat.com> In-Reply-To: <20210831121545.2874233-1-kraxel@redhat.com> References: <20210831121545.2874233-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) DKIMWL_WL_HIGH=-0.391, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , "Michael S. Tsirkin" , Bin Meng , David Hildenbrand , Aleksandar Rikalo , Peter Xu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Filippov , Alistair Francis , Gerd Hoffmann , "Edgar E. Iglesias" , Alexandre Iooss , Huacai Chen , Halil Pasic , Christian Borntraeger , Palmer Dabbelt , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Eduardo Habkost , Richard Henderson , Greg Kurz , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Stafford Horne , =?UTF-8?q?Alex=20Benn=C3=A9e?= , David Gibson , qemu-riscv@nongnu.org, Bastian Koppelmann , Cornelia Huck , Laurent Vivier , qemu-ppc@nongnu.org, Paolo Bonzini , Mahmoud Mandour , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1630414007200100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann --- include/exec/exec-all.h | 3 +-- include/tcg/tcg-module.h | 2 ++ accel/tcg/tcg-module.c | 5 +++++ accel/tcg/translate-all.c | 3 ++- cpu.c | 4 ++-- linux-user/mmap.c | 6 +++--- softmmu/physmem.c | 2 +- 7 files changed, 16 insertions(+), 9 deletions(-) diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 9cb8337acee1..c27e911b65f9 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -25,7 +25,6 @@ #include "exec/cpu_ldst.h" #endif #include "sysemu/cpu-timers.h" -#include "tcg/tcg-module.h" =20 /* allow to see translation results - the slowdown should be negligible, s= o we leave it */ #define DEBUG_DISAS @@ -42,6 +41,7 @@ typedef ram_addr_t tb_page_addr_t; #endif =20 #include "qemu/log.h" +#include "tcg/tcg-module.h" =20 void gen_intermediate_code(CPUState *cpu, TranslationBlock *tb, int max_in= sns); void restore_state_to_opc(CPUArchState *env, TranslationBlock *tb, @@ -571,7 +571,6 @@ void tb_invalidate_phys_addr(tb_page_addr_t addr); #else void tb_invalidate_phys_addr(AddressSpace *as, hwaddr addr, MemTxAttrs att= rs); #endif -void tb_invalidate_phys_range(tb_page_addr_t start, tb_page_addr_t end); void tb_phys_invalidate(TranslationBlock *tb, tb_page_addr_t page_addr); TranslationBlock *tb_htable_lookup(CPUState *cpu, target_ulong pc, target_ulong cs_base, uint32_t flags, diff --git a/include/tcg/tcg-module.h b/include/tcg/tcg-module.h index 003581b0718c..6069b056f91f 100644 --- a/include/tcg/tcg-module.h +++ b/include/tcg/tcg-module.h @@ -14,6 +14,8 @@ struct TCGModuleOps { void (*tcg_exec_unrealizefn)(CPUState *cpu); void (*tcg_exec_realizefn)(CPUState *cpu, Error **errp); void (*tb_flush)(CPUState *cpu); + void (*tb_invalidate_phys_range)(tb_page_addr_t start, tb_page_addr_t = end); + }; extern struct TCGModuleOps tcg; =20 diff --git a/accel/tcg/tcg-module.c b/accel/tcg/tcg-module.c index 7600951fd20b..dfd7d3bbc2e0 100644 --- a/accel/tcg/tcg-module.c +++ b/accel/tcg/tcg-module.c @@ -25,6 +25,10 @@ static void tcg_exec_realizefn_stub(CPUState *cpu, Error= **errp) { } =20 +static void tb_invalidate_phys_range_stub(tb_page_addr_t start, tb_page_ad= dr_t end) +{ +} + struct TCGModuleOps tcg =3D { .tlb_flush =3D update_cpu_stub, .tlb_flush_page =3D tlb_flush_page_stub, @@ -35,4 +39,5 @@ struct TCGModuleOps tcg =3D { .tcg_exec_realizefn =3D tcg_exec_realizefn_stub, .tcg_exec_unrealizefn =3D update_cpu_stub, .tb_flush =3D update_cpu_stub, + .tb_invalidate_phys_range =3D tb_invalidate_phys_range_stub, }; diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 3a3a60575141..e71e58aff9e7 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -1777,7 +1777,7 @@ tb_invalidate_phys_page_range__locked(struct page_col= lection *pages, * * Called with mmap_lock held for user-mode emulation. */ -void tb_invalidate_phys_range(tb_page_addr_t start, tb_page_addr_t end) +static void tb_invalidate_phys_range(tb_page_addr_t start, tb_page_addr_t = end) { struct page_collection *pages; tb_page_addr_t next; @@ -2438,6 +2438,7 @@ int page_unprotect(target_ulong address, uintptr_t pc) static void tcg_module_ops_tb(void) { tcg.tb_flush =3D tb_flush; + tcg.tb_invalidate_phys_range =3D tb_invalidate_phys_range; } =20 type_init(tcg_module_ops_tb); diff --git a/cpu.c b/cpu.c index b8ac817cb3fd..536bb6911a58 100644 --- a/cpu.c +++ b/cpu.c @@ -222,7 +222,7 @@ const char *parse_cpu_option(const char *cpu_option) void tb_invalidate_phys_addr(tb_page_addr_t addr) { mmap_lock(); - tb_invalidate_phys_range(addr, addr + 1); + tcg.tb_invalidate_phys_range(addr, addr + 1); mmap_unlock(); } #else @@ -243,7 +243,7 @@ void tb_invalidate_phys_addr(AddressSpace *as, hwaddr a= ddr, MemTxAttrs attrs) return; } ram_addr =3D memory_region_get_ram_addr(mr) + addr; - tb_invalidate_phys_range(ram_addr, ram_addr + 1); + tcg.tb_invalidate_phys_range(ram_addr, ram_addr + 1); } #endif =20 diff --git a/linux-user/mmap.c b/linux-user/mmap.c index 85cb03e176c1..0f4cfefe01cb 100644 --- a/linux-user/mmap.c +++ b/linux-user/mmap.c @@ -630,7 +630,7 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, in= t target_prot, if (qemu_loglevel_mask(CPU_LOG_PAGE)) { log_page_dump(__func__); } - tb_invalidate_phys_range(start, start + len); + tcg.tb_invalidate_phys_range(start, start + len); mmap_unlock(); return start; fail: @@ -734,7 +734,7 @@ int target_munmap(abi_ulong start, abi_ulong len) =20 if (ret =3D=3D 0) { page_set_flags(start, start + len, 0); - tb_invalidate_phys_range(start, start + len); + tcg.tb_invalidate_phys_range(start, start + len); } mmap_unlock(); return ret; @@ -824,7 +824,7 @@ abi_long target_mremap(abi_ulong old_addr, abi_ulong ol= d_size, page_set_flags(new_addr, new_addr + new_size, prot | PAGE_VALID | PAGE_RESET); } - tb_invalidate_phys_range(new_addr, new_addr + new_size); + tcg.tb_invalidate_phys_range(new_addr, new_addr + new_size); mmap_unlock(); return new_addr; } diff --git a/softmmu/physmem.c b/softmmu/physmem.c index 8b27827c533d..f2301f4445cc 100644 --- a/softmmu/physmem.c +++ b/softmmu/physmem.c @@ -2696,7 +2696,7 @@ static void invalidate_and_set_dirty(MemoryRegion *mr= , hwaddr addr, } if (dirty_log_mask & (1 << DIRTY_MEMORY_CODE)) { assert(tcg_enabled()); - tb_invalidate_phys_range(addr, addr + length); + tcg.tb_invalidate_phys_range(addr, addr + length); dirty_log_mask &=3D ~(1 << DIRTY_MEMORY_CODE); } cpu_physical_memory_set_dirty_range(addr, length, dirty_log_mask); --=20 2.31.1 From nobody Sat May 4 07:03:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1630413758459443.9666587005777; Tue, 31 Aug 2021 05:42:38 -0700 (PDT) Received: from localhost ([::1]:54532 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mL365-0005gd-8S for importer@patchew.org; Tue, 31 Aug 2021 08:42:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32876) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2ij-0007WD-WE for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:18:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:31223) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2if-0006SC-Dk for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:18:29 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-105-MPsc-aRfOl62WacDB5Ddsw-1; Tue, 31 Aug 2021 08:18:23 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C589218C8C3D; Tue, 31 Aug 2021 12:18:18 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 06E0860E1C; Tue, 31 Aug 2021 12:18:02 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 7426E18009DD; Tue, 31 Aug 2021 14:15:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630412304; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=osPQ4bLKsDhnqdn8uaDB3ZlP3+Rdgg45jSXidZEEElc=; b=S0tmB8cBBvwsmq5gsBDK5mp6bBfGAJ+FNFedxe/Lw2Pf4J0B8HjaAxEPranCM5yC6Ht20w jKQmhpkx5zHJWG1Ht2ZvET1lh4L8m+PqJP9psvhzm+hMbRq/+1b2kwej1u0xrke3cMvwi/ Fwt7SggZgrXqip/rTc/HYZrtokl8IeA= X-MC-Unique: MPsc-aRfOl62WacDB5Ddsw-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 19/29] tcg_funcs: Add tb_check_watchpoint to TCGModuleOps Date: Tue, 31 Aug 2021 14:15:35 +0200 Message-Id: <20210831121545.2874233-20-kraxel@redhat.com> In-Reply-To: <20210831121545.2874233-1-kraxel@redhat.com> References: <20210831121545.2874233-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , "Michael S. Tsirkin" , Bin Meng , David Hildenbrand , Aleksandar Rikalo , Peter Xu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Filippov , Alistair Francis , Gerd Hoffmann , "Edgar E. Iglesias" , Alexandre Iooss , Huacai Chen , Halil Pasic , Christian Borntraeger , Palmer Dabbelt , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Eduardo Habkost , Richard Henderson , Greg Kurz , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Stafford Horne , =?UTF-8?q?Alex=20Benn=C3=A9e?= , David Gibson , qemu-riscv@nongnu.org, Bastian Koppelmann , Cornelia Huck , Laurent Vivier , qemu-ppc@nongnu.org, Paolo Bonzini , Mahmoud Mandour , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1630413759254100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann --- include/exec/translate-all.h | 1 - include/tcg/tcg-module.h | 2 +- accel/tcg/tcg-module.c | 5 +++++ accel/tcg/translate-all.c | 3 ++- softmmu/physmem.c | 2 +- 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/include/exec/translate-all.h b/include/exec/translate-all.h index f313542cdae1..fa9cebd56c60 100644 --- a/include/exec/translate-all.h +++ b/include/exec/translate-all.h @@ -29,7 +29,6 @@ void page_collection_unlock(struct page_collection *set); void tb_invalidate_phys_page_fast(struct page_collection *pages, tb_page_addr_t start, int len, uintptr_t retaddr); -void tb_check_watchpoint(CPUState *cpu, uintptr_t retaddr); =20 #ifdef CONFIG_USER_ONLY int page_unprotect(target_ulong address, uintptr_t pc); diff --git a/include/tcg/tcg-module.h b/include/tcg/tcg-module.h index 6069b056f91f..645e8eb39e71 100644 --- a/include/tcg/tcg-module.h +++ b/include/tcg/tcg-module.h @@ -15,7 +15,7 @@ struct TCGModuleOps { void (*tcg_exec_realizefn)(CPUState *cpu, Error **errp); void (*tb_flush)(CPUState *cpu); void (*tb_invalidate_phys_range)(tb_page_addr_t start, tb_page_addr_t = end); - + void (*tb_check_watchpoint)(CPUState *cpu, uintptr_t retaddr); }; extern struct TCGModuleOps tcg; =20 diff --git a/accel/tcg/tcg-module.c b/accel/tcg/tcg-module.c index dfd7d3bbc2e0..ea0c2a160a97 100644 --- a/accel/tcg/tcg-module.c +++ b/accel/tcg/tcg-module.c @@ -29,6 +29,10 @@ static void tb_invalidate_phys_range_stub(tb_page_addr_t= start, tb_page_addr_t e { } =20 +static void tb_check_watchpoint_stub(CPUState *cpu, uintptr_t retaddr) +{ +} + struct TCGModuleOps tcg =3D { .tlb_flush =3D update_cpu_stub, .tlb_flush_page =3D tlb_flush_page_stub, @@ -40,4 +44,5 @@ struct TCGModuleOps tcg =3D { .tcg_exec_unrealizefn =3D update_cpu_stub, .tb_flush =3D update_cpu_stub, .tb_invalidate_phys_range =3D tb_invalidate_phys_range_stub, + .tb_check_watchpoint =3D tb_check_watchpoint_stub, }; diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index e71e58aff9e7..57129bbeb791 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -1910,7 +1910,7 @@ static bool tb_invalidate_phys_page(tb_page_addr_t ad= dr, uintptr_t pc) #endif =20 /* user-mode: call with mmap_lock held */ -void tb_check_watchpoint(CPUState *cpu, uintptr_t retaddr) +static void tb_check_watchpoint(CPUState *cpu, uintptr_t retaddr) { TranslationBlock *tb; =20 @@ -2439,6 +2439,7 @@ static void tcg_module_ops_tb(void) { tcg.tb_flush =3D tb_flush; tcg.tb_invalidate_phys_range =3D tb_invalidate_phys_range; + tcg.tb_check_watchpoint =3D tb_check_watchpoint; } =20 type_init(tcg_module_ops_tb); diff --git a/softmmu/physmem.c b/softmmu/physmem.c index f2301f4445cc..634500fd3b7b 100644 --- a/softmmu/physmem.c +++ b/softmmu/physmem.c @@ -937,7 +937,7 @@ void cpu_check_watchpoint(CPUState *cpu, vaddr addr, va= ddr len, cpu->watchpoint_hit =3D wp; =20 mmap_lock(); - tb_check_watchpoint(cpu, ra); + tcg.tb_check_watchpoint(cpu, ra); if (wp->flags & BP_STOP_BEFORE_ACCESS) { cpu->exception_index =3D EXCP_DEBUG; mmap_unlock(); --=20 2.31.1 From nobody Sat May 4 07:03:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1630413764234757.7450203194294; Tue, 31 Aug 2021 05:42:44 -0700 (PDT) Received: from localhost ([::1]:54840 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mL36A-0005uu-UO for importer@patchew.org; Tue, 31 Aug 2021 08:42:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33008) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2iz-0007oW-Vc for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:18:46 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:45795) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2iw-0006e2-77 for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:18:45 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-555-ZrhI2ExNPsaoKib384-OFg-1; Tue, 31 Aug 2021 08:18:40 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 62A2293920; Tue, 31 Aug 2021 12:18:36 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 64FFD60843; Tue, 31 Aug 2021 12:18:20 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id A380818009DE; Tue, 31 Aug 2021 14:15:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630412321; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DlnfQx6rLK4ZENJCeIGcgssSnyAh0WjzHulYEeHbTzE=; b=AohpvXWwkQt4unGxEIKh52P6qTOXYDWsOecYttMvksDbOiqQw5mx1+4xAKRON8H7STVdDs 8aICRLsE/WT8AxrRwHyfzCZUJfMo0ZNRq2rlBmgqLeBD96OJXiNWGaCsnKlcyh8sSNg/xr G7emu8hWBO3/HOo3eV11wkO0eZegob4= X-MC-Unique: ZrhI2ExNPsaoKib384-OFg-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 20/29] tcg_funcs: Add cpu_restore_state to TCGModuleOps Date: Tue, 31 Aug 2021 14:15:36 +0200 Message-Id: <20210831121545.2874233-21-kraxel@redhat.com> In-Reply-To: <20210831121545.2874233-1-kraxel@redhat.com> References: <20210831121545.2874233-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , "Michael S. Tsirkin" , Bin Meng , David Hildenbrand , Aleksandar Rikalo , Peter Xu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Filippov , Alistair Francis , Gerd Hoffmann , "Edgar E. Iglesias" , Alexandre Iooss , Huacai Chen , Halil Pasic , Christian Borntraeger , Palmer Dabbelt , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Eduardo Habkost , Richard Henderson , Greg Kurz , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Stafford Horne , =?UTF-8?q?Alex=20Benn=C3=A9e?= , David Gibson , qemu-riscv@nongnu.org, Bastian Koppelmann , Cornelia Huck , Laurent Vivier , qemu-ppc@nongnu.org, Paolo Bonzini , Mahmoud Mandour , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1630413765805100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann Reviewed-by: Bastian Koppelmann --- include/exec/exec-all.h | 2 +- include/tcg/tcg-module.h | 1 + accel/tcg/cpu-exec-common.c | 2 +- accel/tcg/tcg-module.c | 6 ++++++ accel/tcg/translate-all.c | 3 ++- softmmu/physmem.c | 2 +- target/alpha/helper.c | 2 +- target/alpha/mem_helper.c | 2 +- target/arm/op_helper.c | 2 +- target/arm/tlb_helper.c | 8 ++++---- target/cris/helper.c | 2 +- target/i386/helper.c | 2 +- target/i386/tcg/sysemu/svm_helper.c | 2 +- target/m68k/op_helper.c | 6 +++--- target/microblaze/helper.c | 2 +- target/openrisc/sys_helper.c | 8 ++++---- target/ppc/excp_helper.c | 2 +- target/s390x/tcg/excp_helper.c | 2 +- target/tricore/op_helper.c | 2 +- target/xtensa/helper.c | 6 +++--- 20 files changed, 36 insertions(+), 28 deletions(-) diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index c27e911b65f9..546db9416f43 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -60,7 +60,7 @@ void restore_state_to_opc(CPUArchState *env, TranslationB= lock *tb, * code. If the searched_pc is not in translated code no state is * restored and the function returns false. */ -bool cpu_restore_state(CPUState *cpu, uintptr_t searched_pc, bool will_exi= t); +// FIXME: docs =20 void QEMU_NORETURN cpu_loop_exit_noexc(CPUState *cpu); void QEMU_NORETURN cpu_loop_exit(CPUState *cpu); diff --git a/include/tcg/tcg-module.h b/include/tcg/tcg-module.h index 645e8eb39e71..01205ad8fd34 100644 --- a/include/tcg/tcg-module.h +++ b/include/tcg/tcg-module.h @@ -16,6 +16,7 @@ struct TCGModuleOps { void (*tb_flush)(CPUState *cpu); void (*tb_invalidate_phys_range)(tb_page_addr_t start, tb_page_addr_t = end); void (*tb_check_watchpoint)(CPUState *cpu, uintptr_t retaddr); + bool (*cpu_restore_state)(CPUState *cpu, uintptr_t searched_pc, bool w= ill_exit); }; extern struct TCGModuleOps tcg; =20 diff --git a/accel/tcg/cpu-exec-common.c b/accel/tcg/cpu-exec-common.c index 777ad00befc8..e3c34a51ff6a 100644 --- a/accel/tcg/cpu-exec-common.c +++ b/accel/tcg/cpu-exec-common.c @@ -71,7 +71,7 @@ void cpu_loop_exit(CPUState *cpu) void cpu_loop_exit_restore(CPUState *cpu, uintptr_t pc) { if (pc) { - cpu_restore_state(cpu, pc, true); + tcg.cpu_restore_state(cpu, pc, true); } cpu_loop_exit(cpu); } diff --git a/accel/tcg/tcg-module.c b/accel/tcg/tcg-module.c index ea0c2a160a97..61ad3a648767 100644 --- a/accel/tcg/tcg-module.c +++ b/accel/tcg/tcg-module.c @@ -33,6 +33,11 @@ static void tb_check_watchpoint_stub(CPUState *cpu, uint= ptr_t retaddr) { } =20 +static bool cpu_restore_state_stub(CPUState *cpu, uintptr_t searched_pc, b= ool will_exit) +{ + return false; +} + struct TCGModuleOps tcg =3D { .tlb_flush =3D update_cpu_stub, .tlb_flush_page =3D tlb_flush_page_stub, @@ -45,4 +50,5 @@ struct TCGModuleOps tcg =3D { .tb_flush =3D update_cpu_stub, .tb_invalidate_phys_range =3D tb_invalidate_phys_range_stub, .tb_check_watchpoint =3D tb_check_watchpoint_stub, + .cpu_restore_state =3D cpu_restore_state_stub, }; diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 57129bbeb791..836ac0565e01 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -378,7 +378,7 @@ static int cpu_restore_state_from_tb(CPUState *cpu, Tra= nslationBlock *tb, return 0; } =20 -bool cpu_restore_state(CPUState *cpu, uintptr_t host_pc, bool will_exit) +static bool cpu_restore_state(CPUState *cpu, uintptr_t host_pc, bool will_= exit) { /* * The host_pc has to be in the rx region of the code buffer. @@ -2440,6 +2440,7 @@ static void tcg_module_ops_tb(void) tcg.tb_flush =3D tb_flush; tcg.tb_invalidate_phys_range =3D tb_invalidate_phys_range; tcg.tb_check_watchpoint =3D tb_check_watchpoint; + tcg.cpu_restore_state =3D cpu_restore_state; } =20 type_init(tcg_module_ops_tb); diff --git a/softmmu/physmem.c b/softmmu/physmem.c index 634500fd3b7b..76b6e16d9466 100644 --- a/softmmu/physmem.c +++ b/softmmu/physmem.c @@ -947,7 +947,7 @@ void cpu_check_watchpoint(CPUState *cpu, vaddr addr, va= ddr len, cpu->cflags_next_tb =3D 1 | curr_cflags(cpu); mmap_unlock(); if (ra) { - cpu_restore_state(cpu, ra, true); + tcg.cpu_restore_state(cpu, ra, true); } cpu_loop_exit_noexc(cpu); } diff --git a/target/alpha/helper.c b/target/alpha/helper.c index 4f56fe4d2317..5694c3428296 100644 --- a/target/alpha/helper.c +++ b/target/alpha/helper.c @@ -504,7 +504,7 @@ void QEMU_NORETURN dynamic_excp(CPUAlphaState *env, uin= tptr_t retaddr, cs->exception_index =3D excp; env->error_code =3D error; if (retaddr) { - cpu_restore_state(cs, retaddr, true); + tcg.cpu_restore_state(cs, retaddr, true); /* Floating-point exceptions (our only users) point to the next PC= . */ env->pc +=3D 4; } diff --git a/target/alpha/mem_helper.c b/target/alpha/mem_helper.c index 75e72bc3370f..b4d208cff8f9 100644 --- a/target/alpha/mem_helper.c +++ b/target/alpha/mem_helper.c @@ -34,7 +34,7 @@ void alpha_cpu_do_unaligned_access(CPUState *cs, vaddr ad= dr, uint64_t pc; uint32_t insn; =20 - cpu_restore_state(cs, retaddr, true); + tcg.cpu_restore_state(cs, retaddr, true); =20 pc =3D env->pc; insn =3D cpu_ldl_code(env, pc); diff --git a/target/arm/op_helper.c b/target/arm/op_helper.c index 70b42b55fd0c..d309f32a755e 100644 --- a/target/arm/op_helper.c +++ b/target/arm/op_helper.c @@ -62,7 +62,7 @@ void raise_exception_ra(CPUARMState *env, uint32_t excp, = uint32_t syndrome, * we must restore CPU state here before setting the syndrome * the caller passed us, and cannot use cpu_loop_exit_restore(). */ - cpu_restore_state(cs, ra, true); + tcg.cpu_restore_state(cs, ra, true); raise_exception(env, excp, syndrome, target_el); } =20 diff --git a/target/arm/tlb_helper.c b/target/arm/tlb_helper.c index 3107f9823eff..22c9c8c01d2f 100644 --- a/target/arm/tlb_helper.c +++ b/target/arm/tlb_helper.c @@ -117,7 +117,7 @@ void arm_cpu_do_unaligned_access(CPUState *cs, vaddr va= ddr, ARMMMUFaultInfo fi =3D {}; =20 /* now we have a real cpu fault */ - cpu_restore_state(cs, retaddr, true); + tcg.cpu_restore_state(cs, retaddr, true); =20 fi.type =3D ARMFault_Alignment; arm_deliver_fault(cpu, vaddr, access_type, mmu_idx, &fi); @@ -140,7 +140,7 @@ void arm_cpu_do_transaction_failed(CPUState *cs, hwaddr= physaddr, ARMMMUFaultInfo fi =3D {}; =20 /* now we have a real cpu fault */ - cpu_restore_state(cs, retaddr, true); + tcg.cpu_restore_state(cs, retaddr, true); =20 fi.ea =3D arm_extabort_type(response); fi.type =3D ARMFault_SyncExternal; @@ -166,7 +166,7 @@ bool arm_cpu_tlb_fill(CPUState *cs, vaddr address, int = size, fi.level =3D 3; =20 /* now we have a real cpu fault */ - cpu_restore_state(cs, retaddr, true); + tcg.cpu_restore_state(cs, retaddr, true); arm_deliver_fault(cpu, address, access_type, mmu_idx, &fi); #else hwaddr phys_addr; @@ -207,7 +207,7 @@ bool arm_cpu_tlb_fill(CPUState *cs, vaddr address, int = size, return false; } else { /* now we have a real cpu fault */ - cpu_restore_state(cs, retaddr, true); + tcg.cpu_restore_state(cs, retaddr, true); arm_deliver_fault(cpu, address, access_type, mmu_idx, &fi); } #endif diff --git a/target/cris/helper.c b/target/cris/helper.c index 911867f3b482..0b8bfd0efa8f 100644 --- a/target/cris/helper.c +++ b/target/cris/helper.c @@ -116,7 +116,7 @@ bool cris_cpu_tlb_fill(CPUState *cs, vaddr address, int= size, cs->exception_index =3D EXCP_BUSFAULT; env->fault_vector =3D res.bf_vec; if (retaddr) { - if (cpu_restore_state(cs, retaddr, true)) { + if (tcg.cpu_restore_state(cs, retaddr, true)) { /* Evaluate flags after retranslation. */ helper_top_evaluate_flags(env); } diff --git a/target/i386/helper.c b/target/i386/helper.c index 100add713c5d..a059044b84c9 100644 --- a/target/i386/helper.c +++ b/target/i386/helper.c @@ -500,7 +500,7 @@ void cpu_report_tpr_access(CPUX86State *env, TPRAccess = access) =20 cpu_interrupt(cs, CPU_INTERRUPT_TPR); } else if (tcg_enabled()) { - cpu_restore_state(cs, cs->mem_io_pc, false); + tcg.cpu_restore_state(cs, cs->mem_io_pc, false); =20 apic_handle_tpr_access_report(cpu->apic_state, env->eip, access); } diff --git a/target/i386/tcg/sysemu/svm_helper.c b/target/i386/tcg/sysemu/s= vm_helper.c index 0d549b3d6c3b..74241443aba5 100644 --- a/target/i386/tcg/sysemu/svm_helper.c +++ b/target/i386/tcg/sysemu/svm_helper.c @@ -630,7 +630,7 @@ void cpu_vmexit(CPUX86State *env, uint32_t exit_code, u= int64_t exit_info_1, { CPUState *cs =3D env_cpu(env); =20 - cpu_restore_state(cs, retaddr, true); + tcg.cpu_restore_state(cs, retaddr, true); =20 qemu_log_mask(CPU_LOG_TB_IN_ASM, "vmexit(%08x, %016" PRIx64 ", %016" PRIx64 ", " TARGET_FMT_lx ")!\n", diff --git a/target/m68k/op_helper.c b/target/m68k/op_helper.c index d006d1cb3eaa..54932083dfcb 100644 --- a/target/m68k/op_helper.c +++ b/target/m68k/op_helper.c @@ -468,7 +468,7 @@ void m68k_cpu_transaction_failed(CPUState *cs, hwaddr p= hysaddr, vaddr addr, M68kCPU *cpu =3D M68K_CPU(cs); CPUM68KState *env =3D &cpu->env; =20 - cpu_restore_state(cs, retaddr, true); + tcg.cpu_restore_state(cs, retaddr, true); =20 if (m68k_feature(env, M68K_FEATURE_M68040)) { env->mmu.mmusr =3D 0; @@ -1076,7 +1076,7 @@ void HELPER(chk)(CPUM68KState *env, int32_t val, int3= 2_t ub) CPUState *cs =3D env_cpu(env); =20 /* Recover PC and CC_OP for the beginning of the insn. */ - cpu_restore_state(cs, GETPC(), true); + tcg.cpu_restore_state(cs, GETPC(), true); =20 /* flags have been modified by gen_flush_flags() */ env->cc_op =3D CC_OP_FLAGS; @@ -1108,7 +1108,7 @@ void HELPER(chk2)(CPUM68KState *env, int32_t val, int= 32_t lb, int32_t ub) CPUState *cs =3D env_cpu(env); =20 /* Recover PC and CC_OP for the beginning of the insn. */ - cpu_restore_state(cs, GETPC(), true); + tcg.cpu_restore_state(cs, GETPC(), true); =20 /* flags have been modified by gen_flush_flags() */ env->cc_op =3D CC_OP_FLAGS; diff --git a/target/microblaze/helper.c b/target/microblaze/helper.c index 20dbd673136e..b0652b20c2ec 100644 --- a/target/microblaze/helper.c +++ b/target/microblaze/helper.c @@ -297,7 +297,7 @@ void mb_cpu_do_unaligned_access(CPUState *cs, vaddr add= r, uint32_t esr, iflags; =20 /* Recover the pc and iflags from the corresponding insn_start. */ - cpu_restore_state(cs, retaddr, true); + tcg.cpu_restore_state(cs, retaddr, true); iflags =3D cpu->env.iflags; =20 qemu_log_mask(CPU_LOG_INT, diff --git a/target/openrisc/sys_helper.c b/target/openrisc/sys_helper.c index 48674231e743..0208485b8567 100644 --- a/target/openrisc/sys_helper.c +++ b/target/openrisc/sys_helper.c @@ -45,7 +45,7 @@ void HELPER(mtspr)(CPUOpenRISCState *env, target_ulong sp= r, target_ulong rb) break; =20 case TO_SPR(0, 16): /* NPC */ - cpu_restore_state(cs, GETPC(), true); + tcg.cpu_restore_state(cs, GETPC(), true); /* ??? Mirror or1ksim in not trashing delayed branch state when "jumping" to the current instruction. */ if (env->pc !=3D rb) { @@ -131,7 +131,7 @@ void HELPER(mtspr)(CPUOpenRISCState *env, target_ulong = spr, target_ulong rb) case TO_SPR(8, 0): /* PMR */ env->pmr =3D rb; if (env->pmr & PMR_DME || env->pmr & PMR_SME) { - cpu_restore_state(cs, GETPC(), true); + tcg.cpu_restore_state(cs, GETPC(), true); env->pc +=3D 4; cs->halted =3D 1; raise_exception(cpu, EXCP_HALTED); @@ -222,14 +222,14 @@ target_ulong HELPER(mfspr)(CPUOpenRISCState *env, tar= get_ulong rd, return env->evbar; =20 case TO_SPR(0, 16): /* NPC (equals PC) */ - cpu_restore_state(cs, GETPC(), false); + tcg.cpu_restore_state(cs, GETPC(), false); return env->pc; =20 case TO_SPR(0, 17): /* SR */ return cpu_get_sr(env); =20 case TO_SPR(0, 18): /* PPC */ - cpu_restore_state(cs, GETPC(), false); + tcg.cpu_restore_state(cs, GETPC(), false); return env->ppc; =20 case TO_SPR(0, 32): /* EPCR */ diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index 7b6ac16eef72..2db29b4d88a0 100644 --- a/target/ppc/excp_helper.c +++ b/target/ppc/excp_helper.c @@ -1498,7 +1498,7 @@ void ppc_cpu_do_unaligned_access(CPUState *cs, vaddr = vaddr, uint32_t insn; =20 /* Restore state and reload the insn we executed, for filling in DSISR= . */ - cpu_restore_state(cs, retaddr, true); + tcg.cpu_restore_state(cs, retaddr, true); insn =3D cpu_ldl_code(env, env->nip); =20 cs->exception_index =3D POWERPC_EXCP_ALIGN; diff --git a/target/s390x/tcg/excp_helper.c b/target/s390x/tcg/excp_helper.c index a61917d04fab..08716f7ee6d3 100644 --- a/target/s390x/tcg/excp_helper.c +++ b/target/s390x/tcg/excp_helper.c @@ -38,7 +38,7 @@ void QEMU_NORETURN tcg_s390_program_interrupt(CPUS390XSta= te *env, { CPUState *cs =3D env_cpu(env); =20 - cpu_restore_state(cs, ra, true); + tcg.cpu_restore_state(cs, ra, true); qemu_log_mask(CPU_LOG_INT, "program interrupt at %#" PRIx64 "\n", env->psw.addr); trigger_pgm_exception(env, code); diff --git a/target/tricore/op_helper.c b/target/tricore/op_helper.c index 32c2bc169981..a7e57abd9f7c 100644 --- a/target/tricore/op_helper.c +++ b/target/tricore/op_helper.c @@ -31,7 +31,7 @@ raise_exception_sync_internal(CPUTriCoreState *env, uint3= 2_t class, int tin, { CPUState *cs =3D env_cpu(env); /* in case we come from a helper-call we need to restore the PC */ - cpu_restore_state(cs, pc, true); + tcg.cpu_restore_state(cs, pc, true); =20 /* Tin is loaded into d[15] */ env->gpr_d[15] =3D tin; diff --git a/target/xtensa/helper.c b/target/xtensa/helper.c index f18ab383fd89..347054520b87 100644 --- a/target/xtensa/helper.c +++ b/target/xtensa/helper.c @@ -272,7 +272,7 @@ void xtensa_cpu_do_unaligned_access(CPUState *cs, =20 assert(xtensa_option_enabled(env->config, XTENSA_OPTION_UNALIGNED_EXCEPTION)); - cpu_restore_state(CPU(cpu), retaddr, true); + tcg.cpu_restore_state(CPU(cpu), retaddr, true); HELPER(exception_cause_vaddr)(env, env->pc, LOAD_STORE_ALIGNMENT_CAUSE, addr); @@ -303,7 +303,7 @@ bool xtensa_cpu_tlb_fill(CPUState *cs, vaddr address, i= nt size, } else if (probe) { return false; } else { - cpu_restore_state(cs, retaddr, true); + tcg.cpu_restore_state(cs, retaddr, true); HELPER(exception_cause_vaddr)(env, env->pc, ret, address); } } @@ -316,7 +316,7 @@ void xtensa_cpu_do_transaction_failed(CPUState *cs, hwa= ddr physaddr, vaddr addr, XtensaCPU *cpu =3D XTENSA_CPU(cs); CPUXtensaState *env =3D &cpu->env; =20 - cpu_restore_state(cs, retaddr, true); + tcg.cpu_restore_state(cs, retaddr, true); HELPER(exception_cause_vaddr)(env, env->pc, access_type =3D=3D MMU_INST_FETCH ? INSTR_PIF_ADDR_ERROR_CAUSE : --=20 2.31.1 From nobody Sat May 4 07:03:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1630413586923398.1023657028952; Tue, 31 Aug 2021 05:39:46 -0700 (PDT) Received: from localhost ([::1]:46476 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mL33J-0008VM-VW for importer@patchew.org; Tue, 31 Aug 2021 08:39:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:32956) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2iu-0007mj-Ig for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:18:42 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:31623) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2ir-0006aX-D6 for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:18:40 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-438-R-rFrnRJOSG5W3eEQBxamA-1; Tue, 31 Aug 2021 08:18:35 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 68E18802C8F; Tue, 31 Aug 2021 12:18:32 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 687FA5D6D5; Tue, 31 Aug 2021 12:18:20 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id B837D18009E5; Tue, 31 Aug 2021 14:15:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630412316; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=p11PRkJOJjAxargU1dz9TBF2UP/nwlBlyI4WqujO8tw=; b=Fh0oGeUPSQ8KggBU+PoAbrZ2SlpnVpuhTseFeL+8EjtlP5z51Rmnm8vzN/tEwra4xw2OmO hiq2GB9KaCZDNQidPxPfjyTCRVdnHK/jXTWWUKwwf/eZU/m7w/d4behPdR9uRkE2R8TVq7 rPnE9ULQ+snj9dC5t1d1Hm6nmCdFbys= X-MC-Unique: R-rFrnRJOSG5W3eEQBxamA-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 21/29] tcg_funcs: Add curr_cflags to TCGModuleOps Date: Tue, 31 Aug 2021 14:15:37 +0200 Message-Id: <20210831121545.2874233-22-kraxel@redhat.com> In-Reply-To: <20210831121545.2874233-1-kraxel@redhat.com> References: <20210831121545.2874233-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) DKIMWL_WL_HIGH=-0.391, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , "Michael S. Tsirkin" , Bin Meng , David Hildenbrand , Aleksandar Rikalo , Peter Xu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Filippov , Alistair Francis , Gerd Hoffmann , "Edgar E. Iglesias" , Alexandre Iooss , Huacai Chen , Halil Pasic , Christian Borntraeger , Palmer Dabbelt , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Eduardo Habkost , Richard Henderson , Greg Kurz , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Stafford Horne , =?UTF-8?q?Alex=20Benn=C3=A9e?= , David Gibson , qemu-riscv@nongnu.org, Bastian Koppelmann , Cornelia Huck , Laurent Vivier , qemu-ppc@nongnu.org, Paolo Bonzini , Mahmoud Mandour , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1630413587324100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann --- include/exec/exec-all.h | 2 +- include/tcg/tcg-module.h | 1 + accel/tcg/cpu-exec.c | 3 ++- accel/tcg/tcg-module.c | 6 ++++++ accel/tcg/translate-all.c | 6 +++--- softmmu/physmem.c | 4 ++-- 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 546db9416f43..d3cd6bf4988a 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -563,7 +563,7 @@ static inline uint32_t tb_cflags(const TranslationBlock= *tb) } =20 /* current cflags for hashing/comparison */ -uint32_t curr_cflags(CPUState *cpu); +// FIXME: docs =20 /* TranslationBlock invalidate API */ #if defined(CONFIG_USER_ONLY) diff --git a/include/tcg/tcg-module.h b/include/tcg/tcg-module.h index 01205ad8fd34..e9c0615b51d9 100644 --- a/include/tcg/tcg-module.h +++ b/include/tcg/tcg-module.h @@ -17,6 +17,7 @@ struct TCGModuleOps { void (*tb_invalidate_phys_range)(tb_page_addr_t start, tb_page_addr_t = end); void (*tb_check_watchpoint)(CPUState *cpu, uintptr_t retaddr); bool (*cpu_restore_state)(CPUState *cpu, uintptr_t searched_pc, bool w= ill_exit); + uint32_t (*curr_cflags)(CPUState *cpu); }; extern struct TCGModuleOps tcg; =20 diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index d41d1d2bd24f..54d10a06914c 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -145,7 +145,7 @@ static void init_delay_params(SyncClocks *sc, const CPU= State *cpu) } #endif /* CONFIG USER ONLY */ =20 -uint32_t curr_cflags(CPUState *cpu) +static uint32_t curr_cflags(CPUState *cpu) { uint32_t cflags =3D cpu->tcg_cflags; =20 @@ -1036,6 +1036,7 @@ static void tcg_module_ops_exec(void) { tcg.tcg_exec_realizefn =3D tcg_exec_realizefn; tcg.tcg_exec_unrealizefn =3D tcg_exec_unrealizefn; + tcg.curr_cflags =3D curr_cflags; } =20 type_init(tcg_module_ops_exec); diff --git a/accel/tcg/tcg-module.c b/accel/tcg/tcg-module.c index 61ad3a648767..f307975caff2 100644 --- a/accel/tcg/tcg-module.c +++ b/accel/tcg/tcg-module.c @@ -38,6 +38,11 @@ static bool cpu_restore_state_stub(CPUState *cpu, uintpt= r_t searched_pc, bool wi return false; } =20 +static uint32_t curr_cflags_stub(CPUState *cpu) +{ + return 0; +} + struct TCGModuleOps tcg =3D { .tlb_flush =3D update_cpu_stub, .tlb_flush_page =3D tlb_flush_page_stub, @@ -51,4 +56,5 @@ struct TCGModuleOps tcg =3D { .tb_invalidate_phys_range =3D tb_invalidate_phys_range_stub, .tb_check_watchpoint =3D tb_check_watchpoint_stub, .cpu_restore_state =3D cpu_restore_state_stub, + .curr_cflags =3D curr_cflags_stub, }; diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 836ac0565e01..5ec7139a75bf 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -1761,7 +1761,7 @@ tb_invalidate_phys_page_range__locked(struct page_col= lection *pages, if (current_tb_modified) { page_collection_unlock(pages); /* Force execution of one insn next time. */ - cpu->cflags_next_tb =3D 1 | curr_cflags(cpu); + cpu->cflags_next_tb =3D 1 | tcg.curr_cflags(cpu); mmap_unlock(); cpu_loop_exit_noexc(cpu); } @@ -1900,7 +1900,7 @@ static bool tb_invalidate_phys_page(tb_page_addr_t ad= dr, uintptr_t pc) #ifdef TARGET_HAS_PRECISE_SMC if (current_tb_modified) { /* Force execution of one insn next time. */ - cpu->cflags_next_tb =3D 1 | curr_cflags(cpu); + cpu->cflags_next_tb =3D 1 | tcg.curr_cflags(cpu); return true; } #endif @@ -1976,7 +1976,7 @@ void cpu_io_recompile(CPUState *cpu, uintptr_t retadd= r) * operations only (which execute after completion) so we don't * double instrument the instruction. */ - cpu->cflags_next_tb =3D curr_cflags(cpu) | CF_MEMI_ONLY | CF_LAST_IO |= n; + cpu->cflags_next_tb =3D tcg.curr_cflags(cpu) | CF_MEMI_ONLY | CF_LAST_= IO | n; =20 qemu_log_mask_and_addr(CPU_LOG_EXEC, tb->pc, "cpu_io_recompile: rewound execution of TB to " diff --git a/softmmu/physmem.c b/softmmu/physmem.c index 76b6e16d9466..4b57d2f1d8aa 100644 --- a/softmmu/physmem.c +++ b/softmmu/physmem.c @@ -911,7 +911,7 @@ void cpu_check_watchpoint(CPUState *cpu, vaddr addr, va= ddr len, */ if (!cpu->can_do_io) { /* Force execution of one insn next time. */ - cpu->cflags_next_tb =3D 1 | CF_LAST_IO | curr_cflags(c= pu); + cpu->cflags_next_tb =3D 1 | CF_LAST_IO | tcg.curr_cfla= gs(cpu); cpu_loop_exit_restore(cpu, ra); } /* @@ -944,7 +944,7 @@ void cpu_check_watchpoint(CPUState *cpu, vaddr addr, va= ddr len, cpu_loop_exit_restore(cpu, ra); } else { /* Force execution of one insn next time. */ - cpu->cflags_next_tb =3D 1 | curr_cflags(cpu); + cpu->cflags_next_tb =3D 1 | tcg.curr_cflags(cpu); mmap_unlock(); if (ra) { tcg.cpu_restore_state(cpu, ra, true); --=20 2.31.1 From nobody Sat May 4 07:03:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1630413929250834.2368586397699; Tue, 31 Aug 2021 05:45:29 -0700 (PDT) Received: from localhost ([::1]:58974 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mL38q-0000HA-6E for importer@patchew.org; Tue, 31 Aug 2021 08:45:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33224) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2jC-00088Z-Aj for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:18:59 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:55707) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2j9-0006l4-Nu for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:18:58 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-213-hhaxD5rUMbGlAywzxULgFw-1; Tue, 31 Aug 2021 08:18:53 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9DE6C18C9F42; Tue, 31 Aug 2021 12:18:50 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 24F6627CB1; Tue, 31 Aug 2021 12:18:34 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id CCB7E18009E6; Tue, 31 Aug 2021 14:15:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630412335; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1FX/az27XaMeHUvM8QQkgGCCE/jWAwmUfVJoWBRI9Wg=; b=B4wSE++P4vv40nk831JgoU/ZA38uI+9s7+pNxIxKbbcrEO4GGgGmhx9kzLXitBMjLUbsyY ZBXy6/V4Kg8LLqTYwuSdj/JLxBVY1AKbByqumCw/gQrNtH7vP/YJiDNUPd9W54z7Zz4jsv AIZdB5rU7KHalCzM9+lY3pyTry18kQM= X-MC-Unique: hhaxD5rUMbGlAywzxULgFw-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 22/29] tcg_i386_funcs: Add update_fp_status to TCGI386ModuleOps Date: Tue, 31 Aug 2021 14:15:38 +0200 Message-Id: <20210831121545.2874233-23-kraxel@redhat.com> In-Reply-To: <20210831121545.2874233-1-kraxel@redhat.com> References: <20210831121545.2874233-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , "Michael S. Tsirkin" , Bin Meng , David Hildenbrand , Aleksandar Rikalo , Peter Xu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Filippov , Alistair Francis , Gerd Hoffmann , "Edgar E. Iglesias" , Alexandre Iooss , Huacai Chen , Halil Pasic , Christian Borntraeger , Palmer Dabbelt , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Eduardo Habkost , Richard Henderson , Greg Kurz , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Stafford Horne , =?UTF-8?q?Alex=20Benn=C3=A9e?= , David Gibson , qemu-riscv@nongnu.org, Bastian Koppelmann , Cornelia Huck , Laurent Vivier , qemu-ppc@nongnu.org, Paolo Bonzini , Mahmoud Mandour , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1630413929950100001 Content-Type: text/plain; charset="utf-8" Also add TCGI386ModuleOps struct, which works like TCGModuleOps but for i386-specific functions. Signed-off-by: Gerd Hoffmann --- include/tcg/tcg-module-i386.h | 9 +++++++++ target/i386/cpu.h | 4 ++-- accel/tcg/tcg-module-i386.c | 10 ++++++++++ target/i386/machine.c | 2 +- target/i386/tcg/fpu_helper.c | 9 ++++++++- accel/tcg/meson.build | 6 ++++++ 6 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 include/tcg/tcg-module-i386.h create mode 100644 accel/tcg/tcg-module-i386.c diff --git a/include/tcg/tcg-module-i386.h b/include/tcg/tcg-module-i386.h new file mode 100644 index 000000000000..3854b506d5dc --- /dev/null +++ b/include/tcg/tcg-module-i386.h @@ -0,0 +1,9 @@ +#ifndef TCG_MODULE_I386_H +#define TCG_MODULE_I386_H + +struct TCGI386ModuleOps { + void (*update_fp_status)(CPUX86State *env); +}; +extern struct TCGI386ModuleOps tcg_i386; + +#endif /* TCG_MODULE_I386_H */ diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 6c50d3ab4f1d..5769c1292683 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1802,6 +1802,7 @@ struct X86CPU { int32_t hv_max_vps; }; =20 +#include "tcg/tcg-module-i386.h" =20 #ifndef CONFIG_USER_ONLY extern const VMStateDescription vmstate_x86_cpu; @@ -2127,7 +2128,6 @@ static inline bool cpu_vmx_maybe_enabled(CPUX86State = *env) int get_pg_mode(CPUX86State *env); =20 /* fpu_helper.c */ -void update_fp_status(CPUX86State *env); void update_mxcsr_status(CPUX86State *env); void update_mxcsr_from_sse_status(CPUX86State *env); =20 @@ -2143,7 +2143,7 @@ static inline void cpu_set_fpuc(CPUX86State *env, uin= t16_t fpuc) { env->fpuc =3D fpuc; if (tcg_enabled()) { - update_fp_status(env); + tcg_i386.update_fp_status(env); } } =20 diff --git a/accel/tcg/tcg-module-i386.c b/accel/tcg/tcg-module-i386.c new file mode 100644 index 000000000000..41ce2ba4eb76 --- /dev/null +++ b/accel/tcg/tcg-module-i386.c @@ -0,0 +1,10 @@ +#include "qemu/osdep.h" +#include "cpu.h" + +static void i386_update_cpu_stub(CPUX86State *cpu) +{ +} + +struct TCGI386ModuleOps tcg_i386 =3D { + .update_fp_status =3D i386_update_cpu_stub, +}; diff --git a/target/i386/machine.c b/target/i386/machine.c index 571e98853c64..7f5d80766f28 100644 --- a/target/i386/machine.c +++ b/target/i386/machine.c @@ -371,7 +371,7 @@ static int cpu_post_load(void *opaque, int version_id) } if (tcg_enabled()) { target_ulong dr7; - update_fp_status(env); + tcg_i386.update_fp_status(env); update_mxcsr_status(env); =20 cpu_breakpoint_remove_all(cs, BP_CPU); diff --git a/target/i386/tcg/fpu_helper.c b/target/i386/tcg/fpu_helper.c index eddf0bb9dfc4..0f7206e834fd 100644 --- a/target/i386/tcg/fpu_helper.c +++ b/target/i386/tcg/fpu_helper.c @@ -672,7 +672,7 @@ uint32_t helper_fnstcw(CPUX86State *env) return env->fpuc; } =20 -void update_fp_status(CPUX86State *env) +static void update_fp_status(CPUX86State *env) { FloatRoundMode rnd_mode; FloatX80RoundPrec rnd_prec; @@ -3039,3 +3039,10 @@ void helper_movq(CPUX86State *env, void *d, void *s) =20 #define SHIFT 1 #include "ops_sse.h" + +static void tcgi386_module_ops_fpu(void) +{ + tcg_i386.update_fp_status =3D update_fp_status; +} + +type_init(tcgi386_module_ops_fpu); diff --git a/accel/tcg/meson.build b/accel/tcg/meson.build index 93cbbf9f3926..7f1fdd68233b 100644 --- a/accel/tcg/meson.build +++ b/accel/tcg/meson.build @@ -1,6 +1,12 @@ specific_ss.add(files( 'tcg-module.c', )) +specific_ss.add(when: 'TARGET_I386', if_true: files( + 'tcg-module-i386.c', +)) +specific_ss.add(when: 'TARGET_X86_64', if_true: files( + 'tcg-module-i386.c', +)) =20 specific_ss.add(when: 'CONFIG_TCG', if_true: files( 'cpu-exec-common.c', --=20 2.31.1 From nobody Sat May 4 07:03:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1630413685437248.74688922065366; Tue, 31 Aug 2021 05:41:25 -0700 (PDT) Received: from localhost ([::1]:50642 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mL34u-00032L-AO for importer@patchew.org; Tue, 31 Aug 2021 08:41:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33184) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2jB-00087j-7Z for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:18:57 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:50879) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2j8-0006kG-Np for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:18:56 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-239-wzZQLAZwOJq8XmMfOrETSg-1; Tue, 31 Aug 2021 08:18:52 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 72819875118; Tue, 31 Aug 2021 12:18:49 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D522060BD8; Tue, 31 Aug 2021 12:18:37 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id DF22F18009E9; Tue, 31 Aug 2021 14:15:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630412334; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=l7/kp6ZcRFvxoK6BJgtBhQaabSWzcO2N+/IvjX3LuSo=; b=hTXf3cKGbJHUsY0gJfIixYMO1yK/AsKfhw9PfDjMgJZCpU/6OaCEyfh2DQXcYnzIl236Oq 4BA8KIAqhJPO7ySAFoXYPlmg//tlTH7RYRAs8xbshGiVCyLG2QbqgiUT0/JLUO0qbrTuub iHyWSGE12DwIs8Ionuqw72wQUDi6OoA= X-MC-Unique: wzZQLAZwOJq8XmMfOrETSg-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 23/29] tcg_i386_funcs: Add update_mxcsr_status to TCGI386ModuleOps Date: Tue, 31 Aug 2021 14:15:39 +0200 Message-Id: <20210831121545.2874233-24-kraxel@redhat.com> In-Reply-To: <20210831121545.2874233-1-kraxel@redhat.com> References: <20210831121545.2874233-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , "Michael S. Tsirkin" , Bin Meng , David Hildenbrand , Aleksandar Rikalo , Peter Xu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Filippov , Alistair Francis , Gerd Hoffmann , "Edgar E. Iglesias" , Alexandre Iooss , Huacai Chen , Halil Pasic , Christian Borntraeger , Palmer Dabbelt , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Eduardo Habkost , Richard Henderson , Greg Kurz , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Stafford Horne , =?UTF-8?q?Alex=20Benn=C3=A9e?= , David Gibson , qemu-riscv@nongnu.org, Bastian Koppelmann , Cornelia Huck , Laurent Vivier , qemu-ppc@nongnu.org, Paolo Bonzini , Mahmoud Mandour , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1630413686233100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann --- include/tcg/tcg-module-i386.h | 1 + target/i386/cpu.h | 3 +-- accel/tcg/tcg-module-i386.c | 1 + target/i386/machine.c | 2 +- target/i386/tcg/fpu_helper.c | 3 ++- 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/tcg/tcg-module-i386.h b/include/tcg/tcg-module-i386.h index 3854b506d5dc..5d8f6434e32d 100644 --- a/include/tcg/tcg-module-i386.h +++ b/include/tcg/tcg-module-i386.h @@ -3,6 +3,7 @@ =20 struct TCGI386ModuleOps { void (*update_fp_status)(CPUX86State *env); + void (*update_mxcsr_status)(CPUX86State *env); }; extern struct TCGI386ModuleOps tcg_i386; =20 diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 5769c1292683..bdfdbdb0d8a8 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -2128,14 +2128,13 @@ static inline bool cpu_vmx_maybe_enabled(CPUX86Stat= e *env) int get_pg_mode(CPUX86State *env); =20 /* fpu_helper.c */ -void update_mxcsr_status(CPUX86State *env); void update_mxcsr_from_sse_status(CPUX86State *env); =20 static inline void cpu_set_mxcsr(CPUX86State *env, uint32_t mxcsr) { env->mxcsr =3D mxcsr; if (tcg_enabled()) { - update_mxcsr_status(env); + tcg_i386.update_mxcsr_status(env); } } =20 diff --git a/accel/tcg/tcg-module-i386.c b/accel/tcg/tcg-module-i386.c index 41ce2ba4eb76..fa455a2e02cb 100644 --- a/accel/tcg/tcg-module-i386.c +++ b/accel/tcg/tcg-module-i386.c @@ -7,4 +7,5 @@ static void i386_update_cpu_stub(CPUX86State *cpu) =20 struct TCGI386ModuleOps tcg_i386 =3D { .update_fp_status =3D i386_update_cpu_stub, + .update_mxcsr_status =3D i386_update_cpu_stub, }; diff --git a/target/i386/machine.c b/target/i386/machine.c index 7f5d80766f28..dc63de37dd6f 100644 --- a/target/i386/machine.c +++ b/target/i386/machine.c @@ -372,7 +372,7 @@ static int cpu_post_load(void *opaque, int version_id) if (tcg_enabled()) { target_ulong dr7; tcg_i386.update_fp_status(env); - update_mxcsr_status(env); + tcg_i386.update_mxcsr_status(env); =20 cpu_breakpoint_remove_all(cs, BP_CPU); cpu_watchpoint_remove_all(cs, BP_CPU); diff --git a/target/i386/tcg/fpu_helper.c b/target/i386/tcg/fpu_helper.c index 0f7206e834fd..12dd6c9a65df 100644 --- a/target/i386/tcg/fpu_helper.c +++ b/target/i386/tcg/fpu_helper.c @@ -2947,7 +2947,7 @@ void helper_xsetbv(CPUX86State *env, uint32_t ecx, ui= nt64_t mask) #define SSE_RC_CHOP 0x6000 #define SSE_FZ 0x8000 =20 -void update_mxcsr_status(CPUX86State *env) +static void update_mxcsr_status(CPUX86State *env) { uint32_t mxcsr =3D env->mxcsr; int rnd_type; @@ -3043,6 +3043,7 @@ void helper_movq(CPUX86State *env, void *d, void *s) static void tcgi386_module_ops_fpu(void) { tcg_i386.update_fp_status =3D update_fp_status; + tcg_i386.update_mxcsr_status =3D update_mxcsr_status; } =20 type_init(tcgi386_module_ops_fpu); --=20 2.31.1 From nobody Sat May 4 07:03:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1630414300750707.0714775542349; Tue, 31 Aug 2021 05:51:40 -0700 (PDT) Received: from localhost ([::1]:48406 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mL3Ep-0003q4-Mh for importer@patchew.org; Tue, 31 Aug 2021 08:51:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33288) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2jF-0008CS-PT for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:19:03 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:50433) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2jB-0006lo-4I for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:19:01 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-393-2FKuroJ9OJi4TR3ILFhEjw-1; Tue, 31 Aug 2021 08:18:54 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 821DD9392B; Tue, 31 Aug 2021 12:18:51 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EAECD27CA6; Tue, 31 Aug 2021 12:18:50 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 0305118009EA; Tue, 31 Aug 2021 14:15:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630412336; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qiRX0Suz4eEcLoNuIeaDXeDr5OG1xIEgcGYjIBCDH+4=; b=BcopqL7sPc8RTWxkXoL24OSRGX8fLALxZ4NLUWctph1/WtpbYT8yK2MtVPF2+KqKk+QGc7 4qdLfrKE0JR/uF+YRUDRh4ERm8uZUFpH2H9ycoBwWKmzRMTE8oPgkVVcSaa8BNqGD3TXas WV+WyDHvPxkT+4z98rKgsN4B9loj81I= X-MC-Unique: 2FKuroJ9OJi4TR3ILFhEjw-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 24/29] tcg_i386_funcs: Add update_mxcsr_from_sse_status to TCGI386ModuleOps Date: Tue, 31 Aug 2021 14:15:40 +0200 Message-Id: <20210831121545.2874233-25-kraxel@redhat.com> In-Reply-To: <20210831121545.2874233-1-kraxel@redhat.com> References: <20210831121545.2874233-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , "Michael S. Tsirkin" , Bin Meng , David Hildenbrand , Aleksandar Rikalo , Peter Xu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Filippov , Alistair Francis , Gerd Hoffmann , "Edgar E. Iglesias" , Alexandre Iooss , Huacai Chen , Halil Pasic , Christian Borntraeger , Palmer Dabbelt , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Eduardo Habkost , Richard Henderson , Greg Kurz , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Stafford Horne , =?UTF-8?q?Alex=20Benn=C3=A9e?= , David Gibson , qemu-riscv@nongnu.org, Bastian Koppelmann , Cornelia Huck , Laurent Vivier , qemu-ppc@nongnu.org, Paolo Bonzini , Mahmoud Mandour , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1630414302515100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann --- include/tcg/tcg-module-i386.h | 2 ++ target/i386/cpu.h | 3 --- accel/tcg/tcg-module-i386.c | 1 + target/i386/cpu-dump.c | 2 +- target/i386/gdbstub.c | 2 +- target/i386/tcg/fpu_helper.c | 5 +++-- target/i386/tcg/tcg-stub.c | 25 ------------------------- target/i386/tcg/meson.build | 2 -- 8 files changed, 8 insertions(+), 34 deletions(-) delete mode 100644 target/i386/tcg/tcg-stub.c diff --git a/include/tcg/tcg-module-i386.h b/include/tcg/tcg-module-i386.h index 5d8f6434e32d..576e0a63f01f 100644 --- a/include/tcg/tcg-module-i386.h +++ b/include/tcg/tcg-module-i386.h @@ -4,6 +4,8 @@ struct TCGI386ModuleOps { void (*update_fp_status)(CPUX86State *env); void (*update_mxcsr_status)(CPUX86State *env); + void (*update_mxcsr_from_sse_status)(CPUX86State *env); + }; extern struct TCGI386ModuleOps tcg_i386; =20 diff --git a/target/i386/cpu.h b/target/i386/cpu.h index bdfdbdb0d8a8..deba8eb04d1f 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -2127,9 +2127,6 @@ static inline bool cpu_vmx_maybe_enabled(CPUX86State = *env) /* excp_helper.c */ int get_pg_mode(CPUX86State *env); =20 -/* fpu_helper.c */ -void update_mxcsr_from_sse_status(CPUX86State *env); - static inline void cpu_set_mxcsr(CPUX86State *env, uint32_t mxcsr) { env->mxcsr =3D mxcsr; diff --git a/accel/tcg/tcg-module-i386.c b/accel/tcg/tcg-module-i386.c index fa455a2e02cb..6908fe34cef6 100644 --- a/accel/tcg/tcg-module-i386.c +++ b/accel/tcg/tcg-module-i386.c @@ -8,4 +8,5 @@ static void i386_update_cpu_stub(CPUX86State *cpu) struct TCGI386ModuleOps tcg_i386 =3D { .update_fp_status =3D i386_update_cpu_stub, .update_mxcsr_status =3D i386_update_cpu_stub, + .update_mxcsr_from_sse_status =3D i386_update_cpu_stub, }; diff --git a/target/i386/cpu-dump.c b/target/i386/cpu-dump.c index 02b635a52cff..cce9110705c7 100644 --- a/target/i386/cpu-dump.c +++ b/target/i386/cpu-dump.c @@ -487,7 +487,7 @@ void x86_cpu_dump_state(CPUState *cs, FILE *f, int flag= s) for(i =3D 0; i < 8; i++) { fptag |=3D ((!env->fptags[i]) << i); } - update_mxcsr_from_sse_status(env); + tcg_i386.update_mxcsr_from_sse_status(env); qemu_fprintf(f, "FCW=3D%04x FSW=3D%04x [ST=3D%d] FTW=3D%02x MXCSR= =3D%08x\n", env->fpuc, (env->fpus & ~0x3800) | (env->fpstt & 0x7) << 11, diff --git a/target/i386/gdbstub.c b/target/i386/gdbstub.c index 098a2ad15a9c..e73125dbe9e2 100644 --- a/target/i386/gdbstub.c +++ b/target/i386/gdbstub.c @@ -190,7 +190,7 @@ int x86_cpu_gdb_read_register(CPUState *cs, GByteArray = *mem_buf, int n) return gdb_get_reg32(mem_buf, 0); /* fop */ =20 case IDX_MXCSR_REG: - update_mxcsr_from_sse_status(env); + tcg_i386.update_mxcsr_from_sse_status(env); return gdb_get_reg32(mem_buf, env->mxcsr); =20 case IDX_CTL_CR0_REG: diff --git a/target/i386/tcg/fpu_helper.c b/target/i386/tcg/fpu_helper.c index 12dd6c9a65df..9a0d1798985b 100644 --- a/target/i386/tcg/fpu_helper.c +++ b/target/i386/tcg/fpu_helper.c @@ -2534,7 +2534,7 @@ static void do_xsave_fpu(CPUX86State *env, target_ulo= ng ptr, uintptr_t ra) =20 static void do_xsave_mxcsr(CPUX86State *env, target_ulong ptr, uintptr_t r= a) { - update_mxcsr_from_sse_status(env); + tcg_i386.update_mxcsr_from_sse_status(env); cpu_stl_data_ra(env, ptr + XO(legacy.mxcsr), env->mxcsr, ra); cpu_stl_data_ra(env, ptr + XO(legacy.mxcsr_mask), 0x0000ffff, ra); } @@ -2985,7 +2985,7 @@ static void update_mxcsr_status(CPUX86State *env) set_flush_to_zero((mxcsr & SSE_FZ) ? 1 : 0, &env->sse_status); } =20 -void update_mxcsr_from_sse_status(CPUX86State *env) +static void update_mxcsr_from_sse_status(CPUX86State *env) { uint8_t flags =3D get_float_exception_flags(&env->sse_status); /* @@ -3044,6 +3044,7 @@ static void tcgi386_module_ops_fpu(void) { tcg_i386.update_fp_status =3D update_fp_status; tcg_i386.update_mxcsr_status =3D update_mxcsr_status; + tcg_i386.update_mxcsr_from_sse_status =3D update_mxcsr_from_sse_status; } =20 type_init(tcgi386_module_ops_fpu); diff --git a/target/i386/tcg/tcg-stub.c b/target/i386/tcg/tcg-stub.c deleted file mode 100644 index 8d45579ada25..000000000000 --- a/target/i386/tcg/tcg-stub.c +++ /dev/null @@ -1,25 +0,0 @@ -/* - * x86 FPU, MMX/3DNow!/SSE/SSE2/SSE3/SSSE3/SSE4/PNI helpers - * - * Copyright (c) 2003 Fabrice Bellard - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, see . - */ - -#include "qemu/osdep.h" -#include "cpu.h" - -void update_mxcsr_from_sse_status(CPUX86State *env) -{ -} diff --git a/target/i386/tcg/meson.build b/target/i386/tcg/meson.build index 7bbe3d926975..8162511e6dac 100644 --- a/target/i386/tcg/meson.build +++ b/target/i386/tcg/meson.build @@ -1,5 +1,3 @@ -i386_softmmu_ss.add(when: 'CONFIG_TCG', if_false: files('tcg-stub.c')) - files_ss =3D ss.source_set() files_ss.add(when: 'CONFIG_TCG', if_true: files( 'bpt_helper.c', --=20 2.31.1 From nobody Sat May 4 07:03:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1630414092774143.14366002359213; Tue, 31 Aug 2021 05:48:12 -0700 (PDT) Received: from localhost ([::1]:38850 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mL3BT-0005l8-EJ for importer@patchew.org; Tue, 31 Aug 2021 08:48:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33498) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2jW-0008Ra-IR for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:19:19 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:37254) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2jR-0006wo-4V for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:19:16 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-191-7eZEGYkOOtOWjAYionviwA-1; Tue, 31 Aug 2021 08:19:11 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 071D918C9F49; Tue, 31 Aug 2021 12:19:08 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1B25B104B51C; Tue, 31 Aug 2021 12:18:52 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 1937F18009EC; Tue, 31 Aug 2021 14:15:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630412352; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uUA7IgeB5RYl+qZYzoL+znUhF73/ifVtnM5Z3ysYhdM=; b=ADzQdwDY/wI/ZUn0Pybfp2poPw4T3ynBiD8zd8Z5GWC2ayyUlrkehhZusERKKbVmXEgXIo 1Ak9JheyucjneGa2Npztf/3TIGj0jAQr/fhguuVDtK/f1CZhH/pCi6a1zoqT1nZ+CZHM2E O0drsfOShUlY+fMPnzI8wxF5rj0IZns= X-MC-Unique: 7eZEGYkOOtOWjAYionviwA-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 25/29] tcg_i386_funcs: Add x86_register_ferr_irq to TCGI386ModuleOps Date: Tue, 31 Aug 2021 14:15:41 +0200 Message-Id: <20210831121545.2874233-26-kraxel@redhat.com> In-Reply-To: <20210831121545.2874233-1-kraxel@redhat.com> References: <20210831121545.2874233-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , "Michael S. Tsirkin" , Bin Meng , David Hildenbrand , Aleksandar Rikalo , Peter Xu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Filippov , Alistair Francis , Gerd Hoffmann , "Edgar E. Iglesias" , Alexandre Iooss , Huacai Chen , Halil Pasic , Christian Borntraeger , Palmer Dabbelt , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Eduardo Habkost , Richard Henderson , Greg Kurz , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Stafford Horne , =?UTF-8?q?Alex=20Benn=C3=A9e?= , David Gibson , qemu-riscv@nongnu.org, Bastian Koppelmann , Cornelia Huck , Laurent Vivier , qemu-ppc@nongnu.org, Paolo Bonzini , Mahmoud Mandour , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1630414094872100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann --- include/tcg/tcg-module-i386.h | 2 +- target/i386/cpu.h | 1 - accel/tcg/tcg-module-i386.c | 5 +++++ hw/i386/pc_piix.c | 2 +- hw/i386/pc_q35.c | 2 +- target/i386/tcg/sysemu/fpu_helper.c | 9 ++++++++- 6 files changed, 16 insertions(+), 5 deletions(-) diff --git a/include/tcg/tcg-module-i386.h b/include/tcg/tcg-module-i386.h index 576e0a63f01f..7b99b9836a20 100644 --- a/include/tcg/tcg-module-i386.h +++ b/include/tcg/tcg-module-i386.h @@ -5,7 +5,7 @@ struct TCGI386ModuleOps { void (*update_fp_status)(CPUX86State *env); void (*update_mxcsr_status)(CPUX86State *env); void (*update_mxcsr_from_sse_status)(CPUX86State *env); - + void (*x86_register_ferr_irq)(qemu_irq irq); }; extern struct TCGI386ModuleOps tcg_i386; =20 diff --git a/target/i386/cpu.h b/target/i386/cpu.h index deba8eb04d1f..d1819166ae11 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1835,7 +1835,6 @@ int cpu_x86_support_mca_broadcast(CPUX86State *env); =20 int cpu_get_pic_interrupt(CPUX86State *s); /* MSDOS compatibility mode FPU exception support */ -void x86_register_ferr_irq(qemu_irq irq); void fpu_check_raise_ferr_irq(CPUX86State *s); void cpu_set_ignne(void); void cpu_clear_ignne(void); diff --git a/accel/tcg/tcg-module-i386.c b/accel/tcg/tcg-module-i386.c index 6908fe34cef6..f6d367912c17 100644 --- a/accel/tcg/tcg-module-i386.c +++ b/accel/tcg/tcg-module-i386.c @@ -5,8 +5,13 @@ static void i386_update_cpu_stub(CPUX86State *cpu) { } =20 +static void x86_register_ferr_irq_stub(qemu_irq irq) +{ +} + struct TCGI386ModuleOps tcg_i386 =3D { .update_fp_status =3D i386_update_cpu_stub, .update_mxcsr_status =3D i386_update_cpu_stub, .update_mxcsr_from_sse_status =3D i386_update_cpu_stub, + .x86_register_ferr_irq =3D x86_register_ferr_irq_stub, }; diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 1bc30167acc0..d02edaa7e611 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -224,7 +224,7 @@ static void pc_init1(MachineState *machine, } =20 if (tcg_enabled()) { - x86_register_ferr_irq(x86ms->gsi[13]); + tcg_i386.x86_register_ferr_irq(x86ms->gsi[13]); } =20 pc_vga_init(isa_bus, pcmc->pci_enabled ? pci_bus : NULL); diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index eeb0b185b118..9c2623fe61e0 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -266,7 +266,7 @@ static void pc_q35_init(MachineState *machine) } =20 if (tcg_enabled()) { - x86_register_ferr_irq(x86ms->gsi[13]); + tcg_i386.x86_register_ferr_irq(x86ms->gsi[13]); } =20 assert(pcms->vmport !=3D ON_OFF_AUTO__MAX); diff --git a/target/i386/tcg/sysemu/fpu_helper.c b/target/i386/tcg/sysemu/f= pu_helper.c index 1c3610da3b91..9caf164a7269 100644 --- a/target/i386/tcg/sysemu/fpu_helper.c +++ b/target/i386/tcg/sysemu/fpu_helper.c @@ -23,7 +23,7 @@ =20 static qemu_irq ferr_irq; =20 -void x86_register_ferr_irq(qemu_irq irq) +static void x86_register_ferr_irq(qemu_irq irq) { ferr_irq =3D irq; } @@ -55,3 +55,10 @@ void cpu_set_ignne(void) */ qemu_irq_lower(ferr_irq); } + +static void tcgi386_module_ops_fpu_sys(void) +{ + tcg_i386.x86_register_ferr_irq =3D x86_register_ferr_irq; +} + +type_init(tcgi386_module_ops_fpu_sys); --=20 2.31.1 From nobody Sat May 4 07:03:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1630414132675246.47597828130756; Tue, 31 Aug 2021 05:48:52 -0700 (PDT) Received: from localhost ([::1]:40508 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mL3C7-0006uR-IH for importer@patchew.org; Tue, 31 Aug 2021 08:48:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33482) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2jW-0008RT-F6 for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:19:19 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:26792) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2jQ-0006wc-TP for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:19:16 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-86-mJxDlrd5P4CCeJlY2hFhXg-1; Tue, 31 Aug 2021 08:19:11 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D5E35100960B; Tue, 31 Aug 2021 12:19:07 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1D6511001281; Tue, 31 Aug 2021 12:18:53 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 2C2E518009EE; Tue, 31 Aug 2021 14:15:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630412352; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bAh7jA6EdUo63aN7uq8/4SBOFFdgzWJ9ei5/ZCA+u+k=; b=Ly5Q44HCjB8/MUI88Ee4Wi1c9tD6fET4IMWDwn4i5NQI1faituUSEG0p1NzzBmxB67y2lx 9wlSAU7qUmhLqucah/UH3mV+kpO4OEjnWNs2WgIG8Zn6yf9Gr5WOnE+xZDPzkeIrp/MyRb QX/PQGDKuRJPflEtchdlWHBVOYsAloA= X-MC-Unique: mJxDlrd5P4CCeJlY2hFhXg-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 26/29] tcg_i386_funcs: Add cpu_set_ignne to TCGI386ModuleOps Date: Tue, 31 Aug 2021 14:15:42 +0200 Message-Id: <20210831121545.2874233-27-kraxel@redhat.com> In-Reply-To: <20210831121545.2874233-1-kraxel@redhat.com> References: <20210831121545.2874233-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , "Michael S. Tsirkin" , Bin Meng , David Hildenbrand , Aleksandar Rikalo , Peter Xu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Filippov , Alistair Francis , Gerd Hoffmann , "Edgar E. Iglesias" , Alexandre Iooss , Huacai Chen , Halil Pasic , Christian Borntraeger , Palmer Dabbelt , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Eduardo Habkost , Richard Henderson , Greg Kurz , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Stafford Horne , =?UTF-8?q?Alex=20Benn=C3=A9e?= , David Gibson , qemu-riscv@nongnu.org, Bastian Koppelmann , Cornelia Huck , Laurent Vivier , qemu-ppc@nongnu.org, Paolo Bonzini , Mahmoud Mandour , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1630414134896100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann --- include/tcg/tcg-module-i386.h | 1 + target/i386/cpu.h | 1 - accel/tcg/tcg-module-i386.c | 5 +++++ hw/i386/pc.c | 2 +- target/i386/tcg/sysemu/fpu_helper.c | 3 ++- 5 files changed, 9 insertions(+), 3 deletions(-) diff --git a/include/tcg/tcg-module-i386.h b/include/tcg/tcg-module-i386.h index 7b99b9836a20..aa96aca82c4a 100644 --- a/include/tcg/tcg-module-i386.h +++ b/include/tcg/tcg-module-i386.h @@ -6,6 +6,7 @@ struct TCGI386ModuleOps { void (*update_mxcsr_status)(CPUX86State *env); void (*update_mxcsr_from_sse_status)(CPUX86State *env); void (*x86_register_ferr_irq)(qemu_irq irq); + void (*cpu_set_ignne)(void); }; extern struct TCGI386ModuleOps tcg_i386; =20 diff --git a/target/i386/cpu.h b/target/i386/cpu.h index d1819166ae11..6b9b1fad016f 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1836,7 +1836,6 @@ int cpu_x86_support_mca_broadcast(CPUX86State *env); int cpu_get_pic_interrupt(CPUX86State *s); /* MSDOS compatibility mode FPU exception support */ void fpu_check_raise_ferr_irq(CPUX86State *s); -void cpu_set_ignne(void); void cpu_clear_ignne(void); =20 /* mpx_helper.c */ diff --git a/accel/tcg/tcg-module-i386.c b/accel/tcg/tcg-module-i386.c index f6d367912c17..307238e3bc78 100644 --- a/accel/tcg/tcg-module-i386.c +++ b/accel/tcg/tcg-module-i386.c @@ -5,6 +5,10 @@ static void i386_update_cpu_stub(CPUX86State *cpu) { } =20 +static void i386_update_stub(void) +{ +} + static void x86_register_ferr_irq_stub(qemu_irq irq) { } @@ -14,4 +18,5 @@ struct TCGI386ModuleOps tcg_i386 =3D { .update_mxcsr_status =3D i386_update_cpu_stub, .update_mxcsr_from_sse_status =3D i386_update_cpu_stub, .x86_register_ferr_irq =3D x86_register_ferr_irq_stub, + .cpu_set_ignne =3D i386_update_stub, }; diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 102b22394689..4b74776f6d8a 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -389,7 +389,7 @@ static void ioportF0_write(void *opaque, hwaddr addr, u= int64_t data, unsigned size) { if (tcg_enabled()) { - cpu_set_ignne(); + tcg_i386.cpu_set_ignne(); } } =20 diff --git a/target/i386/tcg/sysemu/fpu_helper.c b/target/i386/tcg/sysemu/f= pu_helper.c index 9caf164a7269..6453760b33c7 100644 --- a/target/i386/tcg/sysemu/fpu_helper.c +++ b/target/i386/tcg/sysemu/fpu_helper.c @@ -42,7 +42,7 @@ void cpu_clear_ignne(void) env->hflags2 &=3D ~HF2_IGNNE_MASK; } =20 -void cpu_set_ignne(void) +static void cpu_set_ignne(void) { CPUX86State *env =3D &X86_CPU(first_cpu)->env; env->hflags2 |=3D HF2_IGNNE_MASK; @@ -59,6 +59,7 @@ void cpu_set_ignne(void) static void tcgi386_module_ops_fpu_sys(void) { tcg_i386.x86_register_ferr_irq =3D x86_register_ferr_irq; + tcg_i386.cpu_set_ignne =3D cpu_set_ignne; } =20 type_init(tcgi386_module_ops_fpu_sys); --=20 2.31.1 From nobody Sat May 4 07:03:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1630414190153437.98694899927045; Tue, 31 Aug 2021 05:49:50 -0700 (PDT) Received: from localhost ([::1]:42592 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mL3D3-0008Kb-1G for importer@patchew.org; Tue, 31 Aug 2021 08:49:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33622) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2jk-0000P1-5b for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:19:33 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:55567) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2ji-00076O-GF for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:19:31 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-414-tix8G2sPOqmNDDjCgBMWqw-1; Tue, 31 Aug 2021 08:19:28 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 725B8802B9F; Tue, 31 Aug 2021 12:19:25 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 743A627CB1; Tue, 31 Aug 2021 12:19:09 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 407BB18009F0; Tue, 31 Aug 2021 14:15:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630412369; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/3ujaq1NT6nZmAaAMZak8E793ppg3V97NR3xFqYDTs8=; b=ELmow3suXIQtxc60N4mWMP+jzl5f4KgoRdIp4kweT8dsbweNWEGj19kNAh9qIgca1X8yQ1 87eUUCyrFTUDkw9/QkE16FzOQLrO8oS3tK0wsCIPzetA0igxkyxoZ2bp0wA7ZBkeiDjLOz jju80oO4frr6m/TAWwsRcLDMdUXywQU= X-MC-Unique: tix8G2sPOqmNDDjCgBMWqw-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 27/29] tcg_i386_funcs: Add cpu_x86_update_dr7 to TCGI386ModuleOps Date: Tue, 31 Aug 2021 14:15:43 +0200 Message-Id: <20210831121545.2874233-28-kraxel@redhat.com> In-Reply-To: <20210831121545.2874233-1-kraxel@redhat.com> References: <20210831121545.2874233-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , "Michael S. Tsirkin" , Bin Meng , David Hildenbrand , Aleksandar Rikalo , Peter Xu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Filippov , Alistair Francis , Gerd Hoffmann , "Edgar E. Iglesias" , Alexandre Iooss , Huacai Chen , Halil Pasic , Christian Borntraeger , Palmer Dabbelt , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Eduardo Habkost , Richard Henderson , Greg Kurz , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Stafford Horne , =?UTF-8?q?Alex=20Benn=C3=A9e?= , David Gibson , qemu-riscv@nongnu.org, Bastian Koppelmann , Cornelia Huck , Laurent Vivier , qemu-ppc@nongnu.org, Paolo Bonzini , Mahmoud Mandour , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1630414190985100001 Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann --- include/tcg/tcg-module-i386.h | 1 + target/i386/cpu.h | 1 - accel/tcg/tcg-module-i386.c | 5 +++++ target/i386/machine.c | 2 +- target/i386/tcg/seg_helper.c | 2 +- target/i386/tcg/sysemu/bpt_helper.c | 9 ++++++++- 6 files changed, 16 insertions(+), 4 deletions(-) diff --git a/include/tcg/tcg-module-i386.h b/include/tcg/tcg-module-i386.h index aa96aca82c4a..02a9716e2e66 100644 --- a/include/tcg/tcg-module-i386.h +++ b/include/tcg/tcg-module-i386.h @@ -7,6 +7,7 @@ struct TCGI386ModuleOps { void (*update_mxcsr_from_sse_status)(CPUX86State *env); void (*x86_register_ferr_irq)(qemu_irq irq); void (*cpu_set_ignne)(void); + void (*cpu_x86_update_dr7)(CPUX86State *env, uint32_t new_dr7); }; extern struct TCGI386ModuleOps tcg_i386; =20 diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 6b9b1fad016f..0f3922939eb6 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -1995,7 +1995,6 @@ void x86_stq_phys(CPUState *cs, hwaddr addr, uint64_t= val); void cpu_x86_update_cr0(CPUX86State *env, uint32_t new_cr0); void cpu_x86_update_cr3(CPUX86State *env, target_ulong new_cr3); void cpu_x86_update_cr4(CPUX86State *env, uint32_t new_cr4); -void cpu_x86_update_dr7(CPUX86State *env, uint32_t new_dr7); =20 /* hw/pc.c */ uint64_t cpu_get_tsc(CPUX86State *env); diff --git a/accel/tcg/tcg-module-i386.c b/accel/tcg/tcg-module-i386.c index 307238e3bc78..1025943c8b21 100644 --- a/accel/tcg/tcg-module-i386.c +++ b/accel/tcg/tcg-module-i386.c @@ -13,10 +13,15 @@ static void x86_register_ferr_irq_stub(qemu_irq irq) { } =20 +static void cpu_x86_update_dr7_stub(CPUX86State *env, uint32_t new_dr7) +{ +} + struct TCGI386ModuleOps tcg_i386 =3D { .update_fp_status =3D i386_update_cpu_stub, .update_mxcsr_status =3D i386_update_cpu_stub, .update_mxcsr_from_sse_status =3D i386_update_cpu_stub, .x86_register_ferr_irq =3D x86_register_ferr_irq_stub, .cpu_set_ignne =3D i386_update_stub, + .cpu_x86_update_dr7 =3D cpu_x86_update_dr7_stub, }; diff --git a/target/i386/machine.c b/target/i386/machine.c index dc63de37dd6f..44736cb036c0 100644 --- a/target/i386/machine.c +++ b/target/i386/machine.c @@ -381,7 +381,7 @@ static int cpu_post_load(void *opaque, int version_id) let the helper re-enable them. */ dr7 =3D env->dr[7]; env->dr[7] =3D dr7 & ~(DR7_GLOBAL_BP_MASK | DR7_LOCAL_BP_MASK); - cpu_x86_update_dr7(env, dr7); + tcg_i386.cpu_x86_update_dr7(env, dr7); } tcg.tlb_flush(cs); return 0; diff --git a/target/i386/tcg/seg_helper.c b/target/i386/tcg/seg_helper.c index 3ed20ca31d75..f39d5be97b94 100644 --- a/target/i386/tcg/seg_helper.c +++ b/target/i386/tcg/seg_helper.c @@ -460,7 +460,7 @@ static void switch_tss_ra(CPUX86State *env, int tss_sel= ector, #ifndef CONFIG_USER_ONLY /* reset local breakpoints */ if (env->dr[7] & DR7_LOCAL_BP_MASK) { - cpu_x86_update_dr7(env, env->dr[7] & ~DR7_LOCAL_BP_MASK); + tcg_i386.cpu_x86_update_dr7(env, env->dr[7] & ~DR7_LOCAL_BP_MASK); } #endif } diff --git a/target/i386/tcg/sysemu/bpt_helper.c b/target/i386/tcg/sysemu/b= pt_helper.c index 4d96a48a3ca3..b90c5e267ddf 100644 --- a/target/i386/tcg/sysemu/bpt_helper.c +++ b/target/i386/tcg/sysemu/bpt_helper.c @@ -121,7 +121,7 @@ static void hw_breakpoint_remove(CPUX86State *env, int = index) } } =20 -void cpu_x86_update_dr7(CPUX86State *env, uint32_t new_dr7) +static void cpu_x86_update_dr7(CPUX86State *env, uint32_t new_dr7) { target_ulong old_dr7 =3D env->dr[7]; int iobpt =3D 0; @@ -296,3 +296,10 @@ void helper_bpt_io(CPUX86State *env, uint32_t port, raise_exception(env, EXCP01_DB); } } + +static void tcgi386_module_ops_bpt_sys(void) +{ + tcg_i386.cpu_x86_update_dr7 =3D cpu_x86_update_dr7; +} + +type_init(tcgi386_module_ops_bpt_sys); --=20 2.31.1 From nobody Sat May 4 07:03:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1630414421958791.2318012840053; Tue, 31 Aug 2021 05:53:41 -0700 (PDT) Received: from localhost ([::1]:53086 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mL3Gm-0006wk-RZ for importer@patchew.org; Tue, 31 Aug 2021 08:53:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33558) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2jZ-0008UF-Jb for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:19:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:32284) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2jU-0006ys-4u for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:19:21 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-421-UlBueg-JPtqnKN6hmEjUIg-1; Tue, 31 Aug 2021 08:19:14 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1E3C71009600; Tue, 31 Aug 2021 12:19:10 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8FAEB1001281; Tue, 31 Aug 2021 12:19:09 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 5C26218009F1; Tue, 31 Aug 2021 14:15:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630412355; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TfHHzUf/ne1SzGHt9JtdfF6smhUP6CvP/geWH7Zk86k=; b=gIc4o1ZqUZxF3E3YDg0MZRuDEPFDdOAKosYMEzWcmyM845WmSkESDbLqGO2ZjQbmDDwCvo 6z19L0WAEWFIeL3ChjG1pBDZOvpZOy05Yz2bUDExnoV55Kbm310Zk6FJBEiCJExRYaC4Wq hSDqER1IGrIXn0HWx6yINakfuj6Q+K0= X-MC-Unique: UlBueg-JPtqnKN6hmEjUIg-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 28/29] tcg_i386_funcs: Add cpu_cc_compute_all to TCGI386ModuleOps Date: Tue, 31 Aug 2021 14:15:44 +0200 Message-Id: <20210831121545.2874233-29-kraxel@redhat.com> In-Reply-To: <20210831121545.2874233-1-kraxel@redhat.com> References: <20210831121545.2874233-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , "Michael S. Tsirkin" , Bin Meng , David Hildenbrand , Aleksandar Rikalo , Peter Xu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Filippov , Alistair Francis , Gerd Hoffmann , "Edgar E. Iglesias" , Alexandre Iooss , Huacai Chen , Halil Pasic , Christian Borntraeger , Palmer Dabbelt , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Eduardo Habkost , Richard Henderson , Greg Kurz , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Stafford Horne , =?UTF-8?q?Alex=20Benn=C3=A9e?= , David Gibson , qemu-riscv@nongnu.org, Bastian Koppelmann , Cornelia Huck , Laurent Vivier , qemu-ppc@nongnu.org, Paolo Bonzini , Mahmoud Mandour , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1630414422489100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann --- include/tcg/tcg-module-i386.h | 1 + target/i386/cpu.h | 4 +--- accel/tcg/tcg-module-i386.c | 6 ++++++ target/i386/tcg/cc_helper.c | 9 ++++++++- target/i386/tcg/fpu_helper.c | 4 ++-- target/i386/tcg/int_helper.c | 8 ++++---- target/i386/tcg/mem_helper.c | 8 ++++---- target/i386/tcg/misc_helper.c | 2 +- target/i386/tcg/seg_helper.c | 8 ++++---- 9 files changed, 31 insertions(+), 19 deletions(-) diff --git a/include/tcg/tcg-module-i386.h b/include/tcg/tcg-module-i386.h index 02a9716e2e66..f6cd2bc075c7 100644 --- a/include/tcg/tcg-module-i386.h +++ b/include/tcg/tcg-module-i386.h @@ -8,6 +8,7 @@ struct TCGI386ModuleOps { void (*x86_register_ferr_irq)(qemu_irq irq); void (*cpu_set_ignne)(void); void (*cpu_x86_update_dr7)(CPUX86State *env, uint32_t new_dr7); + uint32_t (*cpu_cc_compute_all)(CPUX86State *env1, int op); }; extern struct TCGI386ModuleOps tcg_i386; =20 diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 0f3922939eb6..43f97fe5686d 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -2064,13 +2064,11 @@ void cpu_x86_inject_mce(Monitor *mon, X86CPU *cpu, = int bank, uint64_t status, uint64_t mcg_status, uint64_t add= r, uint64_t misc, int flags); =20 -uint32_t cpu_cc_compute_all(CPUX86State *env1, int op); - static inline uint32_t cpu_compute_eflags(CPUX86State *env) { uint32_t eflags =3D env->eflags; if (tcg_enabled()) { - eflags |=3D cpu_cc_compute_all(env, CC_OP) | (env->df & DF_MASK); + eflags |=3D tcg_i386.cpu_cc_compute_all(env, CC_OP) | (env->df & D= F_MASK); } return eflags; } diff --git a/accel/tcg/tcg-module-i386.c b/accel/tcg/tcg-module-i386.c index 1025943c8b21..0954fbbc2db5 100644 --- a/accel/tcg/tcg-module-i386.c +++ b/accel/tcg/tcg-module-i386.c @@ -17,6 +17,11 @@ static void cpu_x86_update_dr7_stub(CPUX86State *env, ui= nt32_t new_dr7) { } =20 +static uint32_t cpu_cc_compute_all_stub(CPUX86State *env1, int op) +{ + return 0; +} + struct TCGI386ModuleOps tcg_i386 =3D { .update_fp_status =3D i386_update_cpu_stub, .update_mxcsr_status =3D i386_update_cpu_stub, @@ -24,4 +29,5 @@ struct TCGI386ModuleOps tcg_i386 =3D { .x86_register_ferr_irq =3D x86_register_ferr_irq_stub, .cpu_set_ignne =3D i386_update_stub, .cpu_x86_update_dr7 =3D cpu_x86_update_dr7_stub, + .cpu_cc_compute_all =3D cpu_cc_compute_all_stub, }; diff --git a/target/i386/tcg/cc_helper.c b/target/i386/tcg/cc_helper.c index cc7ea9e8b9d9..d61f5c5131aa 100644 --- a/target/i386/tcg/cc_helper.c +++ b/target/i386/tcg/cc_helper.c @@ -220,7 +220,7 @@ target_ulong helper_cc_compute_all(target_ulong dst, ta= rget_ulong src1, } } =20 -uint32_t cpu_cc_compute_all(CPUX86State *env, int op) +static uint32_t cpu_cc_compute_all(CPUX86State *env, int op) { return helper_cc_compute_all(CC_DST, CC_SRC, CC_SRC2, op); } @@ -387,3 +387,10 @@ void helper_sti_vm(CPUX86State *env) } } #endif + +static void tcgi386_module_ops_cc(void) +{ + tcg_i386.cpu_cc_compute_all =3D cpu_cc_compute_all; +} + +type_init(tcgi386_module_ops_cc); diff --git a/target/i386/tcg/fpu_helper.c b/target/i386/tcg/fpu_helper.c index 9a0d1798985b..12d4988713b8 100644 --- a/target/i386/tcg/fpu_helper.c +++ b/target/i386/tcg/fpu_helper.c @@ -469,7 +469,7 @@ void helper_fcomi_ST0_FT0(CPUX86State *env) FloatRelation ret; =20 ret =3D floatx80_compare(ST0, FT0, &env->fp_status); - eflags =3D cpu_cc_compute_all(env, CC_OP); + eflags =3D tcg_i386.cpu_cc_compute_all(env, CC_OP); eflags =3D (eflags & ~(CC_Z | CC_P | CC_C)) | fcomi_ccval[ret + 1]; CC_SRC =3D eflags; merge_exception_flags(env, old_flags); @@ -482,7 +482,7 @@ void helper_fucomi_ST0_FT0(CPUX86State *env) FloatRelation ret; =20 ret =3D floatx80_compare_quiet(ST0, FT0, &env->fp_status); - eflags =3D cpu_cc_compute_all(env, CC_OP); + eflags =3D tcg_i386.cpu_cc_compute_all(env, CC_OP); eflags =3D (eflags & ~(CC_Z | CC_P | CC_C)) | fcomi_ccval[ret + 1]; CC_SRC =3D eflags; merge_exception_flags(env, old_flags); diff --git a/target/i386/tcg/int_helper.c b/target/i386/tcg/int_helper.c index 87fa7280eec7..658989ebd464 100644 --- a/target/i386/tcg/int_helper.c +++ b/target/i386/tcg/int_helper.c @@ -189,7 +189,7 @@ void helper_aaa(CPUX86State *env) int al, ah, af; int eflags; =20 - eflags =3D cpu_cc_compute_all(env, CC_OP); + eflags =3D tcg_i386.cpu_cc_compute_all(env, CC_OP); af =3D eflags & CC_A; al =3D env->regs[R_EAX] & 0xff; ah =3D (env->regs[R_EAX] >> 8) & 0xff; @@ -213,7 +213,7 @@ void helper_aas(CPUX86State *env) int al, ah, af; int eflags; =20 - eflags =3D cpu_cc_compute_all(env, CC_OP); + eflags =3D tcg_i386.cpu_cc_compute_all(env, CC_OP); af =3D eflags & CC_A; al =3D env->regs[R_EAX] & 0xff; ah =3D (env->regs[R_EAX] >> 8) & 0xff; @@ -236,7 +236,7 @@ void helper_daa(CPUX86State *env) int old_al, al, af, cf; int eflags; =20 - eflags =3D cpu_cc_compute_all(env, CC_OP); + eflags =3D tcg_i386.cpu_cc_compute_all(env, CC_OP); cf =3D eflags & CC_C; af =3D eflags & CC_A; old_al =3D al =3D env->regs[R_EAX] & 0xff; @@ -263,7 +263,7 @@ void helper_das(CPUX86State *env) int al, al1, af, cf; int eflags; =20 - eflags =3D cpu_cc_compute_all(env, CC_OP); + eflags =3D tcg_i386.cpu_cc_compute_all(env, CC_OP); cf =3D eflags & CC_C; af =3D eflags & CC_A; al =3D env->regs[R_EAX] & 0xff; diff --git a/target/i386/tcg/mem_helper.c b/target/i386/tcg/mem_helper.c index 2da3cd14b66d..5338b26be7f7 100644 --- a/target/i386/tcg/mem_helper.c +++ b/target/i386/tcg/mem_helper.c @@ -33,7 +33,7 @@ void helper_cmpxchg8b_unlocked(CPUX86State *env, target_u= long a0) uint64_t oldv, cmpv, newv; int eflags; =20 - eflags =3D cpu_cc_compute_all(env, CC_OP); + eflags =3D tcg_i386.cpu_cc_compute_all(env, CC_OP); =20 cmpv =3D deposit64(env->regs[R_EAX], 32, 32, env->regs[R_EDX]); newv =3D deposit64(env->regs[R_EBX], 32, 32, env->regs[R_ECX]); @@ -59,7 +59,7 @@ void helper_cmpxchg8b(CPUX86State *env, target_ulong a0) uint64_t oldv, cmpv, newv; int eflags; =20 - eflags =3D cpu_cc_compute_all(env, CC_OP); + eflags =3D tcg_i386.cpu_cc_compute_all(env, CC_OP); =20 cmpv =3D deposit64(env->regs[R_EAX], 32, 32, env->regs[R_EDX]); newv =3D deposit64(env->regs[R_EBX], 32, 32, env->regs[R_ECX]); @@ -96,7 +96,7 @@ void helper_cmpxchg16b_unlocked(CPUX86State *env, target_= ulong a0) if ((a0 & 0xf) !=3D 0) { raise_exception_ra(env, EXCP0D_GPF, GETPC()); } - eflags =3D cpu_cc_compute_all(env, CC_OP); + eflags =3D tcg_i386.cpu_cc_compute_all(env, CC_OP); =20 cmpv =3D int128_make128(env->regs[R_EAX], env->regs[R_EDX]); newv =3D int128_make128(env->regs[R_EBX], env->regs[R_ECX]); @@ -130,7 +130,7 @@ void helper_cmpxchg16b(CPUX86State *env, target_ulong a= 0) if ((a0 & 0xf) !=3D 0) { raise_exception_ra(env, EXCP0D_GPF, ra); } else if (HAVE_CMPXCHG128) { - int eflags =3D cpu_cc_compute_all(env, CC_OP); + int eflags =3D tcg_i386.cpu_cc_compute_all(env, CC_OP); =20 Int128 cmpv =3D int128_make128(env->regs[R_EAX], env->regs[R_EDX]); Int128 newv =3D int128_make128(env->regs[R_EBX], env->regs[R_ECX]); diff --git a/target/i386/tcg/misc_helper.c b/target/i386/tcg/misc_helper.c index dc974dad6acc..15c549277ebc 100644 --- a/target/i386/tcg/misc_helper.c +++ b/target/i386/tcg/misc_helper.c @@ -40,7 +40,7 @@ void helper_into(CPUX86State *env, int next_eip_addend) { int eflags; =20 - eflags =3D cpu_cc_compute_all(env, CC_OP); + eflags =3D tcg_i386.cpu_cc_compute_all(env, CC_OP); if (eflags & CC_O) { raise_interrupt(env, EXCP04_INTO, 1, 0, next_eip_addend); } diff --git a/target/i386/tcg/seg_helper.c b/target/i386/tcg/seg_helper.c index f39d5be97b94..cae88059689f 100644 --- a/target/i386/tcg/seg_helper.c +++ b/target/i386/tcg/seg_helper.c @@ -2252,7 +2252,7 @@ target_ulong helper_lsl(CPUX86State *env, target_ulon= g selector1) int rpl, dpl, cpl, type; =20 selector =3D selector1 & 0xffff; - eflags =3D cpu_cc_compute_all(env, CC_OP); + eflags =3D tcg_i386.cpu_cc_compute_all(env, CC_OP); if ((selector & 0xfffc) =3D=3D 0) { goto fail; } @@ -2299,7 +2299,7 @@ target_ulong helper_lar(CPUX86State *env, target_ulon= g selector1) int rpl, dpl, cpl, type; =20 selector =3D selector1 & 0xffff; - eflags =3D cpu_cc_compute_all(env, CC_OP); + eflags =3D tcg_i386.cpu_cc_compute_all(env, CC_OP); if ((selector & 0xfffc) =3D=3D 0) { goto fail; } @@ -2348,7 +2348,7 @@ void helper_verr(CPUX86State *env, target_ulong selec= tor1) int rpl, dpl, cpl; =20 selector =3D selector1 & 0xffff; - eflags =3D cpu_cc_compute_all(env, CC_OP); + eflags =3D tcg_i386.cpu_cc_compute_all(env, CC_OP); if ((selector & 0xfffc) =3D=3D 0) { goto fail; } @@ -2386,7 +2386,7 @@ void helper_verw(CPUX86State *env, target_ulong selec= tor1) int rpl, dpl, cpl; =20 selector =3D selector1 & 0xffff; - eflags =3D cpu_cc_compute_all(env, CC_OP); + eflags =3D tcg_i386.cpu_cc_compute_all(env, CC_OP); if ((selector & 0xfffc) =3D=3D 0) { goto fail; } --=20 2.31.1 From nobody Sat May 4 07:03:22 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1630414595355959.4442326591025; Tue, 31 Aug 2021 05:56:35 -0700 (PDT) Received: from localhost ([::1]:33008 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mL3JZ-00040H-8n for importer@patchew.org; Tue, 31 Aug 2021 08:56:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33712) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2jn-0000QC-3W for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:19:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:30191) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL2jk-000785-MT for qemu-devel@nongnu.org; Tue, 31 Aug 2021 08:19:34 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-345-jIS5CnXoMDiZwGqv9SumQA-1; Tue, 31 Aug 2021 08:19:30 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4AFF293922; Tue, 31 Aug 2021 12:19:27 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.91]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A149C1001281; Tue, 31 Aug 2021 12:19:11 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 6608A18009F2; Tue, 31 Aug 2021 14:15:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630412372; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hq0XekWZ6wNI++fX5qK67SfjTvBuQ/Myz8WyFIG4GqY=; b=btkBs+Ooso3by5pmAjPJop+iiU+QdSTfSQ+fILj9AW3k3gj2Z4V7qs+cWA8WZGKS1bCkXM Y8oI1FTIewWjqeepJJ0HFiY5sYzVuKpDc9PVhPg714yWKmgZtlUqZzn9KvzrNTL9nAxuyN tQoErc+YfYvxnxkV29g2SM7FtQijPi8= X-MC-Unique: jIS5CnXoMDiZwGqv9SumQA-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PATCH 29/29] Revert "build: temporarily disable modular tcg" Date: Tue, 31 Aug 2021 14:15:45 +0200 Message-Id: <20210831121545.2874233-30-kraxel@redhat.com> In-Reply-To: <20210831121545.2874233-1-kraxel@redhat.com> References: <20210831121545.2874233-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , "Michael S. Tsirkin" , Bin Meng , David Hildenbrand , Aleksandar Rikalo , Peter Xu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Max Filippov , Alistair Francis , Gerd Hoffmann , "Edgar E. Iglesias" , Alexandre Iooss , Huacai Chen , Halil Pasic , Christian Borntraeger , Palmer Dabbelt , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Eduardo Habkost , Richard Henderson , Greg Kurz , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Stafford Horne , =?UTF-8?q?Alex=20Benn=C3=A9e?= , David Gibson , qemu-riscv@nongnu.org, Bastian Koppelmann , Cornelia Huck , Laurent Vivier , qemu-ppc@nongnu.org, Paolo Bonzini , Mahmoud Mandour , Aurelien Jarno Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1630414596441100001 Content-Type: text/plain; charset="utf-8" Everything is in place now, so re-enable modular tcg builds, with alot more code actually being built modular now. Signed-off-by: Gerd Hoffmann --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index e83aa4f5c3c9..bf6378481250 100644 --- a/meson.build +++ b/meson.build @@ -94,7 +94,7 @@ endif =20 modular_tcg =3D [] # Darwin does not support references to thread-local variables in modules -if false #targetos !=3D 'darwin' +if targetos !=3D 'darwin' modular_tcg =3D ['i386-softmmu', 'x86_64-softmmu'] endif =20 --=20 2.31.1