From patchwork Tue May 6 14:34:50 2025 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: 887771 Delivered-To: patch@linaro.org Received: by 2002:a5d:430f:0:b0:38f:210b:807b with SMTP id h15csp2583148wrq; Tue, 6 May 2025 07:37:01 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUALcqtHAMXv8KIo4Z811Vg1XOhnwFL37UxAibrrrJhr9kDZWREOFu7MI9RwBNf/GO8n5+uVw==@linaro.org X-Google-Smtp-Source: AGHT+IErzXjiBQkHaoVzKfX/rlQHjudsaa09r3TqYdff8CvKU45LFgpET9WZlyQf0HbkVJ+rNyAA X-Received: by 2002:a05:620a:410c:b0:7c8:c97:627f with SMTP id af79cd13be357-7cad5b8d856mr2544473485a.46.1746542221647; Tue, 06 May 2025 07:37:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1746542221; cv=none; d=google.com; s=arc-20240605; b=RQZ0sFuZPWtlrp9NOv22K2pCS1tHWVLjTbpljNEmVUMFGFRgJAOWFdoVpJo9Q2pSZL jYF+JUNd/C1acwhN887fwzQMu6e4lYVt/qCUpJpVLltiJ9k+JLx+3N1i3OyjEvRxVrjo DONBLHbVakRTAwV4ruKYSF7Xqgq4Ndqph2QUagsR6OoKGq2CcOQ2DS66D45tkWCC68zn y4uJCxijy8n6kiBt+5EyeDLwfhEa+6v5DmzbcHYEOsriXsU+GBY1BOT5v+xfFou8YeX3 tslRhGkFNpbODYlDcJYCjDLVMwcnB/Ah53hMq6xq67DrEey0WV04crnIa55QfIfWBGo8 bCEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=7fk0+zfQPUjhKJZd4fHUCreFdVkC6Nw3uJmVrWhWzRI=; fh=6Iy23zC9AdgEjl8BT287tms7OsCTNhvcMTX6iUEgWw0=; b=FX4bAyiDZkynRtnw5+2XOtDRe+xWfb4LAlmcYipT0+pQ82Hp73JejeRwsJdXlUu84v XgKJSnSoK7BUfP1lo5TRVDJDMe5NK1JxnrdO5kLVgsjetspMvmuWMGbLvRIEHrq0p3BU WTFRlD9v+aXUXiBBLr+NcZ/ToGSJKx4soJ/vCX606m7BEJwCWrALkYKDb699cKyfwL4i 3AZwrQawoQ2IdUPrTOjQ4QU5/CU+ZbouXVMF+dtf0G+UufDGbzNUhfgNo4+M///ohiYw tFq1PfQR7FHdWN1BkwEAHisyU5+JJMn1rR5RrX5qIkleG+670j+7HahZcUgL8KEvcI35 JaaA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jTxYmF8j; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7cad2456cedsi1106263685a.605.2025.05.06.07.37.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 06 May 2025 07:37:01 -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=jTxYmF8j; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uCJOH-0006QL-3h; Tue, 06 May 2025 10:35:25 -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 1uCJOF-0006Nb-FP for qemu-devel@nongnu.org; Tue, 06 May 2025 10:35:23 -0400 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 1uCJOD-000122-80 for qemu-devel@nongnu.org; Tue, 06 May 2025 10:35:22 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-43d0359b1fcso36125135e9.0 for ; Tue, 06 May 2025 07:35:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1746542118; x=1747146918; 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=7fk0+zfQPUjhKJZd4fHUCreFdVkC6Nw3uJmVrWhWzRI=; b=jTxYmF8jIUb2GdsQJNxGKhG2qGp5wE6WLdJxDnt0ytXKkOSudoDMwxjLbEAD/yeUzw f7tMZtp5TBYTmcM34IbjnoNXmJRF1XFaycjrt7R44a6NKWl4+pZ8B5aGBp04Pw4tBI3L oMNAiAX4jdBGDtOh0KZDlA+53NCR0g73VQzlNaJgvPseBCGm7FmdWZGtPPCi1qNgFlWD 8BjNvyVowQG8k5uAD2KV8kzf/XcUcZCZds5pT6+gyUdCDfi03sPpEZ42+yd4ruPexSvS TPbs4V+tPh9u+fCQml0pK/PajCAPc7XzvHt7TK7dxZDWcDD/0mla5mQQCFb/vd1KODI6 Pm2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746542118; x=1747146918; 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=7fk0+zfQPUjhKJZd4fHUCreFdVkC6Nw3uJmVrWhWzRI=; b=M9vQW6yKBtMw6M2p125ce5xg0hW7T3L9jGuGZPTmfTrlak2aq+jecmYo4oMKE75D8d WREw+2hT1fDMBjTgDJO3IKTWpjjOzvLqYyiFHDEvG6IR27E1hcLwg8emasU8zxk7dYkR 1gcPvI6YwCNCyCHNYKnNcqem59kG4J+KcrnBkJdVPKp1W5dZ//WqnI72hJ+KNauOcEDg wiUCTdgU0t2k/PmePaK6Oh+8Js6e0C3a7d40ax/tSjPETHofIJXS2L8fgscOhklF8FLf 9QiMaljUCp6P2wJ2wiZeBLi8LFULF6MMkEVoG+MVzsoUVtmTmV33c80ril//Vs8qVsjB bHlQ== X-Gm-Message-State: AOJu0YwuCcicnl6jFhG6G17vi0oMQZ5Abc9u004Td29O9Aexgz6YJrx1 scp6dGuPvM4Q+ZgrRsStett5fiKds1hySIWykPLU5OLnC67oC8FMKVU/YqrU9t1Qb2Hjbj3uzci H X-Gm-Gg: ASbGncvgZ4oAuGjmKFV5V+tcONOHMsNfu7N7624uqai2CIw2Y2bHhLTu9g5NQQ/oMsh PNuWukXL8/PwiPHLLHiWq6aVkYIxNaFCK9rU5zAvs6sY683SAgs84k65k2EHYvta6QiXkbPmf21 xQA80zdkrdTP/dFQDt5m4b0UdNS0QuvSyet927Tq0q05Gpk9xQSDr/yKNVs6GwUEHRPRvSKLKvS 6HdcmCZBGeBKiMqNEFDkvH/A9zGpcCVdD/4jJ2spQ7460Bm0W6Nr0Ze+FcKWhvXb8YQneaFUTua a7JYxMhNKyC/AR7j9V3Bno0hIrCBXMBoF7tHms1kzrke5AAGdAvcP0eEL4KN7A3NhYH+d1ToU4y OC1fZPt4DuQCTLXkzfDUW X-Received: by 2002:a05:600c:c059:10b0:43c:f509:2bbf with SMTP id 5b1f17b1804b1-441d0105d86mr21202865e9.15.1746542118116; Tue, 06 May 2025 07:35:18 -0700 (PDT) Received: from localhost.localdomain (91-163-26-170.subs.proxad.net. [91.163.26.170]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-441b89d1636sm171373065e9.13.2025.05.06.07.35.17 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 06 May 2025 07:35:17 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= Subject: [PULL 01/22] bsd-user: add option to enable plugins Date: Tue, 6 May 2025 16:34:50 +0200 Message-ID: <20250506143512.4315-2-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250506143512.4315-1-philmd@linaro.org> References: <20250506143512.4315-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.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 From: Pierrick Bouvier Nothing prevent plugins to be enabled on this platform for user binaries, only the option in the driver is missing. Signed-off-by: Pierrick Bouvier Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20250331234228.3475706-1-pierrick.bouvier@linaro.org> Signed-off-by: Philippe Mathieu-Daudé --- bsd-user/main.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bsd-user/main.c b/bsd-user/main.c index fdb160bed0f..329bd1acc02 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -175,6 +175,9 @@ static void usage(void) "-strace log system calls\n" "-trace [[enable=]][,events=][,file=]\n" " specify tracing options\n" +#ifdef CONFIG_PLUGIN + "-plugin [file=][,=]\n" +#endif "\n" "Environment variables:\n" "QEMU_STRACE Print system calls and arguments similar to the\n" @@ -225,6 +228,8 @@ static void init_task_state(TaskState *ts) }; } +static QemuPluginList plugins = QTAILQ_HEAD_INITIALIZER(plugins); + void gemu_log(const char *fmt, ...) { va_list ap; @@ -307,6 +312,7 @@ int main(int argc, char **argv) cpu_model = NULL; qemu_add_opts(&qemu_trace_opts); + qemu_plugin_add_opts(); optind = 1; for (;;) { @@ -399,6 +405,11 @@ int main(int argc, char **argv) do_strace = 1; } else if (!strcmp(r, "trace")) { trace_opt_parse(optarg); +#ifdef CONFIG_PLUGIN + } else if (!strcmp(r, "plugin")) { + r = argv[optind++]; + qemu_plugin_opt_parse(r, &plugins); +#endif } else if (!strcmp(r, "0")) { argv0 = argv[optind++]; } else { @@ -433,6 +444,7 @@ int main(int argc, char **argv) exit(1); } trace_init_file(); + qemu_plugin_load_list(&plugins, &error_fatal); /* Zero out regs */ memset(regs, 0, sizeof(struct target_pt_regs));