From patchwork Thu Nov 2 17:19:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Manning X-Patchwork-Id: 13444065 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 C0172C4332F for ; Thu, 2 Nov 2023 17:24:03 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qybP5-0004dQ-9w; Thu, 02 Nov 2023 13:22:47 -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 1qybP3-0004dE-OF for qemu-devel@nongnu.org; Thu, 02 Nov 2023 13:22:45 -0400 Received: from mail-lo2gbr01on0707.outbound.protection.outlook.com ([2a01:111:f400:fe15::707] helo=GBR01-LO2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qybP1-0004ME-Co for qemu-devel@nongnu.org; Thu, 02 Nov 2023 13:22:45 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DPp1txx61vZTeZLTSTX11YTLX3PWTZFhMg34Qf1Z0WnWDQOnCaLajVb3vUb7yVpgFZnYM4JZmm8cc1CuGXrKJ6ERnlMb3HZD7Etu05Ii00RKL9SWM25N1wSd+2wA1rAgfdwUr9AtqnWw8EZP4cScGHwQh1itVybQFZlm98WlxrjPACOi/L8hoK01TASD5Fg7fUuyqI887A2yUiOGvikqGwGAB3iNNIGEnVBBKJlHEJrr9w/TNyxiXrsTxkPed3GeHDqfaeHcbl/G70P44Fkt3vxm45erNizniK3XA8LdLqVINiiNtN+Xeyxw+vkE/zVDgVJrfrWVanwIhEzifF0Fvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=K1W/y/ypHkIKI1hjgM1rmjBZ3ItQnsjjDX8kRgVWSYY=; b=bsaR286Vx+r3VBxaQLiUbGY3XvlLVt+WMyFBkHIN1vGE3iwejD9mzFygWSFOw5vG1ysxBpBH0srHFTw2GQteULKgW1Kt+eRmIenPGaZ1d8DRis1OnNNhzg98GL3b/+MZUn44OMA4g/sRJlamsidLhnMayEQNuC+jLEuT/k5E/TgN684LIfapbPA9SK0cEfo+xvTM9gIvw2Q0PVEljhWhODDPl1usz0KZSQuI1n91rLUcGVy3s8NNXoaoI+bryojdf69vSC+7k1c/kf/i/8chzF0+M1eFRuTkomvcL7Ws9gUUR3qsiETUFOdOuBBlEulnBnfYeHwqPc4IFQWO7IHzCQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=rapitasystems.com; dmarc=pass action=none header.from=rapitasystems.com; dkim=pass header.d=rapitasystems.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rapitasystems.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=K1W/y/ypHkIKI1hjgM1rmjBZ3ItQnsjjDX8kRgVWSYY=; b=eKK8VrkrDNwALXB3xdX/D3DxAJPqrTiv1yVFa8TZEMKeTkZw2ruyZIL1k0QXhlGkmLqX7wEhY1okcL7MWi86KxjbYbVJ1/XgLF7zXcuVIXAJg56Uyc6o6VNJicxVionEMna+MYUX/cB9JvC/NJZzqqCZyRfvKssMj3N5wkrfGcY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=rapitasystems.com; Received: from LO2P123MB4352.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:19a::8) by CWXP123MB3365.GBRP123.PROD.OUTLOOK.COM (2603:10a6:400:7b::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.19; Thu, 2 Nov 2023 17:22:36 +0000 Received: from LO2P123MB4352.GBRP123.PROD.OUTLOOK.COM ([fe80::a33f:4559:b41e:cea9]) by LO2P123MB4352.GBRP123.PROD.OUTLOOK.COM ([fe80::a33f:4559:b41e:cea9%4]) with mapi id 15.20.6954.021; Thu, 2 Nov 2023 17:22:36 +0000 From: Greg Manning To: qemu-devel@nongnu.org Cc: luoyonggang@gmail.com, richard.henderson@linaro.org, =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , Paolo Bonzini , Greg Manning Subject: [PATCH v2 1/4] plugins: add dllexport and dllimport to api funcs Date: Thu, 2 Nov 2023 17:19:44 +0000 Message-ID: <20231102172053.17692-2-gmanning@rapitasystems.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231102172053.17692-1-gmanning@rapitasystems.com> References: <20231102172053.17692-1-gmanning@rapitasystems.com> X-ClientProxiedBy: LO2P265CA0282.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a1::30) To LO2P123MB4352.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:19a::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LO2P123MB4352:EE_|CWXP123MB3365:EE_ X-MS-Office365-Filtering-Correlation-Id: 58e9388f-820f-4aef-4d62-08dbdbc84e10 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: beVVGmmS5FOvd5eoi4YFrBX+DEgJ9nf+L2Rg9EDbcoVjKWx5N51nCZmdvf7kwExTG/eSa4sgyd4CEzK3Ux7NNjCqQdxPI0xE2QeuCyqIW+1PN4FJqiTs770k0gbTDito/hKfMWpEuBO0FjFkxIXUBfr5C0R4bulf6I2omkqDbM0O4WgjLDXQloeEfIO31YQATmevR366tCfzGGA2vdoqB2SNNh9H8sYLSLvFJHVgPTjICGopq82wkuL2cXrOM376p51uVwQPRlzEz6d14eEuQAI6xEb9Cr8zJebyKjDOgOhvd0xDBnQTrkD3dMxwHQNdnxEa9WIlg+HGlR26BOjtfx6etNoqeqKrHlnX0L0FwShaHirdQhtSwn7Fc4wd2sgTMTLLOUKBby8R7BPJVi8o9pibl+6SARj4VfEtK+Vq+ocyjpayGYx+rzMPqjt2vNontMXJ4qP27vQM+oMwjSuYMfFV1dVDh6na14UIgDWdAIhRerOc/X2bDrWoAy/jmBp2vJEiviktr7QwWIZMc7/9j0ZetQ67MPI2jJT00+MB0FQ= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:LO2P123MB4352.GBRP123.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230031)(396003)(39840400004)(346002)(366004)(136003)(376002)(230922051799003)(451199024)(1800799009)(186009)(64100799003)(66556008)(54906003)(6916009)(66476007)(66946007)(316002)(6506007)(478600001)(1076003)(6666004)(107886003)(2616005)(4326008)(26005)(8936002)(83380400001)(8676002)(966005)(6486002)(6512007)(30864003)(5660300002)(36756003)(2906002)(38100700002)(66899024)(41300700001)(86362001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: g+vjLU4xChNB5apGOU6i7BI02+uUoFlX2xxRxf6PbPIu+SBm2A2yW33mZSit9zxHScYQ33gcP9F1PyY8wxDiWHjko+G3saTFJRqU4gEgwlWmu97VUdOhykgMbShbSB5y2uvy/7r+RBQOsbQWsFKONPVkhEYuz/GIQbEIWJ4CwBG5eaVrnZSg4GGTHxGqllnhsP52V7yP5siBHclGFNVyPc6oKKDbHa1tQ0D86r7GrHjkr0vz1bu35EeTCebRr75cLjyJefS7aUAryhn/XdM/IIkQYS0zgCHcNSEjqwYt4y45n8G0qyamBz+07h5/YwViE6I5kHiLNsc+6LgAfhZilFPPdRBCl7FJQqMPFwuaoqeEtyBwrVw1k0WkjWafarxWwVHJJI4obcPke19AyTjUzZ+3U2Of5ph0TdWuIs2xRwLobwXMwaA42GYHNyz4eC3XAsGWdJAeTtaa7GaOsUYOPwfh6pF+igjlVjehJrO0WQ8VAvky6ukBM5vaiBnw7pjFPb7zkOFl97gYgPeZyE0g5Xqdz5MzaSmxVwO/QgFF++hK35fdMdV5wnHxwBjogGdgUw3OWb6xESc5rKDoF1GmQDQVe8JAcvltOGwj68Fk705/Y5R9RQBUE+hA8ZSKlMonhFJCENVP/tsmmLpIK/l6lYEoj8eo89uDZtmRp9e464JtsUu1m2om3hK54rzlNqUEDvMmsHv00ooOCs1u7gkzHIENeXj1MZToVFN/g0hpwSFKW5QGp5TNQJU6oWyVZCCbtlHXu+cqk3QIThCasZ50i/GNkcNZEwLGvUMMiLMiW//Ds81bmDimaVNFeBxmfvpMwTSgQ8ArVyKPefOmSpUj0hTEM2pgI7eokfcbW++MA9TSU1tI1CvY//UO5507HHIcoZbBzKqTr0r/eDpTXnOGHPhi8itmbhxsGzU5cmOml+3OGO6HPgXlc1cWQrauLIH73A0NcTk7Yedg1cthIcMpDE152INIjGU9xsglbO2EccbgDotTsl2P+tEIZPzX+WDrmkCOpTcmlp7LbzOWKYJ5W5MQi9/n/dzPbJFGf0T3qJWHlE0UKhxeSe0+c3hvAf9rOKK0TqQwI+GDbK4u8oIHEvzrUIIJoX1898txTM1/1FCLjA+hJBtHSNu8/0cwHX8vR7lcPmExXBE6hV6p11gDCuxHSEEzILIz5MuH0q+idqfQi/Xp1dWjRb2lu3GyWynfAYftvtGuBG1a1NDdz4xnHUHKthx2LXy6oygR3b3LVmbdiSGQRDxT4Va/45c7iBfjRYkwwiZR2GbDfe9LlRgfqeWvXn+cCiaZaMr0TPqjYjrksdSAOjFLfWE0VXZ7uMCmOmDiTHHbyiICWEO3imnNMHMYK5K7/9j9mQLlfxeWsfneW0iVbZNBryzlMYXoC0HS6NomVqmtHSnW1ozLzwyP6AmD66jeOk/xN2UChE5BmzsI1gMy0WGxDTLVZh9YV5lDi+Ba9cqm0HGq6cBXCOZaI2FFAjw8TqwOb7LH7SOEXA51uJvICeaw6Ku8gl18SGDSgynlZQh6Zatr6yXKTJZJLpA/EelrHIFWU5BxbITjJjk0ebumC7eo3NsRAE8ViU2t3v/xksnIOo9JDC4yzi4DRg== X-OriginatorOrg: rapitasystems.com X-MS-Exchange-CrossTenant-Network-Message-Id: 58e9388f-820f-4aef-4d62-08dbdbc84e10 X-MS-Exchange-CrossTenant-AuthSource: LO2P123MB4352.GBRP123.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2023 17:22:36.1002 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 63a1ab10-c4bd-4b99-881c-0040cec74971 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 05UUVHX+sWjxinapp+4/qnxlDT+veqd1RjCrnpW7j2kqoEtvERjL4iotm8kBqI9yuYgqHM48qull61/rdhKWXyyyiI2P7i/MMLJT5yscblE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CWXP123MB3365 Received-SPF: pass client-ip=2a01:111:f400:fe15::707; envelope-from=gmanning@rapitasystems.com; helo=GBR01-LO2-obe.outbound.protection.outlook.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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org In qemu-plugin.h, mark all API functions as __declspec(dllexport) when compiling the executables, and as __declspec(dllimport) when being used to compile plugins against. Signed-off-by: Greg Manning --- include/qemu/qemu-plugin.h | 50 +++++++++++++++++++++++++++++++++++--- 1 file changed, 47 insertions(+), 3 deletions(-) diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index 50a9957279..4daab6efd2 100644 --- a/include/qemu/qemu-plugin.h +++ b/include/qemu/qemu-plugin.h @@ -22,15 +22,18 @@ * https://gcc.gnu.org/wiki/Visibility */ #if defined _WIN32 || defined __CYGWIN__ - #ifdef BUILDING_DLL - #define QEMU_PLUGIN_EXPORT __declspec(dllexport) - #else + #ifdef CONFIG_PLUGIN #define QEMU_PLUGIN_EXPORT __declspec(dllimport) + #define QEMU_PLUGIN_API __declspec(dllexport) + #else + #define QEMU_PLUGIN_EXPORT __declspec(dllexport) + #define QEMU_PLUGIN_API __declspec(dllimport) #endif #define QEMU_PLUGIN_LOCAL #else #define QEMU_PLUGIN_EXPORT __attribute__((visibility("default"))) #define QEMU_PLUGIN_LOCAL __attribute__((visibility("hidden"))) + #define QEMU_PLUGIN_API #endif /** @@ -147,6 +150,7 @@ typedef void (*qemu_plugin_vcpu_udata_cb_t)(unsigned int vcpu_index, * * Note: Calling this function from qemu_plugin_install() is a bug. */ +QEMU_PLUGIN_API void qemu_plugin_uninstall(qemu_plugin_id_t id, qemu_plugin_simple_cb_t cb); /** @@ -160,6 +164,7 @@ void qemu_plugin_uninstall(qemu_plugin_id_t id, qemu_plugin_simple_cb_t cb); * Plugins are reset asynchronously, and therefore the given plugin receives * callbacks until @cb is called. */ +QEMU_PLUGIN_API void qemu_plugin_reset(qemu_plugin_id_t id, qemu_plugin_simple_cb_t cb); /** @@ -171,6 +176,7 @@ void qemu_plugin_reset(qemu_plugin_id_t id, qemu_plugin_simple_cb_t cb); * * See also: qemu_plugin_register_vcpu_exit_cb() */ +QEMU_PLUGIN_API void qemu_plugin_register_vcpu_init_cb(qemu_plugin_id_t id, qemu_plugin_vcpu_simple_cb_t cb); @@ -183,6 +189,7 @@ void qemu_plugin_register_vcpu_init_cb(qemu_plugin_id_t id, * * See also: qemu_plugin_register_vcpu_init_cb() */ +QEMU_PLUGIN_API void qemu_plugin_register_vcpu_exit_cb(qemu_plugin_id_t id, qemu_plugin_vcpu_simple_cb_t cb); @@ -193,6 +200,7 @@ void qemu_plugin_register_vcpu_exit_cb(qemu_plugin_id_t id, * * The @cb function is called every time a vCPU idles. */ +QEMU_PLUGIN_API void qemu_plugin_register_vcpu_idle_cb(qemu_plugin_id_t id, qemu_plugin_vcpu_simple_cb_t cb); @@ -203,6 +211,7 @@ void qemu_plugin_register_vcpu_idle_cb(qemu_plugin_id_t id, * * The @cb function is called every time a vCPU resumes execution. */ +QEMU_PLUGIN_API void qemu_plugin_register_vcpu_resume_cb(qemu_plugin_id_t id, qemu_plugin_vcpu_simple_cb_t cb); @@ -253,6 +262,7 @@ typedef void (*qemu_plugin_vcpu_tb_trans_cb_t)(qemu_plugin_id_t id, * callbacks to be triggered when the block or individual instruction * executes. */ +QEMU_PLUGIN_API void qemu_plugin_register_vcpu_tb_trans_cb(qemu_plugin_id_t id, qemu_plugin_vcpu_tb_trans_cb_t cb); @@ -265,6 +275,7 @@ void qemu_plugin_register_vcpu_tb_trans_cb(qemu_plugin_id_t id, * * The @cb function is called every time a translated unit executes. */ +QEMU_PLUGIN_API void qemu_plugin_register_vcpu_tb_exec_cb(struct qemu_plugin_tb *tb, qemu_plugin_vcpu_udata_cb_t cb, enum qemu_plugin_cb_flags flags, @@ -296,6 +307,7 @@ enum qemu_plugin_op { * Note: ops are not atomic so in multi-threaded/multi-smp situations * you will get inexact results. */ +QEMU_PLUGIN_API void qemu_plugin_register_vcpu_tb_exec_inline(struct qemu_plugin_tb *tb, enum qemu_plugin_op op, void *ptr, uint64_t imm); @@ -309,6 +321,7 @@ void qemu_plugin_register_vcpu_tb_exec_inline(struct qemu_plugin_tb *tb, * * The @cb function is called every time an instruction is executed */ +QEMU_PLUGIN_API void qemu_plugin_register_vcpu_insn_exec_cb(struct qemu_plugin_insn *insn, qemu_plugin_vcpu_udata_cb_t cb, enum qemu_plugin_cb_flags flags, @@ -324,6 +337,7 @@ void qemu_plugin_register_vcpu_insn_exec_cb(struct qemu_plugin_insn *insn, * Insert an inline op to every time an instruction executes. Useful * if you just want to increment a single counter somewhere in memory. */ +QEMU_PLUGIN_API void qemu_plugin_register_vcpu_insn_exec_inline(struct qemu_plugin_insn *insn, enum qemu_plugin_op op, void *ptr, uint64_t imm); @@ -334,6 +348,7 @@ void qemu_plugin_register_vcpu_insn_exec_inline(struct qemu_plugin_insn *insn, * * Returns: number of instructions in this block */ +QEMU_PLUGIN_API size_t qemu_plugin_tb_n_insns(const struct qemu_plugin_tb *tb); /** @@ -342,6 +357,7 @@ size_t qemu_plugin_tb_n_insns(const struct qemu_plugin_tb *tb); * * Returns: virtual address of block start */ +QEMU_PLUGIN_API uint64_t qemu_plugin_tb_vaddr(const struct qemu_plugin_tb *tb); /** @@ -355,6 +371,7 @@ uint64_t qemu_plugin_tb_vaddr(const struct qemu_plugin_tb *tb); * * Returns: opaque handle to instruction */ +QEMU_PLUGIN_API struct qemu_plugin_insn * qemu_plugin_tb_get_insn(const struct qemu_plugin_tb *tb, size_t idx); @@ -368,6 +385,7 @@ qemu_plugin_tb_get_insn(const struct qemu_plugin_tb *tb, size_t idx); * Returns: pointer to a stream of bytes containing the value of this * instructions opcode. */ +QEMU_PLUGIN_API const void *qemu_plugin_insn_data(const struct qemu_plugin_insn *insn); /** @@ -376,6 +394,7 @@ const void *qemu_plugin_insn_data(const struct qemu_plugin_insn *insn); * * Returns: size of instruction in bytes */ +QEMU_PLUGIN_API size_t qemu_plugin_insn_size(const struct qemu_plugin_insn *insn); /** @@ -384,6 +403,7 @@ size_t qemu_plugin_insn_size(const struct qemu_plugin_insn *insn); * * Returns: virtual address of instruction */ +QEMU_PLUGIN_API uint64_t qemu_plugin_insn_vaddr(const struct qemu_plugin_insn *insn); /** @@ -392,6 +412,7 @@ uint64_t qemu_plugin_insn_vaddr(const struct qemu_plugin_insn *insn); * * Returns: hardware (physical) target address of instruction */ +QEMU_PLUGIN_API void *qemu_plugin_insn_haddr(const struct qemu_plugin_insn *insn); /** @@ -410,6 +431,7 @@ struct qemu_plugin_hwaddr; * * Returns: size of access in ^2 (0=byte, 1=16bit, 2=32bit etc...) */ +QEMU_PLUGIN_API unsigned int qemu_plugin_mem_size_shift(qemu_plugin_meminfo_t info); /** * qemu_plugin_mem_is_sign_extended() - was the access sign extended @@ -417,6 +439,7 @@ unsigned int qemu_plugin_mem_size_shift(qemu_plugin_meminfo_t info); * * Returns: true if it was, otherwise false */ +QEMU_PLUGIN_API bool qemu_plugin_mem_is_sign_extended(qemu_plugin_meminfo_t info); /** * qemu_plugin_mem_is_big_endian() - was the access big endian @@ -424,6 +447,7 @@ bool qemu_plugin_mem_is_sign_extended(qemu_plugin_meminfo_t info); * * Returns: true if it was, otherwise false */ +QEMU_PLUGIN_API bool qemu_plugin_mem_is_big_endian(qemu_plugin_meminfo_t info); /** * qemu_plugin_mem_is_store() - was the access a store @@ -431,6 +455,7 @@ bool qemu_plugin_mem_is_big_endian(qemu_plugin_meminfo_t info); * * Returns: true if it was, otherwise false */ +QEMU_PLUGIN_API bool qemu_plugin_mem_is_store(qemu_plugin_meminfo_t info); /** @@ -446,6 +471,7 @@ bool qemu_plugin_mem_is_store(qemu_plugin_meminfo_t info); * information about the handle should be recovered before the * callback returns. */ +QEMU_PLUGIN_API struct qemu_plugin_hwaddr *qemu_plugin_get_hwaddr(qemu_plugin_meminfo_t info, uint64_t vaddr); @@ -462,6 +488,7 @@ struct qemu_plugin_hwaddr *qemu_plugin_get_hwaddr(qemu_plugin_meminfo_t info, * Returns true if the handle's memory operation is to memory-mapped IO, or * false if it is to RAM */ +QEMU_PLUGIN_API bool qemu_plugin_hwaddr_is_io(const struct qemu_plugin_hwaddr *haddr); /** @@ -473,12 +500,14 @@ bool qemu_plugin_hwaddr_is_io(const struct qemu_plugin_hwaddr *haddr); * Note that the returned physical address may not be unique if you are dealing * with multiple address spaces. */ +QEMU_PLUGIN_API uint64_t qemu_plugin_hwaddr_phys_addr(const struct qemu_plugin_hwaddr *haddr); /* * Returns a string representing the device. The string is valid for * the lifetime of the plugin. */ +QEMU_PLUGIN_API const char *qemu_plugin_hwaddr_device_name(const struct qemu_plugin_hwaddr *h); /** @@ -513,6 +542,7 @@ typedef void (*qemu_plugin_vcpu_mem_cb_t) (unsigned int vcpu_index, * callback so the plugin is responsible for ensuring it doesn't get * confused by making appropriate use of locking if required. */ +QEMU_PLUGIN_API void qemu_plugin_register_vcpu_mem_cb(struct qemu_plugin_insn *insn, qemu_plugin_vcpu_mem_cb_t cb, enum qemu_plugin_cb_flags flags, @@ -531,6 +561,7 @@ void qemu_plugin_register_vcpu_mem_cb(struct qemu_plugin_insn *insn, * instruction. This provides for a lightweight but not thread-safe * way of counting the number of operations done. */ +QEMU_PLUGIN_API void qemu_plugin_register_vcpu_mem_inline(struct qemu_plugin_insn *insn, enum qemu_plugin_mem_rw rw, enum qemu_plugin_op op, void *ptr, @@ -544,6 +575,7 @@ typedef void uint64_t a3, uint64_t a4, uint64_t a5, uint64_t a6, uint64_t a7, uint64_t a8); +QEMU_PLUGIN_API void qemu_plugin_register_vcpu_syscall_cb(qemu_plugin_id_t id, qemu_plugin_vcpu_syscall_cb_t cb); @@ -551,6 +583,7 @@ typedef void (*qemu_plugin_vcpu_syscall_ret_cb_t)(qemu_plugin_id_t id, unsigned int vcpu_idx, int64_t num, int64_t ret); +QEMU_PLUGIN_API void qemu_plugin_register_vcpu_syscall_ret_cb(qemu_plugin_id_t id, qemu_plugin_vcpu_syscall_ret_cb_t cb); @@ -563,6 +596,7 @@ qemu_plugin_register_vcpu_syscall_ret_cb(qemu_plugin_id_t id, * Returns an allocated string containing the disassembly */ +QEMU_PLUGIN_API char *qemu_plugin_insn_disas(const struct qemu_plugin_insn *insn); /** @@ -572,6 +606,7 @@ char *qemu_plugin_insn_disas(const struct qemu_plugin_insn *insn); * Return a static string referring to the symbol. This is dependent * on the binary QEMU is running having provided a symbol table. */ +QEMU_PLUGIN_API const char *qemu_plugin_insn_symbol(const struct qemu_plugin_insn *insn); /** @@ -583,9 +618,11 @@ const char *qemu_plugin_insn_symbol(const struct qemu_plugin_insn *insn); * * See also: qemu_plugin_register_vcpu_init_cb() */ +QEMU_PLUGIN_API void qemu_plugin_vcpu_for_each(qemu_plugin_id_t id, qemu_plugin_vcpu_simple_cb_t cb); +QEMU_PLUGIN_API void qemu_plugin_register_flush_cb(qemu_plugin_id_t id, qemu_plugin_simple_cb_t cb); @@ -602,6 +639,7 @@ void qemu_plugin_register_flush_cb(qemu_plugin_id_t id, * In user-mode it is possible a few un-instrumented instructions from * child threads may run before the host kernel reaps the threads. */ +QEMU_PLUGIN_API void qemu_plugin_register_atexit_cb(qemu_plugin_id_t id, qemu_plugin_udata_cb_t cb, void *userdata); @@ -615,6 +653,7 @@ int qemu_plugin_n_max_vcpus(void); * qemu_plugin_outs() - output string via QEMU's logging system * @string: a string */ +QEMU_PLUGIN_API void qemu_plugin_outs(const char *string); /** @@ -628,6 +667,7 @@ void qemu_plugin_outs(const char *string); * returns true if the combination @name=@val parses correctly to a boolean * argument, and false otherwise */ +QEMU_PLUGIN_API bool qemu_plugin_bool_parse(const char *name, const char *val, bool *ret); /** @@ -638,6 +678,7 @@ bool qemu_plugin_bool_parse(const char *name, const char *val, bool *ret); * return NULL. The user should g_free() the string once no longer * needed. */ +QEMU_PLUGIN_API const char *qemu_plugin_path_to_binary(void); /** @@ -646,6 +687,7 @@ const char *qemu_plugin_path_to_binary(void); * Returns the nominal start address of the main text segment in * user-mode. Currently returns 0 for system emulation. */ +QEMU_PLUGIN_API uint64_t qemu_plugin_start_code(void); /** @@ -654,6 +696,7 @@ uint64_t qemu_plugin_start_code(void); * Returns the nominal end address of the main text segment in * user-mode. Currently returns 0 for system emulation. */ +QEMU_PLUGIN_API uint64_t qemu_plugin_end_code(void); /** @@ -662,6 +705,7 @@ uint64_t qemu_plugin_end_code(void); * Returns the nominal entry address of the main text segment in * user-mode. Currently returns 0 for system emulation. */ +QEMU_PLUGIN_API uint64_t qemu_plugin_entry_code(void); #endif /* QEMU_QEMU_PLUGIN_H */ From patchwork Thu Nov 2 17:19:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Manning X-Patchwork-Id: 13444064 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 16BC9C4167B for ; Thu, 2 Nov 2023 17:23:47 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qybP8-0004es-6L; Thu, 02 Nov 2023 13:22:50 -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 1qybP5-0004dd-S0 for qemu-devel@nongnu.org; Thu, 02 Nov 2023 13:22:47 -0400 Received: from mail-lo2gbr01on0707.outbound.protection.outlook.com ([2a01:111:f400:fe15::707] helo=GBR01-LO2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qybP4-0004ME-0s for qemu-devel@nongnu.org; Thu, 02 Nov 2023 13:22:47 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ROTU/XlwM3KenxPXPmdG5vgXlcIhtlpOiEsOChsHGzORxouVVtyd5jL73OPqzuTUE16e0UPznIkSAFGiok70qN8/kgN82ioMJ4sUTMi4d+MrqDyldR6s5jc/EtWF7ws1O/8Nmx092hg3jNfyCrjDkTYuVZwZcgcFjyJGV2y1GvKTt3hdxDC7rTLA8VdDi52ZYzKSYn7Uwz6y4ov0I+tSoD2uDJxVtOT0vN4dkEfKzSzNBYhV72bsLhEWhd8Vn0d7e2rsLTfVWcsVQwrQa7+QP2b6+2n9bsOeQgnzoHjCsSk3WWwfvjGzVsiGh4p8uGnETL1akrxvnTNnjs818gakhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=xzW5ACAW5ubSA+9ssrRA0Vnz7MdMLMFnlWTB8yiQqq8=; b=CCwDnRsgc1jrS4F3kqQ2lvAtM1qKHC2LbLmHBjG2CsOI0DDpB/MHORI20k7h9jk3/PWEBGg7sgXtcmZe8wvvHJeq3x+ROVwladokg1BbFexqH+CWfKKYIAkhzYhBUncnA/NASZ6CH6a8/dMiPD5MLq9CC5Y/+JiCOqDa6xDhmmq+N15DzKDiw9QMmwrZOKYH7ySrtLlVUaHxSaQ1vw1hKjQMKOoqdIqlviaRtsxW36FEDeTT4Xo7qJp15RPYXWYWBCJA2pe8ibp1Iuavmyv1ibD63PH2R7FPbM+knDzMKQ5F557SiAcqQeh/gVdpJKuEDFco+H913kiX/8sho2cSOg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=rapitasystems.com; dmarc=pass action=none header.from=rapitasystems.com; dkim=pass header.d=rapitasystems.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rapitasystems.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xzW5ACAW5ubSA+9ssrRA0Vnz7MdMLMFnlWTB8yiQqq8=; b=lJ8/pPCAak0O0SQvBF1g9CMQIslyfX0IV/iV3hgWcWC1ZvL6cpfoh806I3GXeAD689P9tvch8Rq+rT7Ssgi1lMnWwbPRMOJcLTgWjg36X9XF/cbAsLXEMdhwxDnda3IeGL/qXn46gT/t8kQoJ2IgGtzM/EaJLe6M3qHpxau7cX8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=rapitasystems.com; Received: from LO2P123MB4352.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:19a::8) by CWXP123MB3365.GBRP123.PROD.OUTLOOK.COM (2603:10a6:400:7b::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.19; Thu, 2 Nov 2023 17:22:37 +0000 Received: from LO2P123MB4352.GBRP123.PROD.OUTLOOK.COM ([fe80::a33f:4559:b41e:cea9]) by LO2P123MB4352.GBRP123.PROD.OUTLOOK.COM ([fe80::a33f:4559:b41e:cea9%4]) with mapi id 15.20.6954.021; Thu, 2 Nov 2023 17:22:37 +0000 From: Greg Manning To: qemu-devel@nongnu.org Cc: luoyonggang@gmail.com, richard.henderson@linaro.org, =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , Paolo Bonzini , Greg Manning Subject: [PATCH v2 2/4] plugins: make test/example plugins work on windows Date: Thu, 2 Nov 2023 17:19:45 +0000 Message-ID: <20231102172053.17692-3-gmanning@rapitasystems.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231102172053.17692-1-gmanning@rapitasystems.com> References: <20231102172053.17692-1-gmanning@rapitasystems.com> X-ClientProxiedBy: LO2P265CA0282.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a1::30) To LO2P123MB4352.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:19a::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LO2P123MB4352:EE_|CWXP123MB3365:EE_ X-MS-Office365-Filtering-Correlation-Id: 40ea0701-a020-4aa2-9205-08dbdbc84ef7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 93pVrQcHmsh9FKejt7Kfa+nAyQLrT2NmvM59RPaBUXliPbSvfy0ZSrcxFrnVzzZTFB5PLcoqHBjvv6I+wxy5J0vCyJcu4mOkW6oIsTnBZZIKnvr+EYAaDVVEys3Jd/Q7r/b8gnqpILyJ4IhI8hdZq93ty9ePo32pIQJINxtCb+y52vdh3sUTGkNPEnXUob3gs9PmPlM6w6sChYNcl/C7fTAFj5FgJKFXmLTXZsI4ibVMmkAD4VqEni5lOvFWNbextS3aBwT6+5mAAIehClrRQ48cRlgEA7urRYXabks6EmY17URs6eNSxQDVvQ5Rj06lbtPd6YEgiDiAgfKYBu2jVnrwz8JFAB7ZXxjXh6ZymanN+lVQsJ6fm+N3+6fLuQEDe55FmJU5ufLOSpPf5yk9CNCmRy0soyC6kaHV1FY23EOOSikVtyjx8+E9ZukqOy9Hmn9bynoH9b2cUTAZfH/I4LNewfwyr7BvAoHxojYZKLlYGuR6mDFUpTQ5R2/ufp7rPuniBHT2ycloiGqBkXwaC9HiA7yB3nEBFkZ0KK/xkb6VOCIfTtFmRMy4KCpMJCzSHPm5u8qqIHQmHUucwioT4o/1nKmzcN39yd5il91P5rY= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:LO2P123MB4352.GBRP123.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230031)(396003)(39840400004)(346002)(366004)(136003)(376002)(230922051799003)(451199024)(1800799009)(186009)(64100799003)(66556008)(54906003)(6916009)(66476007)(66946007)(316002)(6506007)(478600001)(1076003)(6666004)(107886003)(2616005)(4326008)(26005)(8936002)(83380400001)(8676002)(966005)(6486002)(19627235002)(45080400002)(6512007)(5660300002)(36756003)(2906002)(38100700002)(41300700001)(86362001)(460985005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Wh3/T14oTseH4P16Tl8eQ9FX2v2ohf3d8Ln7By6Q1zZESnJ2LVTvcT6JbqrnVpksbmFFSHnKWHMysDi/1CUIb6ocW9reoMqJ6+Yid4r1yHFdrddbq5ae5jv+Y9WPvq6Kl9qHQaTg6OQfXP4Sq5AH8IDfdiGowzoxQei3t1XDpXcjjMx96BBb6Bq/GEcCwsrqoSxwdYuEtmlcU5Eb5y+y6vhHmk59gRsu30O3zItDvhblIFc5sOlisMD0xBoWgUpiqJAr2PCjxeSMyTj/fOkaHTudDBDBnkBVIwIzhSzT4dHMVEd7hOehbty8tDvUtHMclt41r+b9EFinOM7HWmrblJvfqSkyFP407DGkoPRNEFGg2Fq96+3ajNIodglXidlse0tWUpwGyGvOiVGsw+6K0ps6aBm0ESZ5qxtdr21vESVKR5Ziih2PdfoAj8B3LbI+Z0M1G2MdG9SdNdN8EKzulYSd469rN9PMkMt6IizVniZt2ped39sTHvqHdkHxioXT5qevzchviin8Wu9Cg6xfTcMc3XFpus8Lks15HiSbtbqP9nBciY3zgUkePD7WxBs02UfOhDYyaWUUpXKm+YDtIJnJyeAeKQqPahLxhPsu3g8yRz+hD4zvT+aPwvK0lNC9nAlBIL8tqUMKWtD9wSlZZ9uD5+1ryJeXFHdGZqtj81rXwRmWy/n8WirPkpYylUE0mhAUTDj4MtFFCrHiyYpRBCQPFUt0vJlATjvS9davzdvqLayL2SRqUntYnRaauYnUenk60NHw7m+y/NXdts0BH5Uc2vNQfVLk+4tX1zOGmmvvbCnz8R0bdUvU5Tlbemq9MRNJPdXeaWTeGN7hJ5GR+On2uKqvuPUmi/vWKpH31LoVLx66OMXWV3sXFxZ6pMYRR2TqJ9Xl1wubwItSJ62ZyqFfDKhhGQSLeKukgUAxqRLfFd8IykbinP6PG54oRKs61FKIHRClqUu/dHX3uh/qxSWE3LYceypdOIRQ12GlGcgHqaQ95gLXNaKJ4+LbP305+LeuqRjTl228Sgg7mLhjY+sTqnZ/aNypFOr3qftl5cyof26AkK+qA3O/W1f/aEs8ilC7SD25Ztyp2SN4N7uX7R19OBrP/wdX73aQNuDLIFbmJT9n8tMzD5fzv7JOXdPI5lMLXiZ1KC58svOYrKWNbd42DcJKM3xga+D7l1IJnj/fTXQDh7hCr+soncgyy4sn91RkOZ0dN4FRkw1tD6cdj2PTKG9Mi6Vo4I0UqnwfnDG4ScM5Ki4oYcnJr+tQN2y7fWRX1SiC0RkmndEZr+tjhK2+9sSLbzGZ080ts/DCuqO41FpI+y8I4XShDzTjQMO8BtsW/rLo67GMCNBUddt9Yd2hvEqx/5I2dMRrCwSDSlMLEBmaM6xZXVPtjEcMB+kgp1AT/2XktQCsEEKtn1EUf7M9/N7bXShE+Rsnh8E5DFpKNX+TLZ8pGaDg/g6mDFWjp7Df58pDsC2VH7ojFarELGpTW8oZQTZdZCzRZMmkPTd1c4TvHrm4Nin+2IbGZ1FTPp/FDw8KQqNO84JEuv/RmPh0tavhZuTH56cWZnDGQsUQKfzCj7u9j56Vzn9CiWqCF3Hy3wUSYxAPID8r0zE5zw== X-OriginatorOrg: rapitasystems.com X-MS-Exchange-CrossTenant-Network-Message-Id: 40ea0701-a020-4aa2-9205-08dbdbc84ef7 X-MS-Exchange-CrossTenant-AuthSource: LO2P123MB4352.GBRP123.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2023 17:22:37.2330 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 63a1ab10-c4bd-4b99-881c-0040cec74971 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: fwXlBy7KAeF7ehIyF5dvLwEwTcA44HTmlX1iE4k3w/osaaqmQYQ8gDz9bVaaBFAXTwOmuN39bq8es0zZsqi28Czvip9ye9sFH6kBphm8eZU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CWXP123MB3365 Received-SPF: pass client-ip=2a01:111:f400:fe15::707; envelope-from=gmanning@rapitasystems.com; helo=GBR01-LO2-obe.outbound.protection.outlook.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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Generate a qemu_plugin_api.lib delay import lib on windows, for windows qemu plugins to link against. Implement an example dll load fail hook to link up the API functions correctly when a plugin is loaded on windows. Update the build scripts for the test and example plugins to use these things. Signed-off-by: Greg Manning --- configure | 3 +++ contrib/plugins/Makefile | 20 ++++++++++++++++---- contrib/plugins/win32_linker.c | 34 ++++++++++++++++++++++++++++++++++ plugins/meson.build | 17 +++++++++++++++++ tests/plugin/meson.build | 14 +++++++++++--- 5 files changed, 81 insertions(+), 7 deletions(-) create mode 100644 contrib/plugins/win32_linker.c diff --git a/configure b/configure index f1456f6123..04f2cdd166 100755 --- a/configure +++ b/configure @@ -1662,6 +1662,9 @@ echo "CFLAGS=${CFLAGS-$default_cflags} $EXTRA_CFLAGS" >> contrib/plugins/$config if test "$targetos" = darwin; then echo "CONFIG_DARWIN=y" >> contrib/plugins/$config_host_mak fi +if test "$targetos" = windows; then + echo "CONFIG_WIN32=y" >> contrib/plugins/$config_host_mak +fi # tests/tcg configuration (config_host_mak=tests/tcg/config-host.mak diff --git a/contrib/plugins/Makefile b/contrib/plugins/Makefile index 8ba78c7a32..751fa38619 100644 --- a/contrib/plugins/Makefile +++ b/contrib/plugins/Makefile @@ -22,7 +22,14 @@ NAMES += hwprofile NAMES += cache NAMES += drcov -SONAMES := $(addsuffix .so,$(addprefix lib,$(NAMES))) +ifeq ($(CONFIG_WIN32),y) +SO_SUFFIX := .dll +LDLIBS += $(shell $(PKG_CONFIG) --libs glib-2.0) +else +SO_SUFFIX := .so +endif + +SONAMES := $(addsuffix $(SO_SUFFIX),$(addprefix lib,$(NAMES))) # The main QEMU uses Glib extensively so it's perfectly fine to use it # in plugins (which many example do). @@ -35,15 +42,20 @@ all: $(SONAMES) %.o: %.c $(CC) $(CFLAGS) $(PLUGIN_CFLAGS) -c -o $@ $< -lib%.so: %.o -ifeq ($(CONFIG_DARWIN),y) +ifeq ($(CONFIG_WIN32),y) +lib%$(SO_SUFFIX): %.o win32_linker.o ../../plugins/qemu_plugin_api.lib + $(CC) -shared -o $@ $^ $(LDLIBS) +else ifeq ($(CONFIG_DARWIN),y) +lib%$(SO_SUFFIX): %.o $(CC) -bundle -Wl,-undefined,dynamic_lookup -o $@ $^ $(LDLIBS) else +lib%$(SO_SUFFIX): %.o $(CC) -shared -o $@ $^ $(LDLIBS) endif + clean: - rm -f *.o *.so *.d + rm -f *.o *$(SO_SUFFIX) *.d rm -Rf .libs .PHONY: all clean diff --git a/contrib/plugins/win32_linker.c b/contrib/plugins/win32_linker.c new file mode 100644 index 0000000000..50797d616e --- /dev/null +++ b/contrib/plugins/win32_linker.c @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2023, Greg Manning + * + * This hook, __pfnDliFailureHook2, is documented in the microsoft documentation here: + * https://learn.microsoft.com/en-us/cpp/build/reference/error-handling-and-notification + * It gets called when a delay-loaded DLL encounters various errors. + * We handle the specific case of a DLL looking for a "qemu.exe", + * and give it the running executable (regardless of what it is named). + * + * This work is licensed under the terms of the GNU LGPL, version 2 or later. + * See the COPYING.LIB file in the top-level directory. + */ + +#include +#include + +FARPROC WINAPI dll_failure_hook(unsigned dliNotify, PDelayLoadInfo pdli); + + +PfnDliHook __pfnDliFailureHook2 = dll_failure_hook; + +FARPROC WINAPI dll_failure_hook(unsigned dliNotify, PDelayLoadInfo pdli) { + if (dliNotify == dliFailLoadLib) { + /* If the failing request was for qemu.exe, ... */ + if (strcmp(pdli->szDll, "qemu.exe") == 0) { + /* Then pass back a pointer to the top level module. */ + HMODULE top = GetModuleHandle(NULL); + return (FARPROC) top; + } + } + /* Otherwise we can't do anything special. */ + return 0; +} + diff --git a/plugins/meson.build b/plugins/meson.build index 71ed996ed3..8ed9fa270c 100644 --- a/plugins/meson.build +++ b/plugins/meson.build @@ -14,6 +14,23 @@ if not enable_modules endif if get_option('plugins') + if targetos == 'windows' + # Generate a .lib file for plugins to link against. + # First, create a .def file listing all the symbols a plugin should expect to have + # available in qemu + win32_plugin_def = configure_file( + input: files('qemu-plugins.symbols'), + output: 'qemu_plugin_api.def', + capture: true, + command: ['sed', '-e', '0,/^/s//EXPORTS/; s/[{};]//g', '@INPUT@']) + # then use dlltool to assemble a delaylib. + win32_qemu_plugin_api_lib = configure_file( + input: win32_plugin_def, + output: 'qemu_plugin_api.lib', + command: ['dlltool', '--input-def', '@INPUT@', + '--output-delaylib', '@OUTPUT@', '--dllname', 'qemu.exe'] + ) + endif specific_ss.add(files( 'loader.c', 'core.c', diff --git a/tests/plugin/meson.build b/tests/plugin/meson.build index 322cafcdf6..528bb9d86c 100644 --- a/tests/plugin/meson.build +++ b/tests/plugin/meson.build @@ -1,9 +1,17 @@ t = [] if get_option('plugins') foreach i : ['bb', 'empty', 'insn', 'mem', 'syscall'] - t += shared_module(i, files(i + '.c'), - include_directories: '../../include/qemu', - dependencies: glib) + if targetos == 'windows' + t += shared_module(i, files(i + '.c') + '../../contrib/plugins/win32_linker.c', + include_directories: '../../include/qemu', + objects: [win32_qemu_plugin_api_lib], + dependencies: glib) + + else + t += shared_module(i, files(i + '.c'), + include_directories: '../../include/qemu', + dependencies: glib) + endif endforeach endif if t.length() > 0 From patchwork Thu Nov 2 17:19:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Manning X-Patchwork-Id: 13444063 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 3C6E6C4332F for ; Thu, 2 Nov 2023 17:23:46 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qybP8-0004fs-UE; Thu, 02 Nov 2023 13:22:50 -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 1qybP7-0004eU-HW for qemu-devel@nongnu.org; Thu, 02 Nov 2023 13:22:49 -0400 Received: from mail-lo2gbr01on0707.outbound.protection.outlook.com ([2a01:111:f400:fe15::707] helo=GBR01-LO2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qybP6-0004ME-3q for qemu-devel@nongnu.org; Thu, 02 Nov 2023 13:22:49 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hufquIzBQ/j0sxFnLwed8+eVr6WLAWca+QSE0PqbjBb6iyoRcayqvaDLEXrszAMJXLggy0dlbBvtg56zWDOl+/K21HCfApz5GMDfa40e0JSWaPNLZA7YlLO/iB8nMtIRfqi/K0kukyWrhkg33bwRzklG6C1qko0x6T0RGNHD4dYNuoy+4/S1+t55gt3RIs6a/W97Zxs6c1HFp1jtRCzYUsVmIFf0P0+mfaRqNDKeOScItcCbZpghFXeUf8xys7uVG+SIK/KOjCq/iWQJnnF153DcRHpMhAIO1+R3SUS7qpGrJO7k4ynDecFy1fr1NgI/QK9wOgnlG10W8veoT/FY8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=cCbZ8rkYogmfNOg2aliXSXgPWrYaiHvbDmIe0+nPzWc=; b=gHBwYT5bVexmf6TUZypXYJU0zRs50FokDa/B+UiYomjEE/agfsGtzOjr88qO3od2WS7AqJUruwSw7wPrZHHlZGlMeELyYuYJbRlPkmL3+sIG8H9FNfn3+kNG9TIiML5aV12xuYvtLxBc5HJtF39AWdX3Jd7LHpuWjj71ZKK4oajdAg8xys2CZgAWakTvYqzVtliWWPQLfg0wF+9x8iL7NkpbiDb46cvOmq2H7xZd52aGwZjVskmOSRfJK5QvnDT79Y0cAFkeARGUGkBesriNHbxw8xFu8O1cIQP2txaRqRWsC72UBR7XE7VaJZnzElwUmGE/7CAdNeAUPXfQOfzdow== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=rapitasystems.com; dmarc=pass action=none header.from=rapitasystems.com; dkim=pass header.d=rapitasystems.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rapitasystems.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cCbZ8rkYogmfNOg2aliXSXgPWrYaiHvbDmIe0+nPzWc=; b=YAWB9OxoTdGKzE29EvbbNwrT5+IYJYQ+sIdu7UoFDY2I6EuRM0s7Nxi1dRA78nFdX/Ea+vWAVSevTbQxLlcTWLE/uPTOR4sH0hIqLYfoO47Cq69Qbz+6IBs2wOyvpG111ES7h5cTM5EXcBpcqozjAg+YkIKGFRo48ZIA0Ab/KkA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=rapitasystems.com; Received: from LO2P123MB4352.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:19a::8) by CWXP123MB3365.GBRP123.PROD.OUTLOOK.COM (2603:10a6:400:7b::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.19; Thu, 2 Nov 2023 17:22:38 +0000 Received: from LO2P123MB4352.GBRP123.PROD.OUTLOOK.COM ([fe80::a33f:4559:b41e:cea9]) by LO2P123MB4352.GBRP123.PROD.OUTLOOK.COM ([fe80::a33f:4559:b41e:cea9%4]) with mapi id 15.20.6954.021; Thu, 2 Nov 2023 17:22:38 +0000 From: Greg Manning To: qemu-devel@nongnu.org Cc: luoyonggang@gmail.com, richard.henderson@linaro.org, =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , Paolo Bonzini , Greg Manning Subject: [PATCH v2 3/4] plugins: disable lockstep plugin on windows Date: Thu, 2 Nov 2023 17:19:46 +0000 Message-ID: <20231102172053.17692-4-gmanning@rapitasystems.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231102172053.17692-1-gmanning@rapitasystems.com> References: <20231102172053.17692-1-gmanning@rapitasystems.com> X-ClientProxiedBy: LO2P265CA0282.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a1::30) To LO2P123MB4352.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:19a::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LO2P123MB4352:EE_|CWXP123MB3365:EE_ X-MS-Office365-Filtering-Correlation-Id: a905f7ae-d942-4613-008f-08dbdbc84fa8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: paaEh8ZRnNJKy9gZbwT/k1vQdUMsToE9m9YEASPWweSCkT9itK1/mR8vezQt91s13tqdRBHNDDl+gCXaIX+bSt3iH2hdI2NFjy2FOpnKp+fny3tdlSZZ1XhmObq32fm7NH2pSN6wIzxyEkJ4+oH5hpS3/6f/AykrAziz2eV6PXyGcDwwCHNUO6vUbCWNXmIx/NFKIN3HCDdQVRsy7FpoMfDtuOTycf8zGHM2U3t8ZHLTo7cXpktc17/VdY8XMy2+Xeyq8EQwLLCikwPoApa9nfmXbrKoPtwJ3eG2gflq97bRdXMKDzx2gCVCzOUApefFgPJq4fjM9GJGeCXupPs21QrK9Rq+8PnPiLmZbz61SV1yTb2enY4LzPBmCDXDFQdyZvssKUrhS0DBYZcWYQd8vWUQbQGA2KfNlZHfGT8vg4gJLqeWD97Q/zj4qHpz9xECjdXHJh9We7jMZHtlrBSeeF+vs+iU3QOteNW7L+58Qttv4AIZpJI5UFud86SZtoPzvaQN+Q5SAhePorjsiyRz5dHFjZwWeZP7KopuUqiOQZK7gOMvEu5Fc1yOT/6Ep0KV X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:LO2P123MB4352.GBRP123.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230031)(396003)(39840400004)(346002)(366004)(136003)(376002)(230922051799003)(451199024)(1800799009)(186009)(64100799003)(66556008)(54906003)(6916009)(66476007)(66946007)(316002)(6506007)(478600001)(1076003)(6666004)(107886003)(2616005)(4326008)(26005)(8936002)(83380400001)(8676002)(6486002)(6512007)(5660300002)(36756003)(4744005)(2906002)(38100700002)(41300700001)(86362001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: fbNLiFfdkfuT85gmiBU6Su1ABHC+cL8M6CkY8gG/HO1E2eaakpmcz0vq30WZ/K8GVgIOeXjdL6aEuC919ftCJWZkkzTalopyT+4TVJP//qGAzOKkpm9WIlulo8ajHLP1ybAbZh3sWVAh+ZR1rUZs7JBFOqEpDcMm+OsnKm6o87yudeHbJUP4J/DdB1E8V/dsN2a2xwPo2D2V2UKAZLU9FM3BZz3rM1P1PD3gTf0IpmP/s09t8ZbyB9sG0IgAcdeOZxkog5ukMSfjOWYXoRcQHaBLVeKLCsiNNzJyDy220XWUpBtq/gq/J5pLh+flTmMKDoHMt0x1F5u6wc63b7P9wWeXvN5FFzBuKYV5wa8I//vpn19A5nYEru47AVA3sxS0YFdoBRYrsZ6Lu9wOMQt+zpZxL5tZOkcV0KUKnGAoZzAXferzcNCmJRrB7WOyoAzddOLHG2hibYIld27Ie70tUZWwCNhLWjHHJz0SCuRQcyogJVqZJQh1NYJL5LtdVr5yU0rYmTWE7qKNFuMCB1Ehh7N9MUwuSix+FziREH5r7NYxTrs4qUjpglSIfLjcN23R6kxXOLDBWdhyth3hC3WvVx83AKDsqbQga5vnZ6XRpc6ysKl/nuj9i6QDK0D/KtztU9d/P1q3GBzm5taWatmstuVRkY7v4qRGHS2gsSw2moTcx7yGM+pMS87HA7RE9gKS5y7uxMR6xWPRnOrv9z0ANezDIljolV16dJ41F4wxzQGtQgm8kEQULO0pNv9f5mBqL13tlsAIjTkcK7UF6lfzcJaSmb/wacU9L5d2jyKQwU49ETy1vngwCFBpe1Os0PvHG3qq5H5uPJAH+adE+uIhj961Q40JFBdpNUoghbgTdtDA6TfyaCQUzjEpkxUO7J5AxLJt1nxlScLhF+eaXmb/S/Uj2L/8PfS5HgvVxCiQSQ5bK2Y1d7GUtS7nCNNaEwJcracyjeX36twnLjYB/WY0Kok9doyygrnylyPfUDaIAu6eJUHPt6YzQLcBB4mv++d/wPKTEhb8jOQCMAJKms/sfA1dzzGxd9Mw8bjgkehVkt2K2+bSOFC7vruxF8b5peOL4hbB9sjgZL4N6FhnMHwkJEeoOeFXH7tJ25KorES87RaWJ8Aw++6vWJmzYYFN7t5xIKEx9hiNZTjb84sE65IKSK7FkuwxiFIr7iStFaAgmBc654BengZW4ULEnyYdldbQljjbIT3tiYQ4NeN9JRIwZlfc2UzrKsrbS/z9D+U7nnLCcnLuxbwyrzECQXMzWv8JUWe2ZjJVHqeNxNFl7aCvAhyo2QbLvLhAhARM3GfqkH5iXhreddZeHI8T6LHAmkRurHtYHzbCd1skdeceYcke7fGaBpAcM01CjBeHHiIJPYTsWdJNxk2/jSWW/OJI6anzdq5zgoaJyfvOlPI4ZKDd/3li8y2H27Ig1lXV+qTmoEUc7JyOJQHhGEM4Eaa7MCEyMnLp8PtVoNI5Lb7ATQA0sAb1TkDz74KzO5zm6iiiKB9Zb3HQQMxedmw8+NT2SgRx9sR8FS22qTHxi6FGlyS1UPpa9o0gEAPHRqRiDuf7/N1zIrF3sD46DeiwYxT4k8SvU672elzbX44mC7GvlC3AOw== X-OriginatorOrg: rapitasystems.com X-MS-Exchange-CrossTenant-Network-Message-Id: a905f7ae-d942-4613-008f-08dbdbc84fa8 X-MS-Exchange-CrossTenant-AuthSource: LO2P123MB4352.GBRP123.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2023 17:22:38.1392 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 63a1ab10-c4bd-4b99-881c-0040cec74971 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: uYCNgv973aD0uOf9qbNqeqv199aSXgZsxN4MN8o5NbRiOKmNZ5BeYdaXcgrWEe38RrmZ1hgJry8BGZ3UpUThdqCZcuO85PpLXgeqttK7Y7w= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CWXP123MB3365 Received-SPF: pass client-ip=2a01:111:f400:fe15::707; envelope-from=gmanning@rapitasystems.com; helo=GBR01-LO2-obe.outbound.protection.outlook.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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org The lockstep plugin uses unix sockets and would require a different communication mechanism to work on Windows. Signed-off-by: Greg Manning --- contrib/plugins/Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/contrib/plugins/Makefile b/contrib/plugins/Makefile index 751fa38619..1783750cf6 100644 --- a/contrib/plugins/Makefile +++ b/contrib/plugins/Makefile @@ -17,7 +17,13 @@ NAMES += execlog NAMES += hotblocks NAMES += hotpages NAMES += howvec + +# The lockstep example communicates using unix sockets, +# and can't be easily made to work on windows. +ifneq ($(CONFIG_WIN32),y) NAMES += lockstep +endif + NAMES += hwprofile NAMES += cache NAMES += drcov From patchwork Thu Nov 2 17:19:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Manning X-Patchwork-Id: 13444062 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 4ED4FC4167D for ; Thu, 2 Nov 2023 17:23:46 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qybPB-0004jR-LK; Thu, 02 Nov 2023 13:22:53 -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 1qybP9-0004hK-Bv for qemu-devel@nongnu.org; Thu, 02 Nov 2023 13:22:51 -0400 Received: from mail-lo2gbr01on0707.outbound.protection.outlook.com ([2a01:111:f400:fe15::707] helo=GBR01-LO2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qybP7-0004ME-Qa for qemu-devel@nongnu.org; Thu, 02 Nov 2023 13:22:51 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kzaC0tDd4f5BtqUDXe4BS77mPtmqkw/DLNj/0E3LIqH/LHpybvNUtyP1GaIlbvtoiCThdld2FJitZgzw1BECmVUnE5e1zsX0kvSdE8nlr6bdlOVaZHhrFvzPR5329iCKC/qVjXHSSQ6SoEBj81wSX2AU4Gy7+ARV/7/XPsHAAot4uU5yqJmBLBWzj3OG5hik8FoBewvA/8JvNXY/fPIysUXw/LQqUrxIDWBtgYCNMqDd2lOgYLODrJynWDn1M9kSZmcrJh3zKxOGGSDl4GZ+XYeobp8EpOzKAC/yskZNRvqudsKqik9lsYiXA6lNXSRnK3RMMz+yHPD1GrcWQbFJRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=fqJenFpOkaZGD0stEfyWz444Z8zJate4MIi/ygJhhfk=; b=dIJbc+LuyQ88BIh2BjTI0Gl24EVrDtHSB2T0MCA/qE2iUnnPGRzSBjWAZ6wCzXgMqjy4ppO8duccj24B8cDQAVNSXfV5RWsLdeFkMqEV83q4Sp2Bl0MgcGX/h5mZMA1oPEcum7MkuTatFho9vl3VzWcl/73nY7HSAb7cC+Z5cvuvC5Pbm7xwV6DzczZQZNbOuLWYAgFNowpPbSkDgUTEjsuer5iE7mKdjJPSlyQL7vsOsmajou6L3MWvetE4VzSioX6uNgCpKtJnO+ZQhCd6lZXvPMNN/C6S2EKKy2TGM5K+KEUPUnhe5MLF/k/41Ri9ANqMy8xUHZLPq7XA/3lufg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=rapitasystems.com; dmarc=pass action=none header.from=rapitasystems.com; dkim=pass header.d=rapitasystems.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rapitasystems.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fqJenFpOkaZGD0stEfyWz444Z8zJate4MIi/ygJhhfk=; b=L2KgGk2Se0kd6PCh2P1pGcqS+E/ZU32jkAeV/dVdXLojPV601YZTRyR7jdzTBuFWpS4WNx/ScIQGvRdDqxxJJ4wmm5olSL6lU7tHFSg1ZAWxaAtj32In0uCpuxH9zZenjRFbM/6Rek0kf3fW2tmgwCP4JD+fJhRZqdU24UWpTQU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=rapitasystems.com; Received: from LO2P123MB4352.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:19a::8) by CWXP123MB3365.GBRP123.PROD.OUTLOOK.COM (2603:10a6:400:7b::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.19; Thu, 2 Nov 2023 17:22:38 +0000 Received: from LO2P123MB4352.GBRP123.PROD.OUTLOOK.COM ([fe80::a33f:4559:b41e:cea9]) by LO2P123MB4352.GBRP123.PROD.OUTLOOK.COM ([fe80::a33f:4559:b41e:cea9%4]) with mapi id 15.20.6954.021; Thu, 2 Nov 2023 17:22:38 +0000 From: Greg Manning To: qemu-devel@nongnu.org Cc: luoyonggang@gmail.com, richard.henderson@linaro.org, =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , Paolo Bonzini , Greg Manning Subject: [PATCH v2 4/4] plugins: allow plugins to be enabled on windows Date: Thu, 2 Nov 2023 17:19:47 +0000 Message-ID: <20231102172053.17692-5-gmanning@rapitasystems.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231102172053.17692-1-gmanning@rapitasystems.com> References: <20231102172053.17692-1-gmanning@rapitasystems.com> X-ClientProxiedBy: LO2P265CA0282.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a1::30) To LO2P123MB4352.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:19a::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LO2P123MB4352:EE_|CWXP123MB3365:EE_ X-MS-Office365-Filtering-Correlation-Id: 6e91ec5a-e041-4c68-10d7-08dbdbc84ff9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qhSaavY8yrBSvJgM71qtTPzO/NIh3tFpsUX1EvhKi9wCbj3Ysj8a1Pmyurk4hh9Xj5E2+2xENjSBuU6FfLE3VFOaf/yhWP+yq3kPm0UEwDe0mV4xO8hW66GCFVTD/5PXy0tg9vxXU4r6G2vLCABgE31zOCaPNmSP0NY+wxM9lrVbxMRXlDw7u8W67q/NPZJs7eGWyBAJDdyas+/hP/Cia3/Lbx76wgzuEgJIJnODdQs4W1hbtkmMzU4jbhC1Uf98as1nRUln8XGkzLP1lEO0MkP+zbFtDNQtBcWB4nhvmQTSKTaJ5IpeOvCmYgYmxWcTXM+r6abof7whO8rPss6ZXd/Er47YzKqEnjd8JRbl1i6/0TnJzYB7DT04f9vqjd0pMI/14FVwXcKieJzk/QDsOaYoFuHzTb90Gavp5AgEqmdKBgyrVWq2fmUKV8oan1PoxvAvJhYgXCLVftT7UnuAcvPOjRSS5yGcrJA0xiPWf1yIuHmowvzHLW/eGWoynFMSK3CucZPFpp60kjhjdf5B7Qc5G1Afpv+IIQQGxwt+pe/f4wUANmXoO1JBA6x62jdm X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:LO2P123MB4352.GBRP123.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230031)(396003)(39840400004)(346002)(366004)(136003)(376002)(230922051799003)(451199024)(1800799009)(186009)(64100799003)(66556008)(54906003)(6916009)(66476007)(66946007)(316002)(6506007)(478600001)(1076003)(6666004)(107886003)(2616005)(4326008)(26005)(8936002)(83380400001)(8676002)(6486002)(6512007)(5660300002)(36756003)(2906002)(38100700002)(41300700001)(86362001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: a8nd6/8C2DhtwB3Mq0YTub+2GSy0JUam3a86WwgsvG4XghDiOYCQZBttYa3b0ivDdl6V16RIuUCbs68XV6bdV6/ykYeT0W1p20Gj5n22RpylLgvzA+haEtuGTVYcR6rjIEXWJ5Tpf2O5rFEfDRXjRqXBzM6m5k2mXQxzZBClEI8sZ4zES9/ia3BS5ynMkKoJRHo55PCHcwacvv7ugykGQL673Sr9bj4GhrphqawB3aF4BW5yEiAXl35lZzWKv+2s0MaB3uoKxq5QUC/PxIQL1rtNNhBX/E6Sq5eOrGIroU2Ar9Bp6Z2Wx6Y1RMXgBfwv/YIYtIGuMtnjALPrIMwhppG+XxNqUEMKo/rxCa8X1xYCdIyaGG/RnDrnCNl9dYCoklTKCdgUGV2+y2SQCcwNUeEOa4xIdO9zCH/0YEKAjGFXc0XcaTjlQkVMlLtjzNXSXsZspgCRrtTkWAOiDOe8AMJG+nSlli2VHGa9eV0t9ckHZnmDvHTTvNsCXVTkYr3zPTZ299JkJQhK96WuZW2xLuoysmYLnyeSuSF4zBVGDatL3Ppt/etd9lDI7wGFszJ0qE7OxjJpOu5yfN3xawiuWS9Lt5xz2su02h52I50daKXPspJD8fL6ubOPbqlzHRSpibSFTGe307xo5mmat2r6IxUTxl/YRP6ngDfX9zBzDSfQo28Es3AaBoIpGIf960CdRuJLFCNqhoTqVwTc7M7MA1SG7AeDn+pL1x2zjJsmbGJUMK4zEJDzJpoJzRbmGXXXpXxvGRl2LjvmWKsAVdqD/jCdtjUwTaNBSG1pmx+lY+mF2aQItmfHhq7Ts1MGFPVVzq3I/rw917/C/68gM7uTu5K25Un3xQyVc7Q+xbleTTOGSiYl4hKSqd2DEI1D2UM+9mRrZbBKerWbSpKMxZ/ccr4VbqcqoLyrMZVQXdvehtOAIh/3VAYBf1OVUaKg9bqo/PTv3BeOv/hl8wBDuCiVVpDB9BQnUNw7bXgaNxBAf4s3hBfBJaBJ5Bn5bqkqg8tLsHXoIRfyTXrpJNab8bj+t89DmnanadjgbwPUhVkwZeINvke4ShX3Y4iGEZ9jXgn2Mubgc9tUS8wAQWZdmGBlfU+VdJgl5TdYnmq9bT8zfP5KXFInj+Yb/Gzy4olo12iXs9G+TJzEXcL/N9AJg5txvFjuMsgVIBbctEZ/jp5j9ZDXRL66Ie4tSRiZpHA8N4NoVWH1Ms22YY7hy5Za/aa48Bp+hixeE8oZsX7A+queIHL5pxqfSoH4Qd3VtUWHKRxvreWxTt9jCU/SVzI5unGDDMhEHeW3IWgYm6RAw+rSsO/auACzVDQhHATiORD9Gq2NjFNTnh7LGRJPDznjtpHpADmTGzXbIsoGdhXiyDrlPW0//qY68id2lVzsaV7yDLlnaKLAC+UJJ/2W2foTrJFNcGH/JEMQVZD3qkheLHobpe/S36M+evC+MpRV1vx9b7WJTLbnyZnYPsn3zvGA54sQCjIZ+kJFOrvqTH9Dtmd3mEWA2J+zj49+hNLIdKvt3ZNDIWE71l2duXqTKnUJos09TaItxZgJBmmrFcYxpywnwCKf2RUmLBWuQruUNna1iwl8L5vIZ8fr+iUFd0NQgRxsig== X-OriginatorOrg: rapitasystems.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6e91ec5a-e041-4c68-10d7-08dbdbc84ff9 X-MS-Exchange-CrossTenant-AuthSource: LO2P123MB4352.GBRP123.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Nov 2023 17:22:38.7491 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 63a1ab10-c4bd-4b99-881c-0040cec74971 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: G3NRmpeAGAu4S7drnlU6aBGIjDRGmgJighxezinVA435pDBM4bhtl7uwmHTc1YThWaZhvEVNWQAN0faAPOPW4GEJk4A7lDBg3fQ1sSMcTSQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CWXP123MB3365 Received-SPF: pass client-ip=2a01:111:f400:fe15::707; envelope-from=gmanning@rapitasystems.com; helo=GBR01-LO2-obe.outbound.protection.outlook.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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org allow plugins to be enabled in the configure script on windows. Also, add the qemu_plugin_api.lib to the installer. Signed-off-by: Greg Manning --- configure | 6 ------ meson.build | 5 +++++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/configure b/configure index 04f2cdd166..1129e6dd94 100755 --- a/configure +++ b/configure @@ -1010,12 +1010,6 @@ if test "$targetos" = "bogus"; then fi # test for any invalid configuration combinations -if test "$targetos" = "windows"; then - if test "$plugins" = "yes"; then - error_exit "TCG plugins not currently supported on Windows platforms" - fi - plugins="no" -fi if test "$tcg" = "disabled" ; then if test "$plugins" = "yes"; then error_exit "Can't enable plugins on non-TCG builds" diff --git a/meson.build b/meson.build index dcef8b1e79..b855224acc 100644 --- a/meson.build +++ b/meson.build @@ -3904,6 +3904,11 @@ endforeach if get_option('plugins') install_headers('include/qemu/qemu-plugin.h') + if targetos == 'windows' + # On windows, we want to deliver the qemu_plugin_api.lib file in the qemu installer, + # so that plugin authors can compile against it. + install_data(win32_qemu_plugin_api_lib, install_dir: 'lib') + endif endif subdir('qga')