From nobody Tue Nov 26 17:30:24 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1706091482; cv=none; d=zohomail.com; s=zohoarc; b=ipdz4y0NgwgJeS1czKpY1TpYP9JBcrLpBTB7bQpXCU4Vceme+KrsiqWfVGhJZWg2vLLr34Up3jadl9RsnzZStkXcRLHYyYk19T+qf1JTVz2L2Qw3YF4ifV8TT6jvYEU4sZEzTlhXY+oBXiHpeMJT68lcIzeuPX9BAGxNVz898dU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706091482; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=aG1VmNa9qyKWKkyTkfP1qaYwJsyZK0k+Eh9BTsafnvQ=; b=XBavcj9phkgMbnWA7IDQzokl10SY+6wE6nqe/yZRlQBWCoRJwt1xqdmGjHveB7x3Ia7gvuiWQiMAY/FBjK4c9lvry4K7N8WhaaN7jAfxZ0DPWJt3N7mRLSzcGlDdEwxZg8S5Wm1Wo3FiR0AzKWQHi4UUwwOQWBlZHLQRJebQjOI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1706091482404914.7300001176737; Wed, 24 Jan 2024 02:18:02 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSaJQ-0003Cz-TD; Wed, 24 Jan 2024 05:16:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rSaJQ-0003Ck-6e for qemu-devel@nongnu.org; Wed, 24 Jan 2024 05:16:52 -0500 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSaJO-0003nP-Aq for qemu-devel@nongnu.org; Wed, 24 Jan 2024 05:16:51 -0500 Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-a30359b97a8so345924066b.0 for ; Wed, 24 Jan 2024 02:16:49 -0800 (PST) Received: from m1x-phil.lan (lgp44-h02-176-184-8-67.dsl.sta.abo.bbox.fr. [176.184.8.67]) by smtp.gmail.com with ESMTPSA id i2-20020a170906090200b00a2a04c9226asm15225890ejd.194.2024.01.24.02.16.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 24 Jan 2024 02:16:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706091409; x=1706696209; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=aG1VmNa9qyKWKkyTkfP1qaYwJsyZK0k+Eh9BTsafnvQ=; b=VzLi3jxHhxEo920rGX6gRIDmRiZj2AkSHCaXwZKpN+TWCS4+yhHuxhDKEciGgNeR7+ xmlRzUOrDC/m2/1eSaR7vBmWr/RLDIgpTca9JGLk/6hDdQ4eiX+HG26dh3KlgdQ7Guu0 YEJ8Ht2gDxtPpqq1IN6GiUJZrUvM7IglPa0FsnaM3wZOyGZOOzyjBTYhf4F4WM28dqax +g+5natMg7mVDhASbJpl3Jvq5wArg7axR6yw1OeXaWwI/IrZlJCgB+rna3JdesOyJ0UC 8AsgC+AN3Tb+58Iw/lLXZ/4Q/A/YszCTinzmEEWuY1g8qpm9Iy3WbNhUc95HZiVuSrbU j/dQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706091409; x=1706696209; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=aG1VmNa9qyKWKkyTkfP1qaYwJsyZK0k+Eh9BTsafnvQ=; b=SinOml0dtSKFTZDZUxtwZHf+Mb0IdfVGt0Sfi+vgSmCxT3rt4YLgwzisNnqkL25V8u p61k5sMeNzfrDlnW5MdhXY/qGn/32BFYtUiUhDqU1zoDo6t+vVKEEyz7xuBEC1hYHZrg MncgfFQIS9HNcfGZM+l/IAGtU4ndReDxxNHk8b7mENVCd5SWtjSfCZhpsglYpzlqsYYE tEXqxF5EWRZiwgxGdPisKHbYQz0HBOrkmuy2Pzv9nTpqDDyuiHalRD4Csab9eCz7JreH dDLiSo8qlATZLMglhmWs7asevSlGJBoESlKcI3Yhyk/ZnW1mYhugdDcLSFTC1fJ3vI7y RnVA== X-Gm-Message-State: AOJu0YwLpHDjUT5h86FK6g8bEGyCCWSrPoYqB4CkP8chiw/+eIQGA1CT kWZgfg3zICYmNdDiX/5dbL2EgpNumdHrWyS38JrCuoiliy+nLoIVsbJpSYl079Y= X-Google-Smtp-Source: AGHT+IG7V+UBnvi+5pbPb6BUIafu8xEh+xMJhHE6KHSpw95PGthvKCiqljmTc1FngTIWiHANLuzCPg== X-Received: by 2002:a17:907:c201:b0:a31:3d5a:1337 with SMTP id ti1-20020a170907c20100b00a313d5a1337mr120904ejc.45.1706091408933; Wed, 24 Jan 2024 02:16:48 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Anton Johansson , qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , Pavel Dovgalyuk , Claudio Fontana , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 1/9] accel/tcg: Rename tcg_ss[] -> tcg_specific_ss[] in meson Date: Wed, 24 Jan 2024 11:16:31 +0100 Message-ID: <20240124101639.30056-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240124101639.30056-1-philmd@linaro.org> References: <20240124101639.30056-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2a00:1450:4864:20::629; envelope-from=philmd@linaro.org; helo=mail-ej1-x629.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706091484393100019 tcg_ss[] source set contains target-specific units. Rename it as 'tcg_specific_ss[]' for clarity. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Anton Johansson Reviewed-by: Richard Henderson --- accel/tcg/meson.build | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/accel/tcg/meson.build b/accel/tcg/meson.build index 46f7d53eeb..aef80de967 100644 --- a/accel/tcg/meson.build +++ b/accel/tcg/meson.build @@ -1,8 +1,8 @@ -tcg_ss =3D ss.source_set() common_ss.add(when: 'CONFIG_TCG', if_true: files( 'cpu-exec-common.c', )) -tcg_ss.add(files( +tcg_specific_ss =3D ss.source_set() +tcg_specific_ss.add(files( 'tcg-all.c', 'cpu-exec.c', 'tb-maint.c', @@ -11,12 +11,12 @@ tcg_ss.add(files( 'translate-all.c', 'translator.c', )) -tcg_ss.add(when: 'CONFIG_USER_ONLY', if_true: files('user-exec.c')) -tcg_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_false: files('user-exec-stub.c')) +tcg_specific_ss.add(when: 'CONFIG_USER_ONLY', if_true: files('user-exec.c'= )) +tcg_specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_false: files('user-exec= -stub.c')) if get_option('plugins') - tcg_ss.add(files('plugin-gen.c')) + tcg_specific_ss.add(files('plugin-gen.c')) endif -specific_ss.add_all(when: 'CONFIG_TCG', if_true: tcg_ss) +specific_ss.add_all(when: 'CONFIG_TCG', if_true: tcg_specific_ss) =20 specific_ss.add(when: ['CONFIG_SYSTEM_ONLY', 'CONFIG_TCG'], if_true: files( 'cputlb.c', --=20 2.41.0 From nobody Tue Nov 26 17:30:24 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1706091482; cv=none; d=zohomail.com; s=zohoarc; b=ClPNaDySwitvP6JS1I8utOpLZ3lvsoyAUgpm7ZyjEuuVnB1yi9z3xPk97v+AGVLaHpdYxhV0UE7EZ3zZoBZisZDu1ybF9OMfplgAJr+5xAPP4ZS+kop4urDkD4oLr8OPVAvx9aPD/CjV/xX4tTfKX4rZdv3u9FA4LJvVkx83+UA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706091482; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=FBMlS39CW/Iv4VBfcOh+Zv0cB8PVhw/t20rhumALwGU=; b=XDdqTG6Um80mpULCB8DX+BonOQ6aU2spuq8zyO8K4/8to+BU3jjQDBBUysoYzzmJqpXi62fbn6MclkIwUxNZ4/O0zKOn0cf9Y/XvKysTPWWJbm1sTNdFfuCF3qibP6orc4FOXTg3BQmpOJ43lM7RFXh5RbHPJybi5ZRka4TEY98= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1706091481949187.34108205961854; Wed, 24 Jan 2024 02:18:01 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSaJZ-0003EP-75; Wed, 24 Jan 2024 05:17:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rSaJW-0003ED-VY for qemu-devel@nongnu.org; Wed, 24 Jan 2024 05:16:59 -0500 Received: from mail-lj1-x22d.google.com ([2a00:1450:4864:20::22d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSaJV-0003oZ-DC for qemu-devel@nongnu.org; Wed, 24 Jan 2024 05:16:58 -0500 Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2cf2a381b86so2734441fa.0 for ; Wed, 24 Jan 2024 02:16:56 -0800 (PST) Received: from m1x-phil.lan (lgp44-h02-176-184-8-67.dsl.sta.abo.bbox.fr. [176.184.8.67]) by smtp.gmail.com with ESMTPSA id cn7-20020a0564020ca700b0055c349e04f8sm3444326edb.36.2024.01.24.02.16.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 24 Jan 2024 02:16:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706091415; x=1706696215; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FBMlS39CW/Iv4VBfcOh+Zv0cB8PVhw/t20rhumALwGU=; b=Kkdr2i3BB1dXg81R+RWi9qDJn3QQEEOuI7C4nuEx2ab9BEdZkuncnRWCnxZNw8YAkB G5oIjVSS3hrjIVSBAquYqq+H4DoCQzTkByzWBIvOsB2ggBjxpK4sioJzxfMdxrvBGibd yE49qpZB39HYrGXQ12bu3gGfN+89LdxV4BQq9gK1sWpRFkjBUqp/UvJLYZ+L3DtWbg9g R2AkkD2ruvaIBzf7e0vouGV8t18Tno3+EkmIRAaDGBccusojcRb04b8eVSSap4dWPY1O b4aNDMKMKyKSaabx88powozt844fgfzbN97Fz04gnw94srmdl/3S/NL1nwmUKWEdhx5H ateQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706091415; x=1706696215; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FBMlS39CW/Iv4VBfcOh+Zv0cB8PVhw/t20rhumALwGU=; b=ORIIHZVpyokCZ5MhPf+rDjABkoldUMve766OX1bh3nPuDiZbGvSWEGs5JTQF+3SotK 61pVRpP+S+ldlGjfgZ4YTtQt/Ew/UfHPDoSQTIc+jdeybPNeKU4075LZArbVSWyx15RC yuEikW/XHIs0MRGWRUxBuD0wCT2KO3Ps178hArNjK7JvpNFJaQEn3Whll0u3NbOwAiOs i/nAPTUm3OXP97mxkOVXIshTP3U+UEOKnLCUBj/QNSAZ19J1x0NoE/5JSR3z2AdIFXNx Yg+SIJRcJBmgrVIHbwb+tEgdghV35w5L5kIog8PjyO+K27GbZF85uPdjJtDFroCTCkwu KoiA== X-Gm-Message-State: AOJu0Ywcm8PR3Hl/X5LWfCnbcxJTZWHztCtppc6ZzHcwfk51CsSMVYBd K4ZU9RIiIFL+pidhGHfl6Ds/YtL4XjB0AWMAR51L/UZ54koZ5w3r3G61QSv1eHA= X-Google-Smtp-Source: AGHT+IGWwkbYOC0U4dBmSTynpfE6ssaqXGSArnjuAeOxnV9ZtNSORTiLNAcuzDaJQpkloBLfSHLM6A== X-Received: by 2002:a2e:be84:0:b0:2cc:c7ef:924d with SMTP id a4-20020a2ebe84000000b002ccc7ef924dmr971451ljr.29.1706091415358; Wed, 24 Jan 2024 02:16:55 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Anton Johansson , qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , Pavel Dovgalyuk , Claudio Fontana , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 2/9] accel/tcg: Rename tcg_cpus_destroy() -> tcg_cpu_destroy() Date: Wed, 24 Jan 2024 11:16:32 +0100 Message-ID: <20240124101639.30056-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240124101639.30056-1-philmd@linaro.org> References: <20240124101639.30056-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2a00:1450:4864:20::22d; envelope-from=philmd@linaro.org; helo=mail-lj1-x22d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706091482586100002 tcg_cpus_destroy() operates on a single vCPU, rename it as 'tcg_cpu_destroy'. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Anton Johansson Reviewed-by: Richard Henderson --- accel/tcg/tcg-accel-ops.h | 2 +- accel/tcg/tcg-accel-ops-mttcg.c | 2 +- accel/tcg/tcg-accel-ops-rr.c | 2 +- accel/tcg/tcg-accel-ops.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/accel/tcg/tcg-accel-ops.h b/accel/tcg/tcg-accel-ops.h index f9bc6330e2..17c7ed00eb 100644 --- a/accel/tcg/tcg-accel-ops.h +++ b/accel/tcg/tcg-accel-ops.h @@ -14,7 +14,7 @@ =20 #include "sysemu/cpus.h" =20 -void tcg_cpus_destroy(CPUState *cpu); +void tcg_cpu_destroy(CPUState *cpu); int tcg_cpus_exec(CPUState *cpu); void tcg_handle_interrupt(CPUState *cpu, int mask); void tcg_cpu_init_cflags(CPUState *cpu, bool parallel); diff --git a/accel/tcg/tcg-accel-ops-mttcg.c b/accel/tcg/tcg-accel-ops-mttc= g.c index af7307013a..bcba314a65 100644 --- a/accel/tcg/tcg-accel-ops-mttcg.c +++ b/accel/tcg/tcg-accel-ops-mttcg.c @@ -118,7 +118,7 @@ static void *mttcg_cpu_thread_fn(void *arg) qemu_wait_io_event(cpu); } while (!cpu->unplug || cpu_can_run(cpu)); =20 - tcg_cpus_destroy(cpu); + tcg_cpu_destroy(cpu); bql_unlock(); rcu_remove_force_rcu_notifier(&force_rcu.notifier); rcu_unregister_thread(); diff --git a/accel/tcg/tcg-accel-ops-rr.c b/accel/tcg/tcg-accel-ops-rr.c index 3208035d85..0617f66b5b 100644 --- a/accel/tcg/tcg-accel-ops-rr.c +++ b/accel/tcg/tcg-accel-ops-rr.c @@ -131,7 +131,7 @@ static void rr_deal_with_unplugged_cpus(void) =20 CPU_FOREACH(cpu) { if (cpu->unplug && !cpu_can_run(cpu)) { - tcg_cpus_destroy(cpu); + tcg_cpu_destroy(cpu); break; } } diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c index 813065c0ec..9b84b84218 100644 --- a/accel/tcg/tcg-accel-ops.c +++ b/accel/tcg/tcg-accel-ops.c @@ -63,7 +63,7 @@ void tcg_cpu_init_cflags(CPUState *cpu, bool parallel) cpu->tcg_cflags |=3D cflags; } =20 -void tcg_cpus_destroy(CPUState *cpu) +void tcg_cpu_destroy(CPUState *cpu) { cpu_thread_signal_destroyed(cpu); } --=20 2.41.0 From nobody Tue Nov 26 17:30:24 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1706091481; cv=none; d=zohomail.com; s=zohoarc; b=hvIxMZfulNHQhwO7dJgRCeicWJDcd79yS4NV58HisaVznU2UOlKP8/gajSEjch/uqeYneNzBAsSiH6f1kydMrK3E5cR/wu3pSU7vAJSM/umqL4Lt8MM5uCnTzCtzygO/FzqHX2dBMCZtVpKtW/5l/u/orAOLwdkgO114i/AMD3U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706091481; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=QCaFP/JCcM9wNK6S/97qMJvFLtrlt8qlwc6m36BcsKg=; b=kYl2mjHYfjNmsfboinl6BsoUtqYzWr0q8cHoRBZzk05p5SAoPqf5ZU75MdDnQLHEOU/GQdRfgiHOsC85mBIu865u1s/PjXEZn2/zJizCIcimxo16iMwORBvrPQ1IT1juS8cMWncUuMzEUZd2u70sx98SSaP6re4X4k81/vL1s2M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1706091481649479.790551965296; Wed, 24 Jan 2024 02:18:01 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSaJg-0003Fs-2e; Wed, 24 Jan 2024 05:17:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rSaJc-0003FQ-VU for qemu-devel@nongnu.org; Wed, 24 Jan 2024 05:17:04 -0500 Received: from mail-lj1-x233.google.com ([2a00:1450:4864:20::233]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSaJb-0003oy-BR for qemu-devel@nongnu.org; Wed, 24 Jan 2024 05:17:04 -0500 Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2cf161b5eadso17107841fa.2 for ; Wed, 24 Jan 2024 02:17:02 -0800 (PST) Received: from m1x-phil.lan (lgp44-h02-176-184-8-67.dsl.sta.abo.bbox.fr. [176.184.8.67]) by smtp.gmail.com with ESMTPSA id h27-20020a056402095b00b0055c643f4f8asm2410643edz.32.2024.01.24.02.17.00 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 24 Jan 2024 02:17:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706091421; x=1706696221; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QCaFP/JCcM9wNK6S/97qMJvFLtrlt8qlwc6m36BcsKg=; b=z75ITGLPdKccL7TMKDO/oMH/IW9BWXWuV5maFFOIMUyrrWmcQiQ57AZL2Mm833VMob NlNS9QNFuJJhOU240IsHqSwTJ/IIcSEeQNVbkS67TwrDC2ZIvrwzpYeu3nt1EQCU4E7K /tXexVPmj1Ix0fONkbOyZcabDW/juXDBPmILKWhhXrjV0R3uC6sRlrYcZziG4Dzt3a7K 4isKeyYmbwDQX2OKB5CvkR7qTKXEYqj6VCmA/NEnMI50LmKEsjkjCsWLdeEWScbv6zBG tZXUVned0OHaDpRAS9/0uZoV3C/W259tYE2tthjIbvyV56W+B8PDNwTjJmEwxXImv9UW /Lrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706091421; x=1706696221; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QCaFP/JCcM9wNK6S/97qMJvFLtrlt8qlwc6m36BcsKg=; b=Kp+nTJFVHdUio2/WGOvpHJjH3SndRQBONmpP5LchaVxIcOA3NFTVJW3W1Pvv/MqE4a lxMX7966nW7bg/DkB/vcHqQkPAZCtIFfBHvkGXJEdjZpL4QZowpI7WXhW+YYMqlepgwb +v9xV/1uvlBJ4OavmbnD5lJuD0FgbQO+qPD7ttTY3CRoM3kW67ZxT3CvADsbbHln2KF1 GUzc8yc14AvR3SMFvhFLeUgY1oQzfdkXsRwHeWfhTurtn+ZM98PvEbvEFrsxxCOOLbSf 2EIdyYRYMJD+Xfo6Noz4ZJfGT0XJsWS/LxMSZppdEW7ksuHo6zLvI7At3fBJeo8/2L+s qqPA== X-Gm-Message-State: AOJu0YzoXgrnZMEiHIY506jmIuKqvUHojCwIAMohsBGst/m0tsnK84bh ElihM+yp5t2SYK9RONhxH0en0Ett/V7TcVtjjG60nLUIkvrDIUyOnWFWHeHAzzQQNrexM8pzQBD j X-Google-Smtp-Source: AGHT+IEVG4Ln3bk/nYFNEbNSjklMnjb2JXuXOuKJ3rARoxHbBpuoCuPrWt+0nrivveIK/Qp9qMMPWA== X-Received: by 2002:a2e:beaa:0:b0:2cd:9f51:ac23 with SMTP id a42-20020a2ebeaa000000b002cd9f51ac23mr804483ljr.4.1706091421496; Wed, 24 Jan 2024 02:17:01 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Anton Johansson , qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , Pavel Dovgalyuk , Claudio Fontana , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 3/9] accel/tcg: Rename tcg_cpus_exec() -> tcg_cpu_exec() Date: Wed, 24 Jan 2024 11:16:33 +0100 Message-ID: <20240124101639.30056-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240124101639.30056-1-philmd@linaro.org> References: <20240124101639.30056-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2a00:1450:4864:20::233; envelope-from=philmd@linaro.org; helo=mail-lj1-x233.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706091482723100005 tcg_cpus_exec() operates on a single vCPU, rename it as 'tcg_cpu_exec'. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Anton Johansson Reviewed-by: Richard Henderson --- accel/tcg/tcg-accel-ops.h | 2 +- accel/tcg/tcg-accel-ops-mttcg.c | 2 +- accel/tcg/tcg-accel-ops-rr.c | 2 +- accel/tcg/tcg-accel-ops.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/accel/tcg/tcg-accel-ops.h b/accel/tcg/tcg-accel-ops.h index 17c7ed00eb..44c4079972 100644 --- a/accel/tcg/tcg-accel-ops.h +++ b/accel/tcg/tcg-accel-ops.h @@ -15,7 +15,7 @@ #include "sysemu/cpus.h" =20 void tcg_cpu_destroy(CPUState *cpu); -int tcg_cpus_exec(CPUState *cpu); +int tcg_cpu_exec(CPUState *cpu); void tcg_handle_interrupt(CPUState *cpu, int mask); void tcg_cpu_init_cflags(CPUState *cpu, bool parallel); =20 diff --git a/accel/tcg/tcg-accel-ops-mttcg.c b/accel/tcg/tcg-accel-ops-mttc= g.c index bcba314a65..c552b45b8e 100644 --- a/accel/tcg/tcg-accel-ops-mttcg.c +++ b/accel/tcg/tcg-accel-ops-mttcg.c @@ -92,7 +92,7 @@ static void *mttcg_cpu_thread_fn(void *arg) if (cpu_can_run(cpu)) { int r; bql_unlock(); - r =3D tcg_cpus_exec(cpu); + r =3D tcg_cpu_exec(cpu); bql_lock(); switch (r) { case EXCP_DEBUG: diff --git a/accel/tcg/tcg-accel-ops-rr.c b/accel/tcg/tcg-accel-ops-rr.c index 0617f66b5b..894e73e52c 100644 --- a/accel/tcg/tcg-accel-ops-rr.c +++ b/accel/tcg/tcg-accel-ops-rr.c @@ -258,7 +258,7 @@ static void *rr_cpu_thread_fn(void *arg) if (icount_enabled()) { icount_prepare_for_run(cpu, cpu_budget); } - r =3D tcg_cpus_exec(cpu); + r =3D tcg_cpu_exec(cpu); if (icount_enabled()) { icount_process_data(cpu); } diff --git a/accel/tcg/tcg-accel-ops.c b/accel/tcg/tcg-accel-ops.c index 9b84b84218..9c957f421c 100644 --- a/accel/tcg/tcg-accel-ops.c +++ b/accel/tcg/tcg-accel-ops.c @@ -68,7 +68,7 @@ void tcg_cpu_destroy(CPUState *cpu) cpu_thread_signal_destroyed(cpu); } =20 -int tcg_cpus_exec(CPUState *cpu) +int tcg_cpu_exec(CPUState *cpu) { int ret; assert(tcg_enabled()); --=20 2.41.0 From nobody Tue Nov 26 17:30:24 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1706091482; cv=none; d=zohomail.com; s=zohoarc; b=lkPA2mUuG/ZamiJUxmUAcuQronEToUPNDwa22bVwa32YuIAxJi+8Q1c7G7G77oOnpQpZFoUGpQ9g0jzbDnqXalCThUy3Lhj11aHphUDhNBMe5hlmCVFH2N4Q7D0yCOnkQRsxMIMWtG/zO1Encwc+rmlTu8AHtO9f6i6SQL5BZ6U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706091482; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=sHl/AtYG7is0KFUXE16Nv2to1GnXQQp2fEWClGXzUg0=; b=LOCRodkIAPgfu424Wh4kndo8OHhq5lD50fjxwR9l07UubSpEdB2+r2BA7y0maxyzcT7JSSaa85K9zvE+NF+VaVFUk+GBw7qXITaTB5rDruA3Gp7HwWuVsEVorp/266D/h3FmOWW0LwDlBwA1rVrhAtC9Zs7wNKKiOGBqXViLjOc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 170609148219723.89047892119686; Wed, 24 Jan 2024 02:18:02 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSaK8-0003OO-6z; Wed, 24 Jan 2024 05:17:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rSaJk-0003GJ-Ik for qemu-devel@nongnu.org; Wed, 24 Jan 2024 05:17:14 -0500 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSaJh-0003pa-2F for qemu-devel@nongnu.org; Wed, 24 Jan 2024 05:17:12 -0500 Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-50f1c524010so5839871e87.3 for ; Wed, 24 Jan 2024 02:17:08 -0800 (PST) Received: from m1x-phil.lan (lgp44-h02-176-184-8-67.dsl.sta.abo.bbox.fr. [176.184.8.67]) by smtp.gmail.com with ESMTPSA id g17-20020a170906c19100b00a2b1a20e662sm15185422ejz.34.2024.01.24.02.17.06 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 24 Jan 2024 02:17:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706091427; x=1706696227; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sHl/AtYG7is0KFUXE16Nv2to1GnXQQp2fEWClGXzUg0=; b=kd937uMxTjOVfqtJKOjiL5NmagA0shvH8906ZoZfdzRuuICqvKtlV94VIY0XXr5n+p YNyLCcjvsaoWkCALdjPrA/UxxAd6HILa5NLPeRlPLcuL3R+ZlITCx6OTPBgBtGXQ4/h6 MrbbK2X3iEyUHJA/ytOfp84EdZiZEVF5m1CSfdXQYPM9H3jB7lGNX/Gkkb0ZlN7dShQh kqRuyRhTGHBe/De5U57FXgubCSJtIuOeUdsAikjCcKslp9oE9T5n6MkMp9Of3jvI/NYp hbTfZVOO8JWd5ePEioH1tP1tD5ywq4Q0bEdRb8fUDFmxjE05yehK/9ggPx1adFLvWysR sqjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706091427; x=1706696227; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sHl/AtYG7is0KFUXE16Nv2to1GnXQQp2fEWClGXzUg0=; b=kVgaWEKw4vZVSnI+YiBhjohO0gH8YDtO7ynXS5b77GgrWchUb79cnU5NIGrmPJqLIF D2HSTdTDlq5Pc3r5N3aBpS4ju2hpQk55F4Dz4uwSTMx9ip1tkXRKYdx0z5dR+pVrxfgf 8xpTol2i53El3IldOMDdRqdrLwkq+09qZEw02bnDrQsX127KIrQoMwFIaO9xzmRpoADX qpsAfsHkwDcnHVM1c4UpDh5gmUPa1A3cP3zF8I4YxcTBKTQAS+aSbg+PoP3RnpQFaaLy PSW04MlBAr9X8YSmAyu4/B01C1ZZlYeFnvIkYHogrsYMy1azdPfERuty3yoRqrIHGj8B uYQg== X-Gm-Message-State: AOJu0Yzz8GjFmNyqR1cYM/JVG0pKbukIgzFbY8cog1kPRXwE8nStLasl 71imj5q187nlD6fdZt36Z2mS1VOcwhLJ8fCxxwtqkHD2GxMnWq8K4sH9ZiKL6V8= X-Google-Smtp-Source: AGHT+IHcaI9f0VCMx3KUF7ype2ngx8znRoz2FootGivNktqk80lS8Eg81b6JHz7qws4W3+Gm2giwdQ== X-Received: by 2002:ac2:5d2e:0:b0:50f:1c9a:13f4 with SMTP id i14-20020ac25d2e000000b0050f1c9a13f4mr1566570lfb.52.1706091427590; Wed, 24 Jan 2024 02:17:07 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Anton Johansson , qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , Pavel Dovgalyuk , Claudio Fontana , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 4/9] accel/tcg: Un-inline icount_exit_request() for clarity Date: Wed, 24 Jan 2024 11:16:34 +0100 Message-ID: <20240124101639.30056-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240124101639.30056-1-philmd@linaro.org> References: <20240124101639.30056-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2a00:1450:4864:20::134; envelope-from=philmd@linaro.org; helo=mail-lf1-x134.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706091482586100001 Convert packed logic to dumb icount_exit_request() helper. No functional change intended. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Anton Johansson Reviewed-by: Richard Henderson --- accel/tcg/cpu-exec.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 6b3f66930e..d61b285d5e 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -791,6 +791,17 @@ static inline bool need_replay_interrupt(int interrupt= _request) } #endif /* !CONFIG_USER_ONLY */ =20 +static inline bool icount_exit_request(CPUState *cpu) +{ + if (!icount_enabled()) { + return false; + } + if (cpu->cflags_next_tb !=3D -1 && !(cpu->cflags_next_tb & CF_USE_ICOU= NT)) { + return false; + } + return cpu->neg.icount_decr.u16.low + cpu->icount_extra =3D=3D 0; +} + static inline bool cpu_handle_interrupt(CPUState *cpu, TranslationBlock **last_tb) { @@ -896,10 +907,7 @@ static inline bool cpu_handle_interrupt(CPUState *cpu, } =20 /* Finally, check if we need to exit to the main loop. */ - if (unlikely(qatomic_read(&cpu->exit_request)) - || (icount_enabled() - && (cpu->cflags_next_tb =3D=3D -1 || cpu->cflags_next_tb & CF_= USE_ICOUNT) - && cpu->neg.icount_decr.u16.low + cpu->icount_extra =3D=3D 0))= { + if (unlikely(qatomic_read(&cpu->exit_request)) || icount_exit_request(= cpu)) { qatomic_set(&cpu->exit_request, 0); if (cpu->exception_index =3D=3D -1) { cpu->exception_index =3D EXCP_INTERRUPT; --=20 2.41.0 From nobody Tue Nov 26 17:30:24 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1706091482; cv=none; d=zohomail.com; s=zohoarc; b=O2XX2PU0yi60w2MYIyXvDO0xPPCcD3jm+k/8YjUqYhGWVjGEdyMqeYTIuBazzwIK/MgLC3iOviEzkSLV+/as+uk1Z0SV1ZvYS8fDozUxBpJYPEEm2sVa43qqFRO6JKbKbWTsMBv6txxkeACv+v0iMxTFSPUH5dlUjXa3UuHvPhE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706091482; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=kCdApdVb2tqf6HzKRfmudkQU18WR02XSp7D7zgQR15M=; b=TdUyzr7zXEymf3e1aAJPDfGUc4Kg2gNoZZ8yx2DptifcK4iwteLuY5zVCOY7euXtIgPZkyaF7b3LLDLcu9aNfAADnoCHg8B+28UKBbeori4O+xs7JO4ttubkv0QqaDmpGEyKo3w0nLAGIfvGZciSLC4crAEhtaVqoTZOarI8XbA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 170609148240839.26591521864418; Wed, 24 Jan 2024 02:18:02 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSaKE-0003jB-O3; Wed, 24 Jan 2024 05:17:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rSaJq-0003Mq-HN for qemu-devel@nongnu.org; Wed, 24 Jan 2024 05:17:20 -0500 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSaJo-0003q3-5Y for qemu-devel@nongnu.org; Wed, 24 Jan 2024 05:17:18 -0500 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-a293f2280c7so549244766b.1 for ; Wed, 24 Jan 2024 02:17:15 -0800 (PST) Received: from m1x-phil.lan (lgp44-h02-176-184-8-67.dsl.sta.abo.bbox.fr. [176.184.8.67]) by smtp.gmail.com with ESMTPSA id w17-20020a17090652d100b00a28116285e0sm10969588ejn.165.2024.01.24.02.17.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 24 Jan 2024 02:17:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706091434; x=1706696234; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kCdApdVb2tqf6HzKRfmudkQU18WR02XSp7D7zgQR15M=; b=kr5swZd+2nM1QAnTrCMMOZ5KARfyobJ4HPJY86G0Bq94ies0QJLgO76Jg8dSEwpMKv TENaYADgGJc1GYDnhTKGowl2T5kjATMMmOVxo/prSpTQJrnHG+L0W6wXxMeauOdS6weC FbvyeD+09sY9SghpqGQ9F+uMMyP1XqJ8eGMAlGcd7U6cONePOYpnecJqAKeaC/H/LuV+ NOC77FA6jl9Glcfo0pM6n+iRUtIQb1Lm4ZjlOod6GusRAQJ5sygksWl67w/Y60cOvnCt 8ntMbBP+09oMX3d/GXAACSkcrBzMi/hxRhKh+7ygkUuppq+gxUJUQkANTuAMOvjMJJnk 3jmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706091434; x=1706696234; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kCdApdVb2tqf6HzKRfmudkQU18WR02XSp7D7zgQR15M=; b=Gk2HuTa+JYJ4v5KadNmG/3WMAsAY/pUnkaKch4FsCDfWXhX2xP8PhdRHMShvLcv8ev pz7BbLyxaphqx3HCsgMryvJQrdu8G5whfiJxXo6lz+swr4C3FaLbVCdhMQ3olNYO7FmP 4Bks6Dt4qKAqBOI/fAveurrJNWUMpMtAKhnKW/dEdDSVVZJKL99zUT5ooGTmK8IvsQeD 6DYs70eCsWmmlnISQDD/gmW8kFOxDTJLdOroBoh53Po82knkyAkcv7IeWDtUie0XIwzB Vqc/5DlxzP0/Ebio5iUjaBMDEjysn+wO8w7tTSApuPdVY6piD+0Lx1YIrvkl0tk8hKPK Uv2Q== X-Gm-Message-State: AOJu0YwNYQ1iiCp1oLrsybRDa7bW5iLfivtIqSwCF7g6A2eijlCvydcs wGgaJHOFs5uCBjWhMG/4yiLakr4O30kJpd/p4tD+mCRWJQSfu9Iral12HZ8i90Y= X-Google-Smtp-Source: AGHT+IHn1Xvl36cwiqj9hcYhEW0WZ34e4eNFzBSz1q8ioyEEXwnTprlQ8V5G5MMuYOQNErFAxI3qog== X-Received: by 2002:a17:907:8b87:b0:a31:1092:69b2 with SMTP id tb7-20020a1709078b8700b00a31109269b2mr339392ejc.77.1706091433618; Wed, 24 Jan 2024 02:17:13 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Anton Johansson , qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , Pavel Dovgalyuk , Claudio Fontana , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 5/9] accel/tcg: Hoist CPUClass arg to functions with external linkage Date: Wed, 24 Jan 2024 11:16:35 +0100 Message-ID: <20240124101639.30056-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240124101639.30056-1-philmd@linaro.org> References: <20240124101639.30056-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2a00:1450:4864:20::636; envelope-from=philmd@linaro.org; helo=mail-ej1-x636.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706091484491100023 Hoist the CPUClass argument from most of these internal helpers: - check_for_breakpoints_slow - check_for_breakpoints() - cpu_tb_exec() - cpu_exec_enter() - cpu_exec_exit() - cpu_handle_halt() - cpu_handle_debug_exception() - cpu_handle_exception() - need_replay_interrupt() - cpu_handle_interrupt() - cpu_loop_exec_tb() - cpu_exec_loop() - cpu_exec_setjmp() to the following ones with external linkage: - lookup_tb_ptr() - cpu_exec_step_atomic() - cpu_exec() Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Anton Johansson --- accel/tcg/cpu-exec.c | 82 ++++++++++++++++++++------------------------ 1 file changed, 37 insertions(+), 45 deletions(-) diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index d61b285d5e..b10472cbc7 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -324,8 +324,8 @@ static void log_cpu_exec(vaddr pc, CPUState *cpu, } } =20 -static bool check_for_breakpoints_slow(CPUState *cpu, vaddr pc, - uint32_t *cflags) +static bool check_for_breakpoints_slow(CPUClass *cc, CPUState *cpu, + vaddr pc, uint32_t *cflags) { CPUBreakpoint *bp; bool match_page =3D false; @@ -357,7 +357,6 @@ static bool check_for_breakpoints_slow(CPUState *cpu, v= addr pc, #ifdef CONFIG_USER_ONLY g_assert_not_reached(); #else - CPUClass *cc =3D CPU_GET_CLASS(cpu); assert(cc->tcg_ops->debug_check_breakpoint); match_bp =3D cc->tcg_ops->debug_check_breakpoint(cpu); #endif @@ -390,11 +389,11 @@ static bool check_for_breakpoints_slow(CPUState *cpu,= vaddr pc, return false; } =20 -static inline bool check_for_breakpoints(CPUState *cpu, vaddr pc, - uint32_t *cflags) +static inline bool check_for_breakpoints(CPUClass *cc, CPUState *cpu, + vaddr pc, uint32_t *cflags) { return unlikely(!QTAILQ_EMPTY(&cpu->breakpoints)) && - check_for_breakpoints_slow(cpu, pc, cflags); + check_for_breakpoints_slow(cc, cpu, pc, cflags); } =20 /** @@ -408,6 +407,7 @@ static inline bool check_for_breakpoints(CPUState *cpu,= vaddr pc, const void *HELPER(lookup_tb_ptr)(CPUArchState *env) { CPUState *cpu =3D env_cpu(env); + CPUClass *cc =3D CPU_GET_CLASS(cpu); TranslationBlock *tb; vaddr pc; uint64_t cs_base; @@ -416,7 +416,7 @@ const void *HELPER(lookup_tb_ptr)(CPUArchState *env) cpu_get_tb_cpu_state(env, &pc, &cs_base, &flags); =20 cflags =3D curr_cflags(cpu); - if (check_for_breakpoints(cpu, pc, &cflags)) { + if (check_for_breakpoints(cc, cpu, pc, &cflags)) { cpu_loop_exit(cpu); } =20 @@ -443,7 +443,7 @@ const void *HELPER(lookup_tb_ptr)(CPUArchState *env) * affect the impact of CFI in environment with high security requirements */ static inline TranslationBlock * QEMU_DISABLE_CFI -cpu_tb_exec(CPUState *cpu, TranslationBlock *itb, int *tb_exit) +cpu_tb_exec(CPUClass *cc, CPUState *cpu, TranslationBlock *itb, int *tb_ex= it) { CPUArchState *env =3D cpu_env(cpu); uintptr_t ret; @@ -476,8 +476,6 @@ cpu_tb_exec(CPUState *cpu, TranslationBlock *itb, int *= tb_exit) * counter hit zero); we must restore the guest PC to the address * of the start of the TB. */ - CPUClass *cc =3D CPU_GET_CLASS(cpu); - if (cc->tcg_ops->synchronize_from_tb) { cc->tcg_ops->synchronize_from_tb(cpu, last_tb); } else { @@ -509,19 +507,15 @@ cpu_tb_exec(CPUState *cpu, TranslationBlock *itb, int= *tb_exit) } =20 =20 -static void cpu_exec_enter(CPUState *cpu) +static void cpu_exec_enter(CPUClass *cc, CPUState *cpu) { - CPUClass *cc =3D CPU_GET_CLASS(cpu); - if (cc->tcg_ops->cpu_exec_enter) { cc->tcg_ops->cpu_exec_enter(cpu); } } =20 -static void cpu_exec_exit(CPUState *cpu) +static void cpu_exec_exit(CPUClass *cc, CPUState *cpu) { - CPUClass *cc =3D CPU_GET_CLASS(cpu); - if (cc->tcg_ops->cpu_exec_exit) { cc->tcg_ops->cpu_exec_exit(cpu); } @@ -566,6 +560,7 @@ static void cpu_exec_longjmp_cleanup(CPUState *cpu) =20 void cpu_exec_step_atomic(CPUState *cpu) { + CPUClass *cc =3D CPU_GET_CLASS(cpu); CPUArchState *env =3D cpu_env(cpu); TranslationBlock *tb; vaddr pc; @@ -600,11 +595,11 @@ void cpu_exec_step_atomic(CPUState *cpu) mmap_unlock(); } =20 - cpu_exec_enter(cpu); + cpu_exec_enter(cc, cpu); /* execute the generated code */ trace_exec_tb(tb, pc); - cpu_tb_exec(cpu, tb, &tb_exit); - cpu_exec_exit(cpu); + cpu_tb_exec(cc, cpu, tb, &tb_exit); + cpu_exec_exit(cc, cpu); } else { cpu_exec_longjmp_cleanup(cpu); } @@ -673,7 +668,7 @@ static inline void tb_add_jump(TranslationBlock *tb, in= t n, return; } =20 -static inline bool cpu_handle_halt(CPUState *cpu) +static inline bool cpu_handle_halt(CPUClass *cc, CPUState *cpu) { #ifndef CONFIG_USER_ONLY if (cpu->halted) { @@ -697,9 +692,8 @@ static inline bool cpu_handle_halt(CPUState *cpu) return false; } =20 -static inline void cpu_handle_debug_exception(CPUState *cpu) +static inline void cpu_handle_debug_exception(CPUClass *cc, CPUState *cpu) { - CPUClass *cc =3D CPU_GET_CLASS(cpu); CPUWatchpoint *wp; =20 if (!cpu->watchpoint_hit) { @@ -713,7 +707,7 @@ static inline void cpu_handle_debug_exception(CPUState = *cpu) } } =20 -static inline bool cpu_handle_exception(CPUState *cpu, int *ret) +static inline bool cpu_handle_exception(CPUClass *cc, CPUState *cpu, int *= ret) { if (cpu->exception_index < 0) { #ifndef CONFIG_USER_ONLY @@ -730,7 +724,7 @@ static inline bool cpu_handle_exception(CPUState *cpu, = int *ret) /* exit request from the cpu execution loop */ *ret =3D cpu->exception_index; if (*ret =3D=3D EXCP_DEBUG) { - cpu_handle_debug_exception(cpu); + cpu_handle_debug_exception(cc, cpu); } cpu->exception_index =3D -1; return true; @@ -740,7 +734,6 @@ static inline bool cpu_handle_exception(CPUState *cpu, = int *ret) which will be handled outside the cpu execution loop */ #if defined(TARGET_I386) - CPUClass *cc =3D CPU_GET_CLASS(cpu); cc->tcg_ops->fake_user_interrupt(cpu); #endif /* TARGET_I386 */ *ret =3D cpu->exception_index; @@ -748,7 +741,6 @@ static inline bool cpu_handle_exception(CPUState *cpu, = int *ret) return true; #else if (replay_exception()) { - CPUClass *cc =3D CPU_GET_CLASS(cpu); bql_lock(); cc->tcg_ops->do_interrupt(cpu); bql_unlock(); @@ -761,7 +753,7 @@ static inline bool cpu_handle_exception(CPUState *cpu, = int *ret) * next instruction. */ *ret =3D EXCP_DEBUG; - cpu_handle_debug_exception(cpu); + cpu_handle_debug_exception(cc, cpu); return true; } } else if (!replay_has_interrupt()) { @@ -781,7 +773,7 @@ static inline bool cpu_handle_exception(CPUState *cpu, = int *ret) * "real" interrupt event later. It does not need to be recorded for * replay purposes. */ -static inline bool need_replay_interrupt(int interrupt_request) +static inline bool need_replay_interrupt(CPUClass *cc, int interrupt_reque= st) { #if defined(TARGET_I386) return !(interrupt_request & CPU_INTERRUPT_POLL); @@ -802,7 +794,7 @@ static inline bool icount_exit_request(CPUState *cpu) return cpu->neg.icount_decr.u16.low + cpu->icount_extra =3D=3D 0; } =20 -static inline bool cpu_handle_interrupt(CPUState *cpu, +static inline bool cpu_handle_interrupt(CPUClass *cc, CPUState *cpu, TranslationBlock **last_tb) { /* @@ -870,11 +862,9 @@ static inline bool cpu_handle_interrupt(CPUState *cpu, True when it is, and we should restart on a new TB, and via longjmp via cpu_loop_exit. */ else { - CPUClass *cc =3D CPU_GET_CLASS(cpu); - if (cc->tcg_ops->cpu_exec_interrupt && cc->tcg_ops->cpu_exec_interrupt(cpu, interrupt_request)) { - if (need_replay_interrupt(interrupt_request)) { + if (need_replay_interrupt(cc, interrupt_request)) { replay_interrupt(); } /* @@ -918,14 +908,15 @@ static inline bool cpu_handle_interrupt(CPUState *cpu, return false; } =20 -static inline void cpu_loop_exec_tb(CPUState *cpu, TranslationBlock *tb, +static inline void cpu_loop_exec_tb(CPUClass *cc, CPUState *cpu, + TranslationBlock *tb, vaddr pc, TranslationBlock **last_tb, int *tb_exit) { int32_t insns_left; =20 trace_exec_tb(tb, pc); - tb =3D cpu_tb_exec(cpu, tb, tb_exit); + tb =3D cpu_tb_exec(cc, cpu, tb, tb_exit); if (*tb_exit !=3D TB_EXIT_REQUESTED) { *last_tb =3D tb; return; @@ -970,16 +961,16 @@ static inline void cpu_loop_exec_tb(CPUState *cpu, Tr= anslationBlock *tb, /* main execution loop */ =20 static int __attribute__((noinline)) -cpu_exec_loop(CPUState *cpu, SyncClocks *sc) +cpu_exec_loop(CPUClass *cc, CPUState *cpu, SyncClocks *sc) { int ret; =20 /* if an exception is pending, we execute it here */ - while (!cpu_handle_exception(cpu, &ret)) { + while (!cpu_handle_exception(cc, cpu, &ret)) { TranslationBlock *last_tb =3D NULL; int tb_exit =3D 0; =20 - while (!cpu_handle_interrupt(cpu, &last_tb)) { + while (!cpu_handle_interrupt(cc, cpu, &last_tb)) { TranslationBlock *tb; vaddr pc; uint64_t cs_base; @@ -1001,7 +992,7 @@ cpu_exec_loop(CPUState *cpu, SyncClocks *sc) cpu->cflags_next_tb =3D -1; } =20 - if (check_for_breakpoints(cpu, pc, &cflags)) { + if (check_for_breakpoints(cc, cpu, pc, &cflags)) { break; } =20 @@ -1046,7 +1037,7 @@ cpu_exec_loop(CPUState *cpu, SyncClocks *sc) tb_add_jump(last_tb, tb_exit, tb); } =20 - cpu_loop_exec_tb(cpu, tb, pc, &last_tb, &tb_exit); + cpu_loop_exec_tb(cc, cpu, tb, pc, &last_tb, &tb_exit); =20 /* Try to align the host and virtual clocks if the guest is in advance */ @@ -1056,30 +1047,31 @@ cpu_exec_loop(CPUState *cpu, SyncClocks *sc) return ret; } =20 -static int cpu_exec_setjmp(CPUState *cpu, SyncClocks *sc) +static int cpu_exec_setjmp(CPUClass *cc, CPUState *cpu, SyncClocks *sc) { /* Prepare setjmp context for exception handling. */ if (unlikely(sigsetjmp(cpu->jmp_env, 0) !=3D 0)) { cpu_exec_longjmp_cleanup(cpu); } =20 - return cpu_exec_loop(cpu, sc); + return cpu_exec_loop(cc, cpu, sc); } =20 int cpu_exec(CPUState *cpu) { int ret; SyncClocks sc =3D { 0 }; + CPUClass *cc =3D CPU_GET_CLASS(cpu); =20 /* replay_interrupt may need current_cpu */ current_cpu =3D cpu; =20 - if (cpu_handle_halt(cpu)) { + if (cpu_handle_halt(cc, cpu)) { return EXCP_HALTED; } =20 WITH_RCU_READ_LOCK_GUARD() { - cpu_exec_enter(cpu); + cpu_exec_enter(cc, cpu); =20 /* * Calculate difference between guest clock and host clock. @@ -1089,9 +1081,9 @@ int cpu_exec(CPUState *cpu) */ init_delay_params(&sc, cpu); =20 - ret =3D cpu_exec_setjmp(cpu, &sc); + ret =3D cpu_exec_setjmp(cc, cpu, &sc); =20 - cpu_exec_exit(cpu); + cpu_exec_exit(cc, cpu); }; =20 return ret; --=20 2.41.0 From nobody Tue Nov 26 17:30:24 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1706091514; cv=none; d=zohomail.com; s=zohoarc; b=mayrLF8n2Pn2fQS9FZfuLAk0BA9SYWqbeSb/i0IO9T+KohNGgYLXhk0OpjS3pYvcrK1oLGzOTNwslGj3jaqwEWFYRS1rfgtpmczAbcSZAhXWwa48MxaJwaTwN5XeG6j6IisG3UXtXbhuxHJ7KGAg8Ubwsu13dnzC2ntCH4vw2p0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706091514; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=TSQhp0P/DRalBnOPDt7LO9q/NJaOxDtFUMlWyOyZnN8=; b=Ydm6soCnFZJ6VWcqj6g8WeE66JCOMNg0F1c1szVcGHraJuUrTBnBu7XyAAX58txAjS83kShPGI54eNXWOh9blt7+mgzOH3ouNPbKB+AU+jMXGvnVTZpNt8PJjFtMbravUXcsEGZib3rmKX+L65pLVjN7+b3iu1bMshhNkJJQi3k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1706091514280405.63463008413066; Wed, 24 Jan 2024 02:18:34 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSaKG-0003t8-3r; Wed, 24 Jan 2024 05:17:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rSaJv-0003NS-3C for qemu-devel@nongnu.org; Wed, 24 Jan 2024 05:17:25 -0500 Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSaJt-0003qQ-8j for qemu-devel@nongnu.org; Wed, 24 Jan 2024 05:17:22 -0500 Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-5100b424f8fso1401957e87.0 for ; Wed, 24 Jan 2024 02:17:20 -0800 (PST) Received: from m1x-phil.lan (lgp44-h02-176-184-8-67.dsl.sta.abo.bbox.fr. [176.184.8.67]) by smtp.gmail.com with ESMTPSA id i13-20020a05640200cd00b00559c71e70e3sm9558946edu.79.2024.01.24.02.17.18 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 24 Jan 2024 02:17:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706091439; x=1706696239; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TSQhp0P/DRalBnOPDt7LO9q/NJaOxDtFUMlWyOyZnN8=; b=l1L1keZpSxgaSwqjNK8uAs3+/ZEr7MkclSMw1/S/byFZkYEKrKu/TLZD4zM0nhpjAv Fi2eSEoM+1+g11TMyzOmDzNt25ZJpwlF1/ZcpMN/r/+ankap4ed6ik0d7TjTzdvLQdr4 NDzFquoLZemjwRjdI+8QuP9xVGo47ZMYBjC1EBjxrKbFpm7+9mPE1SXZCMx3jsgfw5u1 oX+ITyz7f3bC6YhE+NacK29ZSzODXSKhoVN6bidlbHlmn8nTyKJiY+dG2r1QqAAiLU4r wNhbfUuyRMrrGZNq2QaqJlq7+qdYsnaG6eFSvGMJ12e0KUkRql+Olx1LJxkkO/Mj3lAt Blew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706091439; x=1706696239; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TSQhp0P/DRalBnOPDt7LO9q/NJaOxDtFUMlWyOyZnN8=; b=PZG0ti4auOF5wDLUYlaOY18LYN+w9qiKLjc3AUXzjrH0qp+v96XB6XIKO0haKfBj64 VLZ5D6za8KTe3WUT9WD78du9iHxNbdGDT7qUIkhtzhmquZviVQcrdCP4BsSSJLY/MwDK 1itxVpq5xk+tUvY6Age8Ra2SCmwhx8+pvDfC/LLHKvqcLa/PzmeO6FzfUrJheQ9kQFdY yvxe93fs7mo4it2z4W6w9qeg/Y9WvUk8Pn/loPnnWyMX2s9bltoiFPw4X2Mggl8QUzD2 xS+4l+XcwKoPrqUy4D6v2Lb7HrK9JfmEoZJke0ZpqPIywe3N6DlKrXVrWZEyiwHS6zya oDMA== X-Gm-Message-State: AOJu0Yy35S+sKw7xqvOd/6xToUH+0SfD1xxInYpIEtRi3z2+kXswuOV2 zjVBApkQstguVi2ySPeDJ1RsFJl98dNJOozK9lJB+ECmy5XmLG/kHr6mXty8EaA= X-Google-Smtp-Source: AGHT+IGQlAgZaXnyZceE+/sYIMLyuxs6C1gSEEQtHHKiUo7Iy7xOXHaKOHVdL2t70v5IIF7PgTq/IQ== X-Received: by 2002:a05:6512:4018:b0:50f:da9:16b2 with SMTP id br24-20020a056512401800b0050f0da916b2mr3904262lfb.74.1706091439730; Wed, 24 Jan 2024 02:17:19 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Anton Johansson , qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , Pavel Dovgalyuk , Claudio Fontana , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 6/9] accel/tcg: Introduce TCGCPUOps::need_replay_interrupt() handler Date: Wed, 24 Jan 2024 11:16:36 +0100 Message-ID: <20240124101639.30056-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240124101639.30056-1-philmd@linaro.org> References: <20240124101639.30056-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2a00:1450:4864:20::12a; envelope-from=philmd@linaro.org; helo=mail-lf1-x12a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706091514633100001 In order to make accel/tcg/ target agnostic, introduce the need_replay_interrupt() handler. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Anton Johansson Reviewed-by: Pavel Dovgalyuk Reviewed-by: Richard Henderson --- include/hw/core/tcg-cpu-ops.h | 5 +++++ accel/tcg/cpu-exec.c | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/hw/core/tcg-cpu-ops.h b/include/hw/core/tcg-cpu-ops.h index 479713a36e..2fae3ac70f 100644 --- a/include/hw/core/tcg-cpu-ops.h +++ b/include/hw/core/tcg-cpu-ops.h @@ -170,6 +170,11 @@ struct TCGCPUOps { */ bool (*io_recompile_replay_branch)(CPUState *cpu, const TranslationBlock *tb); + /** + * @need_replay_interrupt: Return %true if @interrupt_request + * needs to be recorded for replay purposes. + */ + bool (*need_replay_interrupt)(int interrupt_request); #endif /* !CONFIG_USER_ONLY */ #endif /* NEED_CPU_H */ =20 diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index b10472cbc7..4ab7d6c896 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -778,7 +778,10 @@ static inline bool need_replay_interrupt(CPUClass *cc,= int interrupt_request) #if defined(TARGET_I386) return !(interrupt_request & CPU_INTERRUPT_POLL); #else - return true; + if (!cc->tcg_ops->need_replay_interrupt) { + return true; + } + return cc->tcg_ops->need_replay_interrupt(interrupt_request); #endif } #endif /* !CONFIG_USER_ONLY */ --=20 2.41.0 From nobody Tue Nov 26 17:30:24 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1706091520; cv=none; d=zohomail.com; s=zohoarc; b=ebTl8Ci3AlltszrHU1kICQoAgQP0pIStS8tfD9h2OWk4HotxjZI0bOCj2ZIUTXE6XjckypD5yzFZvvTkZAnM1tXKf+/YeMjHGMOP2ULoOQcDGiyb428XEsOuf5uE5BD1h9msTgft2mAJsnRITNHy4RNEz7HL3i7atutukpMF3zA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706091520; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Am9lbFOfXcPiDrwnR+bkztaDbspfqwYjvrmc5JlSn2c=; b=YQjP5Zg49I8JWE/ce9A1jopBM3qj0yqYgefiuVwDdpxYLMThYUQbJcrAOxD4KoA3x//yApyaxojkQrLwNxX524ieCdy549AOO7EEz0YDPZl3Gv6fOOMHpre+tx9PbYYnfnmA9M2BO/ZkWaxlWM5u1AO4sAfvednMC0vXBvvDa9s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1706091520586944.4351000437563; Wed, 24 Jan 2024 02:18:40 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSaKG-0003tu-7w; Wed, 24 Jan 2024 05:17:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rSaK2-0003SI-Mq for qemu-devel@nongnu.org; Wed, 24 Jan 2024 05:17:36 -0500 Received: from mail-lf1-x130.google.com ([2a00:1450:4864:20::130]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSaK0-0003qp-FA for qemu-devel@nongnu.org; Wed, 24 Jan 2024 05:17:30 -0500 Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-50eac018059so7354495e87.0 for ; Wed, 24 Jan 2024 02:17:27 -0800 (PST) Received: from m1x-phil.lan (lgp44-h02-176-184-8-67.dsl.sta.abo.bbox.fr. [176.184.8.67]) by smtp.gmail.com with ESMTPSA id t19-20020a1709067c1300b00a2cab4514a2sm14281787ejo.133.2024.01.24.02.17.24 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 24 Jan 2024 02:17:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706091446; x=1706696246; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Am9lbFOfXcPiDrwnR+bkztaDbspfqwYjvrmc5JlSn2c=; b=vF5HjYUhFRqo+nUDh6iMa6JuEAek56ZT22nnNj2rBAFQ1+t1IGfEPKhlASRNo7H6rM AZ5vT1QGztdH0bRjZE1sTMvW78ilTMW4EIiSUVGv9uwC7GKUuBkesWzubUVhUepLEDqG wEr8L5WHSDEMK0asNrTy2DVr7vrbsezzGOY+OXVA5zAORDMkxLMxDd6fZF8Voxq038Q3 YxLXEoaRR6TZ71GJxHl3SZjILYb4iJM548F8GA6kTllkCP+LvDINghkf5fsDTyEiqdM+ 0ocAvyq3ahnBF3DqLEGV69kzb7gVVSvVlCKgVNQaMePBlMY6M5lK/TXfxLTYvu9BQQY7 768w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706091446; x=1706696246; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Am9lbFOfXcPiDrwnR+bkztaDbspfqwYjvrmc5JlSn2c=; b=Nxlz4NIMA9jTsVsim1bysPvi6btjRNpS4IECCp+DRbfL+XnbDj2QsG+1b2hf6pVI/q x38Ptb15dVX6MmhHD6zgN+tovWYWdHd65DhmSPjn8ZwVrBf7sjY29PDw1uCkDrDHh75z XUGZHzt92GooIoVN/5hcfLBHBXgxJbhV4Pd0QXlzESzZe/cwE0+RqOcsOML4Xnax4gLH DbO+osYeTwbHSQTMdg6VLQBvb4iaP0VzEZvkMhcCtbgxnv/O0rRDzka62FM5xwNl78eW /kySI6XulJBiwyN0QSzQNbM7v46Jlbvw0EgJOGul/7HzSSs7mRIQCwzLpfLitH0GY+Bf mffQ== X-Gm-Message-State: AOJu0YyeNw4XW8Bnyfac9903EYynqNEZgY4vOQPRUSHlIUmiMjUiFaLH t4I7S8mc/VZ0VJwt42BpJ191rhTKGqwofM+rLjPt9y25MuICvdyg5BDTj0haozc= X-Google-Smtp-Source: AGHT+IFgUbTQFWpKFYBz920IezFeznw97CB8BwTvyN0wNYTJZ+6PdxbitusY+bAyH2on8H3il4xlTQ== X-Received: by 2002:ac2:5b5e:0:b0:510:ab6:e418 with SMTP id i30-20020ac25b5e000000b005100ab6e418mr1156806lfp.33.1706091445750; Wed, 24 Jan 2024 02:17:25 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Anton Johansson , qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , Pavel Dovgalyuk , Claudio Fontana , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eduardo Habkost Subject: [PATCH 7/9] target/i386: Extract x86_need_replay_interrupt() from accel/tcg/ Date: Wed, 24 Jan 2024 11:16:37 +0100 Message-ID: <20240124101639.30056-8-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240124101639.30056-1-philmd@linaro.org> References: <20240124101639.30056-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2a00:1450:4864:20::130; envelope-from=philmd@linaro.org; helo=mail-lf1-x130.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706091522684100003 Move this x86-specific code out of the generic accel/tcg/. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Anton Johansson Reviewed-by: Pavel Dovgalyuk Reviewed-by: Richard Henderson --- target/i386/tcg/helper-tcg.h | 1 + accel/tcg/cpu-exec.c | 9 --------- target/i386/tcg/sysemu/seg_helper.c | 10 ++++++++++ target/i386/tcg/tcg-cpu.c | 1 + 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/target/i386/tcg/helper-tcg.h b/target/i386/tcg/helper-tcg.h index ce34b737bb..253b1f561e 100644 --- a/target/i386/tcg/helper-tcg.h +++ b/target/i386/tcg/helper-tcg.h @@ -39,6 +39,7 @@ QEMU_BUILD_BUG_ON(TCG_PHYS_ADDR_BITS > TARGET_PHYS_ADDR_S= PACE_BITS); */ void x86_cpu_do_interrupt(CPUState *cpu); #ifndef CONFIG_USER_ONLY +bool x86_need_replay_interrupt(int interrupt_request); bool x86_cpu_exec_interrupt(CPUState *cpu, int int_req); #endif =20 diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 4ab7d6c896..5a978a9e72 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -768,21 +768,12 @@ static inline bool cpu_handle_exception(CPUClass *cc,= CPUState *cpu, int *ret) } =20 #ifndef CONFIG_USER_ONLY -/* - * CPU_INTERRUPT_POLL is a virtual event which gets converted into a - * "real" interrupt event later. It does not need to be recorded for - * replay purposes. - */ static inline bool need_replay_interrupt(CPUClass *cc, int interrupt_reque= st) { -#if defined(TARGET_I386) - return !(interrupt_request & CPU_INTERRUPT_POLL); -#else if (!cc->tcg_ops->need_replay_interrupt) { return true; } return cc->tcg_ops->need_replay_interrupt(interrupt_request); -#endif } #endif /* !CONFIG_USER_ONLY */ =20 diff --git a/target/i386/tcg/sysemu/seg_helper.c b/target/i386/tcg/sysemu/s= eg_helper.c index 1cb5a0db45..e6f42282bb 100644 --- a/target/i386/tcg/sysemu/seg_helper.c +++ b/target/i386/tcg/sysemu/seg_helper.c @@ -127,6 +127,16 @@ void x86_cpu_do_interrupt(CPUState *cs) } } =20 +bool x86_need_replay_interrupt(int interrupt_request) +{ + /* + * CPU_INTERRUPT_POLL is a virtual event which gets converted into a + * "real" interrupt event later. It does not need to be recorded for + * replay purposes. + */ + return !(interrupt_request & CPU_INTERRUPT_POLL); +} + bool x86_cpu_exec_interrupt(CPUState *cs, int interrupt_request) { X86CPU *cpu =3D X86_CPU(cs); diff --git a/target/i386/tcg/tcg-cpu.c b/target/i386/tcg/tcg-cpu.c index e1405b7be9..255d56d4c3 100644 --- a/target/i386/tcg/tcg-cpu.c +++ b/target/i386/tcg/tcg-cpu.c @@ -123,6 +123,7 @@ static const struct TCGCPUOps x86_tcg_ops =3D { .do_unaligned_access =3D x86_cpu_do_unaligned_access, .debug_excp_handler =3D breakpoint_handler, .debug_check_breakpoint =3D x86_debug_check_breakpoint, + .need_replay_interrupt =3D x86_need_replay_interrupt, #endif /* !CONFIG_USER_ONLY */ }; =20 --=20 2.41.0 From nobody Tue Nov 26 17:30:24 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1706091494; cv=none; d=zohomail.com; s=zohoarc; b=VAX70/I8qlBJ/MDg66w7aIvEO32AdVGxQnb8xH/q+/ejbQBUI5w9v86sqJIxmNPK6B1klxK9FExSzo6qicJBE2rwg8gJgCMbHajVf5M7Ip2iGcW8EnwZ/4DbHF6zmSuVcURyjBV+yG8ZkC150yrpoDvGqKIWtIqPt1UrBSrhlcY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706091494; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=X94AmIL+mNsGxo00rh8nsvmtFlP/7iCFJPTsu1PEIEI=; b=MfPE1aIN8e2yO36jDFhtZ8nw6X5ReRRizTPyGz1c45tqfNPXwNIIaLL76eDgJd1F0NGlDlmb3gHsJgSqVbnxNl6BAQhtzban/mdwMPL8ztBQeXG7SgbDJFcG817PrB51W50vqiq7lE3Y+lajCmriSnZikksae8ZL0bb2GKVaez8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1706091494204913.9406927262035; Wed, 24 Jan 2024 02:18:14 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSaKH-00041Z-A5; Wed, 24 Jan 2024 05:17:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rSaK7-0003cC-TO for qemu-devel@nongnu.org; Wed, 24 Jan 2024 05:17:38 -0500 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSaK6-0003rF-7U for qemu-devel@nongnu.org; Wed, 24 Jan 2024 05:17:35 -0500 Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-559f92bf7b6so9562604a12.0 for ; Wed, 24 Jan 2024 02:17:32 -0800 (PST) Received: from m1x-phil.lan (lgp44-h02-176-184-8-67.dsl.sta.abo.bbox.fr. [176.184.8.67]) by smtp.gmail.com with ESMTPSA id e9-20020a056402104900b0055c15c5919csm4080051edu.86.2024.01.24.02.17.30 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 24 Jan 2024 02:17:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706091451; x=1706696251; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=X94AmIL+mNsGxo00rh8nsvmtFlP/7iCFJPTsu1PEIEI=; b=OZpQtAtAucMqQuCNBUkJge29NiCtNb3k7ii9ODvmv72snZiuYg4U1UDBSBF3Cac7jQ YjAGLYeeD0O8LK87QayTdTVpJNT21ekY7aU2XiDsbh1TQlrfVExGRLPebJp8NsbDHv2n fz6L6fqC0JqzzTrUoN8Z0k20jQCoekU7SKLetnHtUKj1kyyV679WnQA0Y3gt+WowqO0O uIZmjCLxzVG9SfJkWKdThYNU+HrdxH99L+kaHT5qOLBe+c12iRBeWugG15Jx404oqZVL CSCqZD0ZQhqOVfu9erKwqoXHBHwOCdhnrOjgosfW8mhuCd3Fr+atlrjql0Fpe/u5aWMV nYGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706091451; x=1706696251; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=X94AmIL+mNsGxo00rh8nsvmtFlP/7iCFJPTsu1PEIEI=; b=wgYkKYjqfj1AoJS4NFCGBOF3rL2kUXEPiLf9Ik57VBKDgVAvuVI1LgapI1Xr5ti5xu fzmGQkYgrdWif+HGecYbX2Fob2tvczwNeRnCzAcEK90aG4GCLqMiKC3DLkTcZOH7AvI+ /MqghashjR3YHPTFaPaZw48VU0t7btxswPy33rR+Xtv/6c+RwvXoh+Nk4HbDPUlKLtik 0YdPYJwl7cyUKTFo2zQkh0qCQzD9glYFP/vkR1dhBG9XGVWcLSzFTjkSzV9TIw/j6Dhg 6uG/yKwnNeVkbBtjyD8QbEI8r5QOfGJvQHgyZQ38UvZ9rOkR4N/d8X5nN1Jy7xILdT0m Uo3w== X-Gm-Message-State: AOJu0YxJzeQ4hq336w8da7kBwBUlW5udy97F02zOxNZxiZcKF/KyFOQm gvsxyQErpRNrzWAclUeCNcpWu+nhpTCeBgc+l5M43eYa2g2xelWi7E8u9sec6KU= X-Google-Smtp-Source: AGHT+IHEZ2Xnctj0Ypz0sXKJndqrCnF8cX6WEK/A2zQJz49zqqAFc/OtE0tBaogsHCqJdSK1fX/MGQ== X-Received: by 2002:aa7:d3c8:0:b0:55c:8d17:1bea with SMTP id o8-20020aa7d3c8000000b0055c8d171beamr1038023edr.17.1706091451682; Wed, 24 Jan 2024 02:17:31 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Anton Johansson , qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , Pavel Dovgalyuk , Claudio Fontana , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 8/9] accel/tcg: Introduce TCGCPUOps::cpu_exec_halt() handler Date: Wed, 24 Jan 2024 11:16:38 +0100 Message-ID: <20240124101639.30056-9-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240124101639.30056-1-philmd@linaro.org> References: <20240124101639.30056-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2a00:1450:4864:20::52a; envelope-from=philmd@linaro.org; helo=mail-ed1-x52a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706091494470100001 In order to make accel/tcg/ target agnostic, introduce the cpu_exec_halt() handler. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Anton Johansson Reviewed-by: Richard Henderson --- include/hw/core/tcg-cpu-ops.h | 2 ++ accel/tcg/cpu-exec.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/include/hw/core/tcg-cpu-ops.h b/include/hw/core/tcg-cpu-ops.h index 2fae3ac70f..3307338c80 100644 --- a/include/hw/core/tcg-cpu-ops.h +++ b/include/hw/core/tcg-cpu-ops.h @@ -114,6 +114,8 @@ struct TCGCPUOps { void (*record_sigbus)(CPUState *cpu, vaddr addr, MMUAccessType access_type, uintptr_t ra); #else + /** @cpu_exec_halt: Callback for handling halt in cpu_exec */ + void (*cpu_exec_halt)(CPUState *cpu); /** @cpu_exec_interrupt: Callback for processing interrupts in cpu_exe= c */ bool (*cpu_exec_interrupt)(CPUState *cpu, int interrupt_request); /** diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 5a978a9e72..390a9644da 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -681,6 +681,9 @@ static inline bool cpu_handle_halt(CPUClass *cc, CPUSta= te *cpu) bql_unlock(); } #endif /* TARGET_I386 */ + if (cc->tcg_ops->cpu_exec_halt) { + cc->tcg_ops->cpu_exec_halt(cpu); + } if (!cpu_has_work(cpu)) { return true; } --=20 2.41.0 From nobody Tue Nov 26 17:30:24 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1706091501; cv=none; d=zohomail.com; s=zohoarc; b=JP1T5KW0IXGxnsWtc8Zs6XeuSSKywdv8QhkHXACZS2cRfYEAyZCwcNuX2V0/x6uBzhunyexb8oDLCjZiIvKOe6ugAP/x2+bB7iPD98VmFVEcgajJM+3j5lfP4zfGItV0+FxMBNjznsiBMOwN2UpbZWRAsMMn9dy6kpTCZ07fSns= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1706091501; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=gpEb2PEYPX2zoYAlv9rul3UN8M152eCIu+XSN9MDjH0=; b=MYUIU4G6S43Xg8rcEe4HGpQrC0q0SUXCigpOMB9F4YtfWSeLYwzg8WHFQkmlZ/7QvG0xwtL3CXl2qLyWQChWIKJwtr0JeN4z7A7H0ziY1rH2EOcGU8sPgYDuBnFUEylknQZgSG/u+0GQX9EUHe97x1nqvma+MWy3nnQKVamElB0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1706091501867185.07175030040037; Wed, 24 Jan 2024 02:18:21 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rSaKI-0004Cw-7S; Wed, 24 Jan 2024 05:17:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rSaKD-0003hF-3T for qemu-devel@nongnu.org; Wed, 24 Jan 2024 05:17:41 -0500 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rSaKB-0003t0-DX for qemu-devel@nongnu.org; Wed, 24 Jan 2024 05:17:40 -0500 Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-a30b3a9e9c6so209303566b.2 for ; Wed, 24 Jan 2024 02:17:38 -0800 (PST) Received: from m1x-phil.lan (lgp44-h02-176-184-8-67.dsl.sta.abo.bbox.fr. [176.184.8.67]) by smtp.gmail.com with ESMTPSA id tj4-20020a170907c24400b00a311082cd00sm599770ejc.37.2024.01.24.02.17.36 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 24 Jan 2024 02:17:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706091458; x=1706696258; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gpEb2PEYPX2zoYAlv9rul3UN8M152eCIu+XSN9MDjH0=; b=O2fAohS+Poviqif5YxxMHRgGtHn0QJ8/pStftmB1hYL/k8NoETwOMrKYCN+kpgNACQ 6jxyU+tSqtmphUGc4H5GPB+TSXri8rbsJEhg+/R7y6HgKCns9Ygn/jYelcD8Tf+zR3QH T1M2O10H/zZWMbuYtJH5bL/KpRJKo87umqaf59fKtTSLIyOb/gB5HyhkEXGnF7KwHdMa a5dprPWuPgJhHhU6qD9cfhPLx7Vfv73Mud6QolgeA1Zypo30l0WGKKUGYW2xpaI3G2xJ 4+AzqystCX7wW6xlvAXfLnnMoIuWf0a14QD2nXHF8+QbRYZRSAu8sygFFt7IPLj2YXiP E2DA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706091458; x=1706696258; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gpEb2PEYPX2zoYAlv9rul3UN8M152eCIu+XSN9MDjH0=; b=wbUma8ZPw5pOYWqRaoSVmX512CMTQEv7T7XslM1CrgJ/NbY5DsKH834wwwj7jJLgvk 6IEFPXei5fLn6jp33YnvkFA3dk7PjlhYe0mUkGYpsB5uuuTzUMFsykfNj1uHuABK3XQa QwmV+FrTa2k8JUUJZJF2OxOkj2ydAvhcwoLd6PRZUSJesYeV5lAGObxfcO2CbBuV29yD soi9GVjKdddQ0t5nweSlCMistWwl+QX3OGzOIkcJxrZK9JfmAo8SlByjqAeZfCgIfsI/ Py1wDq+E7EwR0PNcXAHcftM4jiTZeEvlZqNYV4aX7MvzWy8RRulXfoB6ep52wJKrjJy9 gSDg== X-Gm-Message-State: AOJu0YxqVlBOufCepcfo0xBuROHViHpy7p9TZ/9LtO1exFyhG7xQdFg4 JK3eRURi4cZ1Hnmcdx0rRk5++bJ1HuQdiQXIHCKMm7QwdnOPDuj7zzXiiuuPipo= X-Google-Smtp-Source: AGHT+IGAX8mq8S4UC+lQnwqIxhDW1uaxnZ4vzpUfX7QVDiewYICyao4JkcpFe58Lpc4HfYtSOkPReg== X-Received: by 2002:a17:906:c50:b0:a30:8497:4db2 with SMTP id t16-20020a1709060c5000b00a3084974db2mr325628ejf.201.1706091457794; Wed, 24 Jan 2024 02:17:37 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Anton Johansson , qemu-devel@nongnu.org Cc: Paolo Bonzini , Richard Henderson , Pavel Dovgalyuk , Claudio Fontana , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eduardo Habkost Subject: [PATCH 9/9] target/i386: Extract x86_cpu_exec_halt() from accel/tcg/ Date: Wed, 24 Jan 2024 11:16:39 +0100 Message-ID: <20240124101639.30056-10-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240124101639.30056-1-philmd@linaro.org> References: <20240124101639.30056-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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=2a00:1450:4864:20::62d; envelope-from=philmd@linaro.org; helo=mail-ej1-x62d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1706091502557100003 Move this x86-specific code out of the generic accel/tcg/. Reported-by: Anton Johansson Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Anton Johansson Reviewed-by: Richard Henderson --- target/i386/tcg/helper-tcg.h | 1 + accel/tcg/cpu-exec.c | 12 ------------ target/i386/tcg/sysemu/seg_helper.c | 13 +++++++++++++ target/i386/tcg/tcg-cpu.c | 1 + 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/target/i386/tcg/helper-tcg.h b/target/i386/tcg/helper-tcg.h index 253b1f561e..effc2c1c98 100644 --- a/target/i386/tcg/helper-tcg.h +++ b/target/i386/tcg/helper-tcg.h @@ -39,6 +39,7 @@ QEMU_BUILD_BUG_ON(TCG_PHYS_ADDR_BITS > TARGET_PHYS_ADDR_S= PACE_BITS); */ void x86_cpu_do_interrupt(CPUState *cpu); #ifndef CONFIG_USER_ONLY +void x86_cpu_exec_halt(CPUState *cpu); bool x86_need_replay_interrupt(int interrupt_request); bool x86_cpu_exec_interrupt(CPUState *cpu, int int_req); #endif diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 390a9644da..7662f4973d 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -30,9 +30,6 @@ #include "qemu/rcu.h" #include "exec/log.h" #include "qemu/main-loop.h" -#if defined(TARGET_I386) && !defined(CONFIG_USER_ONLY) -#include "hw/i386/apic.h" -#endif #include "sysemu/cpus.h" #include "exec/cpu-all.h" #include "sysemu/cpu-timers.h" @@ -672,15 +669,6 @@ static inline bool cpu_handle_halt(CPUClass *cc, CPUSt= ate *cpu) { #ifndef CONFIG_USER_ONLY if (cpu->halted) { -#if defined(TARGET_I386) - if (cpu->interrupt_request & CPU_INTERRUPT_POLL) { - X86CPU *x86_cpu =3D X86_CPU(cpu); - bql_lock(); - apic_poll_irq(x86_cpu->apic_state); - cpu_reset_interrupt(cpu, CPU_INTERRUPT_POLL); - bql_unlock(); - } -#endif /* TARGET_I386 */ if (cc->tcg_ops->cpu_exec_halt) { cc->tcg_ops->cpu_exec_halt(cpu); } diff --git a/target/i386/tcg/sysemu/seg_helper.c b/target/i386/tcg/sysemu/s= eg_helper.c index e6f42282bb..2db8083748 100644 --- a/target/i386/tcg/sysemu/seg_helper.c +++ b/target/i386/tcg/sysemu/seg_helper.c @@ -20,6 +20,7 @@ =20 #include "qemu/osdep.h" #include "qemu/log.h" +#include "qemu/main-loop.h" #include "cpu.h" #include "exec/helper-proto.h" #include "exec/cpu_ldst.h" @@ -127,6 +128,18 @@ void x86_cpu_do_interrupt(CPUState *cs) } } =20 +void x86_cpu_exec_halt(CPUState *cpu) +{ + if (cpu->interrupt_request & CPU_INTERRUPT_POLL) { + X86CPU *x86_cpu =3D X86_CPU(cpu); + + bql_lock(); + apic_poll_irq(x86_cpu->apic_state); + cpu_reset_interrupt(cpu, CPU_INTERRUPT_POLL); + bql_unlock(); + } +} + bool x86_need_replay_interrupt(int interrupt_request) { /* diff --git a/target/i386/tcg/tcg-cpu.c b/target/i386/tcg/tcg-cpu.c index 255d56d4c3..3028b57c97 100644 --- a/target/i386/tcg/tcg-cpu.c +++ b/target/i386/tcg/tcg-cpu.c @@ -119,6 +119,7 @@ static const struct TCGCPUOps x86_tcg_ops =3D { #else .tlb_fill =3D x86_cpu_tlb_fill, .do_interrupt =3D x86_cpu_do_interrupt, + .cpu_exec_halt =3D x86_cpu_exec_halt, .cpu_exec_interrupt =3D x86_cpu_exec_interrupt, .do_unaligned_access =3D x86_cpu_do_unaligned_access, .debug_excp_handler =3D breakpoint_handler, --=20 2.41.0