From patchwork Tue Feb 25 11:08:35 2025 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: 13989830 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 30709C021B6 for ; Tue, 25 Feb 2025 11:10:49 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tmsoU-0001fV-G2; Tue, 25 Feb 2025 06:09:22 -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 1tmsnx-0001XY-Ae for qemu-devel@nongnu.org; Tue, 25 Feb 2025 06:08:50 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tmsnv-0007kI-OZ for qemu-devel@nongnu.org; Tue, 25 Feb 2025 06:08:49 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-4399deda38cso33192155e9.1 for ; Tue, 25 Feb 2025 03:08:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1740481725; x=1741086525; 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=cXGP6wzkZErmn2F04TQmNlmyR3CeFAZYW4eH79gDg7o=; b=YuWHG7bvBaWPqP7QT3rkvU/Zv6mmG8v5HygVj3dPKRlKn05E/yUZECzsIzhTbfeGhz WAMykDpiYRK15O11cQkhXgaW2lOIcmWsIccXFp9lswMJ5hPMyLjPHSh1SYQbQRl73Z0H yPmTDEcZ2k81oIG1rzGaq02lZ0DMy6OEtABDZp/K0axp/3VO16IQeeAtuOR9ZbgYgaFd zHhO47l16HU/Syzyrv0QZv8pqZ5JmH1GqKk8W28mYFgBTGA07VF1j1f8bSyviJFIa9vJ OZ99/KrmfLqBaieNTcQdenRyMtIuCTRbecoerfeV5Mwv8CmBjNzDUt1hcoXbbF7XoQKo C8Dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740481725; x=1741086525; 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=cXGP6wzkZErmn2F04TQmNlmyR3CeFAZYW4eH79gDg7o=; b=doNRiU2+f7BSDVenPFDR2I6KcF2POaOZZRh+F/HB0+btHExw/xvPZ4/ZI7oBfh1Fvr 1uYIiSmGpvt1/0liZE5CULO9Mg8e0FuOA99CiKBMMbaIz8cI7W7/DvPc9dHP5EpVsz0Z H4eUzqR5j1RgCWgvUjcR55evkrTtWqG8G6SZ2wbZ+x1qkq35Fi+F4PYKJZzSIj54d5bl JmgOmSYgcCh1imCinv6BiKElvcjlk4frWz+TQNONc7Udu/RPROOaETsVlPbSNN2pB1D3 Ej4uJgJbESIVGnGEk8Zk+oToE3dqMd8dutEuyp6zlsW0tnOdITUBXjd5Iqf1evqiVN44 Q9WQ== X-Gm-Message-State: AOJu0YzhBzlgSsEX97sNWcHNpcaM6Gi7E+Txw5CynqIvYjKnEQZ4+s85 /nzvhaQSE5/zmTauRaDlZlJ+gcXNEL2YHwK0K7LnCrr9V6+s6L29FEfvynXqWE8= X-Gm-Gg: ASbGncvqfvJB/yPfgYic0JuZ4IZUKG/L6L70Xpx/ak3bkc3jG2LjwA6QoiftF9xFKpq hBRej/hzS3cxVjat7Qajj/BLoEmJsTATBqqRLr+Eo0ZOlvGpApPWjtTvrMLNCsvTvUoCduSDrVw 8mMgtA2LD0J3KrwH0E1ssb6qNgSjX7a/tx1CVQfi8tvKRNIab+O3r+MQtFtmM+n3z0raiZt553O 8jGFWnbEWFAJt8VGfcDFhmgVdg1qSZpJCavT9x53tV3OeBGDNIfTqGLq1R7xXKVw4eXi83urHQu fCvak0u4Uwth0mn68rc5RlYtQ3tP X-Google-Smtp-Source: AGHT+IGsy/RqBFd06tETCtxhAw5hpQRYwExwI8EikFRM0h/sw6AoS/YvKex7xdT3HiD0yC4o1cgPNg== X-Received: by 2002:a05:600c:4753:b0:439:9a28:9e8d with SMTP id 5b1f17b1804b1-43ab0f313a0mr24678915e9.12.1740481725626; Tue, 25 Feb 2025 03:08:45 -0800 (PST) Received: from draig.lan ([185.126.160.109]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-439b02ce65dsm136562215e9.1.2025.02.25.03.08.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Feb 2025 03:08:44 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 41A355F9D0; Tue, 25 Feb 2025 11:08:44 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Laurent Vivier , Pierrick Bouvier , Alexandre Iooss , Mahmoud Mandour Subject: [PATCH 01/10] plugins/api: use tcg_ctx to get TARGET_PAGE_MASK Date: Tue, 25 Feb 2025 11:08:35 +0000 Message-Id: <20250225110844.3296991-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250225110844.3296991-1-alex.bennee@linaro.org> References: <20250225110844.3296991-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 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, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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 Requiring TARGET_PAGE_MASK to be defined gets in the way of building this unit once. As tcg_ctx has the value lets use it. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé --- plugins/api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/api.c b/plugins/api.c index cf8cdf076a..10b258b08d 100644 --- a/plugins/api.c +++ b/plugins/api.c @@ -287,7 +287,7 @@ uint64_t qemu_plugin_insn_vaddr(const struct qemu_plugin_insn *insn) void *qemu_plugin_insn_haddr(const struct qemu_plugin_insn *insn) { const DisasContextBase *db = tcg_ctx->plugin_db; - vaddr page0_last = db->pc_first | ~TARGET_PAGE_MASK; + vaddr page0_last = db->pc_first | ~tcg_ctx->page_mask; if (db->fake_insn) { return NULL; From patchwork Tue Feb 25 11:08:36 2025 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: 13989841 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 4A7C2C021B2 for ; Tue, 25 Feb 2025 11:11:14 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tmsoI-0001b4-JC; Tue, 25 Feb 2025 06:09:12 -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 1tmsnx-0001XX-A0 for qemu-devel@nongnu.org; Tue, 25 Feb 2025 06:08:50 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tmsnv-0007kL-Pv for qemu-devel@nongnu.org; Tue, 25 Feb 2025 06:08:49 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-439ac3216dcso31534665e9.1 for ; Tue, 25 Feb 2025 03:08:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1740481726; x=1741086526; 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=BXCoC3AjlvjFHfpG46LUtIZq27ESsMFw+aj5c/6HJiY=; b=pI2JePBOnvXQUHQSo5AX3g+2f0Xwe5/c6MSSC3V2XSie8bh83+XtaKs9clCZ90nhkD ubHxRGwyMW5nHOUG+8Tknv1dUxmM4sWqgRLJ2GunwBW8onmoSrCMq0MVZ8B8CZqz6uCO okVTH9mQy67ncjHKuL1sfnTdH1kuCoINWY0ZlswvUiNLa5i5REiffuGIh0HAOMmZC6TM ydz1+jD/OIxW3wjF+ku+JxRMP5QtHYw9i7NIdcshQrRoeBPFRPe/AszdnORe+DgHphf3 lO0FB0rgvR0NCjkgal6OxTHJUUNt3I8eqrwh0qvXxflSw+SYS8e0k4dzWvgeh2gdFOI4 h6Ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740481726; x=1741086526; 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=BXCoC3AjlvjFHfpG46LUtIZq27ESsMFw+aj5c/6HJiY=; b=XPKNl58SoC/q0hJtaiG/1Ni0UaTQs9qnk+hBp+uwt/NIiK2QR8VgxP0q3vjakuwPvL 7dMwI8CZ6wvxWNppZn6Q2Aa3V0XMIrkL0oUKZFCt7I+T5hTEoCpA9pYLFMlWiB51ss4d vWDlXP30/j+hgncDZLItae0KDSoSWGILRnZ2mMpkj9uadjDAYTJtmMMSOHiF5FBP4YA0 39ABrRvwIsBJaFKyNfcIM/et4j6CWHopBtiabjjGh1q9Q1yL10BRtrBeGGsKmBbOPg7h z3gz7Mf01oGgohLvTod8GA4zwnpIE+mELBFEJp/S5CBMIR8bKDDdDBRZIjFr1q6NjYvY GOLg== X-Gm-Message-State: AOJu0YxHZSCo3NQXFlhyD3K7iEo22l4dC7guDbGPgQydCMB1dNHMLvSm t7ajQQFMEzfvOza4Rq0kN88zYwMYT3V6PdcqHhOXXFS+7MO6lYHMjDXiQ27vWZglfkzwcKQON2M fTJU= X-Gm-Gg: ASbGnct9j/OUp17sjRShRtg28H9fF1YToy3ww0kQBDWE0kTiRQxywWfD5XlXzQ8GSoP KCvO2drVQ0GiWPMcdE2lUQDe9DFyGI8EvaRu453zZ9c435qCyL7AQEnKc3VHRT874jmJsvlrOSJ tjSTzE347geICq0M3Eqq+CCxY+XPxG2ObB5QnMJoULxqDEDdrFblncjSj+9BK1qby7xl4qgitIv etYgx6qgu4id+oWhydp0qAiW1s61JEmRepCdPDo+pHU6d5x49WAQHsTwKZmtoxhJZpDUI0BtrWH LMfjnbwGbnc3Zit4KAw5lmakxsiI X-Google-Smtp-Source: AGHT+IHEUDqi/lWHUnS/yiCwRNbVZjHheB1kM2eycQhr+AtOAs5gPi2q0Ksc9MbN+Ppw90+weFe6CA== X-Received: by 2002:a05:600c:474b:b0:439:9a40:aa19 with SMTP id 5b1f17b1804b1-43ab1823448mr19381435e9.12.1740481725960; Tue, 25 Feb 2025 03:08:45 -0800 (PST) Received: from draig.lan ([185.126.160.109]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43ab1532f20sm22530435e9.8.2025.02.25.03.08.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Feb 2025 03:08:44 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 56A605F9D3; Tue, 25 Feb 2025 11:08:44 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Laurent Vivier , Pierrick Bouvier , Alexandre Iooss , Mahmoud Mandour Subject: [PATCH 02/10] plugins/loader: populate target_name with target_name() Date: Tue, 25 Feb 2025 11:08:36 +0000 Message-Id: <20250225110844.3296991-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250225110844.3296991-1-alex.bennee@linaro.org> References: <20250225110844.3296991-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32f.google.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 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, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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 We have a function we can call for this, lets not rely on macros that stop us building once. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- plugins/loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/loader.c b/plugins/loader.c index 99686b5466..827473c8b6 100644 --- a/plugins/loader.c +++ b/plugins/loader.c @@ -297,7 +297,7 @@ int qemu_plugin_load_list(QemuPluginList *head, Error **errp) struct qemu_plugin_desc *desc, *next; g_autofree qemu_info_t *info = g_new0(qemu_info_t, 1); - info->target_name = TARGET_NAME; + info->target_name = target_name(); info->version.min = QEMU_PLUGIN_MIN_VERSION; info->version.cur = QEMU_PLUGIN_VERSION; #ifndef CONFIG_USER_ONLY From patchwork Tue Feb 25 11:08:37 2025 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: 13989827 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 B33E5C021B2 for ; Tue, 25 Feb 2025 11:09:47 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tmsoS-0001ei-Tj; Tue, 25 Feb 2025 06:09:20 -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 1tmsnz-0001Xj-5t for qemu-devel@nongnu.org; Tue, 25 Feb 2025 06:08:54 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tmsnw-0007kS-39 for qemu-devel@nongnu.org; Tue, 25 Feb 2025 06:08:50 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-4394345e4d5so35821315e9.0 for ; Tue, 25 Feb 2025 03:08:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1740481726; x=1741086526; 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=A0C07sYpNo4u7rDsFsSfzCKqSXgRvbHOGJATtnHgpac=; b=x9/V855wRzTevpCVybfEKd0VHp/zVyPA6lZlPD5nAC1m8Bc8Ow/d84o0y6wuYLX3OS vAaHn25OR/Pqj0CamWwAbh7WEmz5hoyPJtBgKrZKA9GzuRbMrSmXVsaM/hzoYuxJVkTJ aJANXQTlhSBy9X+NDM+CxU9UISY+vBvKBDAj3ZgVm4aCqYDYAOo2pC5RTv6Qh8ioFC4k qxcMS0zEbgukYR0a7RNwa+xES7QXZWNdd1XMNHRe/8s0oOMoW1T9CxGijFS0l9/UKKza 01ZJPoCOLbZbbJEPkjU6zhABzdT2AYpb6krnYpvve5arKt0EKVNa0QvqyoFlVYRqx1Hq UDnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740481726; x=1741086526; 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=A0C07sYpNo4u7rDsFsSfzCKqSXgRvbHOGJATtnHgpac=; b=IbWft3SR/hgipQ8U3S64LEU8nQ6GvMbg2kHQDDMlA6MGCk+EoSfI6lShuuBhryseFa vd4h8XWgVvFP27MA4Pc1BKbz3J/cBl2vojHy+bj4pH82eE8W4Q++S2D5j6Tax+Ik0LXp W+WqnWeefSJehYaPI3M01je5IFPoywVApDKP63axEf/CYHncI3rujWQpwbCeMGUgCjvk P0Y3ZxY3m7bLuf1ybybbp5LyR5tDG08AyhW6qEhVz93j9HkIrxwqMcrB+PD8FADAcGbi CVNSsSsAHLbmq9Pp9wBRB68Eq31EavFiZFGP2bgA3S2+o7HVzhj8SScU0yaoB+XCpqVM MsEA== X-Gm-Message-State: AOJu0YyDyJCvaZHmJyE7+lBeu4huK0amO/BlJ2J9eUxZnKAT4yNBInaQ G3LZfBbAVp0Tr5fafqyRLsF+kDnXL1NJnKyR/m17kpu6XA/Acfm7QLmAS9gUzKQ= X-Gm-Gg: ASbGncvDSdssdEcWscDjFG2/FCWxNNmDs80UZvz1J5EcoR7ADue06rq0qwfXG2jupBY J29JFodnkcsIj05aDUBwpPEQLktr4GKJ5sFvWHuF7fD1hIqFkmtm6h6CxfgC5Vx0nR3jU87c3OS XdakG9758fR4LynYiMnqdeZ8pKoPQCC29+VBYRzHKkBYw/l3+8nDu/pupXMhqmH9joqmz+H6fRt oQI4diwg3oqNGVYwteSX6vdiIgtW0YTYN50wDZnejGfJdx3GhRiiX4P4gueeuVTcOjw+xgFkEIG es9UUXt+0ZurHutOng60mC31oUmN X-Google-Smtp-Source: AGHT+IEp/YkWTDiYfwzWIF6eGeuCJ3KVxlWw+YREg7vHyC0o0au8uWN9LAnONCah0tHmvDHgIhfaBw== X-Received: by 2002:a05:600c:5106:b0:439:a25a:1686 with SMTP id 5b1f17b1804b1-439aebda0bbmr120429185e9.25.1740481726320; Tue, 25 Feb 2025 03:08:46 -0800 (PST) Received: from draig.lan ([185.126.160.109]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-439b02d60c0sm135556145e9.12.2025.02.25.03.08.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Feb 2025 03:08:45 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 6B7FE5F9D7; Tue, 25 Feb 2025 11:08:44 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Laurent Vivier , Pierrick Bouvier , Alexandre Iooss , Mahmoud Mandour Subject: [PATCH 03/10] include/qemu: plugin-memory.h doesn't need cpu-defs.h Date: Tue, 25 Feb 2025 11:08:37 +0000 Message-Id: <20250225110844.3296991-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250225110844.3296991-1-alex.bennee@linaro.org> References: <20250225110844.3296991-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32d.google.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 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, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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 hwaddr is a fixed size on all builds. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- include/qemu/plugin-memory.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/qemu/plugin-memory.h b/include/qemu/plugin-memory.h index 71c1123308..6065ec7aaf 100644 --- a/include/qemu/plugin-memory.h +++ b/include/qemu/plugin-memory.h @@ -9,7 +9,6 @@ #ifndef PLUGIN_MEMORY_H #define PLUGIN_MEMORY_H -#include "exec/cpu-defs.h" #include "exec/hwaddr.h" struct qemu_plugin_hwaddr { From patchwork Tue Feb 25 11:08:38 2025 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: 13989825 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 C60C0C021B2 for ; Tue, 25 Feb 2025 11:09:37 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tmsoP-0001dT-Vh; Tue, 25 Feb 2025 06:09:18 -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 1tmsnz-0001Xi-5R for qemu-devel@nongnu.org; Tue, 25 Feb 2025 06:08:54 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tmsnx-0007kk-CC for qemu-devel@nongnu.org; Tue, 25 Feb 2025 06:08:50 -0500 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-38a8b17d7a7so3045585f8f.2 for ; Tue, 25 Feb 2025 03:08:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1740481727; x=1741086527; 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=Qb1orkQ+AqcTmWd0ljpleeeoHkiMqn4rSUOQc4oEDwE=; b=lnB3x4ljrfWTdtZzi8b0foad1PWvext1RnqxIKCMEU3G5Ah4P6FTmNhVaPrvGio16C qwh9ZIa2140bqwOWPi7cXEjusDw/j4/yEkYQskct/1bFEdBhKVilpFo2mTRomCRCjtQb HaWGiDoWxd5r/lTOaUYG1c3S1a9gDGn7/PV9pE2HiDifKJYiuK0XBLRgwRqugc1ibjhq pB/csvEBWUJHZF4bLvAyNKxthtz5fPlC6aKpe+/mV1COLmPQrU9DTTZ6WLPwNyJK36uK F3IRea11/icgfvnoFAgxOWvSJOl+N5uBICRVfgb5Nk71/UgCc5xo2mO4/F/psRholNKd Ej1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740481727; x=1741086527; 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=Qb1orkQ+AqcTmWd0ljpleeeoHkiMqn4rSUOQc4oEDwE=; b=qhiwQZlc8OPNj/YOe/GrKO63IV4VxdR7SqkxQQpvZ6Bk9SysbNvDsreTivkRqkOuNw 2+IOSHuTaACs7XZIrUa/CbkGjpmqa5TG9wttR1uSMJCwrjfp2cCdWNuqKfIYGztfr0lj 7wFrWb+n/rNlth1vhFuDrsqGOSzqcXdMNqSCnd8Ap2+iCTfp816EPsDgHbGGTSjZNCLF Fd18t3Ond4S/T6F75LBz5HzRfVZEsoK7pxiWg59G+80gvjKoWko4KfEm0JoMhwMr/bOQ +l1cHJeHGotqJZBPAvuLnqZPeDjkgWSZV8KhnEVR8v0+ZqjmEvmHvrk4ssveOf7u1/yL msfw== X-Gm-Message-State: AOJu0Yyj49kHhSrvdpxY1PCzIJal2g8DlZqgAPHJkpgGePVg3SrC4gVE A1sqFEiTRgaOrFS45J9feRz2NY1i2+/04BuOwmhf0s2PEV/dtdPERbxAH3Fs8GA= X-Gm-Gg: ASbGncsvJFW4kwAL9G0kZOe4lvKqHDWF1lsN/eXD+TCNeduCEcfWuiPkITV341ompgm Lw3L7IcNHWQWtM7AZzVj9Yi1ULiG7GwSoGDYFItV2jIrd7MVZiC6Dw7hZqDalzcqlS8iAugtxBf jWrvkCYANL1mkEUKBkey0YOEGJrLcA1C42co2lAKyqwVqH5uE5M5lQfxiseIBMkqRhEbVzU/SDt N+d2/t5hZupwx7Rbs6/TOrqDsttj4h3NaI2d/3SDE/Ppsj+JgO7lqIUXxmYngBjCMAh4N4xCZ2i gi9ZFhAPu6//4MK/FLzz22jsyQt2 X-Google-Smtp-Source: AGHT+IE5hol5zn1f9Zl4riLKeuflmsqjRzcccRFs5N7gs5KGfEDWcfEtzR3/gcilid0iKrI7qRNxMg== X-Received: by 2002:a05:6000:2c3:b0:38f:4251:597b with SMTP id ffacd0b85a97d-38f6e754752mr14287017f8f.8.1740481727545; Tue, 25 Feb 2025 03:08:47 -0800 (PST) Received: from draig.lan ([185.126.160.109]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-390cd8fcca2sm1898230f8f.96.2025.02.25.03.08.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Feb 2025 03:08:45 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 83BFA5FA34; Tue, 25 Feb 2025 11:08:44 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Laurent Vivier , Pierrick Bouvier , Alexandre Iooss , Mahmoud Mandour Subject: [PATCH 04/10] plugins/api: clean-up the includes Date: Tue, 25 Feb 2025 11:08:38 +0000 Message-Id: <20250225110844.3296991-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250225110844.3296991-1-alex.bennee@linaro.org> References: <20250225110844.3296991-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x436.google.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 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, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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 Thanks to re-factoring and clean-up work (especially to exec-all) we no longer need such broad headers for the api. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- plugins/api.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/plugins/api.c b/plugins/api.c index 10b258b08d..3e1aac7bfb 100644 --- a/plugins/api.c +++ b/plugins/api.c @@ -39,9 +39,7 @@ #include "qemu/main-loop.h" #include "qemu/plugin.h" #include "qemu/log.h" -#include "qemu/timer.h" #include "tcg/tcg.h" -#include "exec/exec-all.h" #include "exec/gdbstub.h" #include "exec/translation-block.h" #include "exec/translator.h" @@ -50,7 +48,6 @@ #ifndef CONFIG_USER_ONLY #include "qapi/error.h" #include "migration/blocker.h" -#include "exec/ram_addr.h" #include "qemu/plugin-memory.h" #include "hw/boards.h" #else From patchwork Tue Feb 25 11:08:39 2025 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: 13989828 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 9C77CC021B2 for ; Tue, 25 Feb 2025 11:09:53 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tmsoP-0001dU-Vh; Tue, 25 Feb 2025 06:09:18 -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 1tmso1-0001Xw-2J for qemu-devel@nongnu.org; Tue, 25 Feb 2025 06:08:54 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tmsny-0007kr-UM for qemu-devel@nongnu.org; Tue, 25 Feb 2025 06:08:52 -0500 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-439a1e8ba83so51574225e9.3 for ; Tue, 25 Feb 2025 03:08:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1740481728; x=1741086528; 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=yzfASlzKsKSjymD2hL0UWygARz8YSW230udVTrSf3Pg=; b=ATxf8MhEWcxPrIjwLXa9t9NFhkK0b1IhDM4l7Uq3mMlRmPbOfK8ITZEQ09v5tbizZG 1w+7XMcRdFN9CUcDEYE5ahH+jwA8RuRSAMpS8VojnGVIiBzYdK3pk8t1mruGsHhPcU4X oj/WpPcCWGQRIWKh22pPqlQy4kiOlhxPgr37JNiDbec8ccOukiJLtshYsMBIwDxTD93C 6poHgCXQJVwPFGAVJH/55AdxLn3QAgemYwpFNXtUQZnfxZCdQtez31tV5H2v2SLCOTjF pBR8eS/842In3DTQIz2mqaVQKXTNKrVPOQpjo19P93nzLqwJAKBCfTHLe7aasVC5KBMe H9wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740481728; x=1741086528; 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=yzfASlzKsKSjymD2hL0UWygARz8YSW230udVTrSf3Pg=; b=lS5CnyvpscHU805dF7183+n5Yz8jaYyOpV36MDRfs8q81+LoSpRoUP+nK+DqL6OZRq qysjSAvyfi3rj71FNbSANqbLfP4lSdOLofnR+bWG4imomzrGFBctvfhB8eDTBaWizEWz jXBFBamS7EjOGksb3p9hVs+cS98JV1r86ud9UJNbJX5KVtuNUNq3VS3ZwxNoe0/2/fnD oAPoBa7+nx97t4u7de0II10ednSs2ibNi1m80mDKBBT7AMA123Rymjbo94ZESHubSLNf 1qviox07xIu6lKFnx2XVnGUDq9KkIcCfQrLaq0WAQq8cHGCq2tm94bE5N6AiGzakChhb IAaQ== X-Gm-Message-State: AOJu0YyB/mDt8GvOafQnbP06sZSMXwYtuWW9dzFDQukqCF2tNaNUVd1U cikp9RIflKMNcJiKw+XB8cvX8ZsWZX3wuME975J6/yUJKp2hk8izh9ej3buy7HQ= X-Gm-Gg: ASbGncuTSU+mvRiAKxbDOs9PXSDo3iy8UFYFnRtMF6HFeWyduvDyFOOlIyEpeHpnbp/ k94fp/dH2aRJtEGgR9TvUwDTt76BRqdPVq1sWtU1ighjNH43UGU6m6Rs7i1AyCIDcjFNxO+TuOc BfaDBuzEJ1LcfNNWga/dYjC2BCNZhnn1VHFIk4hsEMLtWpHJsEbKXD0DRhFgpkrNGK8t2SS0cu9 BUzBZsy7Hgmy3qxCcSaoVI8XjvIR6xcED7OFKqEKOepXkqQfZ1M/sFQ7+tQLT7KCPf3XsUOrAOS X39gsPU847PfMvIjLMavH5iAlua4 X-Google-Smtp-Source: AGHT+IEoxAfbdQqWSPfDT+YzpGXh9jyalK7WloyWAl3AuXQz2RBw8Ap2Kv9nXj1vhIAeE3svxvpy+w== X-Received: by 2002:a05:600c:1d1a:b0:439:9537:e96b with SMTP id 5b1f17b1804b1-439aeb34990mr165336405e9.14.1740481728362; Tue, 25 Feb 2025 03:08:48 -0800 (PST) Received: from draig.lan ([185.126.160.109]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-439b02f3e15sm136595585e9.22.2025.02.25.03.08.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Feb 2025 03:08:47 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 9B0715FA6C; Tue, 25 Feb 2025 11:08:44 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Laurent Vivier , Pierrick Bouvier , Alexandre Iooss , Mahmoud Mandour Subject: [PATCH 05/10] plugins/plugin.h: include queue.h Date: Tue, 25 Feb 2025 11:08:39 +0000 Message-Id: <20250225110844.3296991-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250225110844.3296991-1-alex.bennee@linaro.org> References: <20250225110844.3296991-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x330.google.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 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, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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 Headers should bring in what they need so don't rely on getting queue.h by side effects. This will help with clean-ups in the following patches. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- plugins/plugin.h | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/plugin.h b/plugins/plugin.h index 30e2299a54..9ed20b5c41 100644 --- a/plugins/plugin.h +++ b/plugins/plugin.h @@ -13,6 +13,7 @@ #define PLUGIN_H #include +#include "qemu/queue.h" #include "qemu/qht.h" #define QEMU_PLUGIN_MIN_VERSION 2 From patchwork Tue Feb 25 11:08:40 2025 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: 13989844 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 EF119C021B2 for ; Tue, 25 Feb 2025 11:11:29 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tmsoK-0001cG-DN; Tue, 25 Feb 2025 06:09:12 -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 1tmso2-0001YA-8l for qemu-devel@nongnu.org; Tue, 25 Feb 2025 06:08:54 -0500 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 1tmsnz-0007lD-93 for qemu-devel@nongnu.org; Tue, 25 Feb 2025 06:08:54 -0500 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-38f3ac22948so2757051f8f.0 for ; Tue, 25 Feb 2025 03:08:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1740481729; x=1741086529; 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=ewr0cjB6f+D/BiqNnqVJdKZmiJnBgBiJmXhO/bcFtVA=; b=d5ffqIw2wxI/DuGaUPN/uyxmPUlEBZTVA7kX87upAiJ4X7kF7y62Nyul3Fp/zx37Yh X+8kFPAUcutmqjgZPjRcp1EKYhTSKOF07g7HwpgpoPMQfMOUWcV1nM3FfrWfo6V+B11M 0zMwJL09qjpV7SAGHE6bNoEzwMwifIU2vlqPBI57zmMkLpn9MqPglvRCGb1FEOd36cJe Vg9inTnzy1eaPhWCPcCq/F2G4Ukh2GPG/Qa7kajO/14xofx4laBLT74/K0u7YKZQcUVf jEVWjH8A1uWORSE1lBOxv/v+55jMtMVz1Ua3Ku7WEZ4rdCxC9rTd1DaoWT0vbj58QPoP ZLwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740481729; x=1741086529; 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=ewr0cjB6f+D/BiqNnqVJdKZmiJnBgBiJmXhO/bcFtVA=; b=Vv7vDLT6gYIPqxuf1K/495LTdWO41CD9pgxE/iayaJ7cw1IZfT4tZgV54kDIkC9+D4 5IL/ds26lZ8H1qpCCFwdyb+BxaB9ZmeYT3EFAsA/2UJgV7cj06ZLDXLyHZPbuFK7Rkw6 89adNhytd7foe+f1fDSTvjM05l91GhexVHnx6OFSycppW85Hl29iLNAZT2tL6qPniYl9 pSGJNFMaCBRvNpfij5Sybkk2JPB54jTglOu5mwdY1I/eUsEZD1ifdu+Lochk5Xs0EoXH M1LbW/4BeX3GzCThN/LlvguQjDHnh8v1nhGH1mdPusdSd41tbOfEsp+NI0a8serbmPIg Nm+w== X-Gm-Message-State: AOJu0YwhLTkCfRkdmQa52PszPpbc5humIwjPtlANxq6wMEayHoaNAMne uiEJ/ng43s7HNLnBEHKOv0Ipq895E1xkWnC6UxZF//vboha15v5A2gIJb7tKBnw= X-Gm-Gg: ASbGnctgG+gyjBfD1wu6hYKFiG7obO4tAvDPeLzVIpjdktI+1hH9VTLltG9ss8wqCYO WLWo8doE5XnI8WTiaEKJwUfV+ECUv0EWSqbaHCgpVKVBx2TuYTNjWux0E0vb9/C+geIZBOgJE57 1iUPo41ROhgvQkgL/zVKIdE3C5BtWgY895yHvV9ZkuNRp7hi1Ozpf/BAg6Atz+Kdh0xK3AcdYC4 /YCA2mQd5JTj612mxVK67a6ur80oEUWYckUzJblkMfuxvihRyd5yMw6SWUu4ZoAPUvwle44JArX Jo7CO+SUqrExpvBHIzgoRO2TjQoK X-Google-Smtp-Source: AGHT+IHLfi8JcE0qjtIpELBvf0MyORKDmiRkihGdYk9i/NGYrkAO+aQpGpQGEGkKL0N38ZP0jygALQ== X-Received: by 2002:a05:6000:1447:b0:385:ee40:2d88 with SMTP id ffacd0b85a97d-390cc5f20e0mr2418672f8f.3.1740481729559; Tue, 25 Feb 2025 03:08:49 -0800 (PST) Received: from draig.lan ([185.126.160.109]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43ab2ee361dsm10521075e9.0.2025.02.25.03.08.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Feb 2025 03:08:47 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id B77735FA77; Tue, 25 Feb 2025 11:08:44 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Laurent Vivier , Pierrick Bouvier , Alexandre Iooss , Mahmoud Mandour Subject: [PATCH 06/10] plugins/loader: compile loader only once Date: Tue, 25 Feb 2025 11:08:40 +0000 Message-Id: <20250225110844.3296991-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250225110844.3296991-1-alex.bennee@linaro.org> References: <20250225110844.3296991-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: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 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, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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 There is very little in loader that is different between builds save for a tiny user/system mode difference in the plugin_info structure. Create two new files, user and system to hold mode specific helpers and move loader into common_ss. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- plugins/plugin.h | 6 ++++++ plugins/loader.c | 13 ++----------- plugins/system.c | 24 ++++++++++++++++++++++++ plugins/user.c | 19 +++++++++++++++++++ plugins/meson.build | 7 ++++++- 5 files changed, 57 insertions(+), 12 deletions(-) create mode 100644 plugins/system.c create mode 100644 plugins/user.c diff --git a/plugins/plugin.h b/plugins/plugin.h index 9ed20b5c41..6fbc443b96 100644 --- a/plugins/plugin.h +++ b/plugins/plugin.h @@ -119,4 +119,10 @@ struct qemu_plugin_scoreboard *plugin_scoreboard_new(size_t element_size); void plugin_scoreboard_free(struct qemu_plugin_scoreboard *score); +/** + * qemu_plugin_fillin_mode_info() - populate mode specific info + * info: pointer to qemu_info_t structure + */ +void qemu_plugin_fillin_mode_info(qemu_info_t *info); + #endif /* PLUGIN_H */ diff --git a/plugins/loader.c b/plugins/loader.c index 827473c8b6..7523d554f0 100644 --- a/plugins/loader.c +++ b/plugins/loader.c @@ -31,9 +31,6 @@ #include "qemu/memalign.h" #include "hw/core/cpu.h" #include "exec/tb-flush.h" -#ifndef CONFIG_USER_ONLY -#include "hw/boards.h" -#endif #include "plugin.h" @@ -300,14 +297,8 @@ int qemu_plugin_load_list(QemuPluginList *head, Error **errp) info->target_name = target_name(); info->version.min = QEMU_PLUGIN_MIN_VERSION; info->version.cur = QEMU_PLUGIN_VERSION; -#ifndef CONFIG_USER_ONLY - MachineState *ms = MACHINE(qdev_get_machine()); - info->system_emulation = true; - info->system.smp_vcpus = ms->smp.cpus; - info->system.max_vcpus = ms->smp.max_cpus; -#else - info->system_emulation = false; -#endif + + qemu_plugin_fillin_mode_info(info); QTAILQ_FOREACH_SAFE(desc, head, entry, next) { int err; diff --git a/plugins/system.c b/plugins/system.c new file mode 100644 index 0000000000..b3ecc33ba5 --- /dev/null +++ b/plugins/system.c @@ -0,0 +1,24 @@ +/* + * QEMU Plugin system-emulation helpers + * + * Helpers that are specific to system emulation. + * + * Copyright (C) 2017, Emilio G. Cota + * Copyright (C) 2019-2025, Linaro + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "qemu/plugin.h" +#include "hw/boards.h" + +#include "plugin.h" + +void qemu_plugin_fillin_mode_info(qemu_info_t *info) +{ + MachineState *ms = MACHINE(qdev_get_machine()); + info->system_emulation = true; + info->system.smp_vcpus = ms->smp.cpus; + info->system.max_vcpus = ms->smp.max_cpus; +} diff --git a/plugins/user.c b/plugins/user.c new file mode 100644 index 0000000000..250d542502 --- /dev/null +++ b/plugins/user.c @@ -0,0 +1,19 @@ +/* + * QEMU Plugin user-mode helpers + * + * Helpers that are specific to user-mode. + * + * Copyright (C) 2017, Emilio G. Cota + * Copyright (C) 2019-2025, Linaro + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "qemu/plugin.h" +#include "plugin.h" + +void qemu_plugin_fillin_mode_info(qemu_info_t *info) +{ + info->system_emulation = false; +} diff --git a/plugins/meson.build b/plugins/meson.build index d60be2a4d6..f7820806d3 100644 --- a/plugins/meson.build +++ b/plugins/meson.build @@ -57,8 +57,13 @@ if host_os == 'windows' command: dlltool_cmd ) endif + +user_ss.add(files('user.c')) +system_ss.add(files('system.c')) + +common_ss.add(files('loader.c')) + specific_ss.add(files( - 'loader.c', 'core.c', 'api.c', )) From patchwork Tue Feb 25 11:08:41 2025 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: 13989843 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 D0B0BC021B6 for ; Tue, 25 Feb 2025 11:11:16 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tmsoT-0001eo-OO; Tue, 25 Feb 2025 06:09:21 -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 1tmso3-0001ZG-UI for qemu-devel@nongnu.org; Tue, 25 Feb 2025 06:08:56 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tmso0-0007lI-Oz for qemu-devel@nongnu.org; Tue, 25 Feb 2025 06:08:55 -0500 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-439a4dec9d5so52160465e9.0 for ; Tue, 25 Feb 2025 03:08:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1740481730; x=1741086530; 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=95zpMPBQ4vqu24tnUZPYM2mX9mrk7ldJk6RK0AKliOA=; b=cP1D6ikRg+WT2KUyEkEDS9Qx6Vse6Pqcz4rLS1W508wCoivshD+N945B3B8Kb9SOio 4ny2qbp/TaPI6rnMu4avFPqfCWavcSj9zl2BxVOPodZJ0cqbaBzKcWOD6eVW/1eEQjXd rCJ69U7bctiu56U2fQkQHvR8ms2KXJXSL32Xte1YlyikuMUJasMQmzvOMCxR/CeE1fd0 41oJEc7MnfJV9XZjNM9QL9H1FqGyrcmozfIAJcVDMrtTGU7EzHHeQadjRVYRIcDKtEeg Otvv6YcsWYq2IIVgaM0ZktZAcXK47McDKPRK6THHkDZGlMbGT2kvcmODYBGrogeYz+Ym iinQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740481730; x=1741086530; 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=95zpMPBQ4vqu24tnUZPYM2mX9mrk7ldJk6RK0AKliOA=; b=Y9aHyeZeQhDAGlLDHGiuXb3AP9clSm+rLvm9aV8mqwUuDCIYl8SJqsBLabfOeZdX3A w/327PCLI0+DJ3N5YUkArhbZVx2b9OmsZBJv/HlCPyyL3Dl/wUBbId+Dr9lKCQhWVXNH xQqIpQd6szbPd94IpXONkV9RiQNLucKFx9brUzHt5AiiS1/ZsIEZK0Rsf6HYk2OkGyYY +rnBYiVSUJ6jJPjJuhOnM0kn6jqxd4LZjqQIq7iKUe9eAjQcfbbb1N4RZY5Pt0pmz8/6 l8kShyervtZQMI91caDUbwfMTeUrz0lUTCSCwdMFZ5VcLK/kc2SKbLCBUQkunf/4K2zn 77dA== X-Gm-Message-State: AOJu0YxT83smC08M1ksKT+XIX7j1oGDbZLhocdiaN76kZjIFLlBpbO6F +MRKA64xnUFuhJBY6WEhdnLT0+MD4rnuLBD52EkEXmfyGtlxdhHHnpk01Pcwciw= X-Gm-Gg: ASbGncvXzukWUW8AF8kk4hhAcKCcDawxvnPHtnlHkyqgdQNM/8BHwaKiX0W8RNX4AQv sG/z9zhu/nTeqH9fN2S/liyAwMSR3XuC60QtYXrBRFMI+0Kdh07yLXeDbmQ7LZHf2ht19xVXLIi utrv/1IsdRmJ9iMa3ZIuAU2M44nHf5/5D2G21aeuTdc92nXBEoRgnx0jpH4m8hBSvdnirJyTTDt fHEL0lZYMFSkgz92Q4AaNpFMNYj6jEAjEOG5Cmm1sbMCCk9ctMS4gzJko8MnvswDlDNYUHDfe3K JLyulibD1jePG0ZiBapOXcQxu7HN X-Google-Smtp-Source: AGHT+IFsD9hDABRfI47X5NncnP9sNEp3mQvZj1NNIw2GwLhQB5ci+aNrcVLIEDAZM8h4hSwpFmSGFw== X-Received: by 2002:a05:600c:3d19:b0:43a:b186:8abc with SMTP id 5b1f17b1804b1-43ab1868ac3mr22306705e9.2.1740481729920; Tue, 25 Feb 2025 03:08:49 -0800 (PST) Received: from draig.lan ([185.126.160.109]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-390cd86cd10sm1944786f8f.37.2025.02.25.03.08.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Feb 2025 03:08:47 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id D3B015FB97; Tue, 25 Feb 2025 11:08:44 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Laurent Vivier , Pierrick Bouvier , Alexandre Iooss , Mahmoud Mandour Subject: [PATCH 07/10] plugins/api: split out binary path/start/end/entry code Date: Tue, 25 Feb 2025 11:08:41 +0000 Message-Id: <20250225110844.3296991-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250225110844.3296991-1-alex.bennee@linaro.org> References: <20250225110844.3296991-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32a.google.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 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, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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 To move the main api.c to a single build compilation object we need to start splitting out user and system specific code. As we need to grob around host headers we move these particular helpers into the *-user mode directories. The binary/start/end/entry helpers are all NOPs for system mode. Signed-off-by: Alex Bennée --- linux-user/plugin-api.c | 43 +++++++++++++++++++++++++++++++++++++++++ plugins/api-system.c | 39 +++++++++++++++++++++++++++++++++++++ plugins/api.c | 43 ----------------------------------------- linux-user/meson.build | 1 + plugins/meson.build | 2 +- 5 files changed, 84 insertions(+), 44 deletions(-) create mode 100644 linux-user/plugin-api.c create mode 100644 plugins/api-system.c diff --git a/linux-user/plugin-api.c b/linux-user/plugin-api.c new file mode 100644 index 0000000000..42e977c339 --- /dev/null +++ b/linux-user/plugin-api.c @@ -0,0 +1,43 @@ +/* + * QEMU Plugin API - linux-user-mode only implementations + * + * Common user-mode only APIs are in plugins/api-user. These helpers + * are only specific to linux-user. + * + * Copyright (C) 2017, Emilio G. Cota + * Copyright (C) 2019-2025, Linaro + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "qemu/main-loop.h" +#include "qemu/plugin.h" +#include "qemu.h" + +/* + * Binary path, start and end locations. Host specific due to TaskState. + */ +const char *qemu_plugin_path_to_binary(void) +{ + TaskState *ts = get_task_state(current_cpu); + return g_strdup(ts->bprm->filename); +} + +uint64_t qemu_plugin_start_code(void) +{ + TaskState *ts = get_task_state(current_cpu); + return ts->info->start_code; +} + +uint64_t qemu_plugin_end_code(void) +{ + TaskState *ts = get_task_state(current_cpu); + return ts->info->end_code; +} + +uint64_t qemu_plugin_entry_code(void) +{ + TaskState *ts = get_task_state(current_cpu); + return ts->info->entry; +} diff --git a/plugins/api-system.c b/plugins/api-system.c new file mode 100644 index 0000000000..cb0dd8f730 --- /dev/null +++ b/plugins/api-system.c @@ -0,0 +1,39 @@ +/* + * QEMU Plugin API - System specific implementations + * + * This provides the APIs that have a specific system implementation + * or are only relevant to system-mode. + * + * Copyright (C) 2017, Emilio G. Cota + * Copyright (C) 2019-2025, Linaro + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "qemu/main-loop.h" +#include "qemu/plugin.h" + +/* + * In system mode we cannot trace the binary being executed so the + * helpers all return NULL/0. + */ +const char *qemu_plugin_path_to_binary(void) +{ + return NULL; +} + +uint64_t qemu_plugin_start_code(void) +{ + return 0; +} + +uint64_t qemu_plugin_end_code(void) +{ + return 0; +} + +uint64_t qemu_plugin_entry_code(void) +{ + return 0; +} diff --git a/plugins/api.c b/plugins/api.c index 3e1aac7bfb..12a3b6a66d 100644 --- a/plugins/api.c +++ b/plugins/api.c @@ -470,49 +470,6 @@ bool qemu_plugin_bool_parse(const char *name, const char *value, bool *ret) return name && value && qapi_bool_parse(name, value, ret, NULL); } -/* - * Binary path, start and end locations - */ -const char *qemu_plugin_path_to_binary(void) -{ - char *path = NULL; -#ifdef CONFIG_USER_ONLY - TaskState *ts = get_task_state(current_cpu); - path = g_strdup(ts->bprm->filename); -#endif - return path; -} - -uint64_t qemu_plugin_start_code(void) -{ - uint64_t start = 0; -#ifdef CONFIG_USER_ONLY - TaskState *ts = get_task_state(current_cpu); - start = ts->info->start_code; -#endif - return start; -} - -uint64_t qemu_plugin_end_code(void) -{ - uint64_t end = 0; -#ifdef CONFIG_USER_ONLY - TaskState *ts = get_task_state(current_cpu); - end = ts->info->end_code; -#endif - return end; -} - -uint64_t qemu_plugin_entry_code(void) -{ - uint64_t entry = 0; -#ifdef CONFIG_USER_ONLY - TaskState *ts = get_task_state(current_cpu); - entry = ts->info->entry; -#endif - return entry; -} - /* * Create register handles. * diff --git a/linux-user/meson.build b/linux-user/meson.build index f75b4fe0e3..f47a213ca3 100644 --- a/linux-user/meson.build +++ b/linux-user/meson.build @@ -27,6 +27,7 @@ linux_user_ss.add(libdw) linux_user_ss.add(when: 'TARGET_HAS_BFLT', if_true: files('flatload.c')) linux_user_ss.add(when: 'TARGET_I386', if_true: files('vm86.c')) linux_user_ss.add(when: 'CONFIG_ARM_COMPATIBLE_SEMIHOSTING', if_true: files('semihost.c')) +linux_user_ss.add(when: 'CONFIG_TCG_PLUGINS', if_true: files('plugin-api.c')) syscall_nr_generators = {} diff --git a/plugins/meson.build b/plugins/meson.build index f7820806d3..9c9bc9e5bb 100644 --- a/plugins/meson.build +++ b/plugins/meson.build @@ -59,7 +59,7 @@ if host_os == 'windows' endif user_ss.add(files('user.c')) -system_ss.add(files('system.c')) +system_ss.add(files('system.c', 'api-system.c')) common_ss.add(files('loader.c')) From patchwork Tue Feb 25 11:08:42 2025 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: 13989829 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 D9B44C021B2 for ; Tue, 25 Feb 2025 11:10:13 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tmsoS-0001ee-AE; Tue, 25 Feb 2025 06:09:20 -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 1tmso2-0001YG-Ls for qemu-devel@nongnu.org; Tue, 25 Feb 2025 06:08:54 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tmso0-0007lK-Op for qemu-devel@nongnu.org; Tue, 25 Feb 2025 06:08:54 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-439350f1a0bso32432105e9.0 for ; Tue, 25 Feb 2025 03:08:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1740481730; x=1741086530; 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=wOGEdNee22ihZNFYvdXhvyToWGXPcrh3omffan4xEow=; b=tVddNTMVckHB/wEVxwty7MhRbEQNkQCkI6HOF0kXWgKG1MelbdfSjE0jNlpVVzc/hM 8m7ekslgk6/Ld6gaZcVnWIMeYiRWvrmlAgTtphMzPMK4/4iBg6TL56BuSCQXOkcasmg/ 6pw1mPncQkT4Ap1xbWM14XncTEJMoOhaO+tWZDElyonXQhnrJ45kvFyNmY4dCCOoh4yE SDuJtLV+bIhYzJWD9OCZJphWOhMTtMuADArPzwOdXuzoI/pO5Ejek26G/1ZHM3rHB1Mh TEYPcuDk0DHF3QJJA0yGRzS2S87H7HIX8XwXcNpmRrT9fVeLIlRgV0/ILUgTCRpCZksz BZgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740481730; x=1741086530; 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=wOGEdNee22ihZNFYvdXhvyToWGXPcrh3omffan4xEow=; b=Wmm12/bUwTvDrdt1wVnSnfmhryj3Jh8m8EoRNXepIPkdcwNgtqRtg0Cu0SBwZ0HQ1P CrvOZO4iRXDspTgH6H6/v0yMxXIdkQlZGFvcPupQtNTunmMXu+X6PJQ5S0Zfa0MnSSBv y3CAbXTj5oUinYiShbTlEYi3YF13W0CMVHK4XkRPsFiC/hQ5O64xz7JqUQxh5M3tVNXm caaSugxvV0rAZ23KUfm7DCBnGGLP7sqMUFW8eadaPmuw+GVKZ5b82wCTFWLFo0JgE6HE 7nI+SuNAMlRqTDS5jxxGArLegGzTY+h2BRyly91I74NOrrj+KI2sHHWQc3fgQ18jdzK9 lbwA== X-Gm-Message-State: AOJu0Yx44Sz4eHDNrkt3qpQ9Zwi/YbTAVz/msQPT9dSJ871Qxwt4rzqS AZsb6TVTliRM7EAh6G5AxjrX9Zu6MPt6P1AshA3wgTX2FpScxVXe148wFUidH7Y= X-Gm-Gg: ASbGncvU/wM1r/h/L5BUuIFk3hac4QyQaf5lXt+CBAlHog6a2HClqEaAQEnwCgZWFOa 1t12JTtJueKvoIOI9d0DD7PDAZWWRiga4D8A8+9nktVmkqNB3OiFY35rXVHhMdyJhf3YUUfG8sI zHZFko7iszPJS1urNOoLAdsbnI6zXIPyLGkKvN4pMUeIUN5bk81nmnCVHzD330U1xxaDO/nuIpF t99aQkNLDMFOpJqoXrOCaWOcnEAMBo+Ed0D3cPTLPloxGbgdMQSwsGy8xjmlkDsoIalARQziwme oc4glj3VUHLGRjF/XiKYFto+Gc3b X-Google-Smtp-Source: AGHT+IEBa+SJBlL9dnOxtbQjAnQN5WHbjzmu75hWgbM/9i9vhTmk1ZzGMTuFhBaudUCQ6MjhAMw98Q== X-Received: by 2002:a05:600c:5949:b0:439:8345:17a6 with SMTP id 5b1f17b1804b1-439a30d38e9mr151142155e9.12.1740481730292; Tue, 25 Feb 2025 03:08:50 -0800 (PST) Received: from draig.lan ([185.126.160.109]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-439b02f23c2sm138795405e9.17.2025.02.25.03.08.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Feb 2025 03:08:47 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id EF0775FF26; Tue, 25 Feb 2025 11:08:44 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Laurent Vivier , Pierrick Bouvier , Alexandre Iooss , Mahmoud Mandour Subject: [PATCH 08/10] plugins/api: split out the vaddr/hwaddr helpers Date: Tue, 25 Feb 2025 11:08:42 +0000 Message-Id: <20250225110844.3296991-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250225110844.3296991-1-alex.bennee@linaro.org> References: <20250225110844.3296991-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x329.google.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 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, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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 These only work for system-mode and are NOPs for user-mode. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- plugins/api-system.c | 58 ++++++++++++++++++++++++++++++++++++ plugins/api-user.c | 40 +++++++++++++++++++++++++ plugins/api.c | 70 -------------------------------------------- plugins/meson.build | 2 +- 4 files changed, 99 insertions(+), 71 deletions(-) create mode 100644 plugins/api-user.c diff --git a/plugins/api-system.c b/plugins/api-system.c index cb0dd8f730..38560de342 100644 --- a/plugins/api-system.c +++ b/plugins/api-system.c @@ -12,6 +12,10 @@ #include "qemu/osdep.h" #include "qemu/main-loop.h" +#include "qapi/error.h" +#include "migration/blocker.h" +#include "hw/boards.h" +#include "qemu/plugin-memory.h" #include "qemu/plugin.h" /* @@ -37,3 +41,57 @@ uint64_t qemu_plugin_entry_code(void) { return 0; } + +/* + * Virtual Memory queries + */ + +static __thread struct qemu_plugin_hwaddr hwaddr_info; + +struct qemu_plugin_hwaddr *qemu_plugin_get_hwaddr(qemu_plugin_meminfo_t info, + uint64_t vaddr) +{ + CPUState *cpu = current_cpu; + unsigned int mmu_idx = get_mmuidx(info); + enum qemu_plugin_mem_rw rw = get_plugin_meminfo_rw(info); + hwaddr_info.is_store = (rw & QEMU_PLUGIN_MEM_W) != 0; + + assert(mmu_idx < NB_MMU_MODES); + + if (!tlb_plugin_lookup(cpu, vaddr, mmu_idx, + hwaddr_info.is_store, &hwaddr_info)) { + error_report("invalid use of qemu_plugin_get_hwaddr"); + return NULL; + } + + return &hwaddr_info; +} + +bool qemu_plugin_hwaddr_is_io(const struct qemu_plugin_hwaddr *haddr) +{ + return haddr->is_io; +} + +uint64_t qemu_plugin_hwaddr_phys_addr(const struct qemu_plugin_hwaddr *haddr) +{ + if (haddr) { + return haddr->phys_addr; + } + return 0; +} + +const char *qemu_plugin_hwaddr_device_name(const struct qemu_plugin_hwaddr *h) +{ + if (h && h->is_io) { + MemoryRegion *mr = h->mr; + if (!mr->name) { + unsigned maddr = (uintptr_t)mr; + g_autofree char *temp = g_strdup_printf("anon%08x", maddr); + return g_intern_string(temp); + } else { + return g_intern_string(mr->name); + } + } else { + return g_intern_static_string("RAM"); + } +} diff --git a/plugins/api-user.c b/plugins/api-user.c new file mode 100644 index 0000000000..867b420339 --- /dev/null +++ b/plugins/api-user.c @@ -0,0 +1,40 @@ +/* + * QEMU Plugin API - user-mode only implementations + * + * This provides the APIs that have a user-mode specific + * implementations or are only relevant to user-mode. + * + * Copyright (C) 2017, Emilio G. Cota + * Copyright (C) 2019-2025, Linaro + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "qemu/plugin.h" + +/* + * Virtual Memory queries - these are all NOPs for user-mode which + * only ever has visibility of virtual addresses. + */ + +struct qemu_plugin_hwaddr *qemu_plugin_get_hwaddr(qemu_plugin_meminfo_t info, + uint64_t vaddr) +{ + return NULL; +} + +bool qemu_plugin_hwaddr_is_io(const struct qemu_plugin_hwaddr *haddr) +{ + return false; +} + +uint64_t qemu_plugin_hwaddr_phys_addr(const struct qemu_plugin_hwaddr *haddr) +{ + return 0; +} + +const char *qemu_plugin_hwaddr_device_name(const struct qemu_plugin_hwaddr *h) +{ + return g_intern_static_string("Invalid"); +} diff --git a/plugins/api.c b/plugins/api.c index 12a3b6a66d..b04577424f 100644 --- a/plugins/api.c +++ b/plugins/api.c @@ -382,76 +382,6 @@ qemu_plugin_mem_value qemu_plugin_mem_get_value(qemu_plugin_meminfo_t info) return value; } -/* - * Virtual Memory queries - */ - -#ifdef CONFIG_SOFTMMU -static __thread struct qemu_plugin_hwaddr hwaddr_info; -#endif - -struct qemu_plugin_hwaddr *qemu_plugin_get_hwaddr(qemu_plugin_meminfo_t info, - uint64_t vaddr) -{ -#ifdef CONFIG_SOFTMMU - CPUState *cpu = current_cpu; - unsigned int mmu_idx = get_mmuidx(info); - enum qemu_plugin_mem_rw rw = get_plugin_meminfo_rw(info); - hwaddr_info.is_store = (rw & QEMU_PLUGIN_MEM_W) != 0; - - assert(mmu_idx < NB_MMU_MODES); - - if (!tlb_plugin_lookup(cpu, vaddr, mmu_idx, - hwaddr_info.is_store, &hwaddr_info)) { - error_report("invalid use of qemu_plugin_get_hwaddr"); - return NULL; - } - - return &hwaddr_info; -#else - return NULL; -#endif -} - -bool qemu_plugin_hwaddr_is_io(const struct qemu_plugin_hwaddr *haddr) -{ -#ifdef CONFIG_SOFTMMU - return haddr->is_io; -#else - return false; -#endif -} - -uint64_t qemu_plugin_hwaddr_phys_addr(const struct qemu_plugin_hwaddr *haddr) -{ -#ifdef CONFIG_SOFTMMU - if (haddr) { - return haddr->phys_addr; - } -#endif - return 0; -} - -const char *qemu_plugin_hwaddr_device_name(const struct qemu_plugin_hwaddr *h) -{ -#ifdef CONFIG_SOFTMMU - if (h && h->is_io) { - MemoryRegion *mr = h->mr; - if (!mr->name) { - unsigned maddr = (uintptr_t)mr; - g_autofree char *temp = g_strdup_printf("anon%08x", maddr); - return g_intern_string(temp); - } else { - return g_intern_string(mr->name); - } - } else { - return g_intern_static_string("RAM"); - } -#else - return g_intern_static_string("Invalid"); -#endif -} - int qemu_plugin_num_vcpus(void) { return plugin_num_vcpus(); diff --git a/plugins/meson.build b/plugins/meson.build index 9c9bc9e5bb..942b59e904 100644 --- a/plugins/meson.build +++ b/plugins/meson.build @@ -58,7 +58,7 @@ if host_os == 'windows' ) endif -user_ss.add(files('user.c')) +user_ss.add(files('user.c', 'api-user.c')) system_ss.add(files('system.c', 'api-system.c')) common_ss.add(files('loader.c')) From patchwork Tue Feb 25 11:08:43 2025 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: 13989831 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 70913C021BB for ; Tue, 25 Feb 2025 11:10:58 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tmsoT-0001eR-6w; Tue, 25 Feb 2025 06:09:21 -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 1tmso3-0001ZC-PH for qemu-devel@nongnu.org; Tue, 25 Feb 2025 06:08:58 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tmso1-0007lg-0Q for qemu-devel@nongnu.org; Tue, 25 Feb 2025 06:08:55 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-4399d14334aso47596725e9.0 for ; Tue, 25 Feb 2025 03:08:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1740481731; x=1741086531; 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=6ziKeGk3G2q0jYp9Ya8g4Y6XfpCIgHNkybpH/GkwKVw=; b=B1VoHVdAewwfOFojLzRWPPf7qEtj65m8Gdy0PinuTet4RuTgHsIZRnIYavktqDEPoC wM9okPJluDspqVzLMhIryqdcquujbUA4+wLVA0MlrSbrUNBnbBZDTBLY0cZwgNfw3Lct JQ2wVmKftCftIAL/GNqMfPqbUO/v9sasnYsdBa31InzZoWJnRRcNopfmO77Zp+mOu4jF +eE45uTE3yzMEYmAb8YrNxYljxMa7JPjVPmVR71RDtDyhPTc2A6wszM362UfsxYe3qMz nGAFCORzNepsd4ZpQafyzY1TJgiAa23FR/NpJd5Ri3lhPBDCN1iYrcz0l11s57/vVr1X hpBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740481731; x=1741086531; 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=6ziKeGk3G2q0jYp9Ya8g4Y6XfpCIgHNkybpH/GkwKVw=; b=DlVVpCSkIbUUGPHQ2mU0ZapVguwrgRBcEGzZ15oJY8dCGGPI2e72sAeQrHppHS4OhL CTnUK2m8wRSKZTMNnTpjsOfyWIcyGT52tqHoM2RMQq+XQep/kvNWLGegDHlaRW1bNYVN IITGJTg/WJ+eeas2Fnm4+dE9835ejY2DP65GMPlEaMj+gMr3t/DmpLWJC1L7507bf+Pl LPQXgdMx39xVK2IuIc0C0fctyai4BC7k42HhdzpMKNdWYI8C+que2jGasFuKdSf/jhsR dF2/wJie1MsmnLsGkvTaFrzAfAmWja/d2TLpYXzIJb3rqRvNCciMK2SdW7VO9XoqAidT dO7w== X-Gm-Message-State: AOJu0YwuhGuuEh4Kw+a+omKdPQeidUYCA2kGikHkxFQjtApgmbPKgc/P OxJOhxcidyr50/11Co10fLX55wSPiAX4rKGP3P1xGS9LNZMKrUjfeuHJN/HHyTs= X-Gm-Gg: ASbGncuyYYLA+bL6+jOAFVspkX9rE6gnyRo8wIboYmQKYwDCp5hh06ikDBpNB7VqHBH nkqQU/AWfft1OLECL0o4fgUEfk2nRzroB9XctHA5jDzXWElOF303pi+JgMzPJufHVQ3M6eD8plr wl4mmai7y69TLGq+UGmelrBITqUocSt69KoeX126+7VcRUSf84eyjLaxJDtpYQKwxeZ2wO69WRo 4LzBKRoS86ItJ+0OV6e/7Hei8ZyzAQkZRgxvfZxtqS2R9Oiboz4m3CnCT/7eB7KZtYpoboJ3Ho9 jGtEL30vfcJ0ABUyDM+XNKy6f656 X-Google-Smtp-Source: AGHT+IHwpKeNhLi91xir7Xj1HC6TMMummO9qdb3nimGAxEXyWR23Sy02RmFCmzaCJLw+RUpzJDqQZg== X-Received: by 2002:a05:600c:19c9:b0:439:6a7b:7697 with SMTP id 5b1f17b1804b1-439ae1f349emr169043775e9.14.1740481731490; Tue, 25 Feb 2025 03:08:51 -0800 (PST) Received: from draig.lan ([185.126.160.109]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-439b02f23c2sm138795635e9.17.2025.02.25.03.08.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Feb 2025 03:08:47 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 167FD60346; Tue, 25 Feb 2025 11:08:45 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Laurent Vivier , Pierrick Bouvier , Alexandre Iooss , Mahmoud Mandour Subject: [PATCH 09/10] plugins/api: split out time control helpers Date: Tue, 25 Feb 2025 11:08:43 +0000 Message-Id: <20250225110844.3296991-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250225110844.3296991-1-alex.bennee@linaro.org> References: <20250225110844.3296991-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32d.google.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 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, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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 These are only usable in system mode where we control the timer. For user-mode make them NOPs. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- plugins/api-system.c | 34 ++++++++++++++++++++++++++++++++++ plugins/api-user.c | 17 +++++++++++++++++ plugins/api.c | 41 ----------------------------------------- 3 files changed, 51 insertions(+), 41 deletions(-) diff --git a/plugins/api-system.c b/plugins/api-system.c index 38560de342..cc190b167e 100644 --- a/plugins/api-system.c +++ b/plugins/api-system.c @@ -95,3 +95,37 @@ const char *qemu_plugin_hwaddr_device_name(const struct qemu_plugin_hwaddr *h) return g_intern_static_string("RAM"); } } + +/* + * Time control + */ +static bool has_control; +static Error *migration_blocker; + +const void *qemu_plugin_request_time_control(void) +{ + if (!has_control) { + has_control = true; + error_setg(&migration_blocker, + "TCG plugin time control does not support migration"); + migrate_add_blocker(&migration_blocker, NULL); + return &has_control; + } + return NULL; +} + +static void advance_virtual_time__async(CPUState *cpu, run_on_cpu_data data) +{ + int64_t new_time = data.host_ulong; + qemu_clock_advance_virtual_time(new_time); +} + +void qemu_plugin_update_ns(const void *handle, int64_t new_time) +{ + if (handle == &has_control) { + /* Need to execute out of cpu_exec, so bql can be locked. */ + async_run_on_cpu(current_cpu, + advance_virtual_time__async, + RUN_ON_CPU_HOST_ULONG(new_time)); + } +} diff --git a/plugins/api-user.c b/plugins/api-user.c index 867b420339..28704a89e8 100644 --- a/plugins/api-user.c +++ b/plugins/api-user.c @@ -12,6 +12,7 @@ #include "qemu/osdep.h" #include "qemu/plugin.h" +#include "exec/log.h" /* * Virtual Memory queries - these are all NOPs for user-mode which @@ -38,3 +39,19 @@ const char *qemu_plugin_hwaddr_device_name(const struct qemu_plugin_hwaddr *h) { return g_intern_static_string("Invalid"); } + +/* + * Time control - for user mode the only real time is wall clock time + * so realistically all you can do in user mode is slow down execution + * which doesn't require the ability to mess with the clock. + */ + +const void *qemu_plugin_request_time_control(void) +{ + return NULL; +} + +void qemu_plugin_update_ns(const void *handle, int64_t new_time) +{ + qemu_log_mask(LOG_UNIMP, "user-mode can't control time"); +} diff --git a/plugins/api.c b/plugins/api.c index b04577424f..61480d3dc1 100644 --- a/plugins/api.c +++ b/plugins/api.c @@ -525,44 +525,3 @@ uint64_t qemu_plugin_u64_sum(qemu_plugin_u64 entry) return total; } -/* - * Time control - */ -static bool has_control; -#ifdef CONFIG_SOFTMMU -static Error *migration_blocker; -#endif - -const void *qemu_plugin_request_time_control(void) -{ - if (!has_control) { - has_control = true; -#ifdef CONFIG_SOFTMMU - error_setg(&migration_blocker, - "TCG plugin time control does not support migration"); - migrate_add_blocker(&migration_blocker, NULL); -#endif - return &has_control; - } - return NULL; -} - -#ifdef CONFIG_SOFTMMU -static void advance_virtual_time__async(CPUState *cpu, run_on_cpu_data data) -{ - int64_t new_time = data.host_ulong; - qemu_clock_advance_virtual_time(new_time); -} -#endif - -void qemu_plugin_update_ns(const void *handle, int64_t new_time) -{ -#ifdef CONFIG_SOFTMMU - if (handle == &has_control) { - /* Need to execute out of cpu_exec, so bql can be locked. */ - async_run_on_cpu(current_cpu, - advance_virtual_time__async, - RUN_ON_CPU_HOST_ULONG(new_time)); - } -#endif -} From patchwork Tue Feb 25 11:08:44 2025 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: 13989826 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 259FCC021B2 for ; Tue, 25 Feb 2025 11:09:41 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tmsoE-0001aZ-FY; Tue, 25 Feb 2025 06:09:07 -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 1tmso3-0001ZD-Qe for qemu-devel@nongnu.org; Tue, 25 Feb 2025 06:08:56 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tmso1-0007li-Fk for qemu-devel@nongnu.org; Tue, 25 Feb 2025 06:08:55 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-4398738217aso47551285e9.3 for ; Tue, 25 Feb 2025 03:08:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1740481732; x=1741086532; 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=h6nrshHrtPOrifsqr2VPAodIduwL/dsvQHP+KKR3e9Q=; b=Qd+PHosDoUPTLA0LrrOg88tAwOlRag5Gdeghxg3TJp38cYHvxdm2JjeAASA/h/+4bV eWM/8Kfg2ZLZVyvI5JieyyH0aobqgnKO8m7MlQDIXw10tlbYRBdphfSBJY6JZjmFyuKN PD9Sal/XsqIvSTrLkCxVC3XFhOeMUqIAmyHX6mEtuNhzxDBmUaUtFx1sTH/uTCYuvDO3 lbf0RJS4OWxlkeY9EDjKus3r2SpPxEEiYF18iQddVtdM2Jdpbxpo+s0OOBm+nTQvPnKg Bk7Lb87CJp3+J11GjaU/Vl0I+FtVLKI0KnQYPdQB1x2iOixlTWazOB/2P0ZSqmwq8tbs 3RbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740481732; x=1741086532; 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=h6nrshHrtPOrifsqr2VPAodIduwL/dsvQHP+KKR3e9Q=; b=N1DZafL8hcGaSqSVHfO7Bm5SWX1eWZf4uaoSWRHijPq6bl2GTKS91/6rxjgkVLy/DE bWPGgs0dvUAv8QSIIHCXT9tGOp0XNKayL0Bl4WOJAUuP61XHmazBCTFWyZ4DJFFtppn+ Eg8l1Z3W1tPt5BTLrtnHFsWlNeNJoSzmEWiGtlmGsTIZyu+Ea/MLw2AKtexZ7CBLc4w2 nZQD/LnSC0HSJKix7r2U4fulvP3E498C9xVnVznXvX7TX53rXKZ80daZcNPL53IndH4C iA//oXAS0eCt2WXls95wfziZ9DbeCo/u9mQSSU7ya3wlW77MNDOenh/3fMFndMq1PcLe e8Qw== X-Gm-Message-State: AOJu0Yw8x/DnF1CaMSnp3ki/y+6WgE5b13sPBLlBp7av/1PtNYQani4Z j0dQZabHe9+hsNc6zlcBoaELw0uGhDuVbi40IDdXZ/bKButKb447jEc7ydhg910= X-Gm-Gg: ASbGncuPZDUBtHGKO4qg38vNBkL/2ZFdEjPm2CNpg1AvE/naRt37lgrx7VCL5xfxoyt dlv6fiZeb1pdpHUrGeOOlHpReKgSVoQRlk5dRZiJncGma7mVbcvvEJMdXjOPmvm7tBe925xU6mY WJzG43hlg1YkWeNFXwreGnFd+dI5zR7eqRxcr7P7Xd7x905G2942qIMO3X/CAc6wR5aO6q0CKmk O9YfrUhMLy32sZkqpFt/Hdb2DGAAUDKvCJUV2IfQOf4JHfYwOYH2QGwAiMM65pvxdGbHbzqc7NG HHbeJNJkOs+UQS7CUEwY40YStLaT X-Google-Smtp-Source: AGHT+IFnqMOXSdK5At0p4ylKCzzCcWorQhf6UEgx2/pvCSED9HGox+7amtcN1Cb9mjbMnAHdJmbfqA== X-Received: by 2002:a05:600c:4451:b0:439:8e3d:fb58 with SMTP id 5b1f17b1804b1-439ae1e6dcemr155006875e9.11.1740481731887; Tue, 25 Feb 2025 03:08:51 -0800 (PST) Received: from draig.lan ([185.126.160.109]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-439b02f24acsm138006895e9.21.2025.02.25.03.08.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Feb 2025 03:08:47 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 2E24761A5E; Tue, 25 Feb 2025 11:08:45 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Laurent Vivier , Pierrick Bouvier , Alexandre Iooss , Mahmoud Mandour Subject: [PATCH 10/10] plugins/api: build only once Date: Tue, 25 Feb 2025 11:08:44 +0000 Message-Id: <20250225110844.3296991-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250225110844.3296991-1-alex.bennee@linaro.org> References: <20250225110844.3296991-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32c.google.com X-Spam_score_int: 12 X-Spam_score: 1.2 X-Spam_bar: + X-Spam_report: (1.2 / 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, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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 Now all the softmmu/user-mode stuff has been split out we can build this compilation unit only once. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- plugins/api.c | 11 ----------- plugins/meson.build | 3 +-- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/plugins/api.c b/plugins/api.c index 61480d3dc1..a292b5bff3 100644 --- a/plugins/api.c +++ b/plugins/api.c @@ -45,17 +45,6 @@ #include "exec/translator.h" #include "disas/disas.h" #include "plugin.h" -#ifndef CONFIG_USER_ONLY -#include "qapi/error.h" -#include "migration/blocker.h" -#include "qemu/plugin-memory.h" -#include "hw/boards.h" -#else -#include "qemu.h" -#ifdef CONFIG_LINUX -#include "loader.h" -#endif -#endif /* Uninstall and Reset handlers */ diff --git a/plugins/meson.build b/plugins/meson.build index 942b59e904..d27220d5ff 100644 --- a/plugins/meson.build +++ b/plugins/meson.build @@ -61,9 +61,8 @@ endif user_ss.add(files('user.c', 'api-user.c')) system_ss.add(files('system.c', 'api-system.c')) -common_ss.add(files('loader.c')) +common_ss.add(files('loader.c', 'api.c')) specific_ss.add(files( 'core.c', - 'api.c', ))