From patchwork Sun Sep 27 08:18:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?572X5YuH5YiaKFlvbmdnYW5nIEx1byk=?= X-Patchwork-Id: 272672 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1AE96C4346E for ; Sun, 27 Sep 2020 08:20:24 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 9378023977 for ; Sun, 27 Sep 2020 08:20:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="urnlPCbe" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9378023977 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:50548 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kMRuw-00056H-A2 for qemu-devel@archiver.kernel.org; Sun, 27 Sep 2020 04:20:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43030) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kMRtv-0004Kt-PT for qemu-devel@nongnu.org; Sun, 27 Sep 2020 04:19:19 -0400 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]:38231) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kMRtu-0005Kh-4y for qemu-devel@nongnu.org; Sun, 27 Sep 2020 04:19:19 -0400 Received: by mail-pl1-x62f.google.com with SMTP id c3so1700233plz.5 for ; Sun, 27 Sep 2020 01:19:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/nYQ+8zkCgUp5MR/ASiOY6mLhsrMuES3KlMH28cwivA=; b=urnlPCbexh/zAue8y9VHKC2FrFJDVhohzi/QB1jiNlAgMLOjsdu8xztX5Ng/DtY9eI AlrvEgBlVMstYMsaW3KUnhvhjt9RB6UdWojcqwzTnNmWl5I6jx+DfQakuQ6JeeQUDS8N 4vxI5gkyY7o8vmTOTs6Wr86MpUU9gHAsxAKTG88gFsS/v0BTCwzQsi6lzluLI1V8uAX8 HKhrCEmOGi9TWtGoAWo9OUHm1wgNc4WKLQkKPB+J18agIET9BJ728JsbMCYyni3E3NgA A5RQJJtgkmBZ5jNmdn+H1lEYKmM30/xxvErUvRQ++ghw+oY/ZeADjtg0J2E709mYRZaa NXrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/nYQ+8zkCgUp5MR/ASiOY6mLhsrMuES3KlMH28cwivA=; b=i02vwzxfqKTLNJy9vbU5O6+czwWS0aLxbhIVazL+y0A7E4EQl9fpQtxI4DreEc9Ihn gVNlYgOrEEnUOOwhUUxNcIPgHCVHMlKPzuvKGh+YsIv3Av4YGdENtrRGJAQ2Sx8DyEKO z5Z9ZCFRIcTtuwsnHmh7XFs+RLalCQDWYAF5d9oU+0i+zr41ZcbqA7WQP51AHtC4p/wU VKJRktidgt6o+DmLvtZDO/zzTuyHBmkuN6L6FN0vlENgeCk0tx9ZQJ+/SE9cVig+/sMy zuStvanehEIc+8TjIaI7gD9S2UDm7HBYLfkpDTxeUVlZtc/pd4lYmsuVRJ919D/jh4ps nrrQ== X-Gm-Message-State: AOAM530CzZff5RvkcJVa/RLOXzVcJZPO2o11Ohy9KUD+UguPhwmUm81m yMF/Ow/eAW77zkrfY9kJTsk3vSyL43mSa8gS X-Google-Smtp-Source: ABdhPJxHQKwZPw+k6SHS7cWnoHkS5QFSh7ID8V+5S8bCSYLv5BVfCLvnCG4DUDBK4LokG/Jmq3HFDQ== X-Received: by 2002:a17:902:7c0e:b029:d0:89f3:28d4 with SMTP id x14-20020a1709027c0eb02900d089f328d4mr6603500pll.16.1601194755688; Sun, 27 Sep 2020 01:19:15 -0700 (PDT) Received: from localhost.localdomain ([222.95.248.6]) by smtp.googlemail.com with ESMTPSA id z22sm3317693pjq.2.2020.09.27.01.19.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Sep 2020 01:19:14 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v2 0/4] Enable plugin support on msys2/mingw Date: Sun, 27 Sep 2020 16:18:57 +0800 Message-Id: <20200927081901.771-1-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62f; envelope-from=luoyonggang@gmail.com; helo=mail-pl1-x62f.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, FREEMAIL_FROM=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Alex_Benn=E8=8C=85e?= , Paolo Bonzini , Yonggang Luo , Richard Henderson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" V1-V2 1. Fixes review comments 2. Increase QEMU_PLUGIN_VERSION to 1 for compat QEMU_PLUGIN_VERSION 0 3. Revise the loader to support for version 0 and 1 4. By export function qemu_plugin_initialize in plugin, and call it in loader= , so we have no need call it in every plugin. And also provide a standard implem= entation, anyway, use can also override it. Add this feature on msys2/mingw by using glib provided cross-platform dlsym f= unctional. Yonggang Luo (4): plugins: Fixes a issue when dlsym failed, the handle not closed plugin: Fixes compiling errors on msys2/mingw cirrus: Enable plugin in cirrus for windows Getting qemu-plugin works under win32. .cirrus.yml | 3 +- Makefile | 1 - configure | 71 ------------- contrib/plugins/hotblocks.c | 3 +- contrib/plugins/hotpages.c | 1 + contrib/plugins/howvec.c | 1 + contrib/plugins/lockstep.c | 1 + include/qemu/qemu-plugin.h | 197 +++++++++++++++++++++++++++-------- meson.build | 6 +- plugins/api.c | 65 ++++++------ plugins/core.c | 7 +- plugins/loader.c | 51 ++++++++- plugins/meson.build | 10 +- plugins/plugin.h | 1 + plugins/qemu-plugins.symbols | 40 ------- tests/plugin/bb.c | 5 +- tests/plugin/empty.c | 1 + tests/plugin/insn.c | 1 + tests/plugin/mem.c | 1 + 19 files changed, 258 insertions(+), 208 deletions(-) delete mode 100644 plugins/qemu-plugins.symbols --=20 2.28.0.windows.1