From patchwork Wed Mar 15 17:43:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 663375 Delivered-To: patch@linaro.org Received: by 2002:a5d:5602:0:0:0:0:0 with SMTP id l2csp1714668wrv; Wed, 15 Mar 2023 10:46:44 -0700 (PDT) X-Google-Smtp-Source: AK7set8ZqXVa8PQRW9Rn3x+mFuw1759bKCK7MiytrIt1RojFP905GKKh0d53U21dpHEkGGWBoeQ6 X-Received: by 2002:ac8:5cce:0:b0:3bf:c04a:8d47 with SMTP id s14-20020ac85cce000000b003bfc04a8d47mr1543931qta.18.1678902403996; Wed, 15 Mar 2023 10:46:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678902403; cv=none; d=google.com; s=arc-20160816; b=l58l1rNrR3mqkk1mLI+ktnoH7ToHseDuG6kXBKLmSJGRwam9gCR3/chSBwzAp/ucUn uOQweHnOvOokterDJAze9MWH1Catsv08vByeTg9mFtF5PuCh5u3J5BwdxKe6VTTVUMrr n0KYT/JrBUtf2bd1Mh0Bm4E4LLMqxItEMPtLcjKOVOvSM9ZTK+NcYl/f6+L92dvJhwRF Xl2vFoaI2MjdL9odf3KEWeAKHzPuN0IrQauMYC897MaCphTqnEGkNqw3ZaCMekY0CSKh JXRd4Zci1SvUayR7VngORJVqX7PR7vwMvdsOR2Uu/TrBBAp83LkvLRq2r9xxErbH3yJh hU/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=UVMGZ9W+Y+8un4w4HSts32m5VZ1Mq2mPxSxu1YHDmSY=; b=yuQwL1HwAkqGd8GQOxft6wll20f/0C0tLmb+LTqBeGRMphp5laIHCsNDcGlFr/LaU+ msqqoZkRMCLNmFa3u4YhlgVjp6QrVT7gXh1CjLy/yihbVSAJXAlsnqGRL2DpyrEmmGnw vrS4ldHwGAxvTztbhYU3Ty5lTeVgnUcUFGxN853QtnhUbKtN8VjVGjOkMLGYbiQaLmEO FHAPE9fquVTh2xu4cDQWUiNK/Ytfk1RRm+8R+FRgFqiB13eNccGC75kB52udEEjZE+xN SEdKHUZaWK8aKFp0KRt9f5FfHb1pijb1ZVPSe2XzsqLqv+T5OHWSzOA5tMnivg7rxiSG cArg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="X/6TnPJT"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id p11-20020ae9f30b000000b00728578b7527si4326056qkg.528.2023.03.15.10.46.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Mar 2023 10:46:43 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="X/6TnPJT"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pcVAS-0002QZ-F0; Wed, 15 Mar 2023 13:44:04 -0400 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 1pcVAO-0002MJ-Jo for qemu-devel@nongnu.org; Wed, 15 Mar 2023 13:44:00 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pcVAA-0000bF-VD for qemu-devel@nongnu.org; Wed, 15 Mar 2023 13:44:00 -0400 Received: by mail-wr1-x434.google.com with SMTP id m2so5282553wrh.6 for ; Wed, 15 Mar 2023 10:43:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678902225; 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=UVMGZ9W+Y+8un4w4HSts32m5VZ1Mq2mPxSxu1YHDmSY=; b=X/6TnPJT6tqTp8EMSaOU8VaZjDmCUXTULuB0vNEzfzgPxpnVgqWPTa6PXxP3yGbYx4 Vc7nVRjfam/KU+VrTGF/gzOqSPOYnvq/AhcN2KyGjMktpgXD8da2wHwYpuKSavipbSoV S2ie8EDVfHIhao5VhCIflW2KM5UNrnSpdMJ7W+mej+yVQcOS7le/MwL6Fzs89gCVfrNL 82LzZVGb67x7RwufXHGwizCn8VXBa6F5RdqRD3N6t4OtWZ3VDChYx2WMlk/kza4ooRHV vPz6ZGN9U8vdj+uAFLVoggn2+wKvFxFicMJOMtUhXlmvIfqMvHecMKxry0QaN2lNqoXl uwfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678902225; 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=UVMGZ9W+Y+8un4w4HSts32m5VZ1Mq2mPxSxu1YHDmSY=; b=2Ajb2E6WH8Avwv5mI5sGQq8wofeqLI3Jk1kfWV+Iw2EicZg5RHL3SVzpk4/TM7tNNv 5ClCFnCU/+7s0wsrV8N6rszOtgDJ3HeiXz2ALkNCNLb8j4WNVc7SCkCA5Vsn4+ZfKiqx O7KxGRmbkxy3uYpY0DRFxJ8QLRIugM/eRem8MjtcNRea6bDhqP8HKlRAflZidGTEtWVb +eaoawHB9yXW+WzbRgBOPi4jC06g1yzjSRaijF1889qfxtbM64WzTw3Wa9WaYpSn6XUz QGuNN0411T0xSFxbjv6/NVcbRrY7tv7d7WZwqPRmfesbumfd14aMYrkCqwAcJNVnW7U+ O0Ag== X-Gm-Message-State: AO0yUKW31cU9FevXFAJX6salbJtJGZYmABQmF1LvbXYQhwBj3Nqcx0id xK/mbmFyG48RywEI5PH/YIi9Ww== X-Received: by 2002:a05:6000:1b86:b0:2c5:594f:121d with SMTP id r6-20020a0560001b8600b002c5594f121dmr2713217wru.12.1678902225527; Wed, 15 Mar 2023 10:43:45 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id h3-20020a1ccc03000000b003eb192787bfsm2556244wmb.25.2023.03.15.10.43.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Mar 2023 10:43:45 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 8D4BF1FFC9; Wed, 15 Mar 2023 17:43:43 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Akihiko Odaki , =?utf-8?q?Marc-Andr=C3=A9_Lurea?= =?utf-8?q?u?= , qemu-riscv@nongnu.org, Riku Voipio , Igor Mammedov , Xiao Guangrong , Thomas Huth , Wainer dos Santos Moschetta , "Dr. David Alan Gilbert" , Alex Williamson , Hao Wu , Cleber Rosa , Daniel Henrique Barboza , Jan Kiszka , Aurelien Jarno , qemu-arm@nongnu.org, Marcelo Tosatti , Eduardo Habkost , Alexandre Iooss , Gerd Hoffmann , Palmer Dabbelt , Ilya Leoshkevich , qemu-ppc@nongnu.org, Juan Quintela , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Darren Kenny , kvm@vger.kernel.org, Marcel Apfelbaum , Peter Maydell , Richard Henderson , Stafford Horne , Weiwei Li , Sunil V L , Stefan Hajnoczi , Thomas Huth , Vijai Kumar K , Liu Zhiwei , David Gibson , Song Gao , Paolo Bonzini , "Michael S. Tsirkin" , Niek Linnenbank , Greg Kurz , Laurent Vivier , Qiuhao Li , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Xiaojuan Yang , Mahmoud Mandour , Alexander Bulekov , Jiaxun Yang , qemu-block@nongnu.org, Yanan Wang , David Woodhouse , qemu-s390x@nongnu.org, Strahinja Jankovic , Bandan Das , Alistair Francis , Aleksandar Rikalo , Tyrone Ting , Kevin Wolf , David Hildenbrand , Beraldo Leal , Beniamino Galvani , Paul Durrant , Bin Meng , Sunil Muthuswamy , Hanna Reitz , Peter Xu , =?utf-8?q?Al?= =?utf-8?q?ex_Benn=C3=A9e?= Subject: [PATCH v2 17/32] include/qemu/plugin: Inline qemu_plugin_disable_mem_helpers Date: Wed, 15 Mar 2023 17:43:16 +0000 Message-Id: <20230315174331.2959-18-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230315174331.2959-1-alex.bennee@linaro.org> References: <20230315174331.2959-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x434.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=unavailable 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson Now that we've broken the include loop with cpu.h, we can bring this inline. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20230310195252.210956-8-richard.henderson@linaro.org> Signed-off-by: Alex Bennée --- include/qemu/plugin.h | 6 +++++- plugins/core.c | 11 ----------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/include/qemu/plugin.h b/include/qemu/plugin.h index 6bf4bce188..bc0781cab8 100644 --- a/include/qemu/plugin.h +++ b/include/qemu/plugin.h @@ -14,6 +14,7 @@ #include "qemu/option.h" #include "qemu/plugin-event.h" #include "exec/memopidx.h" +#include "hw/core/cpu.h" /* * Option parsing/processing. @@ -204,7 +205,10 @@ void qemu_plugin_atexit_cb(void); void qemu_plugin_add_dyn_cb_arr(GArray *arr); -void qemu_plugin_disable_mem_helpers(CPUState *cpu); +static inline void qemu_plugin_disable_mem_helpers(CPUState *cpu) +{ + cpu->plugin_mem_cbs = NULL; +} /** * qemu_plugin_user_exit(): clean-up callbacks before calling exit callbacks diff --git a/plugins/core.c b/plugins/core.c index 04632886b9..9912f2cfdb 100644 --- a/plugins/core.c +++ b/plugins/core.c @@ -553,17 +553,6 @@ void qemu_plugin_user_postfork(bool is_child) } } - -/* - * Call this function after longjmp'ing to the main loop. It's possible that the - * last instruction of a TB might have used helpers, and therefore the - * "disable" instruction will never execute because it ended up as dead code. - */ -void qemu_plugin_disable_mem_helpers(CPUState *cpu) -{ - cpu->plugin_mem_cbs = NULL; -} - static bool plugin_dyn_cb_arr_cmp(const void *ap, const void *bp) { return ap == bp;