From patchwork Mon Apr 29 21:30:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 793024 Delivered-To: patch@linaro.org Received: by 2002:adf:ec83:0:b0:34d:5089:5a9e with SMTP id z3csp317500wrn; Mon, 29 Apr 2024 14:31:38 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUDIaJTuqP7sW8RjPZT37Q3hKlaitY/TuKe2EetlRAXBq8zGzMqvF7Us8aJrqIyc45mu42FuvAV56gkYoxTL7am X-Google-Smtp-Source: AGHT+IFoU4tWjV+AP+FdJ2fwxR7zo0e3jlLjXWn7N4ZyNH9KrdxTqdzmWYCa6f27WM8Xal3uI5pu X-Received: by 2002:a05:6214:240b:b0:6a0:ce18:e81d with SMTP id fv11-20020a056214240b00b006a0ce18e81dmr6377749qvb.15.1714426298530; Mon, 29 Apr 2024 14:31:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714426298; cv=none; d=google.com; s=arc-20160816; b=jt7Ikp5YDR5/Yw2O1Eik38pStIpgIeMbbqufIpVQ/Wdz6a1YHEhchWPh4cSXjQzaim YRj0kTybn2SugSWmhBrOX62ajvwcK38eKbU1AwtJoyouPqIvtKCSAS0hPkA+Mt9qvw47 pNuti4pOikD9gzSzUtDx7rUSu46Wy14158df0V6PpEUgzcgDnEwBBjaPeOsDD2jOu715 E+kE8xRnJk6FsmgsXz3eexhyFrmOzSGzgK3RcLbZ7ZeyggjzulKKKUeD/OkkjmokmSVW Nj5U2c/lxrwDd7jcesx/wOIJgCq4j24TAevBmeb5I/p/LWJHuUlEqxjdPAMR1VVkONKZ eBHw== 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=LHXjfEM2X45SFa7lWghHiE4FHLgxWSVxN2s67mkwDws=; fh=hPEYkGzCDPyP/3ZkGHLTHhyYbPfmxEKmvnAkP1JYmAU=; b=aOYDvjfBpgFtDUnkvcEATlFvm4ToawVDMRP1/WoNL3CFZ8ns0QWeESql7yTRb4f7AY NkNgqf0pKEZOWRMwK9DHAgdfzSjatfgG6EQPW0rskMzXPxtR03IR1+eq9GJfDSyzlN6R NhlEamuyq9rc6Tt3S0OzPZ2ANb1eugmiGvVa8tbQ7CTMhNRUiriUxmufI3cyz5zFA4Gh G3kTO3avM0ZjAIwiFWdM4SOOyz8swYa0olJKAkuX4Nd/TomhN3kmrKee8LVfxCLP/BMV 3BSpsJ4f2pcGQSM7q+MoUcU1tgWyBngIjUYYLapkpG1WlahFAPtUQrUZhprSA02Nqfy+ JYmA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=rTNzqyOw; 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 a38-20020a05620a43a600b00790c2ccd287si7712916qkp.449.2024.04.29.14.31.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 29 Apr 2024 14:31:38 -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=rTNzqyOw; 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 1s1YaY-000741-DL; Mon, 29 Apr 2024 17:31:06 -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 1s1YaT-00073q-Mu for qemu-devel@nongnu.org; Mon, 29 Apr 2024 17:31:01 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s1YaS-0003J2-1y for qemu-devel@nongnu.org; Mon, 29 Apr 2024 17:31:01 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-41a1d2a7b81so34337405e9.0 for ; Mon, 29 Apr 2024 14:30:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714426258; x=1715031058; 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=LHXjfEM2X45SFa7lWghHiE4FHLgxWSVxN2s67mkwDws=; b=rTNzqyOwA+JTel4VceyNXkVYa8q+BWHfOMLKG32Z0Nbx6OOnnwxCUDzmppDf89HCPR KSATUy46EJbh+Sc6go+I/2PW5GlWBjEuxYlS10eGYyQiIIkEHOhh8VZ3tkCTBVoP48wN TX2PoYtq8P1C6CB0uzN8M4w+RRAYcN2MYn5MmP1DvksXWEgg9LRMq2pL6RCSSlazpRX2 grrxrXSHgtxRNoB3DxUqsY0v9N5WzUAFCB891nLf/WaRF+s4e2TiqLmrHCZmDqZ045JC 7lNTQsa1PcF1eF6xTDhlS/mFQLh/WoJkkH+29yity2/7BW5QhvM3OW5++Vb5Y5USSW2Z tG8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714426258; x=1715031058; 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=LHXjfEM2X45SFa7lWghHiE4FHLgxWSVxN2s67mkwDws=; b=mUPVPiTNBnFm3HgP+hk2tURz0jnYktjARcNapeBooJsEql+mnLAK5mebVwtmYzbID7 b7YgloiLwdaJDnaHhews4oG0AWconbH76AUd/00kIVCN7J1SgNm5LThZgE+6p+kETPz4 5dahcuO3pI5fxDg16VITDIGJDOtu7bOqSxDHjTBNIcRp/U+91BeuVnXOsGtsOCxj//1m sojgVtrgCwQSaNu1ctu+QUmWVdFSdT+0iagGgm6Q01xqaNaGCUoHN3Gi4pdl3UUqmabb Ki0s0P0COect3/hrLrakUVKfMZd/u9huVfWzjSbK8PVw1DItk2O8sYLmspIM1D5h79Bc i79A== X-Gm-Message-State: AOJu0YxjLrLTu4hhKcX8oOYKlTL1aR09sr/ROaYiYKpAA46xqmBXJImO zCDvXP4MlWSeabEK4owTPV77frydTXttfoiuGOB8usQd5d06ezOLYNDP6IxpNFC60gSAi9UxgLU XbRs= X-Received: by 2002:a05:600c:19c9:b0:41b:f30a:4221 with SMTP id u9-20020a05600c19c900b0041bf30a4221mr821987wmq.15.1714426258171; Mon, 29 Apr 2024 14:30:58 -0700 (PDT) Received: from m1x-phil.lan (bny92-h02-176-184-44-142.dsl.sta.abo.bbox.fr. [176.184.44.142]) by smtp.gmail.com with ESMTPSA id z6-20020adff1c6000000b00343ad4bca7dsm30431276wro.85.2024.04.29.14.30.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 29 Apr 2024 14:30:57 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Anton Johansson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH v2 01/13] accel/tcg: Restrict qemu_plugin_vcpu_exit_hook() to TCG plugins Date: Mon, 29 Apr 2024 23:30:38 +0200 Message-ID: <20240429213050.55177-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240429213050.55177-1-philmd@linaro.org> References: <20240429213050.55177-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org qemu_plugin_vcpu_exit_hook() is specific to TCG plugins, so must be restricted to it in cpu_common_unrealizefn(), similarly to how qemu_plugin_create_vcpu_state() is restricted in the cpu_common_realizefn() counterpart. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/core/cpu-common.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index cbafc79033..f2826d0409 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -30,7 +30,9 @@ #include "hw/boards.h" #include "hw/qdev-properties.h" #include "trace.h" +#ifdef CONFIG_PLUGIN #include "qemu/plugin.h" +#endif CPUState *cpu_by_arch_id(int64_t id) { @@ -226,9 +228,11 @@ static void cpu_common_unrealizefn(DeviceState *dev) CPUState *cpu = CPU(dev); /* Call the plugin hook before clearing the cpu is fully unrealized */ +#ifdef CONFIG_PLUGIN if (tcg_enabled()) { qemu_plugin_vcpu_exit_hook(cpu); } +#endif /* NOTE: latest generic point before the cpu is fully unrealized */ cpu_exec_unrealizefn(cpu);