From patchwork Mon May 6 12:37:11 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: 794998 Delivered-To: patch@linaro.org Received: by 2002:adf:a453:0:b0:34e:ceec:bfcd with SMTP id e19csp901314wra; Mon, 6 May 2024 05:39:15 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUFL11eEIjh3fnnurTcHKC3duYJ96grebgm8MUTq9zMBBt6c7A0yRrxZYHVRbUm0QS8vWaIMYqHDvlq3xxiwMMe X-Google-Smtp-Source: AGHT+IGdQtdxmNOU+YggNcmA8r6YnqXADk6E7OJoqP4scjbmpQfLK7Rw08mippTkWS+brd9Cuz2p X-Received: by 2002:a05:620a:56c9:b0:792:92e4:df55 with SMTP id wh9-20020a05620a56c900b0079292e4df55mr4619419qkn.21.1714999155421; Mon, 06 May 2024 05:39:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714999155; cv=none; d=google.com; s=arc-20160816; b=Vv7aOcC7336VzJrZCTQ6BAjlaHnAl6Tij+2odNjaBCb4g7y5YzZ6yVdR5E0VGp3BJ9 cUjv8u4w+D8+G2ZcOJp3Y4nEmgaUFv80PknqvxN78UZC6N9mT4WFUwXqMMfrMkgwxsDx LX/yFGUnNKMfkc3dWkwRUl35cC67MUx+V5AjKQWjs1X6Oq/pPdci9DlhhKkanjsEj9Ye a+JVdpeuOZ+ZVQOqyEvYfux/ZcgI3lr6i2Z6HjqK2GWa1Az95/bfXjNOmBhchrXSnRGl RyDfCBaYWBCxSe9OUQ9VmVk3vdw8b1TK+MB2fiwXL0g+HwNA3dP+AP1pfDwJ1Gfy1ojT Rg9Q== 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=MWoGQoSIt5HJcg/7P1ISVDqkVosvqIqVP9M622YHe5M=; fh=qtn8prgQtzf5IzCNvLChUZDElvNECP6ej9YfjQeBz3I=; b=lE9UUd+jaWs/WR0EPQf4jf893VQnV9uHYR4pFI7xiBr3BmnM+nOsX51EtJxUCE2hx/ +ySP3TlbL4dwts5qUCVFBqsFIZ1Xnj9FizHlKWTA/WBIeHIXPF5i/jfypCGihBKp0lrw gWT8yHMHvMQSpJX6SSF05ZE4yVFwrQUw3NXsLA7Jj1hSS4zq676kR8c3d5LqLRRPgnLe s0STSpTcrTAJcblpqmbQ7lOR0YKn+hAeV0JKnaPvRf7ptEVRNA/grAD58phnwlpNLPNZ fVZ6GFgc9dWzGJaxXm/lsSLql3lPS18jfUSHGoh1svKJZm2aAE1kpr31m3iazkuHsqbZ MiXg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=La5yRQyh; 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 z24-20020ae9c118000000b007925dc7384dsi8703568qki.721.2024.05.06.05.39.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 May 2024 05:39:15 -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=La5yRQyh; 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 1s3xcW-0002S4-Q7; Mon, 06 May 2024 08:39: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 1s3xcN-00029j-KG for qemu-devel@nongnu.org; Mon, 06 May 2024 08:38:56 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s3xcL-00024R-Vo for qemu-devel@nongnu.org; Mon, 06 May 2024 08:38:55 -0400 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-41b782405bbso12299285e9.1 for ; Mon, 06 May 2024 05:38:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714999132; x=1715603932; 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=MWoGQoSIt5HJcg/7P1ISVDqkVosvqIqVP9M622YHe5M=; b=La5yRQyhNUHvqYbzCjBpMDsFjxSRZPmpWiajSsN81nP6qxvifdVoRGcbv6z/sdTVAY eGGc+O2eZSgY8jzMkifpRodc0nvVPZPcsMgw4Ec+v4HK0Gt8sijz9YcUQYaZv7f3oDNz 1qKPxkJXpAPL/6i2g7+kGJ2Ehr1nwuh78EZr4sYfb6tChbaEQTUCeg21Y+kZRDT3ccb5 36TrFx7ZIx9J2yz8HJQAtWfg9P15Wn5/0g+eqUim4ogysYjVwUwwict4l7SM9Bx84/AJ ltXrISwLwGXuEY7CFmsiQim0lNZqb9eSYyjAAQAH/9CMFiUA9yRJ7O4/Opa4QOv8905G 6IDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714999132; x=1715603932; 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=MWoGQoSIt5HJcg/7P1ISVDqkVosvqIqVP9M622YHe5M=; b=Oalgnxa5Mbwb9qRsqWSD0EHQrPhAVonRiReLVsE3CrpGbLtKwTIQYL4HKBDlWVMgo4 bwLw0bK1dWPFODB8xt9JovZ1pG+V3Hac/MIa6HKpIfs9DKFeR7bGhsPHQXWPm5CNiopH uTE+CuCOyPESAZSSGg9i1yRs2ZobfNKJKqE6Vbc3N1sN6G1Z+TnQeHc5WDy4UktXh0wl jtMOzyQX0OFpCzJdgB5wimYf2vkIFuTZPgzaFEwSZjRtI3ovE/I8mSMdsadkwGpm10G+ nlnKemQdpowBZ5tRgVQ87f9WaQvL5sMWtDJgCQOiee2TnDUVT7EMOmIF0G3/ydcl4GMY WqUA== X-Gm-Message-State: AOJu0YwK4PtLWNWcW0aJPPdu0WtfD1sBnKdjSkMvkbK9lAQ5c6IOC3B/ X8y7DRG7be+88HwCbkZyPEujUpanOqDNtq8d9ecLP2XCQBB+CkLF+2GSb4YxuPGZ8CiEjEc06XD i X-Received: by 2002:a05:600c:46ce:b0:41b:851a:af43 with SMTP id q14-20020a05600c46ce00b0041b851aaf43mr7683963wmo.11.1714999131824; Mon, 06 May 2024 05:38:51 -0700 (PDT) Received: from m1x-phil.lan ([176.187.211.4]) by smtp.gmail.com with ESMTPSA id v6-20020a5d6106000000b0034d743eb8dfsm10598284wrt.29.2024.05.06.05.38.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 06 May 2024 05:38:51 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson Subject: [PULL 11/28] accel/tcg: Restrict cpu_plugin_mem_cbs_enabled() to TCG Date: Mon, 6 May 2024 14:37:11 +0200 Message-ID: <20240506123728.65278-12-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240506123728.65278-1-philmd@linaro.org> References: <20240506123728.65278-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.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 So far cpu_plugin_mem_cbs_enabled() is only called from TCG, so reduce it to accel/tcg/. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <5f59c754-44e5-4743-a2dd-87ef8e13eadf@linaro.org> --- accel/tcg/internal-common.h | 17 +++++++++++++++++ include/hw/core/cpu.h | 17 ----------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/accel/tcg/internal-common.h b/accel/tcg/internal-common.h index ead53cb8a5..cbeff39e3e 100644 --- a/accel/tcg/internal-common.h +++ b/accel/tcg/internal-common.h @@ -24,4 +24,21 @@ static inline bool cpu_in_serial_context(CPUState *cs) return !tcg_cflags_has(cs, CF_PARALLEL) || cpu_in_exclusive_context(cs); } +/** + * cpu_plugin_mem_cbs_enabled() - are plugin memory callbacks enabled? + * @cs: CPUState pointer + * + * The memory callbacks are installed if a plugin has instrumented an + * instruction for memory. This can be useful to know if you want to + * force a slow path for a series of memory accesses. + */ +static inline bool cpu_plugin_mem_cbs_enabled(const CPUState *cpu) +{ +#ifdef CONFIG_PLUGIN + return !!cpu->plugin_mem_cbs; +#else + return false; +#endif +} + #endif diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 173349b0bd..a001bafcf8 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -1111,23 +1111,6 @@ void cpu_watchpoint_remove_by_ref(CPUState *cpu, CPUWatchpoint *watchpoint); void cpu_watchpoint_remove_all(CPUState *cpu, int mask); #endif -/** - * cpu_plugin_mem_cbs_enabled() - are plugin memory callbacks enabled? - * @cs: CPUState pointer - * - * The memory callbacks are installed if a plugin has instrumented an - * instruction for memory. This can be useful to know if you want to - * force a slow path for a series of memory accesses. - */ -static inline bool cpu_plugin_mem_cbs_enabled(const CPUState *cpu) -{ -#ifdef CONFIG_PLUGIN - return !!cpu->plugin_mem_cbs; -#else - return false; -#endif -} - /** * cpu_get_address_space: * @cpu: CPU to get address space from