From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F3A64C7618D for ; Wed, 15 Mar 2023 17:46:43 +0000 (UTC) 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-Google-Smtp-Source: AK7set+F7IXs/0idLlAovaPXV7OJdOVRa0JLhKBiYEEMAQS8mDFX70ypvRshcVMN2d5WUxCmoyXaKQ== 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=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Akihiko Odaki , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , 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=20Le=20Goater?= , 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=20Mathieu-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?Alex=20Benn=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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.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; -- 2.39.2