From nobody Fri May 17 07:56:13 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=1677638927; cv=none; d=zohomail.com; s=zohoarc; b=G9L5+wdyk2y4efPXJM4Iq6O4ST4Z/5eFM7GtvCCAIoXBJ5e9iNZZBSmSwxEljrBuRLujHA0zzeMtV97yqA2FgNhob9XrPrY8ggYC9q9z71an/G/+hoaSRv2W2wNGac1oYMfYi4RObzUWqIWY+4tz1t0WXpl4FL+QQtQfcu3BBtk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677638927; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=klkoOEYiLjCwPEMw+PE6EXEPDAYCAUIdZ4jSX5n/V7M=; b=OC+7GGbAIAfRIl0mXSTgYcxIR00jeuz15i66cdYdPK/XRUsAFAMjy1WsZsE1utG+pkmMBoBmtnNu0OGJVSKqNIvPpXW0nzvFF8OG9CBa+u4rhjB2DqdpaytL9e1kUnlrP3cD8Q6IW3jhLJtkrRDF9yhEVyt64FYk8+U+xodQ4vE= 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 1677638927376620.6763147015323; Tue, 28 Feb 2023 18:48:47 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pXCVP-0005Vj-NE; Tue, 28 Feb 2023 21:47:47 -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 1pXCVO-0005VL-PR for qemu-devel@nongnu.org; Tue, 28 Feb 2023 21:47:46 -0500 Received: from mail-pj1-x1044.google.com ([2607:f8b0:4864:20::1044]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pXCVM-0000gU-Nn for qemu-devel@nongnu.org; Tue, 28 Feb 2023 21:47:46 -0500 Received: by mail-pj1-x1044.google.com with SMTP id kb15so11916012pjb.1 for ; Tue, 28 Feb 2023 18:47:44 -0800 (PST) Received: from stoup.. (rrcs-173-198-77-218.west.biz.rr.com. [173.198.77.218]) by smtp.gmail.com with ESMTPSA id y18-20020aa78052000000b005a8aab9ae7esm6708449pfm.216.2023.02.28.18.47.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 18:47:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=klkoOEYiLjCwPEMw+PE6EXEPDAYCAUIdZ4jSX5n/V7M=; b=hzqa86M9GD8xKXJNevf8CmTN2vV9ErIVGW/qHgGJd8aiz7ipG2ipduMEsnmfLlfCOt kzsMjNLa3vPALmbvXQi4Il7FhP1at6M9B7uhx0oAkgmBiab41yc8foTnuUDhRSWZObs2 43MfEi5UfcoaRvMkeW+U4l/0IPU605ZSQGu4wDKm/SLhA2j9YIlqEMekpItZwmhZvhS9 rn22dO/UsP5RO3n+XpvTPLIz/wgz0vki1H9b66ifBS0R9mb3sfKhwBMr2tqXUvl/mPiK HGstcRtMK9gXZy1h8vRcRHR5IBpkApFFgZdn0xYBfW1H9vPdnVLDOWbsEuFY1nruAiFO deEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=klkoOEYiLjCwPEMw+PE6EXEPDAYCAUIdZ4jSX5n/V7M=; b=3bD09FU+f/O1t/++uDnz/snGriFl8tLeyUGKzhl5uAGQNIMjLGZQnybIDPPox9RCGo bsfu0QaPqNwzOmTG6iJgeHMhOsUWVqXCl6RMEUsycCzqCJgMnAyQJoX52g69JOvcQ80k dWqs8JeM/Nh2u66VhKkAI2yFGaXa5AKjv1hERvc1bMc32RiIDp2lBv1Q8Bxefa4NiUQZ /if0MOZRvsCF7p5JCT0HI6p+VAGaDXluaNOrNmsWDqTjmisyUOm8vQu1pc5g9VhKJDs3 kI9gWxem/+ejpbJcusoNyo3tMXCMXUguCvOszfj5o17qMSmfnddXvPfr/w4RxEbJXRHG 2qAQ== X-Gm-Message-State: AO0yUKWnM1PyiSvlpT/sLndvYXL3vJAnEbHi/ivVo/JN+6GEFLijAFd0 KdpylPg2W7ugpW2e/yuUymjQrh/KP/eo0plfpx76TQ== X-Google-Smtp-Source: AK7set/tM3E8OZbc3EIHC+1Qj6VhStLbtRXYMOwyYdCwJe/QqGFRxvYCTxmtz/AUwswEWJ2fZkUlEw== X-Received: by 2002:a05:6a20:3ca2:b0:cc:e0fb:a835 with SMTP id b34-20020a056a203ca200b000cce0fba835mr7389502pzj.47.1677638863129; Tue, 28 Feb 2023 18:47:43 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: cota@braap.org, alex.bennee@linaro.org, aaron@os.amperecomputing.com, frederic.petrot@univ-grenoble-alpes.fr Subject: [PATCH 1/2] tcg: Clear plugin_mem_cbs on TB exit Date: Tue, 28 Feb 2023 16:47:36 -1000 Message-Id: <20230301024737.1210851-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230301024737.1210851-1-richard.henderson@linaro.org> References: <20230301024737.1210851-1-richard.henderson@linaro.org> MIME-Version: 1.0 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=2607:f8b0:4864:20::1044; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1044.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 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: 1677638929676100007 Content-Type: text/plain; charset="utf-8" Do this in cpu_tb_exec (normal exit) and cpu_loop_exit (exception), adjacent to where we reset can_do_io. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1381 Signed-off-by: Richard Henderson --- accel/tcg/cpu-exec-common.c | 4 ++++ accel/tcg/cpu-exec.c | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/accel/tcg/cpu-exec-common.c b/accel/tcg/cpu-exec-common.c index c7bc8c6efa..e136b0843c 100644 --- a/accel/tcg/cpu-exec-common.c +++ b/accel/tcg/cpu-exec-common.c @@ -65,6 +65,10 @@ void cpu_loop_exit(CPUState *cpu) { /* Undo the setting in cpu_tb_exec. */ cpu->can_do_io =3D 1; +#ifdef CONFIG_PLUGIN + /* Undo any setting in generated code. */ + cpu->plugin_mem_cbs =3D NULL; +#endif siglongjmp(cpu->jmp_env, 1); } =20 diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 56aaf58b9d..2831fcafee 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -459,6 +459,9 @@ cpu_tb_exec(CPUState *cpu, TranslationBlock *itb, int *= tb_exit) qemu_thread_jit_execute(); ret =3D tcg_qemu_tb_exec(env, tb_ptr); cpu->can_do_io =3D 1; +#ifdef CONFIG_PLUGIN + cpu->plugin_mem_cbs =3D NULL; +#endif /* * TODO: Delay swapping back to the read-write region of the TB * until we actually need to modify the TB. The read-only copy, @@ -526,7 +529,6 @@ static void cpu_exec_exit(CPUState *cpu) if (cc->tcg_ops->cpu_exec_exit) { cc->tcg_ops->cpu_exec_exit(cpu); } - QEMU_PLUGIN_ASSERT(cpu->plugin_mem_cbs =3D=3D NULL); } =20 void cpu_exec_step_atomic(CPUState *cpu) @@ -1004,7 +1006,6 @@ cpu_exec_loop(CPUState *cpu, SyncClocks *sc) =20 cpu_loop_exec_tb(cpu, tb, pc, &last_tb, &tb_exit); =20 - QEMU_PLUGIN_ASSERT(cpu->plugin_mem_cbs =3D=3D NULL); /* Try to align the host and virtual clocks if the guest is in advance */ align_clocks(sc, cpu); --=20 2.34.1 From nobody Fri May 17 07:56:13 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=1677638927; cv=none; d=zohomail.com; s=zohoarc; b=M3jyNbWv1FHiTGLvxon3heu0nAhXety8vuhe7N2xwfdGgLJHKL1gsgiGHORbnxaYGGS43c6mi8Pn+lEGWvXNUC7gcHpZWtjSY/UoU11Gpkpxfq8EFfwnhGK4qBt1i0zfWEWyq/qTDBIIJ7a+XAYii+gRI6cYdSvfJTSnogBNX9g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677638927; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=XJhvkoLDc/4Ng5JbPEdzxnJevo2RvOeeg5n87qn4/tg=; b=XruMz4ulBbnaigSMpbklrjaIQ4yQ9Cg51oDH2g2E2JsIQxecYeBLeBCqVxPuJTnKRwg/SAmwr/OfZ/IgMunIm8kevG39gxqFfzhRf381FiiiATgVBovKw7LbykolA9RjKPnqt/Uqyi7DfReGfIqGzWT6AQBTTAvqDfSYRew0uJY= 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 167763892737082.44537299339981; Tue, 28 Feb 2023 18:48:47 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pXCVR-0005WQ-AX; Tue, 28 Feb 2023 21:47: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 1pXCVQ-0005Vy-2M for qemu-devel@nongnu.org; Tue, 28 Feb 2023 21:47:48 -0500 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pXCVO-0000gt-HL for qemu-devel@nongnu.org; Tue, 28 Feb 2023 21:47:47 -0500 Received: by mail-pg1-x530.google.com with SMTP id q23so6899663pgt.7 for ; Tue, 28 Feb 2023 18:47:46 -0800 (PST) Received: from stoup.. (rrcs-173-198-77-218.west.biz.rr.com. [173.198.77.218]) by smtp.gmail.com with ESMTPSA id y18-20020aa78052000000b005a8aab9ae7esm6708449pfm.216.2023.02.28.18.47.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 18:47:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; 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=XJhvkoLDc/4Ng5JbPEdzxnJevo2RvOeeg5n87qn4/tg=; b=EcHtgWPHsqPX0gnaJMsavzjj0soFFobJjplUK8Ntn0cBPIeXpbnuABfo40WY3Jp4nF 4VhoPJ8IjtcqCHcW0N3H5MWHnBiByTPln+XV7Rtu46eDyWtcU0Y1rBiwgsDfmXS2p4ul nUfakdwygd96QUrM8tmWafRNpG1WsLzFwwxAZXt58EMjSmCSckTS4aQkBdT/gnRJ69Tu pebB/YSKGqI81/Le+XgyIfuqyRUAlNYrbZOc7UQk54OESCMeY3isndnVinzdm2/6tfPS U/XztOce1TEyWl5kURdPfkqJy4atwNVqxl89iXzan+DaY/cYbHQC+MuyPPIgu9CDOrg4 dKig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=XJhvkoLDc/4Ng5JbPEdzxnJevo2RvOeeg5n87qn4/tg=; b=PZo0Hktg35r/x5MmW59z+R+GkgFiblB0d82wkSZ5uDYyqdD/qFzy2U8jiTfRT+YHmq Mp0wJLLps25Ay8TJH4sSFDLGQf3eU5URAPoo1wygUd48vpClLcfFaeswmTxFnwOfiOHR H7pY4FdbyzKqRW5zwUT3HJ88euDAqVpxWULsZkrHEtyjgvS1u9pp9CQysTj1yhN2LDTh Z/TGzgmtq3TDffBq3Fv2NHrJ1dWzj8mvqmCoiOS8aKuCw4yc0Hj/IZGajuHiMqGBHMMl zFguE2yZO1oGgFLHIUFAE9/NEaKp/Ra7O0ZIvqzSpVdHrgIViZs1KlgLFu5EJqcgUf0L BkoQ== X-Gm-Message-State: AO0yUKX7iARhTo+X0QSiAeyiv+ddy/unwPqq+kOv0v3EsQsgj7FE0aGQ hHFrIynowV6krAgGy2M3YtHwj9u7m3lGICJGK9o= X-Google-Smtp-Source: AK7set+n82YKSdUHNUMxfBjPD1Q/0QSChGPbt6dSy6HqsN0y2T+ePGy/Xh+N9H1CEySw2b2uWd+sGw== X-Received: by 2002:aa7:9a4a:0:b0:5f1:f57a:b0c3 with SMTP id x10-20020aa79a4a000000b005f1f57ab0c3mr4864455pfj.5.1677638865096; Tue, 28 Feb 2023 18:47:45 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: cota@braap.org, alex.bennee@linaro.org, aaron@os.amperecomputing.com, frederic.petrot@univ-grenoble-alpes.fr Subject: [PATCH 2/2] include/qemu/plugin: Remove QEMU_PLUGIN_ASSERT Date: Tue, 28 Feb 2023 16:47:37 -1000 Message-Id: <20230301024737.1210851-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230301024737.1210851-1-richard.henderson@linaro.org> References: <20230301024737.1210851-1-richard.henderson@linaro.org> MIME-Version: 1.0 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=2607:f8b0:4864:20::530; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x530.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 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: 1677638929668100005 Content-Type: text/plain; charset="utf-8" This macro is no longer used. Signed-off-by: Richard Henderson --- include/qemu/plugin.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/include/qemu/plugin.h b/include/qemu/plugin.h index fb338ba576..e0ebedef84 100644 --- a/include/qemu/plugin.h +++ b/include/qemu/plugin.h @@ -59,8 +59,6 @@ get_plugin_meminfo_rw(qemu_plugin_meminfo_t i) #ifdef CONFIG_PLUGIN extern QemuOptsList qemu_plugin_opts; =20 -#define QEMU_PLUGIN_ASSERT(cond) g_assert(cond) - static inline void qemu_plugin_add_opts(void) { qemu_add_opts(&qemu_plugin_opts); @@ -252,8 +250,6 @@ void qemu_plugin_user_postfork(bool is_child); =20 #else /* !CONFIG_PLUGIN */ =20 -#define QEMU_PLUGIN_ASSERT(cond) - static inline void qemu_plugin_add_opts(void) { } =20 --=20 2.34.1