From nobody Thu Oct 31 23:11:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1601986312; cv=none; d=zohomail.com; s=zohoarc; b=CJxQRddGZTHdNX4ZOWxxRyzvAR024dKaJKvDx79KwFnStGMPMp17LuveS/a42SrIQbGftLHhU4Hb97T+wJwy4cg4KcCHcq86THaSt7cA5aiWuUjpp3oE2WUlGfzmJtagn1YRGVp3n5TbJ0FsBUhHm3U1CfCJ1Sq4Bv99RPqQotM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601986312; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=vwWICdvW/zCGPD13s4UEGsuus824XjxUxjGQ4brZjgg=; b=BpUMVosXZb1qE4BXoU9VXUSU65E7Cwu4FRIltBAR0CkJhkZTCLZegf33VWLxz2kvBLavzvn/1oYF3Ivcc1LKmb40RNyahKaG1SFIat4dQXm0/vswvsCCPVw7Mi2ue6ygPe9E1jmGf8iMRNing71uYMrX0g0wMKm0V/xUkdeS9NI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1601986312642511.10693242733043; Tue, 6 Oct 2020 05:11:52 -0700 (PDT) Received: from localhost ([::1]:46498 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPlot-0004w7-5P for importer@patchew.org; Tue, 06 Oct 2020 08:11:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48926) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPln4-0003Ds-Rq for qemu-devel@nongnu.org; Tue, 06 Oct 2020 08:09:58 -0400 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]:41772) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kPln3-0004DA-6z for qemu-devel@nongnu.org; Tue, 06 Oct 2020 08:09:58 -0400 Received: by mail-pg1-x543.google.com with SMTP id g9so7364405pgh.8 for ; Tue, 06 Oct 2020 05:09:56 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id f4sm2965681pgk.19.2020.10.06.05.09.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Oct 2020 05:09:54 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=vwWICdvW/zCGPD13s4UEGsuus824XjxUxjGQ4brZjgg=; b=bdAbn5U8O55gv9zt0BgJZGlpIr+TwRiQh1uosXXFEnxNI0lujoYGScM5iNxFwQ/9/f u321hqCbTRFyqWlzHtdovTZu7T6H8fJC8DcjOZZl2tDwoizW/VbsiAL4xcWUzgeQngxA Vw0Yteh9jx7OK8x/e0oCej6/zEQtbuZHVUvBAERKmuSh8z7EZwp31t/wqeb8zRHl7fgS SgC0tf1BdA0UIzgHETLUCc5aD/Z/n8YQcpKYWvG17cxp3LAjxLj+BZFDAxzn8AcqsdSI IyBYnsd0O7uh2TGvOeNK1j29ddfCJ/fVSHec/IM4DOn2rBjc7pFp2LLpyiYWApAO9MIx r1Zg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=vwWICdvW/zCGPD13s4UEGsuus824XjxUxjGQ4brZjgg=; b=LZoWpQiQgyqGfnXH+stljQ5ZnLftSuB6/sOV1+3TyCKmSYiswRd+eyB0EoIx4AQKEj KJ31eeYgEk89RkLrjJESUdl1PnhzFtzf1MsYNHYxX+mjLBTw4jBu1OqYRHIKsXH3dKhb 7+u1RkDBXmsc5iCGrQ2eNOXzyIOHWdkoVIZueWYB8mLfkLNGYH7vqYSbydy9dTwCxPNF sO2BS1geeBnzS9Xpx42MdlftSHc5crrJfMVZ/mLb4cNh3q6EMdxW/gOTkO0ftkznRjt0 ZwoWMEWABNtcJaTm4I8gKP+/l2PeHY2mW9t9Q13tZbkVgNWEEN/dht1nAVnrjuOb/pEQ eiRg== X-Gm-Message-State: AOAM533z8MNL932B30a0k9sVAP3VMSqQOpf1uqwFPPe9LyHOMPiLhvRI iiKwPFB/GamWoDicuhbNR9wUBUXJcDrKfQ== X-Google-Smtp-Source: ABdhPJwRFrysBkPxm75fACk4FnTODJOElwZIAW+fn0oi4Clr2JG5ZEsQkO2479DU0QqyXxsznK2TDA== X-Received: by 2002:a62:6c2:0:b029:142:2501:397c with SMTP id 185-20020a6206c20000b02901422501397cmr4196363pfg.65.1601986195433; Tue, 06 Oct 2020 05:09:55 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v5 1/7] plugins: Fixes a issue when dlsym failed, the handle not closed Date: Tue, 6 Oct 2020 20:08:54 +0800 Message-Id: <20201006120900.1579-2-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20201006120900.1579-1-luoyonggang@gmail.com> References: <20201006120900.1579-1-luoyonggang@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::543; envelope-from=luoyonggang@gmail.com; helo=mail-pg1-x543.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=20Benn=C3=A9e?= , Paolo Bonzini , Yonggang Luo , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Signed-off-by: Yonggang Luo Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alex Benn=C3=A9e --- plugins/loader.c | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/loader.c b/plugins/loader.c index 685d334e1a..8ac5dbc20f 100644 --- a/plugins/loader.c +++ b/plugins/loader.c @@ -235,6 +235,7 @@ static int plugin_load(struct qemu_plugin_desc *desc, c= onst qemu_info_t *info) return rc; =20 err_symbol: + g_module_close(ctx->handle); err_dlopen: qemu_vfree(ctx); return 1; --=20 2.28.0.windows.1 From nobody Thu Oct 31 23:11:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1601986316; cv=none; d=zohomail.com; s=zohoarc; b=JeU8ZYfryxJdmwz4DV1WVEoJrunMBND2xEg95bd6yoNsjvnrN6l0to7jSwtWBTQPj7LCI3Y4Hy2qg3J2JJSUusd+MZzcQiw91goBgv+h5M/1XxtOobNomP3N/0ZqD9c3jXRMdkSnXA9Hkr/WoUwzfjifgktXlvGrNp+adpQDOhA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601986316; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=oA6lwA9DRk6v/CqH7e4pibYzUGFI9UFOt7RD8ATdFPQ=; b=ZlnM0DjVYmikSqbht+fgpY59FtGAEZeevCB9x4n8qQ05TOLjlJwttrsnbmA7v85Fl7qgkIfMb6XB7+7ZRtD8ooQVpFNXepE8JU5MSuQ6Th5QxqxqhSUMXWnar/wPXOU5rG/6x9HfO8yz0M7+LgGVzA/UQKV+dRVx56pwFYQGG6c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 160198631677399.63242405620281; Tue, 6 Oct 2020 05:11:56 -0700 (PDT) Received: from localhost ([::1]:46874 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPlow-00055V-EQ for importer@patchew.org; Tue, 06 Oct 2020 08:11:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48944) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPln7-0003JJ-PU for qemu-devel@nongnu.org; Tue, 06 Oct 2020 08:10:01 -0400 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]:43634) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kPln6-0004DX-3U for qemu-devel@nongnu.org; Tue, 06 Oct 2020 08:10:01 -0400 Received: by mail-pl1-x641.google.com with SMTP id o9so1118920plx.10 for ; Tue, 06 Oct 2020 05:09:59 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id f4sm2965681pgk.19.2020.10.06.05.09.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Oct 2020 05:09:57 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=oA6lwA9DRk6v/CqH7e4pibYzUGFI9UFOt7RD8ATdFPQ=; b=mDptSu/TJAdlaMSV4SNo6oO7zBvbrg9VaD+Lp4itrNOG4kSwyhdP1gkThzcy6gsgIx mlgnFY5C05NbZj3A9rENKLr9agYiCETEGtbWILmNGKUKOnM2uUAPZsVtkCSBRo0n2t19 GHHmjwVIkdptlO94nriY6w6vpGcGjcuLiiEDj9BpMYSG3Uc5YH7ojAcWlCevFmmSr0IX HP3RkFKM9K9dhQhEGB5hy+uDOMaq0vLY5YxhVUiZ2hltSe34uGdVEF8osrJ8C1kw9uQn nSkQY/F7abB0UksjP1Bo6HFQjwqARy9CRZjfbraKMAKBZyAT0xr4oO3o3dyZPFzcg6bB 2BvA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=oA6lwA9DRk6v/CqH7e4pibYzUGFI9UFOt7RD8ATdFPQ=; b=ITexIU1U7Ku0NWWbERhVFZAO/sdmmhdtxLyLalnTotdGKbBYF11SjHpe3+L5xTNwNM 4w+zZGZLBr8TUnwmKfY8J2alXFIe5mJJSG9dVdQJhG6CK/BxpiZ9FQnhWB1uYjtHlCtl EHSsss4nBlQdosJ28PBOb/hU22aEM5TBvbyTUE1idWtHfcAZIR7DdJ/HKOSXuRIZvrut QPTZI9lBtS8kDVFvVcMWoTl2U+UxkBlFehpVorsgWDGmxxEzfN0zJp3SwNjzt4YGDnu5 4nddeh7iNPhWJl85ebVbPt9a0J1s4QUViK7rwZPHaVJVo/8OzycGHj4x1WNluxNEoeE6 cROQ== X-Gm-Message-State: AOAM533h8gjLJqmEvU6RyZfT02UGEIhV+EaFUEEgkRcKpANsKsr4M2MY eI5wQ3DNE4j/2vgCU5AJ0uiVdes5vzCk2Q== X-Google-Smtp-Source: ABdhPJyD9ujyUCXnBno29fF1GG6x0UMJ5ZgVq7ozFDQdePY9E0BTIbjngJNSk+5nI4sj/rhMdpIv2Q== X-Received: by 2002:a17:90a:d983:: with SMTP id d3mr3493516pjv.144.1601986198006; Tue, 06 Oct 2020 05:09:58 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v5 2/7] plugin: Fixes compiling errors on msys2/mingw Date: Tue, 6 Oct 2020 20:08:55 +0800 Message-Id: <20201006120900.1579-3-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20201006120900.1579-1-luoyonggang@gmail.com> References: <20201006120900.1579-1-luoyonggang@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::641; envelope-from=luoyonggang@gmail.com; helo=mail-pl1-x641.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=20Benn=C3=A9e?= , Paolo Bonzini , Yonggang Luo , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Signed-off-by: Yonggang Luo Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alex Benn=C3=A9e --- contrib/plugins/hotblocks.c | 2 +- tests/plugin/bb.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/plugins/hotblocks.c b/contrib/plugins/hotblocks.c index 3942a2ca54..37435a3fc7 100644 --- a/contrib/plugins/hotblocks.c +++ b/contrib/plugins/hotblocks.c @@ -102,7 +102,7 @@ static void vcpu_tb_trans(qemu_plugin_id_t id, struct q= emu_plugin_tb *tb) { ExecCount *cnt; uint64_t pc =3D qemu_plugin_tb_vaddr(tb); - unsigned long insns =3D qemu_plugin_tb_n_insns(tb); + size_t insns =3D qemu_plugin_tb_n_insns(tb); uint64_t hash =3D pc ^ insns; =20 g_mutex_lock(&lock); diff --git a/tests/plugin/bb.c b/tests/plugin/bb.c index e4cc7fdd6e..de09bdde4e 100644 --- a/tests/plugin/bb.c +++ b/tests/plugin/bb.c @@ -72,7 +72,7 @@ static void vcpu_tb_exec(unsigned int cpu_index, void *ud= ata) CPUCount *count =3D max_cpus ? g_ptr_array_index(counts, cpu_index) : &inline_count; =20 - unsigned long n_insns =3D (unsigned long)udata; + uintptr_t n_insns =3D (uintptr_t)udata; g_mutex_lock(&count->lock); count->insn_count +=3D n_insns; count->bb_count++; @@ -81,7 +81,7 @@ static void vcpu_tb_exec(unsigned int cpu_index, void *ud= ata) =20 static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) { - unsigned long n_insns =3D qemu_plugin_tb_n_insns(tb); + size_t n_insns =3D qemu_plugin_tb_n_insns(tb); =20 if (do_inline) { qemu_plugin_register_vcpu_tb_exec_inline(tb, QEMU_PLUGIN_INLINE_AD= D_U64, --=20 2.28.0.windows.1 From nobody Thu Oct 31 23:11:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1601986316; cv=none; d=zohomail.com; s=zohoarc; b=oKlRdENgTcpSYgctYHBGIphUoRk/su8DGd28f6xFWe066PfFPMLfTThGSgZD7J9eHUStOrtbW9TUfMRQTsekggbxfd2FEop7pLoP4FXyMWFBS/iNxXe9/c4FDpfQlV751vkimORmBxoPuEZGiJkfWL1O2HX5/ho30PhMF58Wfhk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601986316; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ChWuKq12YEBlrVQq4Iva9E7cg0lDlX98+uvW3A3EDFU=; b=NVfjyiPuCPFfDirGMvHGu2o+k47i3rHK9MOlEY9WLhJPoyM7yQitkRtfcqfQXERXn/HiqrceFmalIXcGxth4rngEanuiWNLL44s4sNO7jELdc5nSz9LhmMT3ldstygPqK70817Gi1zTj03G38E3iFFqcNEr+zp/mYPj8vCufCNo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1601986316658482.2407441779119; Tue, 6 Oct 2020 05:11:56 -0700 (PDT) Received: from localhost ([::1]:46990 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPlox-00058I-EJ for importer@patchew.org; Tue, 06 Oct 2020 08:11:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48976) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPlnA-0003Mm-BE for qemu-devel@nongnu.org; Tue, 06 Oct 2020 08:10:04 -0400 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]:44550) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kPln7-0004Dm-Vr for qemu-devel@nongnu.org; Tue, 06 Oct 2020 08:10:04 -0400 Received: by mail-pl1-x641.google.com with SMTP id h2so1117082pll.11 for ; Tue, 06 Oct 2020 05:10:01 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id f4sm2965681pgk.19.2020.10.06.05.09.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Oct 2020 05:09:59 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=ChWuKq12YEBlrVQq4Iva9E7cg0lDlX98+uvW3A3EDFU=; b=Q0nHtbtgCA/rPt07KzbJ9+UaXJUZvRdskOPP47GpIoRdVyz4D2ik6TezGtkoIaxmHF fARW2a/0bPMCv7REiIAxMILK+aAEJGvnS2Ghcgej6DjKGFPR7thCIDn1+ZYLBmRsio9W fJ3Da+54SDY+DPCkxD1NvbwD1xhPrJicivJNTTVH6RsL17YbzjWpvBcAZIzgXris3pOg IzZUl3DBteHS30S+uuTiNTJfweWCpPk4Wh6CfPK8pv8MK9clMbgI2bfatMEnFJ+QBMqT zk6WXLUExYtHEdSQgI/gNXJYHmzQtGCKj8xdAKPIAXnkNDI4tBrdJQ/uHwhywbH9x3Ft WBXg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=ChWuKq12YEBlrVQq4Iva9E7cg0lDlX98+uvW3A3EDFU=; b=EVvaHXdJOVSjSSh5bdCpO0ICK/0cHrys8p4vjXMuS6G+PUPud5a6OO8tuFJXYf+1FZ PbNfnyeuZ7hDQTBqQWuQGgts0HS4Rk30ISrltIWPPhmQrqNkieYeu9Tszm/yttdAwwVk GnZ7EG4EFiVDp6mOt0hYTl1I1HFYsHP3J7kXQ1H6FddPWmOpa9kRkQZW5xfDt4vLOFQf zTO/5KD3FLxERX/dB+fjWi7/mEYYWRajfVOxE0bPw8Xy1dvctzBViARx0K9ZqosQYlYQ YCKoqZbW6//JwO3JfBOs27XCt2YWgXHZ+3xojurpAannjQGKMoQMcVht/qvLCeqjOPAF ZL/w== X-Gm-Message-State: AOAM532U4S54JtZLNsY6tyg9B10VwHp8FUuF4FFsUMjlL3h+/hDVgBwB lAqQGtVE6CpPM6m5+g2RCO+JWJl8ufVy0A== X-Google-Smtp-Source: ABdhPJxnPS65Yk4e6fTu4UvMdrVzT9i8MaRPkgWO1SUeMLIXcHjDVX8kOcLU2GSjf/WYnxmklQsjxA== X-Received: by 2002:a17:90a:e088:: with SMTP id q8mr4260818pjy.172.1601986200303; Tue, 06 Oct 2020 05:10:00 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v5 3/7] plugin: getting qemu_plugin_get_hwaddr only expose one function prototype Date: Tue, 6 Oct 2020 20:08:56 +0800 Message-Id: <20201006120900.1579-4-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20201006120900.1579-1-luoyonggang@gmail.com> References: <20201006120900.1579-1-luoyonggang@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::641; envelope-from=luoyonggang@gmail.com; helo=mail-pl1-x641.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=20Benn=C3=A9e?= , Paolo Bonzini , Yonggang Luo , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) This is used for counting how much function are export to qemu plugin. Signed-off-by: Yonggang Luo Reviewed-by: Alex Benn=C3=A9e --- plugins/api.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/plugins/api.c b/plugins/api.c index bbdc5a4eb4..13177d3578 100644 --- a/plugins/api.c +++ b/plugins/api.c @@ -251,10 +251,12 @@ bool qemu_plugin_mem_is_store(qemu_plugin_meminfo_t i= nfo) =20 #ifdef CONFIG_SOFTMMU static __thread struct qemu_plugin_hwaddr hwaddr_info; +#endif =20 struct qemu_plugin_hwaddr *qemu_plugin_get_hwaddr(qemu_plugin_meminfo_t in= fo, uint64_t vaddr) { +#ifdef CONFIG_SOFTMMU CPUState *cpu =3D current_cpu; unsigned int mmu_idx =3D info >> TRACE_MEM_MMU_SHIFT; hwaddr_info.is_store =3D info & TRACE_MEM_ST; @@ -266,14 +268,10 @@ struct qemu_plugin_hwaddr *qemu_plugin_get_hwaddr(qem= u_plugin_meminfo_t info, } =20 return &hwaddr_info; -} #else -struct qemu_plugin_hwaddr *qemu_plugin_get_hwaddr(qemu_plugin_meminfo_t in= fo, - uint64_t vaddr) -{ return NULL; -} #endif +} =20 bool qemu_plugin_hwaddr_is_io(const struct qemu_plugin_hwaddr *haddr) { --=20 2.28.0.windows.1 From nobody Thu Oct 31 23:11:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1601986362; cv=none; d=zohomail.com; s=zohoarc; b=VTJMSzKw8I4h61eLtcyVQatdoINs99sbAVhrmE3EYPcU48pVfV3qCSXUCMAG1f3srRlS0R55HqJFmHfuT4OoAp93/CNyL0syQuTVVZ6ywrkMrEkP3RLDJLIoMhg9N6JuUPlSKpvaW/y1NIM68iDU+EB0PEfmy0qL4dp5eIYCI9k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601986362; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=dUzCYJf1zGH8bjxVLC2B7lv4j1gP+ZwtRM63BTbI6Lk=; b=j7o6y40sv8a2hwduFPOjUwu0spqwXrW23nGLlwmEZAptxYIex/zTZGl9hY/RE6l42dRDj7sw87p78KgkC6yj5Eo19Af4DqXkGqeyCS9KP35BzlWa9cFJC2zJa6y+4vSM6gpNq1N+WL0aPMRFuqJtkxuNJe5PS4kWXZ8nNYO8OX4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1601986362150526.1657892420006; Tue, 6 Oct 2020 05:12:42 -0700 (PDT) Received: from localhost ([::1]:51738 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPlpg-00073C-SZ for importer@patchew.org; Tue, 06 Oct 2020 08:12:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49002) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPlnC-0003OQ-7x for qemu-devel@nongnu.org; Tue, 06 Oct 2020 08:10:06 -0400 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]:44551) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kPlnA-0004EN-Fv for qemu-devel@nongnu.org; Tue, 06 Oct 2020 08:10:05 -0400 Received: by mail-pl1-x642.google.com with SMTP id h2so1117125pll.11 for ; Tue, 06 Oct 2020 05:10:04 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id f4sm2965681pgk.19.2020.10.06.05.10.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Oct 2020 05:10:01 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=dUzCYJf1zGH8bjxVLC2B7lv4j1gP+ZwtRM63BTbI6Lk=; b=vbzT3j4Y1pCF30z/9/Ro3kcDdY9cjeq1lyJQdrx7sGwqicbjs1mRTGXJEStrS1xYJ9 BiEWpc7m0VWM/iSy2nx1J9b3HYQRJCUk6zAfyHBp66zHokUhlOC5kZIJmC2dY8kl5PC2 JUI4BrU1adsjDiwUMZd33dNiRtsicBnzXmFmicrDMXYtM8iGoiXydogR4AtIhvCvqXfb arzaV94kYMB+76BOpseREmquhNVEi0Ts9oJc00rcqmCmNBXMfTVlYl6yr0aCQS1BKXLI u+9WbBpJWhXVHEEHNO7lvH9AZElxmQxhI9vtdDNg8Zvw4GqyJbCaCLVmbk5OreSff+3y d1Ew== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=dUzCYJf1zGH8bjxVLC2B7lv4j1gP+ZwtRM63BTbI6Lk=; b=PMi7cb46XeyrT0uSOmbJ14KEiNxNg4nCqL8YgDTbsjeML0l/+OSPWxhvpyhmirFw0J 19ur1ZMUpIRZrv+voPrMLU79vD9PH7I1D/WJzP8lVzTswXcCd4Z45iY0Zkfd47q/C9LM +Z7IUN+cgxcKXbrT/4HUNm40kNBwTztcJOgjwJiiC/hmeGvXObUAphvaqBg/jH0bWFu/ d5ng3q3AGow/OrD0fOo0e1ehQpDAs91GSvmJxxM+58ZBdD+u2U84KcFvDjpsOP2DmqrX kEbkvciHO4dyx00SkAjaNwcFInusSzG+vODJvOdS1u4KCjsAPRg8nJ2p5rwXtHQx4heB Bd/g== X-Gm-Message-State: AOAM5303lsSb98TT+SaftyAXWs55dp06BvyxCqOpI0o0+RUzuHFpkC7H uLMQXxnrR1zSRebPKnLk5Aqq3o03iim5DQ== X-Google-Smtp-Source: ABdhPJwvEqs1rpiA5GDP41oPh7zHTbuvm6dRzzWOn6YR48IL6+VfM25vVQqQnSdB/xmAcxD2woX1Vw== X-Received: by 2002:a17:90a:ae12:: with SMTP id t18mr4148025pjq.147.1601986202638; Tue, 06 Oct 2020 05:10:02 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v5 4/7] plugin: Fixes typo in qemu-plugin.h Date: Tue, 6 Oct 2020 20:08:57 +0800 Message-Id: <20201006120900.1579-5-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20201006120900.1579-1-luoyonggang@gmail.com> References: <20201006120900.1579-1-luoyonggang@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::642; envelope-from=luoyonggang@gmail.com; helo=mail-pl1-x642.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=20Benn=C3=A9e?= , Paolo Bonzini , Yonggang Luo , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Getting the comment consistence with the function name Signed-off-by: Yonggang Luo --- include/qemu/qemu-plugin.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index bab8b0d4b3..daac8291b8 100644 --- a/include/qemu/qemu-plugin.h +++ b/include/qemu/qemu-plugin.h @@ -218,7 +218,7 @@ void qemu_plugin_register_vcpu_tb_trans_cb(qemu_plugin_= id_t id, qemu_plugin_vcpu_tb_trans_cb_t = cb); =20 /** - * qemu_plugin_register_vcpu_tb_trans_exec_cb() - register execution callb= ack + * qemu_plugin_register_vcpu_tb_exec_cb() - register execution callback * @tb: the opaque qemu_plugin_tb handle for the translation * @cb: callback function * @flags: does the plugin read or write the CPU's registers? @@ -236,7 +236,7 @@ enum qemu_plugin_op { }; =20 /** - * qemu_plugin_register_vcpu_tb_trans_exec_inline() - execution inline op + * qemu_plugin_register_vcpu_tb_exec_inline() - execution inline op * @tb: the opaque qemu_plugin_tb handle for the translation * @op: the type of qemu_plugin_op (e.g. ADD_U64) * @ptr: the target memory location for the op --=20 2.28.0.windows.1 From nobody Thu Oct 31 23:11:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1601986478; cv=none; d=zohomail.com; s=zohoarc; b=f8CGDDphFwBRhyaPeiBCvrLS8c1dA8reKiQB1vLb+vulEe4imJdLUbdH628RJwRJEMBUyXrOdjwLw9176IkupSF66Y+18kPN9DoaB/ELicmkd9IiDtQLBAWXSwQcNYz+9wdvOfSJLUFW9639Rhh8mnzMSd+VogfoWpv1dC/50S8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601986478; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=BOlOgUVB/LUsxUJM9RhelHXFkF/Bcu9HYVNIIx7ypx4=; b=jcWk6w+wj2gAuKcPAmr9zMNioS09kXirI+j1NYlmGuSeTs5zMbTyNzsAlwvLaPm7DAOgOs3qoim/+wmObfElZl8SoFZO8dtVInwAGjnPjpAOulwY8BvnV4snUddCTsq1smk9kEU6UI/D4YbEDLC+5G3VnFSED/HYbU5H2zp8MLE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1601986478062870.9511044908168; Tue, 6 Oct 2020 05:14:38 -0700 (PDT) Received: from localhost ([::1]:57684 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPlrY-00013q-Hn for importer@patchew.org; Tue, 06 Oct 2020 08:14:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49066) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPlnK-0003UP-Ui for qemu-devel@nongnu.org; Tue, 06 Oct 2020 08:10:16 -0400 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]:40795) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kPlnF-0004Ev-1W for qemu-devel@nongnu.org; Tue, 06 Oct 2020 08:10:14 -0400 Received: by mail-pj1-x1029.google.com with SMTP id j8so1512324pjy.5 for ; Tue, 06 Oct 2020 05:10:08 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id f4sm2965681pgk.19.2020.10.06.05.10.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Oct 2020 05:10:05 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=BOlOgUVB/LUsxUJM9RhelHXFkF/Bcu9HYVNIIx7ypx4=; b=dbpANuUQD0uQ7djawCn0sZpjdBSpE3YCUd8uyYbK3zZxd2yqlANdVc/V3EONclx0oD tR4LsjrV8i6iWWkHKm3m/Z4kvbpHC2XE/f8+jdvW8gsnSSp7/VGKRl5tb3gxX02BCAM1 Se/pBkfyfC1adB/hfNXeroLYORzQ+ZuJAgbbWkatbBdVb7sSjV0vRjQkVfWDHv78JZBO 1rWkHtYJc0zvpqktNBS6ZcyIIkruWza/FNjAcY2IPrn9gPwwB2ruMw32vQbhnZh+aBRW OFLby0SbHqaQn0hthzPHJW0N9SUcZAzNNFTaXZgHpAfQw/HxNl6pPXuEyxliDa6+Ji8D LmsA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=BOlOgUVB/LUsxUJM9RhelHXFkF/Bcu9HYVNIIx7ypx4=; b=r61OmZvySs3TCaxB4+tJ7vtQCW/yLsYFu2sCog6ZimE5UVQicpPMhgZfol1E1KQaG/ /sWLqjPBSsjCsTgHnWdiCp/OWYznm45zL0Ls76E+6rBbQZMfLv4xW6M0PGd6ixXb7NQx C6FDO+BK55c/jUlJVgYmrTc8WhzfOrGlBNHwnK3diPFqpkHXlV6rsWSpi+SqdrtoClmB prwBp173xLZV3vH5JKS/34ZG7kcmYEBotsZf45svzI0CGkZq8NziNxYMUCvCtyFmN+rp nlbRgKejv0IMgHThufoTHsdV3uRL8atDiQFrWSxVVtAVPF0flPVCGqOizXdTYnjo1/pK pmWQ== X-Gm-Message-State: AOAM532km4Q11Wa3y0WzU0BoSpjMJ2YnaBc0JW3Cw1DmhZ6QbKW+7GDj /5z+Ev+NUPUsyuv0onOATpD/dVOusLncPw== X-Google-Smtp-Source: ABdhPJyi5fGoffyZSSPZe90+Gaz4VkbT/TT5q/4jxYFCQBt9PEwb04Swq7xHrQ0vMan3XH8kywGfxg== X-Received: by 2002:a17:90a:634b:: with SMTP id v11mr3320447pjs.108.1601986206494; Tue, 06 Oct 2020 05:10:06 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v5 5/7] plugin: Getting qemu-plugin works under win32. Date: Tue, 6 Oct 2020 20:08:58 +0800 Message-Id: <20201006120900.1579-6-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20201006120900.1579-1-luoyonggang@gmail.com> References: <20201006120900.1579-1-luoyonggang@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1029; envelope-from=luoyonggang@gmail.com; helo=mail-pj1-x1029.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=20Benn=C3=A9e?= , Paolo Bonzini , Yonggang Luo , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Define QEMU_PLUGIN_API_IMPLEMENTATION in api.c and core.c We removed the need of .symbols file, so is the configure script, if we one expose a function to qemu-plugin just need prefix the function with QEMU_PLUGIN_EXPORT We use QEMU_PLUGIN_EXPORT export the functions in api.c and core.c and loading it in qemu_plugin_initialize, so we need a list of function poi= nter deceleration such as QEMU_PLUGIN_EXTERN qemu_plugin_uninstall_t qemu_plugin_uninstall; Signed-off-by: Yonggang Luo --- Makefile | 1 - configure | 71 -------------- include/qemu/qemu-plugin.h | 185 ++++++++++++++++++++++++++--------- meson.build | 6 +- plugins/api.c | 68 +++++++------ plugins/core.c | 15 ++- plugins/loader.c | 50 +++++++++- plugins/meson.build | 10 +- plugins/plugin.h | 1 + plugins/qemu-plugins.symbols | 40 -------- 10 files changed, 244 insertions(+), 203 deletions(-) delete mode 100644 plugins/qemu-plugins.symbols diff --git a/Makefile b/Makefile index f27bd4b2eb..f8f0450fc0 100644 --- a/Makefile +++ b/Makefile @@ -105,7 +105,6 @@ config-host.mak: $(SRC_PATH)/configure $(SRC_PATH)/pc-b= ios $(SRC_PATH)/VERSION =20 # Force configure to re-run if the API symbols are updated ifeq ($(CONFIG_PLUGIN),y) -config-host.mak: $(SRC_PATH)/plugins/qemu-plugins.symbols =20 .PHONY: plugins plugins: diff --git a/configure b/configure index 30d7711edf..0f094860ec 100755 --- a/configure +++ b/configure @@ -5245,61 +5245,6 @@ if compile_prog "" "" ; then atomic64=3Dyes fi =20 -######################################### -# See if --dynamic-list is supported by the linker -ld_dynamic_list=3D"no" -if test "$static" =3D "no" ; then - cat > $TMPTXT < $TMPC < -void foo(void); - -void foo(void) -{ - printf("foo\n"); -} - -int main(void) -{ - foo(); - return 0; -} -EOF - - if compile_prog "" "-Wl,--dynamic-list=3D$TMPTXT" ; then - ld_dynamic_list=3D"yes" - fi -fi - -######################################### -# See if -exported_symbols_list is supported by the linker - -ld_exported_symbols_list=3D"no" -if test "$static" =3D "no" ; then - cat > $TMPTXT <> $config_host_mak - # Copy the export object list to the build dir - if test "$ld_dynamic_list" =3D "yes" ; then - echo "CONFIG_HAS_LD_DYNAMIC_LIST=3Dyes" >> $config_host_mak - ld_symbols=3Dqemu-plugins-ld.symbols - cp "$source_path/plugins/qemu-plugins.symbols" $ld_symbols - elif test "$ld_exported_symbols_list" =3D "yes" ; then - echo "CONFIG_HAS_LD_EXPORTED_SYMBOLS_LIST=3Dyes" >> $config_host_mak - ld64_symbols=3Dqemu-plugins-ld64.symbols - echo "# Automatically generated by configure - do not modify" > $ld64_sym= bols - grep 'qemu_' "$source_path/plugins/qemu-plugins.symbols" | sed 's/;//g' |= \ - sed -E 's/^[[:space:]]*(.*)/_\1/' >> $ld64_symbols - else - error_exit \ - "If \$plugins=3Dyes, either \$ld_dynamic_list or " \ - "\$ld_exported_symbols_list should have been set to 'yes'." - fi fi =20 if test -n "$gdb_bin" ; then diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index daac8291b8..8c725d429c 100644 --- a/include/qemu/qemu-plugin.h +++ b/include/qemu/qemu-plugin.h @@ -21,11 +21,7 @@ * https://gcc.gnu.org/wiki/Visibility */ #if defined _WIN32 || defined __CYGWIN__ - #ifdef BUILDING_DLL - #define QEMU_PLUGIN_EXPORT __declspec(dllexport) - #else - #define QEMU_PLUGIN_EXPORT __declspec(dllimport) - #endif + #define QEMU_PLUGIN_EXPORT __declspec(dllexport) #define QEMU_PLUGIN_LOCAL #else #if __GNUC__ >=3D 4 @@ -52,7 +48,9 @@ typedef uint64_t qemu_plugin_id_t; =20 extern QEMU_PLUGIN_EXPORT int qemu_plugin_version; =20 -#define QEMU_PLUGIN_VERSION 0 +#define QEMU_PLUGIN_VERSION 1 + +typedef void *(*qemu_plugin_global_dlsym_t)(void* context, const char *nam= e); =20 typedef struct { /* string describing architecture */ @@ -73,8 +71,23 @@ typedef struct { int max_vcpus; } system; }; + void *context; + qemu_plugin_global_dlsym_t dlsym; } qemu_info_t; =20 +/** + * qemu_plugin_initialize() - Initialize a plugin before install + * @info: a block describing some details about the guest + * + * All plugins must export this symbol, and in most case using qemu-plugin= .h + * provided implementation directly. + * For plugin provide this function, the QEMU_PLUGIN_VERSION should >=3D 1 + * + * Note: This function only used to loading qemu's exported functions, not= hing + * else should doding in this function. + */ +QEMU_PLUGIN_EXPORT int qemu_plugin_initialize(const qemu_info_t *info); + /** * qemu_plugin_install() - Install a plugin * @id: this plugin's opaque ID @@ -121,7 +134,7 @@ typedef void (*qemu_plugin_vcpu_udata_cb_t)(unsigned in= t vcpu_index, * * Note: Calling this function from qemu_plugin_install() is a bug. */ -void qemu_plugin_uninstall(qemu_plugin_id_t id, qemu_plugin_simple_cb_t cb= ); +typedef void (*qemu_plugin_uninstall_t)(qemu_plugin_id_t id, qemu_plugin_s= imple_cb_t cb); =20 /** * qemu_plugin_reset() - Reset a plugin @@ -134,7 +147,7 @@ void qemu_plugin_uninstall(qemu_plugin_id_t id, qemu_pl= ugin_simple_cb_t cb); * Plugins are reset asynchronously, and therefore the given plugin receiv= es * callbacks until @cb is called. */ -void qemu_plugin_reset(qemu_plugin_id_t id, qemu_plugin_simple_cb_t cb); +typedef void (*qemu_plugin_reset_t)(qemu_plugin_id_t id, qemu_plugin_simpl= e_cb_t cb); =20 /** * qemu_plugin_register_vcpu_init_cb() - register a vCPU initialization ca= llback @@ -145,7 +158,7 @@ void qemu_plugin_reset(qemu_plugin_id_t id, qemu_plugin= _simple_cb_t cb); * * See also: qemu_plugin_register_vcpu_exit_cb() */ -void qemu_plugin_register_vcpu_init_cb(qemu_plugin_id_t id, +typedef void (*qemu_plugin_register_vcpu_init_cb_t)(qemu_plugin_id_t id, qemu_plugin_vcpu_simple_cb_t cb); =20 /** @@ -157,7 +170,7 @@ void qemu_plugin_register_vcpu_init_cb(qemu_plugin_id_t= id, * * See also: qemu_plugin_register_vcpu_init_cb() */ -void qemu_plugin_register_vcpu_exit_cb(qemu_plugin_id_t id, +typedef void (*qemu_plugin_register_vcpu_exit_cb_t)(qemu_plugin_id_t id, qemu_plugin_vcpu_simple_cb_t cb); =20 /** @@ -167,7 +180,7 @@ void qemu_plugin_register_vcpu_exit_cb(qemu_plugin_id_t= id, * * The @cb function is called every time a vCPU idles. */ -void qemu_plugin_register_vcpu_idle_cb(qemu_plugin_id_t id, +typedef void (*qemu_plugin_register_vcpu_idle_cb_t)(qemu_plugin_id_t id, qemu_plugin_vcpu_simple_cb_t cb); =20 /** @@ -177,7 +190,7 @@ void qemu_plugin_register_vcpu_idle_cb(qemu_plugin_id_t= id, * * The @cb function is called every time a vCPU resumes execution. */ -void qemu_plugin_register_vcpu_resume_cb(qemu_plugin_id_t id, +typedef void (*qemu_plugin_register_vcpu_resume_cb_t)(qemu_plugin_id_t id, qemu_plugin_vcpu_simple_cb_t cb); =20 /* @@ -214,7 +227,7 @@ enum qemu_plugin_mem_rw { typedef void (*qemu_plugin_vcpu_tb_trans_cb_t)(qemu_plugin_id_t id, struct qemu_plugin_tb *tb); =20 -void qemu_plugin_register_vcpu_tb_trans_cb(qemu_plugin_id_t id, +typedef void (*qemu_plugin_register_vcpu_tb_trans_cb_t)(qemu_plugin_id_t i= d, qemu_plugin_vcpu_tb_trans_cb_t = cb); =20 /** @@ -226,7 +239,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. */ -void qemu_plugin_register_vcpu_tb_exec_cb(struct qemu_plugin_tb *tb, +typedef void (*qemu_plugin_register_vcpu_tb_exec_cb_t)(struct qemu_plugin_= tb *tb, qemu_plugin_vcpu_udata_cb_t cb, enum qemu_plugin_cb_flags flags, void *userdata); @@ -246,7 +259,7 @@ enum qemu_plugin_op { * Useful if you just want to increment a single counter somewhere in * memory. */ -void qemu_plugin_register_vcpu_tb_exec_inline(struct qemu_plugin_tb *tb, +typedef void (*qemu_plugin_register_vcpu_tb_exec_inline_t)(struct qemu_plu= gin_tb *tb, enum qemu_plugin_op op, void *ptr, uint64_t imm); =20 @@ -259,7 +272,7 @@ void qemu_plugin_register_vcpu_tb_exec_inline(struct qe= mu_plugin_tb *tb, * * The @cb function is called every time an instruction is executed */ -void qemu_plugin_register_vcpu_insn_exec_cb(struct qemu_plugin_insn *insn, +typedef void (*qemu_plugin_register_vcpu_insn_exec_cb_t)(struct qemu_plugi= n_insn *insn, qemu_plugin_vcpu_udata_cb_t cb, enum qemu_plugin_cb_flags flag= s, void *userdata); @@ -275,26 +288,26 @@ void qemu_plugin_register_vcpu_insn_exec_cb(struct qe= mu_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. */ -void qemu_plugin_register_vcpu_insn_exec_inline(struct qemu_plugin_insn *i= nsn, +typedef void (*qemu_plugin_register_vcpu_insn_exec_inline_t)(struct qemu_p= lugin_insn *insn, enum qemu_plugin_op op, void *ptr, uint64_t imm); =20 /* * Helpers to query information about the instructions in a block */ -size_t qemu_plugin_tb_n_insns(const struct qemu_plugin_tb *tb); +typedef size_t (*qemu_plugin_tb_n_insns_t)(const struct qemu_plugin_tb *tb= ); =20 -uint64_t qemu_plugin_tb_vaddr(const struct qemu_plugin_tb *tb); +typedef uint64_t (*qemu_plugin_tb_vaddr_t)(const struct qemu_plugin_tb *tb= ); =20 -struct qemu_plugin_insn * -qemu_plugin_tb_get_insn(const struct qemu_plugin_tb *tb, size_t idx); +typedef struct qemu_plugin_insn * +(*qemu_plugin_tb_get_insn_t)(const struct qemu_plugin_tb *tb, size_t idx); =20 -const void *qemu_plugin_insn_data(const struct qemu_plugin_insn *insn); +typedef const void *(*qemu_plugin_insn_data_t)(const struct qemu_plugin_in= sn *insn); =20 -size_t qemu_plugin_insn_size(const struct qemu_plugin_insn *insn); +typedef size_t (*qemu_plugin_insn_size_t)(const struct qemu_plugin_insn *i= nsn); =20 -uint64_t qemu_plugin_insn_vaddr(const struct qemu_plugin_insn *insn); -void *qemu_plugin_insn_haddr(const struct qemu_plugin_insn *insn); +typedef uint64_t (*qemu_plugin_insn_vaddr_t)(const struct qemu_plugin_insn= *insn); +typedef void *(*qemu_plugin_insn_haddr_t)(const struct qemu_plugin_insn *i= nsn); =20 /* * Memory Instrumentation @@ -307,10 +320,10 @@ typedef uint32_t qemu_plugin_meminfo_t; struct qemu_plugin_hwaddr; =20 /* meminfo queries */ -unsigned int qemu_plugin_mem_size_shift(qemu_plugin_meminfo_t info); -bool qemu_plugin_mem_is_sign_extended(qemu_plugin_meminfo_t info); -bool qemu_plugin_mem_is_big_endian(qemu_plugin_meminfo_t info); -bool qemu_plugin_mem_is_store(qemu_plugin_meminfo_t info); +typedef unsigned int (*qemu_plugin_mem_size_shift_t)(qemu_plugin_meminfo_t= info); +typedef bool (*qemu_plugin_mem_is_sign_extended_t)(qemu_plugin_meminfo_t i= nfo); +typedef bool (*qemu_plugin_mem_is_big_endian_t)(qemu_plugin_meminfo_t info= ); +typedef bool (*qemu_plugin_mem_is_store_t)(qemu_plugin_meminfo_t info); =20 /* * qemu_plugin_get_hwaddr(): @@ -324,7 +337,7 @@ bool qemu_plugin_mem_is_store(qemu_plugin_meminfo_t inf= o); * information about the handle should be recovered before the * callback returns. */ -struct qemu_plugin_hwaddr *qemu_plugin_get_hwaddr(qemu_plugin_meminfo_t in= fo, +typedef struct qemu_plugin_hwaddr *(*qemu_plugin_get_hwaddr_t)(qemu_plugin= _meminfo_t info, uint64_t vaddr); =20 /* @@ -332,21 +345,21 @@ struct qemu_plugin_hwaddr *qemu_plugin_get_hwaddr(qem= u_plugin_meminfo_t info, * to return information about it. For non-IO accesses the device * offset will be into the appropriate block of RAM. */ -bool qemu_plugin_hwaddr_is_io(const struct qemu_plugin_hwaddr *haddr); -uint64_t qemu_plugin_hwaddr_device_offset(const struct qemu_plugin_hwaddr = *haddr); +typedef bool (*qemu_plugin_hwaddr_is_io_t)(const struct qemu_plugin_hwaddr= *haddr); +typedef uint64_t (*qemu_plugin_hwaddr_device_offset_t)(const struct qemu_p= lugin_hwaddr *haddr); =20 typedef void (*qemu_plugin_vcpu_mem_cb_t)(unsigned int vcpu_index, qemu_plugin_meminfo_t info, uint64_t vaddr, void *userdata); =20 -void qemu_plugin_register_vcpu_mem_cb(struct qemu_plugin_insn *insn, +typedef void (*qemu_plugin_register_vcpu_mem_cb_t)(struct qemu_plugin_insn= *insn, qemu_plugin_vcpu_mem_cb_t cb, enum qemu_plugin_cb_flags flags, enum qemu_plugin_mem_rw rw, void *userdata); =20 -void qemu_plugin_register_vcpu_mem_inline(struct qemu_plugin_insn *insn, +typedef void (*qemu_plugin_register_vcpu_mem_inline_t)(struct qemu_plugin_= insn *insn, enum qemu_plugin_mem_rw rw, enum qemu_plugin_op op, void *pt= r, uint64_t imm); @@ -359,15 +372,15 @@ typedef void uint64_t a3, uint64_t a4, uint64_t a5, uint64_t a6, uint64_t a7, uint64_t a8); =20 -void qemu_plugin_register_vcpu_syscall_cb(qemu_plugin_id_t id, +typedef void (*qemu_plugin_register_vcpu_syscall_cb_t)(qemu_plugin_id_t id, qemu_plugin_vcpu_syscall_cb_t cb= ); =20 typedef void (*qemu_plugin_vcpu_syscall_ret_cb_t)(qemu_plugin_id_t id, unsigned int vcp= u_idx, int64_t num, int64_t ret); =20 -void -qemu_plugin_register_vcpu_syscall_ret_cb(qemu_plugin_id_t id, +typedef void +(*qemu_plugin_register_vcpu_syscall_ret_cb_t)(qemu_plugin_id_t id, qemu_plugin_vcpu_syscall_ret_cb_t= cb); =20 =20 @@ -378,7 +391,7 @@ qemu_plugin_register_vcpu_syscall_ret_cb(qemu_plugin_id= _t id, * Returns an allocated string containing the disassembly */ =20 -char *qemu_plugin_insn_disas(const struct qemu_plugin_insn *insn); +typedef char *(*qemu_plugin_insn_disas_t)(const struct qemu_plugin_insn *i= nsn); =20 /** * qemu_plugin_vcpu_for_each() - iterate over the existing vCPU @@ -389,25 +402,109 @@ char *qemu_plugin_insn_disas(const struct qemu_plugi= n_insn *insn); * * See also: qemu_plugin_register_vcpu_init_cb() */ -void qemu_plugin_vcpu_for_each(qemu_plugin_id_t id, +typedef void (*qemu_plugin_vcpu_for_each_t)(qemu_plugin_id_t id, qemu_plugin_vcpu_simple_cb_t cb); =20 -void qemu_plugin_register_flush_cb(qemu_plugin_id_t id, +typedef void (*qemu_plugin_register_flush_cb_t)(qemu_plugin_id_t id, qemu_plugin_simple_cb_t cb); =20 -void qemu_plugin_register_atexit_cb(qemu_plugin_id_t id, +typedef void (*qemu_plugin_register_atexit_cb_t)(qemu_plugin_id_t id, qemu_plugin_udata_cb_t cb, void *userd= ata); =20 /* returns -1 in user-mode */ -int qemu_plugin_n_vcpus(void); +typedef int (*qemu_plugin_n_vcpus_t)(void); =20 /* returns -1 in user-mode */ -int qemu_plugin_n_max_vcpus(void); +typedef int (*qemu_plugin_n_max_vcpus_t)(void); =20 /** * qemu_plugin_outs() - output string via QEMU's logging system * @string: a string */ -void qemu_plugin_outs(const char *string); +typedef void (*qemu_plugin_outs_t)(const char *string); + +#if !defined(QEMU_PLUGIN_API_IMPLEMENTATION) +#define QEMU_PLUGIN_EXTERN + +QEMU_PLUGIN_EXTERN qemu_plugin_uninstall_t qemu_plugin_uninstall; +QEMU_PLUGIN_EXTERN qemu_plugin_reset_t qemu_plugin_reset; +QEMU_PLUGIN_EXTERN qemu_plugin_register_vcpu_init_cb_t qemu_plugin_registe= r_vcpu_init_cb; +QEMU_PLUGIN_EXTERN qemu_plugin_register_vcpu_exit_cb_t qemu_plugin_registe= r_vcpu_exit_cb; +QEMU_PLUGIN_EXTERN qemu_plugin_register_vcpu_idle_cb_t qemu_plugin_registe= r_vcpu_idle_cb; +QEMU_PLUGIN_EXTERN qemu_plugin_register_vcpu_resume_cb_t qemu_plugin_regis= ter_vcpu_resume_cb; +QEMU_PLUGIN_EXTERN qemu_plugin_register_vcpu_tb_trans_cb_t qemu_plugin_reg= ister_vcpu_tb_trans_cb; +QEMU_PLUGIN_EXTERN qemu_plugin_register_vcpu_tb_exec_cb_t qemu_plugin_regi= ster_vcpu_tb_exec_cb; +QEMU_PLUGIN_EXTERN qemu_plugin_register_vcpu_tb_exec_inline_t qemu_plugin_= register_vcpu_tb_exec_inline; +QEMU_PLUGIN_EXTERN qemu_plugin_register_vcpu_insn_exec_cb_t qemu_plugin_re= gister_vcpu_insn_exec_cb; +QEMU_PLUGIN_EXTERN qemu_plugin_register_vcpu_insn_exec_inline_t qemu_plugi= n_register_vcpu_insn_exec_inline; +QEMU_PLUGIN_EXTERN qemu_plugin_tb_n_insns_t qemu_plugin_tb_n_insns; +QEMU_PLUGIN_EXTERN qemu_plugin_tb_vaddr_t qemu_plugin_tb_vaddr; +QEMU_PLUGIN_EXTERN qemu_plugin_tb_get_insn_t qemu_plugin_tb_get_insn; +QEMU_PLUGIN_EXTERN qemu_plugin_insn_data_t qemu_plugin_insn_data; +QEMU_PLUGIN_EXTERN qemu_plugin_insn_size_t qemu_plugin_insn_size; +QEMU_PLUGIN_EXTERN qemu_plugin_insn_vaddr_t qemu_plugin_insn_vaddr; +QEMU_PLUGIN_EXTERN qemu_plugin_insn_haddr_t qemu_plugin_insn_haddr; +QEMU_PLUGIN_EXTERN qemu_plugin_mem_size_shift_t qemu_plugin_mem_size_shift; +QEMU_PLUGIN_EXTERN qemu_plugin_mem_is_sign_extended_t qemu_plugin_mem_is_s= ign_extended; +QEMU_PLUGIN_EXTERN qemu_plugin_mem_is_big_endian_t qemu_plugin_mem_is_big_= endian; +QEMU_PLUGIN_EXTERN qemu_plugin_mem_is_store_t qemu_plugin_mem_is_store; +QEMU_PLUGIN_EXTERN qemu_plugin_get_hwaddr_t qemu_plugin_get_hwaddr; +QEMU_PLUGIN_EXTERN qemu_plugin_hwaddr_is_io_t qemu_plugin_hwaddr_is_io; +QEMU_PLUGIN_EXTERN qemu_plugin_hwaddr_device_offset_t qemu_plugin_hwaddr_d= evice_offset; +QEMU_PLUGIN_EXTERN qemu_plugin_register_vcpu_mem_cb_t qemu_plugin_register= _vcpu_mem_cb; +QEMU_PLUGIN_EXTERN qemu_plugin_register_vcpu_mem_inline_t qemu_plugin_regi= ster_vcpu_mem_inline; +QEMU_PLUGIN_EXTERN qemu_plugin_register_vcpu_syscall_cb_t qemu_plugin_regi= ster_vcpu_syscall_cb; +QEMU_PLUGIN_EXTERN qemu_plugin_register_vcpu_syscall_ret_cb_t qemu_plugin_= register_vcpu_syscall_ret_cb; +QEMU_PLUGIN_EXTERN qemu_plugin_insn_disas_t qemu_plugin_insn_disas; +QEMU_PLUGIN_EXTERN qemu_plugin_vcpu_for_each_t qemu_plugin_vcpu_for_each; +QEMU_PLUGIN_EXTERN qemu_plugin_register_flush_cb_t qemu_plugin_register_fl= ush_cb; +QEMU_PLUGIN_EXTERN qemu_plugin_register_atexit_cb_t qemu_plugin_register_a= texit_cb; +QEMU_PLUGIN_EXTERN qemu_plugin_n_vcpus_t qemu_plugin_n_vcpus; +QEMU_PLUGIN_EXTERN qemu_plugin_n_max_vcpus_t qemu_plugin_n_max_vcpus; +QEMU_PLUGIN_EXTERN qemu_plugin_outs_t qemu_plugin_outs; + +QEMU_PLUGIN_EXPORT int qemu_plugin_initialize(const qemu_info_t *info) +{ + qemu_plugin_uninstall =3D info->dlsym(info->context, "qemu_plugin_unin= stall"); + qemu_plugin_reset =3D info->dlsym(info->context, "qemu_plugin_reset"); + qemu_plugin_register_vcpu_init_cb =3D info->dlsym(info->context, "qemu= _plugin_register_vcpu_init_cb"); + qemu_plugin_register_vcpu_exit_cb =3D info->dlsym(info->context, "qemu= _plugin_register_vcpu_exit_cb"); + qemu_plugin_register_vcpu_idle_cb =3D info->dlsym(info->context, "qemu= _plugin_register_vcpu_idle_cb"); + qemu_plugin_register_vcpu_resume_cb =3D info->dlsym(info->context, "qe= mu_plugin_register_vcpu_resume_cb"); + qemu_plugin_register_vcpu_tb_trans_cb =3D info->dlsym(info->context, "= qemu_plugin_register_vcpu_tb_trans_cb"); + qemu_plugin_register_vcpu_tb_exec_cb =3D info->dlsym(info->context, "q= emu_plugin_register_vcpu_tb_exec_cb"); + qemu_plugin_register_vcpu_tb_exec_inline =3D info->dlsym(info->context= , "qemu_plugin_register_vcpu_tb_exec_inline"); + qemu_plugin_register_vcpu_insn_exec_cb =3D info->dlsym(info->context, = "qemu_plugin_register_vcpu_insn_exec_cb"); + qemu_plugin_register_vcpu_insn_exec_inline =3D info->dlsym(info->conte= xt, "qemu_plugin_register_vcpu_insn_exec_inline"); + qemu_plugin_tb_n_insns =3D info->dlsym(info->context, "qemu_plugin_tb_= n_insns"); + qemu_plugin_tb_vaddr =3D info->dlsym(info->context, "qemu_plugin_tb_va= ddr"); + qemu_plugin_tb_get_insn =3D info->dlsym(info->context, "qemu_plugin_tb= _get_insn"); + qemu_plugin_insn_data =3D info->dlsym(info->context, "qemu_plugin_insn= _data"); + qemu_plugin_insn_size =3D info->dlsym(info->context, "qemu_plugin_insn= _size"); + qemu_plugin_insn_vaddr =3D info->dlsym(info->context, "qemu_plugin_ins= n_vaddr"); + qemu_plugin_insn_haddr =3D info->dlsym(info->context, "qemu_plugin_ins= n_haddr"); + qemu_plugin_mem_size_shift =3D info->dlsym(info->context, "qemu_plugin= _mem_size_shift"); + qemu_plugin_mem_is_sign_extended =3D info->dlsym(info->context, "qemu_= plugin_mem_is_sign_extended"); + qemu_plugin_mem_is_big_endian =3D info->dlsym(info->context, "qemu_plu= gin_mem_is_big_endian"); + qemu_plugin_mem_is_store =3D info->dlsym(info->context, "qemu_plugin_m= em_is_store"); + qemu_plugin_get_hwaddr =3D info->dlsym(info->context, "qemu_plugin_get= _hwaddr"); + qemu_plugin_hwaddr_is_io =3D info->dlsym(info->context, "qemu_plugin_h= waddr_is_io"); + qemu_plugin_hwaddr_device_offset =3D info->dlsym(info->context, "qemu_= plugin_hwaddr_device_offset"); + qemu_plugin_register_vcpu_mem_cb =3D info->dlsym(info->context, "qemu_= plugin_register_vcpu_mem_cb"); + qemu_plugin_register_vcpu_mem_inline =3D info->dlsym(info->context, "q= emu_plugin_register_vcpu_mem_inline"); + qemu_plugin_register_vcpu_syscall_cb =3D info->dlsym(info->context, "q= emu_plugin_register_vcpu_syscall_cb"); + qemu_plugin_register_vcpu_syscall_ret_cb =3D info->dlsym(info->context= , "qemu_plugin_register_vcpu_syscall_ret_cb"); + qemu_plugin_insn_disas =3D info->dlsym(info->context, "qemu_plugin_ins= n_disas"); + qemu_plugin_vcpu_for_each =3D info->dlsym(info->context, "qemu_plugin_= vcpu_for_each"); + qemu_plugin_register_flush_cb =3D info->dlsym(info->context, "qemu_plu= gin_register_flush_cb"); + qemu_plugin_register_atexit_cb =3D info->dlsym(info->context, "qemu_pl= ugin_register_atexit_cb"); + qemu_plugin_n_vcpus =3D info->dlsym(info->context, "qemu_plugin_n_vcpu= s"); + qemu_plugin_n_max_vcpus =3D info->dlsym(info->context, "qemu_plugin_n_= max_vcpus"); + qemu_plugin_outs =3D info->dlsym(info->context, "qemu_plugin_outs"); + return 0; +} + +#endif /* QEMU_PLUGIN_API_IMPLEMENTATION */ + =20 #endif /* QEMU_PLUGIN_API_H */ diff --git a/meson.build b/meson.build index d515ece664..95a532bd29 100644 --- a/meson.build +++ b/meson.build @@ -331,7 +331,11 @@ endif rt =3D cc.find_library('rt', required: false) libdl =3D not_found if 'CONFIG_PLUGIN' in config_host - libdl =3D cc.find_library('dl', required: true) + if targetos =3D=3D 'windows' + libdl =3D declare_dependency(compile_args: [], link_args: []) + else + libdl =3D cc.find_library('dl', required: true) + endif endif libiscsi =3D not_found if 'CONFIG_LIBISCSI' in config_host diff --git a/plugins/api.c b/plugins/api.c index 13177d3578..96e3345a3f 100644 --- a/plugins/api.c +++ b/plugins/api.c @@ -35,6 +35,7 @@ */ =20 #include "qemu/osdep.h" +#define QEMU_PLUGIN_API_IMPLEMENTATION #include "qemu/plugin.h" #include "cpu.h" #include "sysemu/sysemu.h" @@ -48,14 +49,17 @@ #endif #include "trace/mem.h" =20 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmissing-prototypes" + /* Uninstall and Reset handlers */ =20 -void qemu_plugin_uninstall(qemu_plugin_id_t id, qemu_plugin_simple_cb_t cb) +QEMU_PLUGIN_EXPORT void qemu_plugin_uninstall(qemu_plugin_id_t id, qemu_pl= ugin_simple_cb_t cb) { plugin_reset_uninstall(id, cb, false); } =20 -void qemu_plugin_reset(qemu_plugin_id_t id, qemu_plugin_simple_cb_t cb) +QEMU_PLUGIN_EXPORT void qemu_plugin_reset(qemu_plugin_id_t id, qemu_plugin= _simple_cb_t cb) { plugin_reset_uninstall(id, cb, true); } @@ -67,19 +71,19 @@ void qemu_plugin_reset(qemu_plugin_id_t id, qemu_plugin= _simple_cb_t cb) * during the translation. */ =20 -void qemu_plugin_register_vcpu_init_cb(qemu_plugin_id_t id, +QEMU_PLUGIN_EXPORT void qemu_plugin_register_vcpu_init_cb(qemu_plugin_id_t= id, qemu_plugin_vcpu_simple_cb_t cb) { plugin_register_cb(id, QEMU_PLUGIN_EV_VCPU_INIT, cb); } =20 -void qemu_plugin_register_vcpu_exit_cb(qemu_plugin_id_t id, +QEMU_PLUGIN_EXPORT void qemu_plugin_register_vcpu_exit_cb(qemu_plugin_id_t= id, qemu_plugin_vcpu_simple_cb_t cb) { plugin_register_cb(id, QEMU_PLUGIN_EV_VCPU_EXIT, cb); } =20 -void qemu_plugin_register_vcpu_tb_exec_cb(struct qemu_plugin_tb *tb, +QEMU_PLUGIN_EXPORT void qemu_plugin_register_vcpu_tb_exec_cb(struct qemu_p= lugin_tb *tb, qemu_plugin_vcpu_udata_cb_t cb, enum qemu_plugin_cb_flags flags, void *udata) @@ -88,14 +92,14 @@ void qemu_plugin_register_vcpu_tb_exec_cb(struct qemu_p= lugin_tb *tb, cb, flags, udata); } =20 -void qemu_plugin_register_vcpu_tb_exec_inline(struct qemu_plugin_tb *tb, +QEMU_PLUGIN_EXPORT void qemu_plugin_register_vcpu_tb_exec_inline(struct qe= mu_plugin_tb *tb, enum qemu_plugin_op op, void *ptr, uint64_t imm) { plugin_register_inline_op(&tb->cbs[PLUGIN_CB_INLINE], 0, op, ptr, imm); } =20 -void qemu_plugin_register_vcpu_insn_exec_cb(struct qemu_plugin_insn *insn, +QEMU_PLUGIN_EXPORT 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 flag= s, void *udata) @@ -104,7 +108,7 @@ void qemu_plugin_register_vcpu_insn_exec_cb(struct qemu= _plugin_insn *insn, cb, flags, udata); } =20 -void qemu_plugin_register_vcpu_insn_exec_inline(struct qemu_plugin_insn *i= nsn, +QEMU_PLUGIN_EXPORT void qemu_plugin_register_vcpu_insn_exec_inline(struct = qemu_plugin_insn *insn, enum qemu_plugin_op op, void *ptr, uint64_t imm) { @@ -114,7 +118,7 @@ void qemu_plugin_register_vcpu_insn_exec_inline(struct = qemu_plugin_insn *insn, =20 =20 =20 -void qemu_plugin_register_vcpu_mem_cb(struct qemu_plugin_insn *insn, +QEMU_PLUGIN_EXPORT void qemu_plugin_register_vcpu_mem_cb(struct qemu_plugi= n_insn *insn, qemu_plugin_vcpu_mem_cb_t cb, enum qemu_plugin_cb_flags flags, enum qemu_plugin_mem_rw rw, @@ -124,7 +128,7 @@ void qemu_plugin_register_vcpu_mem_cb(struct qemu_plugi= n_insn *insn, cb, flags, rw, udata); } =20 -void qemu_plugin_register_vcpu_mem_inline(struct qemu_plugin_insn *insn, +QEMU_PLUGIN_EXPORT void qemu_plugin_register_vcpu_mem_inline(struct qemu_p= lugin_insn *insn, enum qemu_plugin_mem_rw rw, enum qemu_plugin_op op, void *pt= r, uint64_t imm) @@ -133,19 +137,19 @@ void qemu_plugin_register_vcpu_mem_inline(struct qemu= _plugin_insn *insn, rw, op, ptr, imm); } =20 -void qemu_plugin_register_vcpu_tb_trans_cb(qemu_plugin_id_t id, +QEMU_PLUGIN_EXPORT void qemu_plugin_register_vcpu_tb_trans_cb(qemu_plugin_= id_t id, qemu_plugin_vcpu_tb_trans_cb_t = cb) { plugin_register_cb(id, QEMU_PLUGIN_EV_VCPU_TB_TRANS, cb); } =20 -void qemu_plugin_register_vcpu_syscall_cb(qemu_plugin_id_t id, +QEMU_PLUGIN_EXPORT void qemu_plugin_register_vcpu_syscall_cb(qemu_plugin_i= d_t id, qemu_plugin_vcpu_syscall_cb_t cb) { plugin_register_cb(id, QEMU_PLUGIN_EV_VCPU_SYSCALL, cb); } =20 -void +QEMU_PLUGIN_EXPORT void qemu_plugin_register_vcpu_syscall_ret_cb(qemu_plugin_id_t id, qemu_plugin_vcpu_syscall_ret_cb_t= cb) { @@ -168,17 +172,17 @@ qemu_plugin_register_vcpu_syscall_ret_cb(qemu_plugin_= id_t id, * each translated instruction. */ =20 -size_t qemu_plugin_tb_n_insns(const struct qemu_plugin_tb *tb) +QEMU_PLUGIN_EXPORT size_t qemu_plugin_tb_n_insns(const struct qemu_plugin_= tb *tb) { return tb->n; } =20 -uint64_t qemu_plugin_tb_vaddr(const struct qemu_plugin_tb *tb) +QEMU_PLUGIN_EXPORT uint64_t qemu_plugin_tb_vaddr(const struct qemu_plugin_= tb *tb) { return tb->vaddr; } =20 -struct qemu_plugin_insn * +QEMU_PLUGIN_EXPORT struct qemu_plugin_insn * qemu_plugin_tb_get_insn(const struct qemu_plugin_tb *tb, size_t idx) { if (unlikely(idx >=3D tb->n)) { @@ -194,27 +198,27 @@ qemu_plugin_tb_get_insn(const struct qemu_plugin_tb *= tb, size_t idx) * instruction being translated. */ =20 -const void *qemu_plugin_insn_data(const struct qemu_plugin_insn *insn) +QEMU_PLUGIN_EXPORT const void *qemu_plugin_insn_data(const struct qemu_plu= gin_insn *insn) { return insn->data->data; } =20 -size_t qemu_plugin_insn_size(const struct qemu_plugin_insn *insn) +QEMU_PLUGIN_EXPORT size_t qemu_plugin_insn_size(const struct qemu_plugin_i= nsn *insn) { return insn->data->len; } =20 -uint64_t qemu_plugin_insn_vaddr(const struct qemu_plugin_insn *insn) +QEMU_PLUGIN_EXPORT uint64_t qemu_plugin_insn_vaddr(const struct qemu_plugi= n_insn *insn) { return insn->vaddr; } =20 -void *qemu_plugin_insn_haddr(const struct qemu_plugin_insn *insn) +QEMU_PLUGIN_EXPORT void *qemu_plugin_insn_haddr(const struct qemu_plugin_i= nsn *insn) { return insn->haddr; } =20 -char *qemu_plugin_insn_disas(const struct qemu_plugin_insn *insn) +QEMU_PLUGIN_EXPORT char *qemu_plugin_insn_disas(const struct qemu_plugin_i= nsn *insn) { CPUState *cpu =3D current_cpu; return plugin_disas(cpu, insn->vaddr, insn->data->len); @@ -225,22 +229,22 @@ char *qemu_plugin_insn_disas(const struct qemu_plugin= _insn *insn) * memory access. */ =20 -unsigned qemu_plugin_mem_size_shift(qemu_plugin_meminfo_t info) +QEMU_PLUGIN_EXPORT unsigned qemu_plugin_mem_size_shift(qemu_plugin_meminfo= _t info) { return info & TRACE_MEM_SZ_SHIFT_MASK; } =20 -bool qemu_plugin_mem_is_sign_extended(qemu_plugin_meminfo_t info) +QEMU_PLUGIN_EXPORT bool qemu_plugin_mem_is_sign_extended(qemu_plugin_memin= fo_t info) { return !!(info & TRACE_MEM_SE); } =20 -bool qemu_plugin_mem_is_big_endian(qemu_plugin_meminfo_t info) +QEMU_PLUGIN_EXPORT bool qemu_plugin_mem_is_big_endian(qemu_plugin_meminfo_= t info) { return !!(info & TRACE_MEM_BE); } =20 -bool qemu_plugin_mem_is_store(qemu_plugin_meminfo_t info) +QEMU_PLUGIN_EXPORT bool qemu_plugin_mem_is_store(qemu_plugin_meminfo_t inf= o) { return !!(info & TRACE_MEM_ST); } @@ -253,7 +257,7 @@ bool qemu_plugin_mem_is_store(qemu_plugin_meminfo_t inf= o) static __thread struct qemu_plugin_hwaddr hwaddr_info; #endif =20 -struct qemu_plugin_hwaddr *qemu_plugin_get_hwaddr(qemu_plugin_meminfo_t in= fo, +QEMU_PLUGIN_EXPORT struct qemu_plugin_hwaddr *qemu_plugin_get_hwaddr(qemu_= plugin_meminfo_t info, uint64_t vaddr) { #ifdef CONFIG_SOFTMMU @@ -273,7 +277,7 @@ struct qemu_plugin_hwaddr *qemu_plugin_get_hwaddr(qemu_= plugin_meminfo_t info, #endif } =20 -bool qemu_plugin_hwaddr_is_io(const struct qemu_plugin_hwaddr *haddr) +QEMU_PLUGIN_EXPORT bool qemu_plugin_hwaddr_is_io(const struct qemu_plugin_= hwaddr *haddr) { #ifdef CONFIG_SOFTMMU return haddr->is_io; @@ -282,7 +286,7 @@ bool qemu_plugin_hwaddr_is_io(const struct qemu_plugin_= hwaddr *haddr) #endif } =20 -uint64_t qemu_plugin_hwaddr_device_offset(const struct qemu_plugin_hwaddr = *haddr) +QEMU_PLUGIN_EXPORT uint64_t qemu_plugin_hwaddr_device_offset(const struct = qemu_plugin_hwaddr *haddr) { #ifdef CONFIG_SOFTMMU if (haddr) { @@ -313,7 +317,7 @@ static MachineState * get_ms(void) } #endif =20 -int qemu_plugin_n_vcpus(void) +QEMU_PLUGIN_EXPORT int qemu_plugin_n_vcpus(void) { #ifdef CONFIG_USER_ONLY return -1; @@ -322,7 +326,7 @@ int qemu_plugin_n_vcpus(void) #endif } =20 -int qemu_plugin_n_max_vcpus(void) +QEMU_PLUGIN_EXPORT int qemu_plugin_n_max_vcpus(void) { #ifdef CONFIG_USER_ONLY return -1; @@ -334,7 +338,9 @@ int qemu_plugin_n_max_vcpus(void) /* * Plugin output */ -void qemu_plugin_outs(const char *string) +QEMU_PLUGIN_EXPORT void qemu_plugin_outs(const char *string) { qemu_log_mask(CPU_LOG_PLUGIN, "%s", string); } + +#pragma GCC diagnostic pop diff --git a/plugins/core.c b/plugins/core.c index 51bfc94787..3df3e7d9af 100644 --- a/plugins/core.c +++ b/plugins/core.c @@ -32,6 +32,9 @@ #include "trace/mem-internal.h" /* mem_info macros */ #include "plugin.h" =20 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmissing-prototypes" + struct qemu_plugin_cb { struct qemu_plugin_ctx *ctx; union qemu_plugin_cb_sig f; @@ -233,7 +236,7 @@ static void plugin_vcpu_for_each(gpointer k, gpointer v= , gpointer udata) args->cb(args->ctx->id, cpu_index); } =20 -void qemu_plugin_vcpu_for_each(qemu_plugin_id_t id, +QEMU_PLUGIN_EXPORT void qemu_plugin_vcpu_for_each(qemu_plugin_id_t id, qemu_plugin_vcpu_simple_cb_t cb) { struct plugin_for_each_args args; @@ -384,19 +387,19 @@ void qemu_plugin_vcpu_resume_cb(CPUState *cpu) plugin_vcpu_cb__simple(cpu, QEMU_PLUGIN_EV_VCPU_RESUME); } =20 -void qemu_plugin_register_vcpu_idle_cb(qemu_plugin_id_t id, +QEMU_PLUGIN_EXPORT void qemu_plugin_register_vcpu_idle_cb(qemu_plugin_id_t= id, qemu_plugin_vcpu_simple_cb_t cb) { plugin_register_cb(id, QEMU_PLUGIN_EV_VCPU_IDLE, cb); } =20 -void qemu_plugin_register_vcpu_resume_cb(qemu_plugin_id_t id, +QEMU_PLUGIN_EXPORT void qemu_plugin_register_vcpu_resume_cb(qemu_plugin_id= _t id, qemu_plugin_vcpu_simple_cb_t cb) { plugin_register_cb(id, QEMU_PLUGIN_EV_VCPU_RESUME, cb); } =20 -void qemu_plugin_register_flush_cb(qemu_plugin_id_t id, +QEMU_PLUGIN_EXPORT void qemu_plugin_register_flush_cb(qemu_plugin_id_t id, qemu_plugin_simple_cb_t cb) { plugin_register_cb(id, QEMU_PLUGIN_EV_FLUSH, cb); @@ -463,7 +466,7 @@ void qemu_plugin_atexit_cb(void) plugin_cb__udata(QEMU_PLUGIN_EV_ATEXIT); } =20 -void qemu_plugin_register_atexit_cb(qemu_plugin_id_t id, +QEMU_PLUGIN_EXPORT void qemu_plugin_register_atexit_cb(qemu_plugin_id_t id, qemu_plugin_udata_cb_t cb, void *udata) { @@ -500,3 +503,5 @@ static void __attribute__((__constructor__)) plugin_ini= t(void) QHT_MODE_AUTO_RESIZE); atexit(qemu_plugin_atexit_cb); } + +#pragma GCC diagnostic pop diff --git a/plugins/loader.c b/plugins/loader.c index 8ac5dbc20f..53fb1671ee 100644 --- a/plugins/loader.c +++ b/plugins/loader.c @@ -63,6 +63,7 @@ QemuOptsList qemu_plugin_opts =3D { }, }; =20 +typedef int (*qemu_plugin_initialize_func_t)(const qemu_info_t *); typedef int (*qemu_plugin_install_func_t)(qemu_plugin_id_t, const qemu_inf= o_t *, int, char **); =20 extern struct qemu_plugin_state plugin; @@ -152,10 +153,12 @@ static uint64_t xorshift64star(uint64_t x) =20 static int plugin_load(struct qemu_plugin_desc *desc, const qemu_info_t *i= nfo) { + qemu_plugin_initialize_func_t initialize =3D NULL; qemu_plugin_install_func_t install; struct qemu_plugin_ctx *ctx; gpointer sym; int rc; + int version =3D -1; =20 ctx =3D qemu_memalign(qemu_dcache_linesize, sizeof(*ctx)); memset(ctx, 0, sizeof(*ctx)); @@ -184,7 +187,7 @@ static int plugin_load(struct qemu_plugin_desc *desc, c= onst qemu_info_t *info) desc->path, g_module_error()); goto err_symbol; } else { - int version =3D *(int *)sym; + version =3D *(int *)sym; if (version < QEMU_PLUGIN_MIN_VERSION) { error_report("TCG plugin %s requires API version %d, but " "this QEMU supports only a minimum version of %d", @@ -198,6 +201,21 @@ static int plugin_load(struct qemu_plugin_desc *desc, = const qemu_info_t *info) } } =20 + if (version >=3D QEMU_PLUGIN_VERSION_1) { + /* This version should call to qemu_plugin_initialize first */ + if (!g_module_symbol(ctx->handle, "qemu_plugin_initialize", &sym))= { + error_report("%s: %s", __func__, g_module_error()); + goto err_symbol; + } + initialize =3D (qemu_plugin_initialize_func_t) sym; + /* symbol was found; it could be NULL though */ + if (initialize =3D=3D NULL) { + error_report("%s: %s: qemu_plugin_initialize is NULL", + __func__, desc->path); + goto err_symbol; + } + } + qemu_rec_mutex_lock(&plugin.lock); =20 /* find an unused random id with &ctx as the seed */ @@ -216,6 +234,16 @@ static int plugin_load(struct qemu_plugin_desc *desc, = const qemu_info_t *info) } } QTAILQ_INSERT_TAIL(&plugin.ctxs, ctx, entry); + if (initialize !=3D NULL) { + rc =3D initialize(info); + if (rc) { + error_report("%s: qemu_plugin_initialize returned error code %= d", + __func__, rc); + /* qemu_plugin_initialize only loading function symbols */ + goto err_symbol; + } + } + ctx->installing =3D true; rc =3D install(ctx->id, info, desc->argc, desc->argv); ctx->installing =3D false; @@ -254,6 +282,17 @@ static void plugin_desc_free(struct qemu_plugin_desc *= desc) g_free(desc); } =20 +static void *qemu_plugin_global_dlsym(void* context, const char *name) +{ + GModule *global_handle =3D context; + gpointer sym =3D NULL; + if (!g_module_symbol(global_handle, name, &sym)) { + error_report("%s: %s", __func__, g_module_error()); + return NULL; + } + return sym; +} + /** * qemu_plugin_load_list - load a list of plugins * @head: head of the list of descriptors of the plugins to be loaded @@ -267,6 +306,7 @@ int qemu_plugin_load_list(QemuPluginList *head) { struct qemu_plugin_desc *desc, *next; g_autofree qemu_info_t *info =3D g_new0(qemu_info_t, 1); + GModule *global_handle =3D NULL; =20 info->target_name =3D TARGET_NAME; info->version.min =3D QEMU_PLUGIN_MIN_VERSION; @@ -276,6 +316,12 @@ int qemu_plugin_load_list(QemuPluginList *head) info->system_emulation =3D true; info->system.smp_vcpus =3D ms->smp.cpus; info->system.max_vcpus =3D ms->smp.max_cpus; + global_handle =3D g_module_open(NULL, G_MODULE_BIND_LOCAL); + if (global_handle =3D=3D NULL) { + goto err_dlopen; + } + info->dlsym =3D qemu_plugin_global_dlsym; + info->context =3D (void*)global_handle; #else info->system_emulation =3D false; #endif @@ -289,6 +335,8 @@ int qemu_plugin_load_list(QemuPluginList *head) } QTAILQ_REMOVE(head, desc, entry); } + +err_dlopen: return 0; } =20 diff --git a/plugins/meson.build b/plugins/meson.build index e77723010e..b48d2046ff 100644 --- a/plugins/meson.build +++ b/plugins/meson.build @@ -1,13 +1,5 @@ -if 'CONFIG_HAS_LD_DYNAMIC_LIST' in config_host - plugin_ldflags =3D ['-Wl,--dynamic-list=3D' + (meson.build_root() / 'qem= u-plugins-ld.symbols')] -elif 'CONFIG_HAS_LD_EXPORTED_SYMBOLS_LIST' in config_host - plugin_ldflags =3D ['-Wl,-exported_symbols_list,' + (meson.build_root() = / 'qemu-plugins-ld64.symbols')] -else - plugin_ldflags =3D [] -endif - specific_ss.add(when: 'CONFIG_PLUGIN', if_true: [files( 'loader.c', 'core.c', 'api.c', -), declare_dependency(link_args: plugin_ldflags)]) +), declare_dependency(link_args: [], compile_args: [])]) diff --git a/plugins/plugin.h b/plugins/plugin.h index 1aa29dcadd..406f246a72 100644 --- a/plugins/plugin.h +++ b/plugins/plugin.h @@ -15,6 +15,7 @@ #include =20 #define QEMU_PLUGIN_MIN_VERSION 0 +#define QEMU_PLUGIN_VERSION_1 1 =20 /* global state */ struct qemu_plugin_state { diff --git a/plugins/qemu-plugins.symbols b/plugins/qemu-plugins.symbols deleted file mode 100644 index 4bdb381f48..0000000000 --- a/plugins/qemu-plugins.symbols +++ /dev/null @@ -1,40 +0,0 @@ -{ - qemu_plugin_uninstall; - qemu_plugin_reset; - qemu_plugin_register_vcpu_init_cb; - qemu_plugin_register_vcpu_exit_cb; - qemu_plugin_register_vcpu_idle_cb; - qemu_plugin_register_vcpu_resume_cb; - qemu_plugin_register_vcpu_insn_exec_cb; - qemu_plugin_register_vcpu_insn_exec_inline; - qemu_plugin_register_vcpu_mem_cb; - qemu_plugin_register_vcpu_mem_haddr_cb; - qemu_plugin_register_vcpu_mem_inline; - qemu_plugin_ram_addr_from_host; - qemu_plugin_register_vcpu_tb_trans_cb; - qemu_plugin_register_vcpu_tb_exec_cb; - qemu_plugin_register_vcpu_tb_exec_inline; - qemu_plugin_register_flush_cb; - qemu_plugin_register_vcpu_syscall_cb; - qemu_plugin_register_vcpu_syscall_ret_cb; - qemu_plugin_register_atexit_cb; - qemu_plugin_tb_n_insns; - qemu_plugin_tb_get_insn; - qemu_plugin_tb_vaddr; - qemu_plugin_insn_data; - qemu_plugin_insn_size; - qemu_plugin_insn_vaddr; - qemu_plugin_insn_haddr; - qemu_plugin_insn_disas; - qemu_plugin_mem_size_shift; - qemu_plugin_mem_is_sign_extended; - qemu_plugin_mem_is_big_endian; - qemu_plugin_mem_is_store; - qemu_plugin_get_hwaddr; - qemu_plugin_hwaddr_is_io; - qemu_plugin_hwaddr_to_raddr; - qemu_plugin_vcpu_for_each; - qemu_plugin_n_vcpus; - qemu_plugin_n_max_vcpus; - qemu_plugin_outs; -}; --=20 2.28.0.windows.1 From nobody Thu Oct 31 23:11:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1601986410; cv=none; d=zohomail.com; s=zohoarc; b=F6r9Nz2BFxGxZQta6QyRfynPgfSEF1UTq6TCfWU4nBSGBRouk2E1fZ7QzUmlkeSW4CNgtjT77tyw4AM+L0KJ8Hc4YZmlh6rDno8+gQTArU2LbJ5PpNiVH4+xwtQ87CFYeLi8zKwHqaPDlT2JVj5ks78yNpeAOaD5otsg3nHR3OE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601986410; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=9m4Jg/id830Dx9xQTw5eTIEmforQvRp5qt9BLy+DBJw=; b=WQvSAOSMM2WssaeHYs7IxZ5YX84HN0n6TUDSPSY7dC/HqALL7iJdOUBB7fEGI08SbSyM2Pc40O+J7cbsiCmWRGLBlavAXRZjrCRssBGctkWgEFb3YVAZrG2xCcRjO2yXCNvPH8cEtlJxUeBLWCkmGqusBmRpgQprPYncCDehMd0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1601986410242368.52973363434353; Tue, 6 Oct 2020 05:13:30 -0700 (PDT) Received: from localhost ([::1]:54000 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPlqQ-0007yi-Ll for importer@patchew.org; Tue, 06 Oct 2020 08:13:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49054) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPlnI-0003T6-Uk for qemu-devel@nongnu.org; Tue, 06 Oct 2020 08:10:12 -0400 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]:45416) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kPlnG-0004F9-QA for qemu-devel@nongnu.org; Tue, 06 Oct 2020 08:10:12 -0400 Received: by mail-pf1-x442.google.com with SMTP id x22so8878944pfo.12 for ; Tue, 06 Oct 2020 05:10:10 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id f4sm2965681pgk.19.2020.10.06.05.10.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Oct 2020 05:10:08 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=9m4Jg/id830Dx9xQTw5eTIEmforQvRp5qt9BLy+DBJw=; b=uA+Ho/Bw3c2GJAwhDybA8txAxBF3NUkr5kKYRqCnUucrYzO0P6xby++NgV3plG70wP FrAPCYRX01XoyDYb2QIsgKnhm9rGgF3nYWHqnsz2hjnk78LQz3CYNfEhCEGQidscTAOL 2ABe6Lea2TyY7KhC+qS1d3m/hYXMJOlRV12hGJUIE/fJGxyKBNtv+tDy7hP/Ds4DAtk+ e/+n9NA+bS8Uku1iIESoC1B/a+GVORuIHOwFUcC0WFdw98KspCO4H4+JzBWefcWJfr9p 6TiSY+HMWCp+l09LHu4BxBlgbZnkfPmTQZM+/cosadgdTMUd6TVyWJQRlHLsbTj4Qobi 43Xg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=9m4Jg/id830Dx9xQTw5eTIEmforQvRp5qt9BLy+DBJw=; b=nXiVcNkkcgwHg30MrHjXT7BH5f51Dym8RPWXnyAgpROdFpXwHY4ddF9gutfIqg4Uzj +F0KfvJS1ZEzq/pMqjo6CcDTxPvhJF+ZRTBPUfq85EHw2Nc11k+zRW+/Ypf+jbDfYTvu MN2XzGIJWHNAzECY6qlxQgv/9ZVhsapc9H1zph9mfnPVYk5Kx9Rifnc6BIlBTDwQHx4P 3hZV0UbENo0sjcK8B1lEVHvfIBa3qNEmFgXsezGc1hHXx+4h/inHGO4k2gfdpf9cdD/R 1K239gylbsswZaRMWNyLbC9VzQEqFFXL6MZbHhPTHmU1sRqEsjUt/Pc8FBJLEctOWouV q3xQ== X-Gm-Message-State: AOAM532vxt+x+KeWBmEat4+cN9B0+cUSvmeoNpfD33rv5xtciELnReCz jmW2jAIMTUwKh7p2iCY/BRpZh1QOjdO32g== X-Google-Smtp-Source: ABdhPJwnfgykWezLDGYrqxnjUJ7pSTS2U1lyXiWyfeMcdpl4XMiXqq5lbSMhar8jgcrRNVRKncsqvg== X-Received: by 2002:a63:d841:: with SMTP id k1mr3816492pgj.59.1601986209027; Tue, 06 Oct 2020 05:10:09 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v5 6/7] plugin: Getting qemu-plugin.h can be included in multiple source file Date: Tue, 6 Oct 2020 20:08:59 +0800 Message-Id: <20201006120900.1579-7-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20201006120900.1579-1-luoyonggang@gmail.com> References: <20201006120900.1579-1-luoyonggang@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::442; envelope-from=luoyonggang@gmail.com; helo=mail-pf1-x442.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=20Benn=C3=A9e?= , Paolo Bonzini , Yonggang Luo , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" If we only have a single .c file in a plugin, then define QEMU_PLUGIN_EXTERN to empty is OK, but if we have multiple .c files in a plugin, then we need distinguish the implementation and the deceleration. only the main .c file should define the macro QEMU_PLUGIN_IMP= LEMENTATION other sources are user and should use extern Signed-off-by: Yonggang Luo --- contrib/plugins/hotblocks.c | 1 + contrib/plugins/hotpages.c | 1 + contrib/plugins/howvec.c | 1 + contrib/plugins/lockstep.c | 1 + include/qemu/qemu-plugin.h | 8 ++++++++ plugins/core.c | 1 + tests/plugin/bb.c | 1 + tests/plugin/empty.c | 1 + tests/plugin/insn.c | 1 + tests/plugin/mem.c | 1 + 10 files changed, 17 insertions(+) diff --git a/contrib/plugins/hotblocks.c b/contrib/plugins/hotblocks.c index 37435a3fc7..39e77d2980 100644 --- a/contrib/plugins/hotblocks.c +++ b/contrib/plugins/hotblocks.c @@ -13,6 +13,7 @@ #include #include =20 +#define QEMU_PLUGIN_IMPLEMENTATION #include =20 QEMU_PLUGIN_EXPORT int qemu_plugin_version =3D QEMU_PLUGIN_VERSION; diff --git a/contrib/plugins/hotpages.c b/contrib/plugins/hotpages.c index ecd6c18732..1ae3f44aed 100644 --- a/contrib/plugins/hotpages.c +++ b/contrib/plugins/hotpages.c @@ -16,6 +16,7 @@ #include #include =20 +#define QEMU_PLUGIN_IMPLEMENTATION #include =20 QEMU_PLUGIN_EXPORT int qemu_plugin_version =3D QEMU_PLUGIN_VERSION; diff --git a/contrib/plugins/howvec.c b/contrib/plugins/howvec.c index 3b9a6939f2..db1b4e5780 100644 --- a/contrib/plugins/howvec.c +++ b/contrib/plugins/howvec.c @@ -18,6 +18,7 @@ #include #include =20 +#define QEMU_PLUGIN_IMPLEMENTATION #include =20 QEMU_PLUGIN_EXPORT int qemu_plugin_version =3D QEMU_PLUGIN_VERSION; diff --git a/contrib/plugins/lockstep.c b/contrib/plugins/lockstep.c index a696673dff..7173b2910d 100644 --- a/contrib/plugins/lockstep.c +++ b/contrib/plugins/lockstep.c @@ -31,6 +31,7 @@ #include #include =20 +#define QEMU_PLUGIN_IMPLEMENTATION #include =20 QEMU_PLUGIN_EXPORT int qemu_plugin_version =3D QEMU_PLUGIN_VERSION; diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index 8c725d429c..8d08f52f7f 100644 --- a/include/qemu/qemu-plugin.h +++ b/include/qemu/qemu-plugin.h @@ -424,7 +424,11 @@ typedef int (*qemu_plugin_n_max_vcpus_t)(void); typedef void (*qemu_plugin_outs_t)(const char *string); =20 #if !defined(QEMU_PLUGIN_API_IMPLEMENTATION) +#if defined(QEMU_PLUGIN_IMPLEMENTATION) #define QEMU_PLUGIN_EXTERN +#else +#define QEMU_PLUGIN_EXTERN extern +#endif =20 QEMU_PLUGIN_EXTERN qemu_plugin_uninstall_t qemu_plugin_uninstall; QEMU_PLUGIN_EXTERN qemu_plugin_reset_t qemu_plugin_reset; @@ -463,6 +467,8 @@ QEMU_PLUGIN_EXTERN qemu_plugin_n_vcpus_t qemu_plugin_n_= vcpus; QEMU_PLUGIN_EXTERN qemu_plugin_n_max_vcpus_t qemu_plugin_n_max_vcpus; QEMU_PLUGIN_EXTERN qemu_plugin_outs_t qemu_plugin_outs; =20 +#if defined(QEMU_PLUGIN_IMPLEMENTATION) + QEMU_PLUGIN_EXPORT int qemu_plugin_initialize(const qemu_info_t *info) { qemu_plugin_uninstall =3D info->dlsym(info->context, "qemu_plugin_unin= stall"); @@ -504,6 +510,8 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_initialize(const qem= u_info_t *info) return 0; } =20 +#endif + #endif /* QEMU_PLUGIN_API_IMPLEMENTATION */ =20 =20 diff --git a/plugins/core.c b/plugins/core.c index 3df3e7d9af..dd1ec7b3fc 100644 --- a/plugins/core.c +++ b/plugins/core.c @@ -12,6 +12,7 @@ * SPDX-License-Identifier: GPL-2.0-or-later */ #include "qemu/osdep.h" +#define QEMU_PLUGIN_API_IMPLEMENTATION #include "qemu/error-report.h" #include "qemu/config-file.h" #include "qapi/error.h" diff --git a/tests/plugin/bb.c b/tests/plugin/bb.c index de09bdde4e..cda3fbdde9 100644 --- a/tests/plugin/bb.c +++ b/tests/plugin/bb.c @@ -12,6 +12,7 @@ #include #include =20 +#define QEMU_PLUGIN_IMPLEMENTATION #include =20 QEMU_PLUGIN_EXPORT int qemu_plugin_version =3D QEMU_PLUGIN_VERSION; diff --git a/tests/plugin/empty.c b/tests/plugin/empty.c index 8fa6bacd93..0c3adf7aa0 100644 --- a/tests/plugin/empty.c +++ b/tests/plugin/empty.c @@ -11,6 +11,7 @@ #include #include =20 +#define QEMU_PLUGIN_IMPLEMENTATION #include =20 QEMU_PLUGIN_EXPORT int qemu_plugin_version =3D QEMU_PLUGIN_VERSION; diff --git a/tests/plugin/insn.c b/tests/plugin/insn.c index a9a6e41237..bf86fdafe6 100644 --- a/tests/plugin/insn.c +++ b/tests/plugin/insn.c @@ -12,6 +12,7 @@ #include #include =20 +#define QEMU_PLUGIN_IMPLEMENTATION #include =20 QEMU_PLUGIN_EXPORT int qemu_plugin_version =3D QEMU_PLUGIN_VERSION; diff --git a/tests/plugin/mem.c b/tests/plugin/mem.c index 4725bd851d..f39be9c969 100644 --- a/tests/plugin/mem.c +++ b/tests/plugin/mem.c @@ -12,6 +12,7 @@ #include #include =20 +#define QEMU_PLUGIN_IMPLEMENTATION #include =20 QEMU_PLUGIN_EXPORT int qemu_plugin_version =3D QEMU_PLUGIN_VERSION; --=20 2.28.0.windows.1 From nobody Thu Oct 31 23:11:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1601986428; cv=none; d=zohomail.com; s=zohoarc; b=Ns143dueQnXTjgTLgmyDRsTD2QpN11rOg5AurejyRWP3TdB8PAeHBQRzHbWPaSHvU57/yCkBOb/UkHDhDz9ipEJLFVtI1u6RW6YPJEQOvesywIoHX5Qk5dvnPImV0zAikuGEqFbbvejK00DNYc7Luo1JpxGkOZ2RkSzCtSFrDvQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601986428; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=9ZjByY0MppOyobXen+0uddzbK8uVuelULUAbb8n9Gk0=; b=Ipllx5urmD397enWy7pCptfjm/Dwy7KfuyYLbNQ7eOltnCDOSPGsYzB+EvvLT9RgS0GJtydZsvR+8DxqK4mEqgb6su7d3HwQUx0FlfDSqrquy57cWFw6uHKAFjX6cvt7/VStsldjXKM7UpsCbb3OD/FVpvYKEusj2qpGkr2j8eI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1601986428980150.443819119949; Tue, 6 Oct 2020 05:13:48 -0700 (PDT) Received: from localhost ([::1]:54392 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kPlql-00088G-Pg for importer@patchew.org; Tue, 06 Oct 2020 08:13:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49098) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kPlnM-0003UU-97 for qemu-devel@nongnu.org; Tue, 06 Oct 2020 08:10:16 -0400 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]:36836) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kPlnK-0004FM-JF for qemu-devel@nongnu.org; Tue, 06 Oct 2020 08:10:15 -0400 Received: by mail-pg1-x52e.google.com with SMTP id x16so7890923pgj.3 for ; Tue, 06 Oct 2020 05:10:12 -0700 (PDT) Received: from localhost.localdomain ([103.94.185.75]) by smtp.googlemail.com with ESMTPSA id f4sm2965681pgk.19.2020.10.06.05.10.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Oct 2020 05:10:10 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=9ZjByY0MppOyobXen+0uddzbK8uVuelULUAbb8n9Gk0=; b=urNh0aSPHimYCDbh5F40nns7wONq/7IYIack8l1bO+X1G5FlSsXi1/ywEpubiS0bbp nXGOnzYrkbX6ybuHKOLkhjSaU8kfq1vuPpJGGpZTAHK3DgKea0+4xYo86FdhdFQT/exX aaVrcV4t9g6WeLrIix7vGfI5RXPC7JWUsJ/QAOpi/2igpbJOocAuPp816VLd4AwJ7AgO W9vbUWO9iwxVY1tgTSk48DdYOedK1wjZyA08qXzPCPKBuMDFEpKxZTb1h81v51Xs+1nD Tg8oNwvwK6R6kHCCo/Re9H97e8x+VEkqiBpWtjVRQc55p5pbzU8uJyRq+224C2rePbJA HgiA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=9ZjByY0MppOyobXen+0uddzbK8uVuelULUAbb8n9Gk0=; b=sd2ulPTFLezsvycHIDb6GLuRNe2G6IaWMJOt7WXG2XGDeC0UM7MVuJfi9sx/ItWtJg djtvKeGoROfyIOW3aDPOXOLFXAEbZ8+D6kkgt3EH+RNhVUq8e/dpx0OiT+uWSlrayPtq pgaqz3iSEQ7C0PRTjnsEphparLfZLxnJm9O8Ai/c79eRtGp4J0m6fOQ9AfH6053Fsw3w 61hvULVwztRkffsV5wWakGOiJJgrjGVEa2E0itGg5eeBsrwJrHcfMDZ7dJ6Rbco22Uxn mVPjc6ch47U9yjt7vYp8Af7uj9WAUVURDA/1m6PC6XBJi0W8TG7vePB9E8Ds3jDyxnY2 Vn3A== X-Gm-Message-State: AOAM533+eNxpgHjyiMl3UEgdimwZVO6YsNKSYmZwSYHR3cKRVdno1QVr v0BI3SGiqNAnb5nYAtMhKaF9xgWKXNdYIA== X-Google-Smtp-Source: ABdhPJz+zAsFQLJjeVAvi8mKrGy3hNxXDZLy1GKjzQn9OunR1Ye4PN9/CDQMH68EKemOPOANVS1BLg== X-Received: by 2002:a63:fe03:: with SMTP id p3mr3773610pgh.100.1601986211368; Tue, 06 Oct 2020 05:10:11 -0700 (PDT) From: Yonggang Luo To: qemu-devel@nongnu.org Subject: [PATCH v5 7/7] cirrus: Enable plugin in cirrus for windows Date: Tue, 6 Oct 2020 20:09:00 +0800 Message-Id: <20201006120900.1579-8-luoyonggang@gmail.com> X-Mailer: git-send-email 2.28.0.windows.1 In-Reply-To: <20201006120900.1579-1-luoyonggang@gmail.com> References: <20201006120900.1579-1-luoyonggang@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::52e; envelope-from=luoyonggang@gmail.com; helo=mail-pg1-x52e.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=20Benn=C3=A9e?= , Paolo Bonzini , Yonggang Luo , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: Yonggang Luo --- .cirrus.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index 86ea33926a..5363142373 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -104,7 +104,8 @@ windows_msys2_task: - C:\tools\msys64\usr\bin\bash.exe -lc "mkdir build" - C:\tools\msys64\usr\bin\bash.exe -lc "cd build && ../configure --python=3Dpython3 --ninja=3Dninja - --target-list-exclude=3Di386-softmmu,arm-softmmu,ppc-softmmu,mips-so= ftmmu" + --target-list-exclude=3Di386-softmmu,arm-softmmu,ppc-softmmu,mips-so= ftmmu + --enable-plugins" - C:\tools\msys64\usr\bin\bash.exe -lc "cd build && make -j$NUMBER_OF_= PROCESSORS" test_script: - C:\tools\msys64\usr\bin\bash.exe -lc "cd build && make V=3D1 check" --=20 2.28.0.windows.1