From patchwork Tue Dec 17 01:06:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 851404 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp110619wrq; Mon, 16 Dec 2024 17:09:53 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUzZ8Sltil5crdO2T9qQWvTKvZowTsvV0Ez3GiKljJDnxM55nezmxQ/FQtS+WhoJ6kPlmCbxA==@linaro.org X-Google-Smtp-Source: AGHT+IFC5lb+P2eOtrUqV/PL3cjYRT7ntLEjxdLLmeL4XaXwmgeWuxNk05un6GDXzbKnAgSp2XLK X-Received: by 2002:a05:6214:5086:b0:6d3:f1ff:f8d6 with SMTP id 6a1803df08f44-6dc96848901mr242151726d6.40.1734397793460; Mon, 16 Dec 2024 17:09:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734397793; cv=none; d=google.com; s=arc-20240605; b=cvpmcKMS+i1bdB/z3OJWj5EHG+OsGqLGqtP/OmN1kT04CNZ3jj9rrBESzXYr3bUqF6 RqX1c8KHpPffBk2lE5zKt5grYvp/g3cDrYvHr7JDWkZjDCdgkwetrhJRDDAs5XP7z7VV KnBehjS5U7xlPL8+6P+L48Oh/81hNQU5N6kUJQBCSl9b+K+pJdZhJ0VPJwJrLJjdieba ItG7yjVQJev5pkq/uwx4zwH9+Ggi9dfpZX4CZHkbdHJAobXbk0L+LD5+1bsB8aUE71+j St1coD9lHwAPbmCcKpQfBLgXztpGm9tLMOc2+6EhMriF3LSU3ylMKZVeIO8QnZQPoTed aw/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kHLhWvJzE9yDVjpN1hr16j3rbknmxcBsd3hvunSMfeU=; fh=CFa3ou2Ry4mS7fTsZUswJFlbz+fCeIacXufDVqA7iAo=; b=OP8JLuzVeP7dn/Vf+YNFHDmidVun+u6zBLEqqh77n+Flunya27+DfkIFT/rNHyMLfU mAnbNAfP4IQjUW/fRi6HfUV4VKkR2YD2gd3U2gYr8fzIg7HKvGTF0vQd4g+AwxFj/IyS w3ns0JGoeF8/2IiNnTHOILa32uC9ZVnV0Xv7jDIimC5m715bG4XVTY1vC4cayJjmdYk6 xBzd33QqbSdYj9gT43mjoYxiAoGRdSVoJIhEB9BCoA7QxeWSfWgKhHgdiFoyYIXEA7vV w6jzIuikD+0Ey3XKTAtS7DLPEZOfbulDxwA5D9dBVU3Zn+C5zRo+lufey3s5LVs4dw3S mwmA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vSRHyDF7; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6dccd34d779si85762526d6.262.2024.12.16.17.09.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Dec 2024 17:09:53 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vSRHyDF7; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNM3X-0008Eg-K1; Mon, 16 Dec 2024 20:07:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tNM3W-0008EK-CK for qemu-devel@nongnu.org; Mon, 16 Dec 2024 20:07:22 -0500 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tNM3U-0004wk-NH for qemu-devel@nongnu.org; Mon, 16 Dec 2024 20:07:22 -0500 Received: by mail-pj1-x1032.google.com with SMTP id 98e67ed59e1d1-2ee8e8e29f6so3626402a91.0 for ; Mon, 16 Dec 2024 17:07:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734397639; x=1735002439; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kHLhWvJzE9yDVjpN1hr16j3rbknmxcBsd3hvunSMfeU=; b=vSRHyDF79BOA/Gm9L54V2toLii+Jzg9uJiX8PcrovvQswTU/fXaBWm+TTr95eiFYWb 8tSpCRB77pDjCEcU7UpG5PvUPI6ZwMgv7VgnTQZ7LhdRwK8jeeBHrz3sdTsUXfKRe/o6 d/ZnEYVNjM45+XwjnbMRF1yJ4Kur72gHgkCe5NiADVZmsDbff5qUMixJU6k6vKcTyEuz bLI4QuG1itQAyd4VMAoscsPbfksvOb4T8SfRBrtwf/wGR5l5EO2Wsg0/hKAsQkKSoCg8 0pwKmyDts0H3OEwfziBw5FP4zY3teBEIlk+dsOBrlAsQEbp6hMP4rvTWmu1HvCtGFYkW zF5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734397639; x=1735002439; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kHLhWvJzE9yDVjpN1hr16j3rbknmxcBsd3hvunSMfeU=; b=wg5bVTnifFh7eQAePH+VoCX35l+x1S3AbbdOG7K62SwbhbGWS3g4ryjya2rgCqyhZp VheXB98Im07oj6qy1qJ3lqvBNzXltM2oB9t1GoM0p9OyWDeGmq2wVmkTYzpUilx58Abc Al0IL+k7uM3x7Vd0fi4AvBJ3FdCSNvtOwfAhSk/BuP19nCvrg8U5sYeAYjumnX3rSPPj EnCdndytbh6Y1XeCLd1qu0xUIQqcRbupENTDgdiseXmwYzoszyEeMF2uB80p0WsV+XP4 wpXOINEO0mhvNTzrYK0y5zIeoxVKYOCE84PrVWg34w3plduB8OmY27mfotHB9GyY/Lnu Ob6Q== X-Gm-Message-State: AOJu0YxlEtoKu7QHsK0U5HJuBsv6bBl8JWRCZp/DNPTUnMSSs5AVCHLA eO43xp091tCYiG0YlskpmPOg8aGPAT5K/0nJDSeG1Kre7Pbz0G1xl3CKOG8fm8GT3DIQuX1weHy W6tE= X-Gm-Gg: ASbGncs5RX+jY5VYKGm/+0Isxem3cp2obeLVunQC5krp7ADtQEstIjLPrwd1WdxKio3 Et6s1PkfZ8jgOEiACT0KrrEHlsqFO1vkxo+lQgFBHGiyQ+e+OYDhNwPGAetkQDC7FQwETAzCa8j ZLpIZj/5Zb2rF2mJCZ0tYjA2bzEk6iZe/UNUBKa5nT92QwXGDKWtcU0MQ0RW0t5FoxI4+Idze5L vFkfGmGzHUlMMi0wktooVoVWS5a8T77CF0+surpI9zm2zaNM5VgeIx2c4KZMWo6rE/agqjTAyi4 J+CoAUYeekLTPHU= X-Received: by 2002:a17:90b:2b45:b0:2ee:d7d3:3008 with SMTP id 98e67ed59e1d1-2f28fb63badmr26648042a91.12.1734397639024; Mon, 16 Dec 2024 17:07:19 -0800 (PST) Received: from pc.. (216-180-64-156.dyn.novuscom.net. [216.180.64.156]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-218a1e6d0e4sm48746595ad.261.2024.12.16.17.07.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Dec 2024 17:07:18 -0800 (PST) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, Pierrick Bouvier , Alexandre Iooss , Paolo Bonzini , Mahmoud Mandour , Thomas Huth , philmd@linaro.org Subject: [PATCH 01/13] plugins: change signature of qemu_plugin_insn_haddr Date: Mon, 16 Dec 2024 17:06:55 -0800 Message-Id: <20241217010707.2557258-2-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241217010707.2557258-1-pierrick.bouvier@linaro.org> References: <20241217010707.2557258-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pj1-x1032.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org It makes more sense to return the same type than qemu_plugin_insn_vaddr. Signed-off-by: Pierrick Bouvier --- include/qemu/qemu-plugin.h | 2 +- plugins/api.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index 0fba36ae028..1fbcff6e1d2 100644 --- a/include/qemu/qemu-plugin.h +++ b/include/qemu/qemu-plugin.h @@ -537,7 +537,7 @@ uint64_t qemu_plugin_insn_vaddr(const struct qemu_plugin_insn *insn); * Returns: hardware (physical) target address of instruction */ QEMU_PLUGIN_API -void *qemu_plugin_insn_haddr(const struct qemu_plugin_insn *insn); +uint64_t qemu_plugin_insn_haddr(const struct qemu_plugin_insn *insn); /** * typedef qemu_plugin_meminfo_t - opaque memory transaction handle diff --git a/plugins/api.c b/plugins/api.c index 24ea64e2de5..17b3a65e773 100644 --- a/plugins/api.c +++ b/plugins/api.c @@ -283,13 +283,13 @@ uint64_t qemu_plugin_insn_vaddr(const struct qemu_plugin_insn *insn) return insn->vaddr; } -void *qemu_plugin_insn_haddr(const struct qemu_plugin_insn *insn) +uint64_t qemu_plugin_insn_haddr(const struct qemu_plugin_insn *insn) { const DisasContextBase *db = tcg_ctx->plugin_db; vaddr page0_last = db->pc_first | ~TARGET_PAGE_MASK; if (db->fake_insn) { - return NULL; + return 0; } /* @@ -300,14 +300,14 @@ void *qemu_plugin_insn_haddr(const struct qemu_plugin_insn *insn) */ if (insn->vaddr <= page0_last) { if (db->host_addr[0] == NULL) { - return NULL; + return 0; } - return db->host_addr[0] + insn->vaddr - db->pc_first; + return (uintptr_t) (db->host_addr[0] + insn->vaddr - db->pc_first); } else { if (db->host_addr[1] == NULL) { - return NULL; + return 0; } - return db->host_addr[1] + insn->vaddr - (page0_last + 1); + return (uintptr_t) (db->host_addr[1] + insn->vaddr - (page0_last + 1)); } } From patchwork Tue Dec 17 01:06:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 851405 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp110613wrq; Mon, 16 Dec 2024 17:09:53 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWV3spJ+5+xe753PjUkOeXVVoo0b+3/2nXtAnLv6tajfgRf6vShMYqgPHPz/vFzI/DxPvNE/g==@linaro.org X-Google-Smtp-Source: AGHT+IEWJa0HAiYvShEwqrgqEQJuLW0Tfyk3uzUcHt54ACseNzZy0+bnbjDOPWrym+LRArbQOkAB X-Received: by 2002:a05:620a:4005:b0:7b1:5545:7104 with SMTP id af79cd13be357-7b8595aeadbmr306804685a.2.1734397793395; Mon, 16 Dec 2024 17:09:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734397793; cv=none; d=google.com; s=arc-20240605; b=XNQcvvti/ORmA4cDUJ0oKMJ8HY7LkJYBYELpSjlCq1dUjCRiA8pQX+yVepT9bPdt0x Dx49mdDtSnymx/y4hmsBpZpv9EdInOY/AcNjKmnSB0axxUemtc+jnDGFwcCM4hehsYhC KDAhCpa5fQN+67MikTvDJI7SNoiJ1hl9bDQkfSf+rLubyKMvYDVPYINviHBRS7ZiKOLP 8CXDsBu1M2bC7CwE/JQvkXjQDaVf2+OjvDqF3ybEtMPXXvCq7OO6JBqBqq32xJsVlX/F MUei5hMPQzk7wmJuHuoh5O3RcHqQCFhzKx499ZAOrpSzWXX/Fuv2pO2nicwrYFgz0Gfw IjCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=71S+eNcZf7pM/na7HmYGPvv/ip7o5rdNjP1L6odqfR8=; fh=CFa3ou2Ry4mS7fTsZUswJFlbz+fCeIacXufDVqA7iAo=; b=Jp1yxZ4PGoNzxlQNHlmr53i1nh7FK81rG53LwrJUrepYRkPfjjUZmJTEHkTV9D97OZ pCGVFrpOVEbpC8wYUYYmUjXm7q5lC0NKnDj+ggb5wj+4neI0g1/85NzaB7olOH3b3xwl TO2S4m/Op5xKoxtmIAEFifX6bXIRw1qhqXY/aRD+Tuww/lL/mUGpr5v8POmwffqL149g z9qe9eTXysOiq1bhfpVHpSZSyEw84PVwC2sLs9/fWLG6o290m8ZXXFs6utIbskHD4Yhx 6Gvbc7C8/pRPzlpwE+fRwjkcHBsPlKCFuh0vAcXWF9QsUyd+FWjZU9hxIAJt8xmyXseB xjXw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Quf0Ud2M; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b7047caa8esi814548985a.101.2024.12.16.17.09.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Dec 2024 17:09:53 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Quf0Ud2M; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNM3Z-0008FM-1H; Mon, 16 Dec 2024 20:07:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tNM3X-0008EY-BM for qemu-devel@nongnu.org; Mon, 16 Dec 2024 20:07:23 -0500 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tNM3V-0004wq-E4 for qemu-devel@nongnu.org; Mon, 16 Dec 2024 20:07:23 -0500 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-725dc290c00so4462902b3a.0 for ; Mon, 16 Dec 2024 17:07:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734397640; x=1735002440; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=71S+eNcZf7pM/na7HmYGPvv/ip7o5rdNjP1L6odqfR8=; b=Quf0Ud2MqezhHoFIGSUpiAGM3YzC+xhikm42h8KKcS/D49EXK8JBY8N2TRSm/ZsP6i GHQx9UrnFGFWFxDIiyoE8fcuxHEjG1DrVFelFy8GRImJx49TnOnYPjEmXgwNryh60S7b +8KWpRUNv1RHwzQPB5lUlrU797OoPcJTit24q36Qkbw+jSStV8M1OEYXGdjXNzukmlA2 Tb88dBme8fa55oWkWjApM/2l1LgnjjQh7XhNnNVYj4hGMOz76pTCPMkRCYpsPqByu+t7 VIPYyjluVyrQxL6uViFpyAbmdLa9Dfj129J0yPq2wVXUWxNY51ErSxI8VGhSXl9fPlsS UUCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734397640; x=1735002440; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=71S+eNcZf7pM/na7HmYGPvv/ip7o5rdNjP1L6odqfR8=; b=pdk93qLxB7E6E/7kPGniu4SF/29gL6HpF92dSm0mhJkHWRaaQQZeOHgFCHEaG0I2jp /lzt5YxTg4FQtmsJojNhe+O1AbU0fs8FFjdGa5UmlWotYBj5Nx9HKmRFBy8Hi6ZabOWl 0yCUaClkpspAQ0UqC423T5eJK22jBwPZfFCJMMJefrSZ1jvDDirf9inhKaidClejl8k+ DeDHePfnRHqDQTjRpIAu+zLB786DlTG7IPxNuUhLvddRR/1zMLAoKR51+dkUfKDaK0Pr p+y7zc4Aeu6LF06jpz/r86j0ojYrj1+893RPgeKsAWtLZCBHS7DGvl7nEe0AAoAMcbKc Djdw== X-Gm-Message-State: AOJu0Yyv6kXoczM5ckbsB37cbn5NBuf7rv/eBlaGsKnnVCmcpK9JBhMy TlNbnlFjefqqHqhJUT8VULLbTbTwpyZJWNuVtcjl4jCvzs6RazeKEvHHSSBwOjoiD3aVujlS9h5 DC90= X-Gm-Gg: ASbGncvC3j9xT5avCztwGDGM1K3b0CljuJOskcqOPnnlUuvSlhPPOue6Y94oZ9uFe26 9PrOIxJbRnx/psJFbVYr9J4bhMkluxz0qSk2Mu7YlE3xl+8dM/9wTkezjhs4NIzhIoW8MajAtna hZdnooUqRh8pxqEoENM9rX9oMU4yO6W6tPxmVxAZowWL5JMM1rzdtf22CQRRN8XTJAp6JK+VlS7 e58nzb98BhB9+1Q5jRUKt/O8MruZkjzYabF34o9kRvCuN0fllQ4Jm/Lj0kj3weElWO6rClyrHAC L5nwmGbZVkOovMk= X-Received: by 2002:a17:902:e852:b0:215:58be:334e with SMTP id d9443c01a7336-218c92136edmr17023625ad.10.1734397639895; Mon, 16 Dec 2024 17:07:19 -0800 (PST) Received: from pc.. (216-180-64-156.dyn.novuscom.net. [216.180.64.156]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-218a1e6d0e4sm48746595ad.261.2024.12.16.17.07.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Dec 2024 17:07:19 -0800 (PST) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, Pierrick Bouvier , Alexandre Iooss , Paolo Bonzini , Mahmoud Mandour , Thomas Huth , philmd@linaro.org Subject: [PATCH 02/13] plugins: bump API version Date: Mon, 16 Dec 2024 17:06:56 -0800 Message-Id: <20241217010707.2557258-3-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241217010707.2557258-1-pierrick.bouvier@linaro.org> References: <20241217010707.2557258-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::436; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pf1-x436.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Pierrick Bouvier --- include/qemu/qemu-plugin.h | 6 +++++- plugins/plugin.h | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index 1fbcff6e1d2..a611f912139 100644 --- a/include/qemu/qemu-plugin.h +++ b/include/qemu/qemu-plugin.h @@ -65,11 +65,15 @@ typedef uint64_t qemu_plugin_id_t; * * version 4: * - added qemu_plugin_read_memory_vaddr + * + * version 5: + * - change signature of qemu_plugin_insn_haddr to return uint64_t instead of + * void *. */ extern QEMU_PLUGIN_EXPORT int qemu_plugin_version; -#define QEMU_PLUGIN_VERSION 4 +#define QEMU_PLUGIN_VERSION 5 /** * struct qemu_info_t - system information for plugins diff --git a/plugins/plugin.h b/plugins/plugin.h index 30e2299a54d..b83c44fda64 100644 --- a/plugins/plugin.h +++ b/plugins/plugin.h @@ -15,7 +15,7 @@ #include #include "qemu/qht.h" -#define QEMU_PLUGIN_MIN_VERSION 2 +#define QEMU_PLUGIN_MIN_VERSION 5 /* global state */ struct qemu_plugin_state { From patchwork Tue Dec 17 01:06:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 851408 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp110631wrq; Mon, 16 Dec 2024 17:09:55 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUJgklO2KLm13/JXBZ6BLxG+8tWL10lAaHy6jJI3u0WyVfOReeyNVfNPNJe8oEsrZJFhvcD3A==@linaro.org X-Google-Smtp-Source: AGHT+IGfNqy44nW/Orivsr5UvNPmFFo36OhzLpa7dNoXK9ReWH548JC1/9H0hoXpYoSgnncden0B X-Received: by 2002:ac8:58c5:0:b0:467:8526:f280 with SMTP id d75a77b69052e-467a5808ad0mr212412511cf.41.1734397794842; Mon, 16 Dec 2024 17:09:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734397794; cv=none; d=google.com; s=arc-20240605; b=ES5LRFboTittff3Rvq2fca5M1Cpe/LgiR2pRnmUuSHGWuIbvW3+xfSPKNHqGBBsQ8q nU09aKpSp1W4SMKZn2K0M++zPaYBw1/aYjHKPNMz5dr52HKXRFcLTX6YvbLMTLyF5dLC hX0uTbn0jjJew/2WJjThzquX9EncnGopo2n1LctrffzHdUWuUgHeCjmkVGdojcZm5bNW Dbvx0YuSLQlK9YZrwHHf1eCSXYMaRWfOmcYvjrGlb11f6PNBvcnY3U6Op83nPgVCikNL j7uUSPyhje1BOaEkAL3vjGPPZsS9keITbMbcmpMc2pboILFPT+4NcMdrfDfE9e5OZcyt 3L8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=cpYSyAxaLUq+FGwtpjTxiPWQf+sG11OxsgGPSOFXX90=; fh=CFa3ou2Ry4mS7fTsZUswJFlbz+fCeIacXufDVqA7iAo=; b=NA3OQNuRU1Ar63qT++mWpJl1GzJBY3xzah8KXroO34SYHO4jW4af0+uwXKoWTqMDA2 KjO0Qdh1E6nJ5N9h9EeNygAtE75horrEEZH+R4CRrYduuGOx/5Kbe4YZ13T46iTuo6Iw weSXqNDmCRwyroh3BlRF45bdMfy7I7yPV3wO0GHyZAh2xa3wxIeUqbXLEndFEz2Uax8x IaTxJNrzE9NujgKJhMp57WDoMv84/vC7uM4J4PYWcN/OOp0CsMbDpbCr7f523zbJzw9r hDVYIXbF8+o0GuQsBnTSjgnSTeOzEPp///3wbRSyLiYYOQMQ2Wl6b4TRf6ZTdAFu02L2 LVGw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BAmxLpaW; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-467b2c9b543si83075941cf.40.2024.12.16.17.09.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Dec 2024 17:09:54 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BAmxLpaW; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNM3Z-0008G0-OR; Mon, 16 Dec 2024 20:07:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tNM3Y-0008F1-42 for qemu-devel@nongnu.org; Mon, 16 Dec 2024 20:07:24 -0500 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tNM3W-0004wx-I1 for qemu-devel@nongnu.org; Mon, 16 Dec 2024 20:07:23 -0500 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-725ea1e19f0so4061837b3a.3 for ; Mon, 16 Dec 2024 17:07:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734397641; x=1735002441; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=cpYSyAxaLUq+FGwtpjTxiPWQf+sG11OxsgGPSOFXX90=; b=BAmxLpaWwOebhMXJ9kmN0RLdGULlDqhR6LTk70deW7jMBwMOxKTuH+Iv2tJPf7cJGZ YVjNpKfleITGxjCxfHAmqTerH6neLR1F5xzJklD4nNTdlWjrp7M/PpA1MKpIJ+Vh27ea HzsfwYO4cOjDvkHH2apzJe1AM1mgSLSs5schFqbc1xwN2TnpWfiRXfoFNHwYJJR3+mGU 8UJvCUujW60kYvCAWEQYVBz9vPOHfur4ueQ1p0dMMyagXSPW8vuDILia4C2FiOx6upcA AAutqQtC/a6VPmPT7o5WFlOXBaGGBbZKUqbnQmgZr7bakLmw5kF0VIBIVVblF8wRkztM cHVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734397641; x=1735002441; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cpYSyAxaLUq+FGwtpjTxiPWQf+sG11OxsgGPSOFXX90=; b=uhcgrVA3Ze7zQAKQ3s7nwmwUbx002mF/6Q7aH3zKv9KyGVsrPDwm2OQGr4UPWhcYJ7 0kBBYVvlAgxXdsvxL3FshEc9jvfBaSDiC4KjmCuRx44sBlv1ujEJiIiJP1aMlv+zSF0P ZfUsIh0AVvnKPHflXMvnyLF4cvTdIOq6XdhdUa+WeJZ0vgfNRy7HccJBF4P98SmnMj2x QaYSyGRjtOciz/3E9SsBmnjerEWK5Z27o3tWe3If81TjPmrAI+PR69vBqTkf67qnvs50 L3Z39lYhgTcljq7leHWpoGbuTQBRtuWDVKlv73uwOW6BmUsGbXtLzs3WHcVIN/KsKCBG hW/g== X-Gm-Message-State: AOJu0Ywt1EjQnNx7Ps97iTKHvTa306E8ZADJqG+lr8mY2lyKLUA9Hr3K D7pErUrgMK0IS09OarBnBK8eCQOuZTud5QNfwyFN2vLuE+WloimmteB/xCgxzRzEaMwHe1NmuKc 3JWE= X-Gm-Gg: ASbGncsk22szbEUqwlFy+Oycu+rBaml67pJkJ8UsRjh8NdiGQuMgSWHTg+Fn88L/Ik8 FM0EoYBwrDKr8tNXmAzWQz82Qh3w+/6IyHIcbtO7DK0qG8HdArw249kGPxunzc252W3H5JTE38C 3YOxMBf+Jd/ukzC89efO2swgMLTn/y5hWDLy9GG2RXeKurOLsv73eeaXnW7A2kDAQnZ09Re2By0 yXRrlckKvYiikvRZQLxDMMspm6Da3w+nXQ4rr8QiVWA+i61waAB1lVhmjfgPIfKvs+U8ruvv6LR 6nhDtr4o8UN7O5w= X-Received: by 2002:a17:902:db09:b0:215:83e1:99ff with SMTP id d9443c01a7336-218929c7077mr182728545ad.27.1734397640793; Mon, 16 Dec 2024 17:07:20 -0800 (PST) Received: from pc.. (216-180-64-156.dyn.novuscom.net. [216.180.64.156]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-218a1e6d0e4sm48746595ad.261.2024.12.16.17.07.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Dec 2024 17:07:20 -0800 (PST) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, Pierrick Bouvier , Alexandre Iooss , Paolo Bonzini , Mahmoud Mandour , Thomas Huth , philmd@linaro.org Subject: [PATCH 03/13] tests/tcg/plugins/insn: remove unused callback parameter Date: Mon, 16 Dec 2024 17:06:57 -0800 Message-Id: <20241217010707.2557258-4-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241217010707.2557258-1-pierrick.bouvier@linaro.org> References: <20241217010707.2557258-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pf1-x42e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Pierrick Bouvier Reviewed-by: Richard Henderson Reviewed-by: Alex BennĂ©e --- tests/tcg/plugins/insn.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/tcg/plugins/insn.c b/tests/tcg/plugins/insn.c index baf2d07205d..0c723cb9ed8 100644 --- a/tests/tcg/plugins/insn.c +++ b/tests/tcg/plugins/insn.c @@ -150,10 +150,8 @@ static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) qemu_plugin_register_vcpu_insn_exec_inline_per_vcpu( insn, QEMU_PLUGIN_INLINE_ADD_U64, insn_count, 1); } else { - uint64_t vaddr = qemu_plugin_insn_vaddr(insn); qemu_plugin_register_vcpu_insn_exec_cb( - insn, vcpu_insn_exec_before, QEMU_PLUGIN_CB_NO_REGS, - GUINT_TO_POINTER(vaddr)); + insn, vcpu_insn_exec_before, QEMU_PLUGIN_CB_NO_REGS, NULL); } if (do_size) { From patchwork Tue Dec 17 01:06:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 851399 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp110000wrq; Mon, 16 Dec 2024 17:08:10 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWmIztyD24irnjN6juKbgu/7xSRq3GJcALBOro9STKMZtUEb+cs5Sksf186Ta6X+V2o/DJcZg==@linaro.org X-Google-Smtp-Source: AGHT+IFLn0hHomf6g006uKinaQ2USHvSQgWRJxzHucyVfFwsin7XPbflaWyhJKo64VlOQYhQGMKm X-Received: by 2002:a05:620a:24c8:b0:7b6:e8d4:9b86 with SMTP id af79cd13be357-7b6fbf4438bmr2196505385a.57.1734397689700; Mon, 16 Dec 2024 17:08:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734397689; cv=none; d=google.com; s=arc-20240605; b=X7n7KwcFz4DKfftufjYb7n4C5WXRllVKP5SHnozPH+5m7AC5tFK/+8feivrY0Tw6B5 JlYrX5k183l7TMI+GC9T7qgj7iwi2tNDUYvjX2R//ljlFtoE1R18u9HZfagZGJBXL3y0 1wyiK/jRxxh7JOmklBP+H6vo6SvwGlcNY5FqvLtdoHgSNShLLkBYleXY5FvdO9QiemUL 7w2LtRCEL0cX+63Sgv0vz5tqE5rAy4nkoPMo4HZ8Pa1u+yOGToILzvUUoX9FF94dr4jD NFIMMEomN4ByhcZoN0AFlEE+DiPOl5yD6k2LUz2OOI+3xRRa+8Tn4Dlso2pnuZiWmUot a4XQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kntzVB1MiyL7bevKjAuLTyrUWmHMkhYgMIBRD8JjWYI=; fh=CFa3ou2Ry4mS7fTsZUswJFlbz+fCeIacXufDVqA7iAo=; b=AhKdpVN+6nKa5qOeXkgMhh6H+Zk+dcVP3LdubeeI2/VCJL6mvZDw7cNkRFaGgBRS3Y vG7st7iGXEs4UiRnJS0gU+5XS1xNIPLIq/YAWGxWw5c3cIr17M75XtoxDkM7yNH+4ic2 pjSxr1NIIuB2BLmwTaXIkMf+bQoOAjBf+l3oS2oLZDUNgi3SIlQN3JAs6Ojw9BvzX4O8 8qFmNXWgyLpeUXjACDKm7cZbkLqdNcXn2F4uY4sNX4UTqMDw1HhyJNdqv1JaQfFH44HR Q0tvucpdz9U1xOp5/m6KL3LMkBSe2cQIs0BommUsZdgRVrAEBXEegG42rReWTEnrVVVZ MA4Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CpzI3AA9; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b7048cc804si879496685a.374.2024.12.16.17.08.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Dec 2024 17:08:09 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CpzI3AA9; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNM3b-0008GO-1T; Mon, 16 Dec 2024 20:07:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tNM3Y-0008F9-Lk for qemu-devel@nongnu.org; Mon, 16 Dec 2024 20:07:24 -0500 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tNM3X-0004xF-19 for qemu-devel@nongnu.org; Mon, 16 Dec 2024 20:07:24 -0500 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-21644e6140cso44505455ad.1 for ; Mon, 16 Dec 2024 17:07:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734397641; x=1735002441; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kntzVB1MiyL7bevKjAuLTyrUWmHMkhYgMIBRD8JjWYI=; b=CpzI3AA9cQ4XB246Icho+c+lwPNhKHVvLda3u5kpJQKLJtWahN6446ZTm1QHYqoMFI uyw3IFBexQB2TZYXlk1i6r+M+bP+SZezASdCakQOCNdcNQfyaew47XG6pgkmbKFSxBuT eG3j9QtGy2laxOhgWNSGkCB6id0lOZ+5WDJn2DNvTN6KL25IXPGxuA4kBO0L6/o48qWm yk9s0Dfqudg6DhpOH4RfhbegfJUvK9lQGogEns1uOqYB8SGMXypjHN1X6ZJl3dZp6ZuI hGh3CFbv5wBvXHdLBP76aqtadoAWenJJ7jXTfeTymqwTnNms3S7hpHKMbkpXMgs7aIuo rKTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734397641; x=1735002441; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kntzVB1MiyL7bevKjAuLTyrUWmHMkhYgMIBRD8JjWYI=; b=WItOxb6+hS67cWTquSIInYvtKPrKUwY1ouQhPQiF5RWNytyq6WXvjR+bMx/RQwRUCd dlv3fZRPG28KIuD9YTUY0/Yyn13NfZtLG7h8T6WricMx8qzDsEQZ/SdobTQef5mWuGsl /y9Fefaep8k1Kw5oVXJMPmXAEHHjLwl6/uIPhSzUOn5oQaxNIQxPpfpWcZsC/OzCh9wI iWIH3c9lp/68nNx2qOwTBOnsyMKKwQukBMtg1Wb89L3CylmqfZnOnNISgcIfRKULOjgY BkLKqWM2EFL4vNSBPaU9uJGIHm77GcwMlqxNW+aiOh+miqVyt8PVGLBMIT9r8lTffFot 3Sqg== X-Gm-Message-State: AOJu0Yws6lU83PaqZ2yQ6YvaZ3kzgnSFvP74FbUinOK3YFYu8ovhLJdu agFOJ61EfXW30aea8P9ybazIBWJ68flfxuDsATQRPm5J1ttg/oBIXGK9mxxwKT/60KFXr1vkJrP Hfi8= X-Gm-Gg: ASbGncstmNolICb2RZnWQMtBist5xTOaRhXGynqOZropqWJnbVqgXdQ77TGOmPSkF9X Xg8wzFyYHHl+09Lw5IH7WVpRVYpO+H0ocup6ZkjjkQiz2N3FOiv1DppK2UHkYY2meTBP09LoTMP j5gtB9QhR7nMkFlG1Q296Lmuy2G2lw9KVmypTqnXpqUJwy4SqiI+OXkH7ZkDjbwj5fL0JC4Xtxb 5lVGoFd737jHKjH/bk+aeCh7hzgo4xQ9zlbvmAj56VpqQINd6W97M9bvrVDO4wrNX6POyo5/LN3 NwTiNsaWsLCVVVY= X-Received: by 2002:a17:902:eccf:b0:215:2f00:67b1 with SMTP id d9443c01a7336-218929f1fe1mr175448485ad.6.1734397641651; Mon, 16 Dec 2024 17:07:21 -0800 (PST) Received: from pc.. (216-180-64-156.dyn.novuscom.net. [216.180.64.156]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-218a1e6d0e4sm48746595ad.261.2024.12.16.17.07.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Dec 2024 17:07:21 -0800 (PST) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, Pierrick Bouvier , Alexandre Iooss , Paolo Bonzini , Mahmoud Mandour , Thomas Huth , philmd@linaro.org Subject: [PATCH 04/13] contrib/plugins/howvec: ensure we don't regress if this plugin is extended Date: Mon, 16 Dec 2024 17:06:58 -0800 Message-Id: <20241217010707.2557258-5-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241217010707.2557258-1-pierrick.bouvier@linaro.org> References: <20241217010707.2557258-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::636; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pl1-x636.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Pierrick Bouvier Reviewed-by: Richard Henderson --- contrib/plugins/howvec.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/contrib/plugins/howvec.c b/contrib/plugins/howvec.c index 9be67f74534..2aa9029c3f0 100644 --- a/contrib/plugins/howvec.c +++ b/contrib/plugins/howvec.c @@ -253,6 +253,8 @@ static struct qemu_plugin_scoreboard *find_counter( int i; uint64_t *cnt = NULL; uint32_t opcode = 0; + /* if opcode is greater than 32 bits, we should refactor insn hash table. */ + G_STATIC_ASSERT(sizeof(opcode) == sizeof(uint32_t)); InsnClassExecCount *class = NULL; /* @@ -284,7 +286,7 @@ static struct qemu_plugin_scoreboard *find_counter( g_mutex_lock(&lock); icount = (InsnExecCount *) g_hash_table_lookup(insns, - GUINT_TO_POINTER(opcode)); + (gpointer)(intptr_t) opcode); if (!icount) { icount = g_new0(InsnExecCount, 1); @@ -295,8 +297,7 @@ static struct qemu_plugin_scoreboard *find_counter( qemu_plugin_scoreboard_new(sizeof(uint64_t)); icount->count = qemu_plugin_scoreboard_u64(score); - g_hash_table_insert(insns, GUINT_TO_POINTER(opcode), - (gpointer) icount); + g_hash_table_insert(insns, (gpointer)(intptr_t) opcode, icount); } g_mutex_unlock(&lock); From patchwork Tue Dec 17 01:06:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 851406 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp110620wrq; Mon, 16 Dec 2024 17:09:53 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWDbNpUDvpKl/Ez9WYHa8Vr50k/+6gXrZ6/aHBBXiguQ4r8DRNEbOAzkyNi/SRSM8reVWuXzQ==@linaro.org X-Google-Smtp-Source: AGHT+IGfp0RkvchBeZ7QGv4Lr+/Eht5oEmDeTQqQ6ySDZdQUcA3LJQfkuaztD4WGmJv5nBF+xNyT X-Received: by 2002:a05:622a:86:b0:467:5da6:808f with SMTP id d75a77b69052e-467a575bbacmr229549741cf.22.1734397793493; Mon, 16 Dec 2024 17:09:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734397793; cv=none; d=google.com; s=arc-20240605; b=OcyiV7BxDPaLMW/BJ0Uuhb2kRHYHsIdsTHSHM2ecLLVSsDM+CkyigoyBrtHjNCnnvb h8vRBIp/O4Pi1Xk2wothW49j0w1tDVSRsr55rA5nEEBCUOlYM1wpS6wIlgByP797Vq23 +ZBzKTCnLKHeqa/7J2TNANBH75WsIxl7gRKisFiKu/lMldzl/pkW+rJ7m4Iw2+fP5G5q C1BiJGNqg9rQEira7awIJDBIXwuAFnWYk9EnPZFAFqv6xOIVIVszsCZLbA/l0KoGTpiS WcVGMreFbh1xRAg+OwAMJ1ZVviu0H6E8AyDTt8auzaXnMJBJUZH4MT/O0Y+QcIxb5WME 5Wqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=rYQneB+NKqjuG7StTn0XWLjAkA1JJLLeS7nr+5pDNNk=; fh=CFa3ou2Ry4mS7fTsZUswJFlbz+fCeIacXufDVqA7iAo=; b=P57r9TqEuMgfm4F2nPiKqyV38ZkDPOFxSCQGCI+Hq/2lnSW51x1oqO9iL4hskZTM25 LrFiArox8rpuAiGY22lo4WAfLvJJKNW5mkQUIxod+VyuCxfZTMpmIzypERTb/7e/DjqG FHEZPQh1ozajoso2DHAkmg12lNTSnZclQ2dikK03O85wWAS+RMbjNkevSfBHM0Muci5V OhlhEY4TneO/CIFgBkXttpEsGsMVMwfJm0m5HFqo+bj+NU8qdyq8/ffpVn8Z+9rg+Noo zUDrNpVc8zk/4jnANGJ22mt0aYApSTaE6GBIHMrx9foku0Ychpv5zCag27fLjisVKJSh hEmA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PeDFltRJ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-467b2e87001si95243131cf.290.2024.12.16.17.09.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Dec 2024 17:09:53 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PeDFltRJ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNM3b-0008Gx-VJ; Mon, 16 Dec 2024 20:07:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tNM3Z-0008Fr-Fa for qemu-devel@nongnu.org; Mon, 16 Dec 2024 20:07:25 -0500 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tNM3Y-0004xW-0G for qemu-devel@nongnu.org; Mon, 16 Dec 2024 20:07:25 -0500 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-7265c18d79bso5066940b3a.3 for ; Mon, 16 Dec 2024 17:07:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734397642; x=1735002442; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rYQneB+NKqjuG7StTn0XWLjAkA1JJLLeS7nr+5pDNNk=; b=PeDFltRJ3DikVQle28iHRpeg0QWuJO+QAxGeP4Bwz8Bs5KWsK1DdPDjcmFyqvsnAk4 4kpN5mjBpjJeANQxu42KjHrDch5kbJl59KHoIPMSmf5kmWNigyTiXAddTaQtDCqUEI9I L9rPRBZ/b0DzkhDtoM58oYorWHlga7lEYbls8SAHZs3/JzeykAdMulVM1RaaRDf8YJSY vetS0OTREaK8UtrkVWnwTXqyfVM/0ocWiXeB0lfDeQCb99w8Z248b/KG5hL4EQPnH2AN ZlHBq5td+g4W8RyAcvF2ws0fi6dQQRLU9LyOGJEtXfeYc+SorpEmiBU47+JDGLNPdK52 Slmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734397642; x=1735002442; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rYQneB+NKqjuG7StTn0XWLjAkA1JJLLeS7nr+5pDNNk=; b=j3Hjs0VUyZ0gPq1QJFnSDhc+hPBFl0V0e6Pk3FgjJXaaJ957u881ZH1HpnfVrLhyiK SKfvH2/WdTKHsvPiXUifLxjRj0XPLA32AFiwa9DtIRtywGbx2EM5VXNpAi14U/DbWte6 9Qz+S+8Ji/Y3HsH1ORIIf23Vq3bEeEkEiIWmcnVF0T8nYo7HKIKkJt25zNsLCQgjst6V jSu99FCasUF0eGA+UUFEJNIWZ4WiJ+ZaCqX10ZNovi7FwVcDHLOqArJv0O1J97Veolp9 cF/ziC6hmbqFAEoE6K19pbZ96/Y3hZXeqOMC59PmYf/DyPtIF2t3mE5sNbKexIEaiF+G JPRw== X-Gm-Message-State: AOJu0YyQXXNtG5Ecp9TF+iK9nx++Aa4g9pTwR555uPR8peZtOUcPubzS /14KeQ+t5WBkhHjQfESLNf3GsQxwZQcJsNsWqHms5OdA3HSpKo+rCHlLGK0l/MruyzCr+ZozD/Q KLcc= X-Gm-Gg: ASbGnctLy0GR5pxbm6Mis75yPUdaXYqWFtT7h4TZuSGQT3I0C9m35+KtudkYw7C/sT4 a3zs7T3shzxfQ7N7d/ugzZpPyqLn56L5r98nV3H6ZF/FBjKPO7xW5/cJUZCQSH17nt6MZLUFmqq VL6dW1aZ3ZrJF51w5CE47tmhnelXxJ1TuSjEaGPRud/qADxH/SNf5UZH6ser9cxXNnTVhUe48te EJPVRtiowh/e9Z5yqGTPtvvvPWqytiNTzkIMIzPtWQneHrj9tqauvKGxvM0jEHhXfEqJGnQZ1dA 3hJa8yxfrn0kEYk= X-Received: by 2002:a17:902:da84:b0:216:7761:cc48 with SMTP id d9443c01a7336-21892a5d762mr250070425ad.40.1734397642580; Mon, 16 Dec 2024 17:07:22 -0800 (PST) Received: from pc.. (216-180-64-156.dyn.novuscom.net. [216.180.64.156]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-218a1e6d0e4sm48746595ad.261.2024.12.16.17.07.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Dec 2024 17:07:22 -0800 (PST) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, Pierrick Bouvier , Alexandre Iooss , Paolo Bonzini , Mahmoud Mandour , Thomas Huth , philmd@linaro.org Subject: [PATCH 05/13] tests/tcg/plugins/syscall: fix 32-bit build Date: Mon, 16 Dec 2024 17:06:59 -0800 Message-Id: <20241217010707.2557258-6-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241217010707.2557258-1-pierrick.bouvier@linaro.org> References: <20241217010707.2557258-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pf1-x435.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Pierrick Bouvier Reviewed-by: Richard Henderson --- tests/tcg/plugins/syscall.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/tcg/plugins/syscall.c b/tests/tcg/plugins/syscall.c index ff452178b18..47aad55fc1b 100644 --- a/tests/tcg/plugins/syscall.c +++ b/tests/tcg/plugins/syscall.c @@ -76,12 +76,12 @@ static int64_t write_sysno = -1; static SyscallStats *get_or_create_entry(int64_t num) { SyscallStats *entry = - (SyscallStats *) g_hash_table_lookup(statistics, GINT_TO_POINTER(num)); + (SyscallStats *) g_hash_table_lookup(statistics, &num); if (!entry) { entry = g_new0(SyscallStats, 1); entry->num = num; - g_hash_table_insert(statistics, GINT_TO_POINTER(num), (gpointer) entry); + g_hash_table_insert(statistics, &entry->num, entry); } return entry; @@ -232,7 +232,7 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, } if (!do_print) { - statistics = g_hash_table_new_full(NULL, g_direct_equal, NULL, g_free); + statistics = g_hash_table_new_full(g_int64_hash, g_int64_equal, NULL, g_free); } if (do_log_writes) { From patchwork Tue Dec 17 01:07:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 851411 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp110700wrq; Mon, 16 Dec 2024 17:10:03 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWNbMzrymHuZn+0ZrPaFaEIZIwCQV/8sKb/9XElbaneFG46OHsdegpfAztXFYIJtVA2FyW1Ig==@linaro.org X-Google-Smtp-Source: AGHT+IHg61g3CPiwveGzUEJI4lPM06Zh9TpL5EpR2vR3vd18rxdvfOsjIIEGfTwjCnDE35ItbzBa X-Received: by 2002:a05:622a:47:b0:467:64ef:9da6 with SMTP id d75a77b69052e-467a5723c11mr276415291cf.10.1734397803542; Mon, 16 Dec 2024 17:10:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734397803; cv=none; d=google.com; s=arc-20240605; b=YwZZNy+P/nqQ94sy8agZq/E7LscLa5XKicwmZFVwbPU6VBEivCdMTRPSvgcPdyXKwP rVD3JOrdSgWB37DbQ3r+FL1ActdNvcZkuSxHUHMd+h+C3Ki67haLkvXKbDUZaKqniW41 l8YZipFP3IWHvOf/Q0QCoDOeEKGINy3j+1l+Q8eeQguJmOepAhjlP+WKnarBaCOCK+v9 sLa/hKsOpXGDmuWcgGk9l1D80o7N6PXmpbSFEcwuhCaJ1Ndere/s2jp/5koWYXrxmc9V Ub1UaagIrBbFt8KlJ1v6v/FHGctGzdeWBq90tbCooGEg3ZK44xwtzp4rrhVLrFRhRBwB fTcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=rWJG60kb5t0dGokgOb8XWZnNeuJ8T72pjzJRQxGzMOY=; fh=CFa3ou2Ry4mS7fTsZUswJFlbz+fCeIacXufDVqA7iAo=; b=JfMqms6n6i2+acj1uwVMEDj84qlklwCN7ekHwq9eAp/D9LeeCgzTNrQukcjWvMXlcZ mOvpc4fjYbUqdi+m2BYotPuvxwcGc1MoK06Iq7rML9GstqnwLGLfySN5fw6rUTGDTH1L XulSVnDPEA1BQXTorJ9WmUfy7K7QaHHaCwFtZefzoLu3r0YKhxyZt74lLhZ9gQktOJ3h xc9dXh7L634ubYjwwLbnYRY26LPKc0QoIz9kqu7l6j8py07bs2J5CvpBmL7j6L2j/8dr WNKHFu2pDuPxt/i3IuGrmSfw6Uv/RbRbuldqfzwGgEwjxGlIPNu/mgc4msiUoV56j2sZ nTpg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ov7M7CZy; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-467b2e85dbcsi94884521cf.270.2024.12.16.17.10.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Dec 2024 17:10:03 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ov7M7CZy; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNM3d-0008HS-26; Mon, 16 Dec 2024 20:07:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tNM3a-0008GN-DU for qemu-devel@nongnu.org; Mon, 16 Dec 2024 20:07:26 -0500 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tNM3Y-0004xl-Kr for qemu-devel@nongnu.org; Mon, 16 Dec 2024 20:07:26 -0500 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-725dac69699so4067806b3a.0 for ; Mon, 16 Dec 2024 17:07:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734397643; x=1735002443; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rWJG60kb5t0dGokgOb8XWZnNeuJ8T72pjzJRQxGzMOY=; b=ov7M7CZyYKFL0gapxnc5L5aNQSdL0ef6DbTVMP0ieyB0NvXj+5jP3hByKEhLspfMUm iFKZLR8ncm4GVkanaY9j9HvuRr1ku5k1dKNg1tGuLupHBvdcZlaIYgNE5E4RF0rpNd0f 9F5Guih375Or2+D/YusU0xHQ7WZpTyN4VOR2kyw/C7R+VkwbBYWcxu+2n0ddxEibMyHE CLoxVFDLU1ARJ4kRgiV8k+YfpTljQS7uNwqaHXEEr/iTMlmcInca0O5hHZuHB3eZoIyt HISmPT7mkBABhr0yPIiRaOXmJeihWkEGDEuszfiuH/iusqSxPJLY51A9FRQ16PKsnEw8 wEmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734397643; x=1735002443; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rWJG60kb5t0dGokgOb8XWZnNeuJ8T72pjzJRQxGzMOY=; b=Tf4k3RZgakgLsUAOz6RLaPTiNr6PsgW4TopFQmQsdEjxBysfrDKJNfDQ1i1mK7aCNm 496iT3dWtZFVHRM/mrXpwaaIlS0/WI9+iPLhPJ5PbdDhBl9jjAkeOliVmbXIJoygYXlT KNl95iSwqhl0F6Y4VSrjr1dpjaaDPZ6YCnMfM2MJ2+Zl673kAzZj7/KZbvvBfuMrWksx j/tIsTtnCWPAt/lCrgJ6rhVRwCV5Pgq9YxjhqQX042tiBUcpof4mfoOX73lbKOGF/zfR QCjorKBloJ9ZVxfKWFXZBM/wx+inln3YndXEVlmD8p0MjJxwOX8GROqBNcH0lAf0qm6X rR0A== X-Gm-Message-State: AOJu0Yzhujipc7eOhlfnLqL+qd8rVXuqEo+fmF17hAd+e8rsTt7Vu+d4 7jlE+aC9qgOzGxlEy1O1g3oxWhfQtC58kIQttUUnaTg48mvYGK+6NBaC/B+VZEBVmMvPS5+6ajh rX68= X-Gm-Gg: ASbGnctwXDr7imxV3wVoO1jm2mKY28nuXi4FfJmjhthG+UpjYY5gBk+EmoPkhqrmlYG ChPZP6oPYN8X0/zE41A/xLjmfeLebQow+I37LeuijTfZAVX0nX7VuoZ3nzeru5xaITFm/1CPAwc ZHzV2zggyzYkHyNeHxLFi0xz1hzKTy5Bz5/l7L3AX3qzOXaZeDNF8As8erDUTEV1PdtyJkUVKNG BZigkimFGWaJB0lV23sb3p317p7/loV0QUaQlkiGYDsbuF7bWKqzSCgYO+oEpneMTsHnnjEMO6q Nb83ZSeHxEmNKq4= X-Received: by 2002:a17:90b:3d12:b0:2ee:ed1c:e451 with SMTP id 98e67ed59e1d1-2f28fb67922mr23471763a91.15.1734397643406; Mon, 16 Dec 2024 17:07:23 -0800 (PST) Received: from pc.. (216-180-64-156.dyn.novuscom.net. [216.180.64.156]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-218a1e6d0e4sm48746595ad.261.2024.12.16.17.07.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Dec 2024 17:07:23 -0800 (PST) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, Pierrick Bouvier , Alexandre Iooss , Paolo Bonzini , Mahmoud Mandour , Thomas Huth , philmd@linaro.org Subject: [PATCH 06/13] tests/tcg/plugins/mem: fix 32-bit build Date: Mon, 16 Dec 2024 17:07:00 -0800 Message-Id: <20241217010707.2557258-7-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241217010707.2557258-1-pierrick.bouvier@linaro.org> References: <20241217010707.2557258-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::436; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pf1-x436.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Pierrick Bouvier Reviewed-by: Richard Henderson --- tests/tcg/plugins/mem.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/tcg/plugins/mem.c b/tests/tcg/plugins/mem.c index b0fa8a9f277..d87d6628e09 100644 --- a/tests/tcg/plugins/mem.c +++ b/tests/tcg/plugins/mem.c @@ -135,14 +135,14 @@ static void update_region_info(uint64_t region, uint64_t offset, g_assert(offset + size <= region_size); g_mutex_lock(&lock); - ri = (RegionInfo *) g_hash_table_lookup(regions, GUINT_TO_POINTER(region)); + ri = (RegionInfo *) g_hash_table_lookup(regions, ®ion); if (!ri) { ri = g_new0(RegionInfo, 1); ri->region_address = region; ri->data = g_malloc0(region_size); ri->seen_all = true; - g_hash_table_insert(regions, GUINT_TO_POINTER(region), (gpointer) ri); + g_hash_table_insert(regions, &ri->region_address, ri); } if (is_store) { @@ -392,7 +392,7 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, if (do_region_summary) { region_mask = (region_size - 1); - regions = g_hash_table_new(NULL, g_direct_equal); + regions = g_hash_table_new(g_int64_hash, g_int64_equal); } counts = qemu_plugin_scoreboard_new(sizeof(CPUCount)); From patchwork Tue Dec 17 01:07:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 851401 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp110292wrq; Mon, 16 Dec 2024 17:09:06 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUZAUTlD9bAqh+aObGJeSNRM3q8ZF/VWzuvDGtcNDhXZq90X+IwtM0NoJoZioa/nXJgceLW+Q==@linaro.org X-Google-Smtp-Source: AGHT+IFJk78h6VpwKZcQOnnpxoZ135SNQGjmlxvLzOr6lBy/Z9ya1/hg2SfW0QLSKzNViLYnRD1D X-Received: by 2002:ac8:7d0f:0:b0:468:f858:6667 with SMTP id d75a77b69052e-468f8586722mr34755071cf.24.1734397746056; Mon, 16 Dec 2024 17:09:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734397746; cv=none; d=google.com; s=arc-20240605; b=BqPrX0pWNPKkiqASc8xlOS6rSOoTi4qBLuCPzN5NxHHySOp4VWETlnLrvb8+KsmT8y OGefU7Fs62nEYFJUnt5ADhtlhh7l3pDeD6g7rlzARUa3A/PbpsbJkL5ZA7P6KoY1wbsI qWpDxDcd0ZFIKJjmGeGFJaM6REcvu+EcTos8F6jLhLGXQ0AczxoQ/VeIXaTfwirJZqfp 5bri+v0xP6f4znP7kme1Q7voTk8D7l32K/A0g5O2naiSVI3hz1VgJB/BHc2vsJYkDdFb 3gNyrHs0vX6xgVXgp6cdOZldbu2pKI/n608uVPtg5MNNRqEp/X1EWb1ISiKdh5iU3wWV waoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=E0X1MlNNMfXe3fyFvrKoslEpzjFsMN2sr/cA5ARxGXA=; fh=CFa3ou2Ry4mS7fTsZUswJFlbz+fCeIacXufDVqA7iAo=; b=h+Gp3EnfrwUQSqgaNE99EtEklr91P2AXwUW+obzl37ScHqzJ4qzPGCGeFC9ijEs4Fs k2iDKT+vVHPOoisKbSKDWwU33/d/5KgsTAfUCFGucChvwZbrYe8epdH33XvmV174gbrl 15wopzV3R2xWkK1StYZinkJGZmNMqNM4+l7BUUTlPbrGTSTURFZNcyZjCbuourOUsUUU /mqLLVq0PYfqpxVP8Qmw41X+l5q9qytdFF3JWww4IM/8QglT35/bv6eYw1lbLfV+noWT 4bv9rgDy1Ko8FRKFI1/assjgYL+YEA1uH5zeFtA2UIgWrHwK9vzzAAW/Rcq4vOjSJPwv K7jg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FRmousVr; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b70d45748dsi644014385a.706.2024.12.16.17.09.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Dec 2024 17:09:06 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FRmousVr; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNM3f-0008Ho-PK; Mon, 16 Dec 2024 20:07:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tNM3b-0008Gp-Fe for qemu-devel@nongnu.org; Mon, 16 Dec 2024 20:07:27 -0500 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tNM3Z-0004y4-JU for qemu-devel@nongnu.org; Mon, 16 Dec 2024 20:07:27 -0500 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-21636268e43so57918655ad.2 for ; Mon, 16 Dec 2024 17:07:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734397644; x=1735002444; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=E0X1MlNNMfXe3fyFvrKoslEpzjFsMN2sr/cA5ARxGXA=; b=FRmousVrJv+7ygwCpPJyWhExj+Ya0MMjhkJqCzgziL7z+kepRWH3mILOpcw2oxVtu+ H43pLJAJCCL/sr0fvbd45ZgGsGnGXflvRJ21mWW4D2uqur1yc/MGE3yFF94Oaw6nIHS0 Q/h1qYHLXKnKP1pID8pgdxyHNCJ++N89LmB5OEbvRKbH3iiT06zJE8Qv4DMEm1eUq6Ox QbsvAWIJ5bECXKNn1hh6sKXQ0BchTQWadYuiKbVZeXwAgE1B5DTIJABol7RvKa2Dv2Ro PjacZAk1eCvYCrnvyN/AobjZOhpvl8Vk/fwM6H7dUKp3ZxTHO9bbmH0vfuNv17LcyQE7 fRbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734397644; x=1735002444; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=E0X1MlNNMfXe3fyFvrKoslEpzjFsMN2sr/cA5ARxGXA=; b=DJRDEDzrH4ohH9X65S31ySHbFrWuCVlpkdJIUEMKFUJcxtEwGuqfxkyNcndVUy0diV 12m7M+K30Aj2ViTR1mtAH8JqVmA1jU0Z0iHrCN3b2/NoVuH2A3Rlv1vwlECxj/aVR8sz /uBidgpZjwALbRw0HkjlmfhdpZG+gFA1asEh6HYHEV5LaPdiGLL1t7qn2KY25RITL1fE wdmc5QvLEj9ZnKgp3HWJD3BKPmG5xIawAebJTqHoKg0Tt04pSq7ZqVLH2ENVkMWl3n/j 1075SpajaR1rbCaMmnzafcdHoap5/A/L1AnOKWieQmYcVgtd1BDmneZcwybknwV1um03 ci3g== X-Gm-Message-State: AOJu0YyQmhjYLNjSRPLl2wqRxRZy2UV6LXr+R7x3B7RpnqiOy3/rUD0b uUuuWcOJqUZoMgqgVge4zTHX96lf8yIL5YUs287s3vJTnnWexYiHJwsTmoWnYKufc7qrz/PqQN1 hLfg= X-Gm-Gg: ASbGncsF+2nJKN6n54CoqTAPcCoFSRCTxv1YwH2l0NhcRBZ0ryHIDOIczXmaPs8aHyI kscQYGAQzcIL468wbV7LX9lEBkh+2bTzOj7KqRzqos7CW0zGQ/Va6hotb/tHvsoNVDXsBygE0h3 pKPJkk5ETxOZeGMGC3wsboccneEaAGTL3EskHDaxrC7SjLgtyElPxCVcRKnd9mdPbUDWm0YD0uE Myvb7Zy5JtqCncdwSrjpkJnNT1dgzfGccgJxYF7Zw/Z24a6xZmDr6DDLgICmNEwaZDTKsQt0vd5 zm9/WK4Zt/53bGk= X-Received: by 2002:a17:902:ce01:b0:215:50fb:ae4a with SMTP id d9443c01a7336-218928bc06bmr235729535ad.0.1734397644273; Mon, 16 Dec 2024 17:07:24 -0800 (PST) Received: from pc.. (216-180-64-156.dyn.novuscom.net. [216.180.64.156]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-218a1e6d0e4sm48746595ad.261.2024.12.16.17.07.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Dec 2024 17:07:23 -0800 (PST) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, Pierrick Bouvier , Alexandre Iooss , Paolo Bonzini , Mahmoud Mandour , Thomas Huth , philmd@linaro.org Subject: [PATCH 07/13] contrib/plugins/stoptrigger: fix 32-bit build Date: Mon, 16 Dec 2024 17:07:01 -0800 Message-Id: <20241217010707.2557258-8-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241217010707.2557258-1-pierrick.bouvier@linaro.org> References: <20241217010707.2557258-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62a; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pl1-x62a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Pierrick Bouvier --- contrib/plugins/stoptrigger.c | 48 ++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/contrib/plugins/stoptrigger.c b/contrib/plugins/stoptrigger.c index 03ee22f4c6a..b3a6ed66a7b 100644 --- a/contrib/plugins/stoptrigger.c +++ b/contrib/plugins/stoptrigger.c @@ -21,9 +21,11 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_version = QEMU_PLUGIN_VERSION; /* Scoreboard to track executed instructions count */ typedef struct { uint64_t insn_count; + uint64_t current_pc; } InstructionsCount; static struct qemu_plugin_scoreboard *insn_count_sb; static qemu_plugin_u64 insn_count; +static qemu_plugin_u64 current_pc; static uint64_t icount; static int icount_exit_code; @@ -34,6 +36,11 @@ static bool exit_on_address; /* Map trigger addresses to exit code */ static GHashTable *addrs_ht; +typedef struct { + uint64_t exit_addr; + int exit_code; +} ExitInfo; + static void exit_emulation(int return_code, char *message) { qemu_plugin_outs(message); @@ -43,23 +50,18 @@ static void exit_emulation(int return_code, char *message) static void exit_icount_reached(unsigned int cpu_index, void *udata) { - uint64_t insn_vaddr = GPOINTER_TO_UINT(udata); + uint64_t insn_vaddr = qemu_plugin_u64_get(current_pc, cpu_index); char *msg = g_strdup_printf("icount reached at 0x%" PRIx64 ", exiting\n", insn_vaddr); - exit_emulation(icount_exit_code, msg); } static void exit_address_reached(unsigned int cpu_index, void *udata) { - uint64_t insn_vaddr = GPOINTER_TO_UINT(udata); - char *msg = g_strdup_printf("0x%" PRIx64 " reached, exiting\n", insn_vaddr); - int exit_code; - - exit_code = GPOINTER_TO_INT( - g_hash_table_lookup(addrs_ht, GUINT_TO_POINTER(insn_vaddr))); - - exit_emulation(exit_code, msg); + ExitInfo *ei = udata; + g_assert(ei); + char *msg = g_strdup_printf("0x%" PRIx64 " reached, exiting\n", ei->exit_addr); + exit_emulation(ei->exit_code, msg); } static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) @@ -67,23 +69,25 @@ static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) size_t tb_n = qemu_plugin_tb_n_insns(tb); for (size_t i = 0; i < tb_n; i++) { struct qemu_plugin_insn *insn = qemu_plugin_tb_get_insn(tb, i); - gpointer insn_vaddr = GUINT_TO_POINTER(qemu_plugin_insn_vaddr(insn)); + uint64_t insn_vaddr = qemu_plugin_insn_vaddr(insn); if (exit_on_icount) { /* Increment and check scoreboard for each instruction */ qemu_plugin_register_vcpu_insn_exec_inline_per_vcpu( insn, QEMU_PLUGIN_INLINE_ADD_U64, insn_count, 1); + qemu_plugin_register_vcpu_insn_exec_inline_per_vcpu( + insn, QEMU_PLUGIN_INLINE_STORE_U64, current_pc, insn_vaddr); qemu_plugin_register_vcpu_insn_exec_cond_cb( insn, exit_icount_reached, QEMU_PLUGIN_CB_NO_REGS, - QEMU_PLUGIN_COND_EQ, insn_count, icount + 1, insn_vaddr); + QEMU_PLUGIN_COND_EQ, insn_count, icount + 1, NULL); } if (exit_on_address) { - if (g_hash_table_contains(addrs_ht, insn_vaddr)) { + ExitInfo *ei = g_hash_table_lookup(addrs_ht, &insn_vaddr); + if (ei) { /* Exit triggered by address */ qemu_plugin_register_vcpu_insn_exec_cb( - insn, exit_address_reached, QEMU_PLUGIN_CB_NO_REGS, - insn_vaddr); + insn, exit_address_reached, QEMU_PLUGIN_CB_NO_REGS, ei); } } } @@ -99,11 +103,13 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, const qemu_info_t *info, int argc, char **argv) { - addrs_ht = g_hash_table_new(NULL, g_direct_equal); + addrs_ht = g_hash_table_new_full(g_int64_hash, g_int64_equal, NULL, g_free); insn_count_sb = qemu_plugin_scoreboard_new(sizeof(InstructionsCount)); insn_count = qemu_plugin_scoreboard_u64_in_struct( insn_count_sb, InstructionsCount, insn_count); + current_pc = qemu_plugin_scoreboard_u64_in_struct( + insn_count_sb, InstructionsCount, current_pc); for (int i = 0; i < argc; i++) { char *opt = argv[i]; @@ -124,13 +130,13 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, exit_on_icount = true; } else if (g_strcmp0(tokens[0], "addr") == 0) { g_auto(GStrv) addr_tokens = g_strsplit(tokens[1], ":", 2); - uint64_t exit_addr = g_ascii_strtoull(addr_tokens[0], NULL, 0); - int exit_code = 0; + ExitInfo *ei = g_malloc(sizeof(ExitInfo)); + ei->exit_addr = g_ascii_strtoull(addr_tokens[0], NULL, 0); + ei->exit_code = 0; if (addr_tokens[1]) { - exit_code = g_ascii_strtoull(addr_tokens[1], NULL, 0); + ei->exit_code = g_ascii_strtoull(addr_tokens[1], NULL, 0); } - g_hash_table_insert(addrs_ht, GUINT_TO_POINTER(exit_addr), - GINT_TO_POINTER(exit_code)); + g_hash_table_insert(addrs_ht, &ei->exit_addr, ei); exit_on_address = true; } else { fprintf(stderr, "option parsing failed: %s\n", opt); From patchwork Tue Dec 17 01:07:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 851412 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp110720wrq; Mon, 16 Dec 2024 17:10:08 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW2fQgW7wI9hXy4Sdcb15HnbSvaIDsHVHIphx/S8uRh7EOHubyrMz5F5LTcBrTA1YtikICuTg==@linaro.org X-Google-Smtp-Source: AGHT+IHkJF0kvS2Xl61lvs9wyGX1VZuU4pdzsnhT1Q7WBys6LTJGZqLUGdrqnOjeXAgCl2hlXMLv X-Received: by 2002:a05:6214:194e:b0:6d8:8496:6b00 with SMTP id 6a1803df08f44-6dc8e95fb66mr279386256d6.35.1734397808115; Mon, 16 Dec 2024 17:10:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734397808; cv=none; d=google.com; s=arc-20240605; b=IYCQe3y/BnElcffCl5qH9qjR+7eMbi/rxOv5eRGkFQayvlVvyu/ZYXHX4QooUqTNts wJ/LRMzJzarfn/EurSMVS6C2A8ms9nhYt4QjFmU1M2aM+9ZbDzUoN4fhhyEozEUfSNso I+xAZABBQJMdnn7ITET6dXcf5+fAvqk3qBjGYgrxNHHmvRSiMByRfgIjq1NJ7RK2G0m0 xWv1yorM+KOnKECozXZP9yBptd+AsR9FdTbweekgQEkJeCv+m1x7O2wL0nVD/mCvg7vF 7uhwspHin9RRHsxL9uDTbi/BCvHrnU6aPBllbX0FA6zThPkQR58e/6oPl2c1oWz10iqR zb0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=XRvxSz/fwAJJS5uNNaJOchif7N0SvzPTk+9aEXLD21I=; fh=CFa3ou2Ry4mS7fTsZUswJFlbz+fCeIacXufDVqA7iAo=; b=jP9/T4t1HFB88PKfmV3s8QY3+Bus+0FDvYCYbM/Q4YwZfJ2oIRn1WjRMOo2v0LrYk2 aKimbJzWvgqJ56+yLdGqUi3vgB5HEzrrBk7X19v2en4Z5ua2klFIVYo1YwoNe8VsU/jP QU0KWsLiF+oAV/2cPLIrjZJkXRrjtwVqrmufXTsOccXVcdh8bnotKXKDEvzxKLjKthEC B9CsOxwreMFvC7blrUzZDWQBmC/9rfNNQ3XRUsIyWOlVDiuPftCHRtiW9IuTmiRMHnq3 TDRnJWBbCpRfbrJbATUohmn+ejvwJQsIVDl/GqkR3ZnarGt99hZnRZ5e7Khba94SXvxC qkqg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uTlAj5ug; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6dccd1bb7c9si86435576d6.48.2024.12.16.17.10.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Dec 2024 17:10:08 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uTlAj5ug; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNM3t-0008JX-2A; Mon, 16 Dec 2024 20:07:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tNM3d-0008HZ-BN for qemu-devel@nongnu.org; Mon, 16 Dec 2024 20:07:29 -0500 Received: from mail-pg1-x532.google.com ([2607:f8b0:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tNM3b-0004yY-OK for qemu-devel@nongnu.org; Mon, 16 Dec 2024 20:07:29 -0500 Received: by mail-pg1-x532.google.com with SMTP id 41be03b00d2f7-7fd4998b0dbso3796923a12.0 for ; Mon, 16 Dec 2024 17:07:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734397645; x=1735002445; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XRvxSz/fwAJJS5uNNaJOchif7N0SvzPTk+9aEXLD21I=; b=uTlAj5ug76XHJsUAiZ3SID3uC80twji2FkuBhvYySwaZ1t5MenPPQ+EHA3yaVyK7Qq Vd3y1E24KLfqjApvZzYkN64vv/4LQhnMAfZN4ULQHQO9KgheTsnPcSBfNRJRjmtRL6yR pNlZ4irz1rFf9pbmQ+nl+/awNTTUaj3dmBfqlpAbNTvpNaP8O7/hDRrnXj4CvGB+zYYS mlm+05WbVpf8EufupvQylpYRmqHNgh4jeQnJStWImi4i5oNJWnd9r8vwFd7CCyfzywA8 PxnNNOiWQQUYvzPRPLMFO3MQyBpDdxO2kbwRjbmFKNk1aRT2AvGwLowo+h4YVEU4dwDw FFCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734397645; x=1735002445; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XRvxSz/fwAJJS5uNNaJOchif7N0SvzPTk+9aEXLD21I=; b=BlGf8Tjs+mca6ECETV3YcX7Cnl7n8UfLpO0uWri9MOlYBPuFjnn+CST3+2ZoNHLUr3 cNWzZrvoNUdX1ogeAzX2GGYuYdQhGXOrNBoDJdjKFvX3bXk0jBVqTrjiSW6VWtV8Emr1 SeMlBuEtLLSi6i9Xvo2apNo3r0dg8+xCzMJnu6HdKUENj0/a96+gVGV+N0nLQz8rSqHS CMX7+PH9L51WnZpwIuPwZbH6Oo3GNRmhzTcn2Ba6mVenowlZRJxCLbVjc8g5jXSfYir9 AJZ4moOaqWGRkLykZGUOR22BtC6J6LkigW4rERX26gUaWk0glAZzrnjwXfqvQoh2RpsA /qDw== X-Gm-Message-State: AOJu0YyMi4aVmXNztSC0T53H/8IRNkxzJpsyEv6/sj3JGN2sVc1KhqRK oMJrDpHy0fSp7EWRiFDO6WSYSOCiChsGdjOdQlhgCDtGF35DL7lzwKufl63c2MajuNdqVd7lbGg Bsq4= X-Gm-Gg: ASbGncugaBqq0lfBbJmMaedI3C3rPJLAtwtuXHjd+2ki3p0eQ4Wo82+PmWsXa2F/5Lh 5Gwc32JYcBqzNqAAO4yPzSaaYfKKYISRNimvRqm/3CWgg07VtN+dsVoZ332C9m5kLXix1joCQTi GdEYVwUy06keLyct+gfHvBtxuLUuCO4vSrHcZYBiFYH+NESjMA2KAHhq/5pPKddovsWoeR4mkaR YlO9NgmSuKJpiCHp20KNquqQX7XqLns6kO/3KW/AB58si88geEqCZmxu/yW66utXDiGAlKVqs27 HdItlnZ9l+TlFC4= X-Received: by 2002:a17:902:f607:b0:216:4e9f:4ec9 with SMTP id d9443c01a7336-21892a34331mr216767305ad.38.1734397645100; Mon, 16 Dec 2024 17:07:25 -0800 (PST) Received: from pc.. (216-180-64-156.dyn.novuscom.net. [216.180.64.156]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-218a1e6d0e4sm48746595ad.261.2024.12.16.17.07.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Dec 2024 17:07:24 -0800 (PST) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, Pierrick Bouvier , Alexandre Iooss , Paolo Bonzini , Mahmoud Mandour , Thomas Huth , philmd@linaro.org Subject: [PATCH 08/13] contrib/plugins/cache: fix 32-bit build Date: Mon, 16 Dec 2024 17:07:02 -0800 Message-Id: <20241217010707.2557258-9-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241217010707.2557258-1-pierrick.bouvier@linaro.org> References: <20241217010707.2557258-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::532; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pg1-x532.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Pierrick Bouvier --- contrib/plugins/cache.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/contrib/plugins/cache.c b/contrib/plugins/cache.c index 512ef6776b7..cc6922c3c95 100644 --- a/contrib/plugins/cache.c +++ b/contrib/plugins/cache.c @@ -208,7 +208,7 @@ static int fifo_get_first_block(Cache *cache, int set) static void fifo_update_on_miss(Cache *cache, int set, int blk_idx) { GQueue *q = cache->sets[set].fifo_queue; - g_queue_push_head(q, GINT_TO_POINTER(blk_idx)); + g_queue_push_head(q, (gpointer)(intptr_t) blk_idx); } static void fifo_destroy(Cache *cache) @@ -471,13 +471,8 @@ static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) n_insns = qemu_plugin_tb_n_insns(tb); for (i = 0; i < n_insns; i++) { struct qemu_plugin_insn *insn = qemu_plugin_tb_get_insn(tb, i); - uint64_t effective_addr; - - if (sys) { - effective_addr = (uint64_t) qemu_plugin_insn_haddr(insn); - } else { - effective_addr = (uint64_t) qemu_plugin_insn_vaddr(insn); - } + uint64_t effective_addr = sys ? qemu_plugin_insn_haddr(insn) : + qemu_plugin_insn_vaddr(insn); /* * Instructions might get translated multiple times, we do not create @@ -485,14 +480,13 @@ static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) * entry from the hash table and register it for the callback again. */ g_mutex_lock(&hashtable_lock); - data = g_hash_table_lookup(miss_ht, GUINT_TO_POINTER(effective_addr)); + data = g_hash_table_lookup(miss_ht, &effective_addr); if (data == NULL) { data = g_new0(InsnData, 1); data->disas_str = qemu_plugin_insn_disas(insn); data->symbol = qemu_plugin_insn_symbol(insn); data->addr = effective_addr; - g_hash_table_insert(miss_ht, GUINT_TO_POINTER(effective_addr), - (gpointer) data); + g_hash_table_insert(miss_ht, &data->addr, data); } g_mutex_unlock(&hashtable_lock); @@ -853,7 +847,7 @@ int qemu_plugin_install(qemu_plugin_id_t id, const qemu_info_t *info, qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); - miss_ht = g_hash_table_new_full(NULL, g_direct_equal, NULL, insn_free); + miss_ht = g_hash_table_new_full(g_int64_hash, g_int64_equal, NULL, insn_free); return 0; } From patchwork Tue Dec 17 01:07:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 851407 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp110622wrq; Mon, 16 Dec 2024 17:09:53 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWPn0eoXBqJyJFGzchm8IQYB25YcH7wWnhgqZxVbg0tihMCXfDb5+LfP04Crhe1J8pkCJ/ZMg==@linaro.org X-Google-Smtp-Source: AGHT+IECzOj9CIgWJdZn9qd07wL0pjNLSAWgQ9Itn3Yc3Nz4UVsG1+wbz0b2P3RAKHd3rRxUHJ5L X-Received: by 2002:a05:622a:4a0e:b0:467:7401:ce95 with SMTP id d75a77b69052e-467a577d966mr247791321cf.21.1734397793717; Mon, 16 Dec 2024 17:09:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734397793; cv=none; d=google.com; s=arc-20240605; b=cgFzIU0qqDbHEnBI2aa3zM1KIKbbwvGjWlIgv4ozbvSU22viPlD2erBhC9uyvlcBCP aEYWnyAtI/oSo2FzdF+WmWUJ4eCGLdXeqqPzFFJ/0zjv/pjonHfNariAQjrwjyk5GrNa TtM7PBCreTjto/xsTmcyr34M91ajuG2DsRegaiPpNNjnJrvziSGQIGt2aPe+pKoIn9M0 0hRlyoF5eZz1j5svpb97Oi42WYGuSTuz0pyrSdnAybcd3ghRrLGRZvpHvZHLAB0450jB N0zyH/T9PJTgjVGL+uHgnjvANTTxP5FKlTVV73pxRrhMLKxt5orub/P751TeB3h5Mzky IDLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=J4yd/tBwPNPBRY/0J+B/Kg1jzHM613LeB/uGZ5OlcYk=; fh=CFa3ou2Ry4mS7fTsZUswJFlbz+fCeIacXufDVqA7iAo=; b=eupOeWiMK32yQfSFHAEmqlLdwAAhUxngsAwFIUN75jjyu6enu5Tw732OcBFQnNi13W srte7wQCCyJHqfipXQB6fUmScppk1HxYYrUo06NFiqWEo/Cuhfd7okONn2v+FdtghjUX DR+CLNln/dEAJmWG7FRZq92KkHygHG9c8AJu06hjKqgMlyD52NhALto0bbnBFymA2X7d gAi5FwI8ivSRBBNjKGpRyP8pnyjoBNRtnMksTx7Whru0NpM0Uh9v45GLxXtpdDxe+z9o PY2awq2WNrAjMUVvJ7nwNkN6iDYDUGUxtoVj3U5dLGhIfXTCr6E1lgd7vj14jOWu81+K t99w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=K2xmaP9P; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-467b2c96956si86268471cf.42.2024.12.16.17.09.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Dec 2024 17:09:53 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=K2xmaP9P; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNM3h-0008I2-Lp; Mon, 16 Dec 2024 20:07:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tNM3d-0008HV-4p for qemu-devel@nongnu.org; Mon, 16 Dec 2024 20:07:29 -0500 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tNM3b-0004yS-Hk for qemu-devel@nongnu.org; Mon, 16 Dec 2024 20:07:28 -0500 Received: by mail-pj1-x102b.google.com with SMTP id 98e67ed59e1d1-2ee9a780de4so3113031a91.3 for ; Mon, 16 Dec 2024 17:07:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734397646; x=1735002446; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=J4yd/tBwPNPBRY/0J+B/Kg1jzHM613LeB/uGZ5OlcYk=; b=K2xmaP9Pw9PUacevACZWtRYiwodluRfZl2IVVNxG8lxLUbAVz1cWygBlkccjBUVO9n IA1FM5IuzD9AzUTKPQ1gZWext2UWeUjh5kJQK3JEK4DwmNHqLc7+GYrFYZqNTKIZHjd/ yIKPSTUiZWOfXd0gQhW9n5zANhm86lmyXnt7JjrwLbHu01t4lfERtQCh8qOpXc5/UeZF MZdhLmMOT/el1VVNoLTxSyi1r085UOu9i++Z6KnvFM+HqP7t2b0NhFP9xjSR0GZpkBLm 9DXUYMwrvDLiFM33yzm86x3UCdKP+n7gh5i1KG6DJTGBpMNXqaP5Qi9IxRG81eCaWIDZ bBAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734397646; x=1735002446; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=J4yd/tBwPNPBRY/0J+B/Kg1jzHM613LeB/uGZ5OlcYk=; b=vjoaPGNmTM8+pDfYAu+7O0+QMGWdGWlmK4rPyd98GsJ8+Xc7YWnJYtQSE1HtKo8v0+ zzmAroN8+zSXO9AV9GAUce/1NX0ehZZSW656AsZ7mmsLf5xfUO9x/g9hygIAyUUliKgf BJ6tMWnhlcdg6arwe858bVtQCEVBRAoHmO4fMcJReV86row57FMzqPOoFHIRV8nhEGDp 1a/qeVLVGYrUlmAs4Xq+RCh7TroixljON4wAXZiimBIcdfqyjiWURdgIW/q8KoViF681 DD/WuEPerYYEggO+B7g5sCh3g0GQKxpVxCUlGtdcMiDnYk+AMhQIebbuidmFURME8yKl aQ5Q== X-Gm-Message-State: AOJu0Ywdwx+ZZjwwkySs2RGt2aHRslZp6kXSNUCApyCqXzF1x8Q18fkE YDREDq5cFwDsZyqA4s8Hoi4cKcmrqCyn04lH+3r2Sw4M15p4Vjo4qkHc8F+lgEt0ulLF/olMshp i2xY= X-Gm-Gg: ASbGncteXVu8axb+EAGYR6FD5FQdU5FvX44HXNhpBA3eiUQJGcMLzZswJ1m06Se+6al xu68HgAe8jZ1J/zRPMe4olw872yuqbGbZce0UrjwjFvWxJ1W0mVHh4+0Ia121ISR99VKvqOQ35T B4zZQaDhW+OWw5AcqmrufZE9vbTd4wqXkr2HxeFwEpqdPHDD+sMAIM7H/jmypYMDVL88eiVbnWd cZNRzSdo5c/3fArejWLUwyfXtM2x6DIuPJuYh5Z9g9jUivIQuIl8G8YBL7BiYxgsbvmYfyCz3JE esMbmPrKFgYQb2w= X-Received: by 2002:a17:90b:2fcd:b0:2ee:b2be:f390 with SMTP id 98e67ed59e1d1-2f28ffa7e4dmr18261917a91.28.1734397645981; Mon, 16 Dec 2024 17:07:25 -0800 (PST) Received: from pc.. (216-180-64-156.dyn.novuscom.net. [216.180.64.156]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-218a1e6d0e4sm48746595ad.261.2024.12.16.17.07.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Dec 2024 17:07:25 -0800 (PST) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, Pierrick Bouvier , Alexandre Iooss , Paolo Bonzini , Mahmoud Mandour , Thomas Huth , philmd@linaro.org Subject: [PATCH 09/13] contrib/plugins/hotblocks: fix 32-bit build Date: Mon, 16 Dec 2024 17:07:03 -0800 Message-Id: <20241217010707.2557258-10-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241217010707.2557258-1-pierrick.bouvier@linaro.org> References: <20241217010707.2557258-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102b; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pj1-x102b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Pierrick Bouvier --- contrib/plugins/hotblocks.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/contrib/plugins/hotblocks.c b/contrib/plugins/hotblocks.c index 02bc5078bdd..09b0932275c 100644 --- a/contrib/plugins/hotblocks.c +++ b/contrib/plugins/hotblocks.c @@ -34,6 +34,7 @@ static guint64 limit = 20; */ typedef struct { uint64_t start_addr; + uint64_t hash; struct qemu_plugin_scoreboard *exec_count; int trans_count; unsigned long insns; @@ -91,7 +92,7 @@ static void plugin_exit(qemu_plugin_id_t id, void *p) static void plugin_init(void) { - hotblocks = g_hash_table_new(NULL, g_direct_equal); + hotblocks = g_hash_table_new(g_int64_hash, g_int64_equal); } static void vcpu_tb_exec(unsigned int cpu_index, void *udata) @@ -114,16 +115,17 @@ static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) uint64_t hash = pc ^ insns; g_mutex_lock(&lock); - cnt = (ExecCount *) g_hash_table_lookup(hotblocks, (gconstpointer) hash); + cnt = (ExecCount *) g_hash_table_lookup(hotblocks, &hash); if (cnt) { cnt->trans_count++; } else { cnt = g_new0(ExecCount, 1); cnt->start_addr = pc; + cnt->hash = hash; cnt->trans_count = 1; cnt->insns = insns; cnt->exec_count = qemu_plugin_scoreboard_new(sizeof(uint64_t)); - g_hash_table_insert(hotblocks, (gpointer) hash, (gpointer) cnt); + g_hash_table_insert(hotblocks, &cnt->hash, cnt); } g_mutex_unlock(&lock); From patchwork Tue Dec 17 01:07:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 851400 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp110194wrq; Mon, 16 Dec 2024 17:08:45 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVPd7eomr9zAwkvz/sfIcr0MN4ax5Y+8NEJasBduY25Vi1UwQhTFRJ1uLuOhAzjt+C1YS4CAw==@linaro.org X-Google-Smtp-Source: AGHT+IG9erYhJpXsxnQOgbH5FrTLye5rw18SqWrT4qB/aV7uwLoGKzOxsc2OdSQoG99u0fEX7HRl X-Received: by 2002:a05:6214:1cc8:b0:6d8:a730:110d with SMTP id 6a1803df08f44-6dcf40dbf32mr34902136d6.0.1734397725226; Mon, 16 Dec 2024 17:08:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734397725; cv=none; d=google.com; s=arc-20240605; b=E0GfoH+3/5dbTddzPh0q3JtRO43I4ot+CVdJzfOhH+K39i5DcMcAm7QklIa00vqC6z P7vlDunwzHBpCiYlEaZ1UyQsnC0pQHUCCs8FygC7WhAi7zf0ClskQjk7KZAiJUqRLhxg bX2Tp8Gt+yRj2AeDzUvFwozjBVDNzO7FTa6jTfNUICxEEF0J7sTTGYi8o6HRR2PLY5ad KPxx0HDzsB4YwO7iBhExz5yt7fnWPFXz98fX1sVvMdHdBB9EvQK3x63zfNYYhwyjVwU6 fgJ6MX3QpcRT9Lco/hYt3nijWyz//Pf7TykGDGivWyIhMXuHvfO7rReg2++gNSTuKttd pRmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=n/SJ8lccCav6ChcddekLPgsSkxigdbVgR6d9YvtHR4g=; fh=CFa3ou2Ry4mS7fTsZUswJFlbz+fCeIacXufDVqA7iAo=; b=c3JQDahaaCVA2PrHX0ZoRAHQGlZ6Igdo1iHab33KFGUkst5ZCx/PVyZIVILUH5aLLM wbBsMQWS1kpbfB8mEmLhiTfsyj646+5vwavirWfgRPVK4x3JqauBecnSrbA4429y+p5m To1TwSFaGO0hfgtDit1VFDQ5hLWwrkXyyDvQRb9l5bZVzyj/WCUQpDAekAvsdvpaESab tdzUciNbmCNqczcnLK0nmRDMnmMXAul79/nlSf15pZ5qpu7dk4zj/I4DhUeAnbCNbXqY f76XBMsigYtbyajqfOwvedCNIbZJz920BGp2RmMm5NK7ECQjI1cHfEjaGUhAZ3tMM57j hc2g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xZVrHgbG; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6dcf63377c0si9291416d6.241.2024.12.16.17.08.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Dec 2024 17:08:45 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xZVrHgbG; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNM3u-0008KJ-7A; Mon, 16 Dec 2024 20:07:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tNM3f-0008Hu-W2 for qemu-devel@nongnu.org; Mon, 16 Dec 2024 20:07:32 -0500 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tNM3c-0004ym-6K for qemu-devel@nongnu.org; Mon, 16 Dec 2024 20:07:30 -0500 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-2164b662090so37317485ad.1 for ; Mon, 16 Dec 2024 17:07:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734397647; x=1735002447; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=n/SJ8lccCav6ChcddekLPgsSkxigdbVgR6d9YvtHR4g=; b=xZVrHgbGlqVQAW37RsY5ho6l/MUYpEYktwyHDvaNnVNEWOxydFqGEtQSKcAJirKr+t iKZOj/X0Hc6WF0Qsjt8Oe11wiqG5G11di1pHH0Xlru14GWvptmdyeU6wVaDQEEHejtVp 0A6+2DylIvbIE/DRER+5SM5QHPkXmx27MNJDYy1sW+e6d+c3cbV8e09q+RE/7WyNStQk yUNgpr7g8PohRtnjJLOh1OLf32KTNgcrPPz3FJCJMw9/Kv8xnAVldnRTgbyv2ql0lAhI 4QjlV+/a4KySODYjcMhSeiC2Ksxh8juEVL2hzHabi0JXTSgIl/gO+kagWTOl/GC64P/q HufA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734397647; x=1735002447; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=n/SJ8lccCav6ChcddekLPgsSkxigdbVgR6d9YvtHR4g=; b=dZzu5/O0WdzDUaxGDO3sDu5mFafHQ9uQpQsFNHovSjdUy7i57vg4f6obfOkDo+Q4+n EcMURo5xcnEFKUqrRCw4IqZSeLk5XYPWfr4d8Yk3tiNYNNjpLN4vUS9rEHH4CCHZEE4L mA8R7JlUhoYgs81qbWnrCIz60TckBCwKU7wxHB8ejaJChVzifcPOJ4UjSGba13vNmZBG bDKY4oMYn4Zqu2mTPHDJroDfgZBRhgmxDwsPV49cYsCF9mGYRgqNRmqelMjohbaDw1jd zTTlFZyPGhOllYPCqRy4W2ikLtcTeC76agpU4NivXZ6ZA25MjRDseeAQuJ09aNMCUJEJ ghiQ== X-Gm-Message-State: AOJu0YzbgbHOrWJ7ebIJYTB68ttnZkfzSb3uBZT6MEoH2w+0DrVv2R6E Px4Ep0mAaCMaw3aNykCpaGZyjHoNolRnKL1NS6oYVTJIyA2czePeC9EJbKPeEpOJf5WG4yeow+P I5kk= X-Gm-Gg: ASbGncuuuWqh11bRxtcxw6WS0nY2G+XNinYGTzHZw2hCKxso1Ma7b5TlRepTFGzlosX dcinqyFFH/EhQFe9gxakTestlbWkzIZ/IIMNwOQImDgz4Zw03/ulCEDTsoZsw3hne5oKDyZBLZ0 goo16elUE0MnRoBFWijx0GrxI50jjPEtkusbP8k2Gm0gIZDUPl3rzsfsFb259c/Qj9a+FPbqbTi UW9Kg91fbO1mricmBLl+zeLQL5nwqf0E0pKtZXty66eT6RqGNK4yOhoHZm+b5NFVZhRFVlJKqbV wAIoJ/Bl7mDEGPs= X-Received: by 2002:a17:902:da8f:b0:216:51fb:bb28 with SMTP id d9443c01a7336-218c9024fd8mr17837005ad.51.1734397646947; Mon, 16 Dec 2024 17:07:26 -0800 (PST) Received: from pc.. (216-180-64-156.dyn.novuscom.net. [216.180.64.156]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-218a1e6d0e4sm48746595ad.261.2024.12.16.17.07.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Dec 2024 17:07:26 -0800 (PST) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, Pierrick Bouvier , Alexandre Iooss , Paolo Bonzini , Mahmoud Mandour , Thomas Huth , philmd@linaro.org Subject: [PATCH 10/13] contrib/plugins/cflow: fix 32-bit build Date: Mon, 16 Dec 2024 17:07:04 -0800 Message-Id: <20241217010707.2557258-11-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241217010707.2557258-1-pierrick.bouvier@linaro.org> References: <20241217010707.2557258-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62a; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pl1-x62a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Pierrick Bouvier Reviewed-by: Richard Henderson --- contrib/plugins/cflow.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/contrib/plugins/cflow.c b/contrib/plugins/cflow.c index b39974d1cf3..930ecb46fcd 100644 --- a/contrib/plugins/cflow.c +++ b/contrib/plugins/cflow.c @@ -76,6 +76,8 @@ typedef struct { /* We use this to track the current execution state */ typedef struct { + /* address of current translated block */ + uint64_t tb_pc; /* address of end of block */ uint64_t end_block; /* next pc after end of block */ @@ -85,6 +87,7 @@ typedef struct { } VCPUScoreBoard; /* descriptors for accessing the above scoreboard */ +static qemu_plugin_u64 tb_pc; static qemu_plugin_u64 end_block; static qemu_plugin_u64 pc_after_block; static qemu_plugin_u64 last_pc; @@ -189,10 +192,11 @@ static void plugin_exit(qemu_plugin_id_t id, void *p) static void plugin_init(void) { g_mutex_init(&node_lock); - nodes = g_hash_table_new(NULL, g_direct_equal); + nodes = g_hash_table_new(g_int64_hash, g_int64_equal); state = qemu_plugin_scoreboard_new(sizeof(VCPUScoreBoard)); /* score board declarations */ + tb_pc = qemu_plugin_scoreboard_u64_in_struct(state, VCPUScoreBoard, tb_pc); end_block = qemu_plugin_scoreboard_u64_in_struct(state, VCPUScoreBoard, end_block); pc_after_block = qemu_plugin_scoreboard_u64_in_struct(state, VCPUScoreBoard, @@ -215,10 +219,10 @@ static NodeData *fetch_node(uint64_t addr, bool create_if_not_found) NodeData *node = NULL; g_mutex_lock(&node_lock); - node = (NodeData *) g_hash_table_lookup(nodes, (gconstpointer) addr); + node = (NodeData *) g_hash_table_lookup(nodes, &addr); if (!node && create_if_not_found) { node = create_node(addr); - g_hash_table_insert(nodes, (gpointer) addr, (gpointer) node); + g_hash_table_insert(nodes, &node->addr, node); } g_mutex_unlock(&node_lock); return node; @@ -234,7 +238,7 @@ static void vcpu_tb_branched_exec(unsigned int cpu_index, void *udata) uint64_t lpc = qemu_plugin_u64_get(last_pc, cpu_index); uint64_t ebpc = qemu_plugin_u64_get(end_block, cpu_index); uint64_t npc = qemu_plugin_u64_get(pc_after_block, cpu_index); - uint64_t pc = GPOINTER_TO_UINT(udata); + uint64_t pc = qemu_plugin_u64_get(tb_pc, cpu_index); /* return early for address 0 */ if (!lpc) { @@ -305,10 +309,11 @@ static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) * handle both early block exits and normal branches in the * callback if we hit it. */ - gpointer udata = GUINT_TO_POINTER(pc); + qemu_plugin_register_vcpu_tb_exec_inline_per_vcpu( + tb, QEMU_PLUGIN_INLINE_STORE_U64, tb_pc, pc); qemu_plugin_register_vcpu_tb_exec_cond_cb( tb, vcpu_tb_branched_exec, QEMU_PLUGIN_CB_NO_REGS, - QEMU_PLUGIN_COND_NE, pc_after_block, pc, udata); + QEMU_PLUGIN_COND_NE, pc_after_block, pc, NULL); /* * Now we can set start/end for this block so the next block can From patchwork Tue Dec 17 01:07:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 851402 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp110343wrq; Mon, 16 Dec 2024 17:09:15 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXMl+yb1GeVFuDHYQk+u75WYQzz4JD/YtdwfmXH2ZOJeZlXeIho8s1jG50wWBkLKgHpurL/Uw==@linaro.org X-Google-Smtp-Source: AGHT+IFXL4pge/+LEiyRGd8XkZl7c1yAfR67HkxGwhp1jk1lbAD6kcZCGE5sK5LaZaazh9325sFt X-Received: by 2002:a05:620a:2992:b0:7b6:d6e5:ac62 with SMTP id af79cd13be357-7b6fbecc660mr2292038685a.6.1734397755617; Mon, 16 Dec 2024 17:09:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734397755; cv=none; d=google.com; s=arc-20240605; b=N5D0FHBbIiShrCj6lZtd52C6ltyE40u2ujvjvl4XcKszYae6gzNGdm8AweWgH6QEwh XdoYJ2k1MGfZKCpkG7jA+TQNoFj9ldwULTkMurOHjfPcqsp9RIWWVsZGUBanImE1GrhS a9XDq1/sB/DKB94/fdbh3gmYYHPI44uMCUO/jMYIojj4QAOtOG8I1ooBNtcDilcD8E9N oYHxmyBgE1PaIYfaqH1T035Wucumf9aZ/QS0D+qSWnhyR6/eG7p21YL9fy4mXjH5FzT0 5VpFA8fvTqSqXqUQ3e7Ndwj6MQV22Zq7OC/k3pcLlg3f12MYXF0ScKpjgwViCg3CPcwa 5Jfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=crzqjDJBZdpI+EWDwy4Pgv4ZHNVlbcwq1nqGrijGMLQ=; fh=CFa3ou2Ry4mS7fTsZUswJFlbz+fCeIacXufDVqA7iAo=; b=UH4Bp24TOff2Vh75nNFUI8bCDFJW34WMRX7Q4bYNF+xruT8VeDd3t5s85aPe0rgufC VjiAD+pfqsV71of4HKH6Stwzd+rlheydimtW+d9C44H0Qb/e0W17eVqUNmunblAxoOta Zl6Dzirz1ZLJY/F16Z+6IP/gFXSVfPdkiBwkPkATC/kJDXREMsko1E6BibGMW9xVKnxm JP/l5izTbiDL37y0Wcz7Xba8ESzbFJB630zhWcxdFrMHkg7ULy2wd36RBjku3F3IrcVZ rkg8pezArm55rHs5rTUolUYFMHjjSJEJYZf9gkn2UjfeZeGtXhmhPBpQe3wfofCh8HYM gmXw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=afI4yBFZ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b7047ca79dsi873475485a.124.2024.12.16.17.09.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Dec 2024 17:09:15 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=afI4yBFZ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNM3p-0008JU-Cs; Mon, 16 Dec 2024 20:07:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tNM3f-0008Ht-W3 for qemu-devel@nongnu.org; Mon, 16 Dec 2024 20:07:32 -0500 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tNM3d-0004yy-Ht for qemu-devel@nongnu.org; Mon, 16 Dec 2024 20:07:31 -0500 Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-725f4623df7so4079370b3a.2 for ; Mon, 16 Dec 2024 17:07:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734397648; x=1735002448; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=crzqjDJBZdpI+EWDwy4Pgv4ZHNVlbcwq1nqGrijGMLQ=; b=afI4yBFZ37rqkhm56I+kuJ12HOAEO1J9MdQBQTT6Fpn9C+t5LVA9sPsIJ9Jd/bgd0D loJKgdexiNEALovJUSZuosIXaDVPjkqDUWCOICaGkfFlgM4VnV4msTJx7gii9+vOp1VK c7n6LtySy023mRsdDvNX4fEYC8EoHG0BeMzoJ2P9YnH86uF6BLgHjWqOkJly+VJ2RMbj ijHUA2mmkEko16+Oc7j1BJbfMZu0smBvjUYm3XFzeUsEEpzg0gha9mEz7of4K5+WyLUM rh1TkpeiZruSr+TamHuNwi8RN1pDFYRh6iqNvCrDYHdT0U7NNpLl9fQnfV2hKh3kJMMK 6DFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734397648; x=1735002448; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=crzqjDJBZdpI+EWDwy4Pgv4ZHNVlbcwq1nqGrijGMLQ=; b=cpqgFKYSLh/tTrKWLIzcr6kOZX0TnycekLLtKwP9sQYOl0jUQlXbnq4LRyPMmxZg9h AdFgclaALupVZ7US9+mVkFKOOMIcDX5rs38yX2eUGktuxQSVDJkwhlsGs8qkLinJWMsV AsBXQ1Z1NdwSzj3gLtsPqfF/GGPA0iXxoYlsW9dc/95xAaW72Mz5YQR9ztCL3tlvf0oq csPXTKbubaqZyiYWTlzF6/i0sAu4z+4AJ0hFl8ZDJgRxx9XhVmtmMqtiSPe9nKE5yOxU QCgiTlDvaLezhH+D1ksxQUbk2YTQbo/ALtXcto41NIATGoQ5AdP9dAH95c25CZjx6gWS O3Yg== X-Gm-Message-State: AOJu0YxwFOs487Cr5INhp3PjvoA+PVRhJuK1+5bOLQVczf4QUJwrc3cF 08uRdG4M6RRHvJpOcXb90mNz+5BAhs+Z+wAvRhbAN2G0KAFbkEDH6KyRksbPGceDqxzjnvh8dpL ESMw= X-Gm-Gg: ASbGncvwunYAk+XXWASMoFzjyhz7MZQB8ZmE0sYL27R/DKSw3A9nAiaQIzLaLvv4Eqf dxVWSRGKPrapKsTxArRUxtYlB2tPxUC+cptWBzcksmWyY+my6TuRFWzmu2j/Uj1ZGiPNCW6YhaX gm30sB9ry0D1n2E3rFEn4i0HsJltCqOhsmulbDV3PxbOT3qwQPikJqbQMgHKmrwYtLYMCyLW6oa URevqO5nkVlX/Sr2T75irF9zAgnVGccGvXBGFEfw/tpnDyEGdh5eQZBMAazIh8DLKsoWj0RrVQY kD81v/5z6OhgoPo= X-Received: by 2002:a17:902:e545:b0:216:7ee9:2212 with SMTP id d9443c01a7336-218929ca98cmr207825885ad.23.1734397647842; Mon, 16 Dec 2024 17:07:27 -0800 (PST) Received: from pc.. (216-180-64-156.dyn.novuscom.net. [216.180.64.156]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-218a1e6d0e4sm48746595ad.261.2024.12.16.17.07.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Dec 2024 17:07:27 -0800 (PST) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, Pierrick Bouvier , Alexandre Iooss , Paolo Bonzini , Mahmoud Mandour , Thomas Huth , philmd@linaro.org Subject: [PATCH 11/13] contrib/plugins/hwprofile: fix 32-bit build Date: Mon, 16 Dec 2024 17:07:05 -0800 Message-Id: <20241217010707.2557258-12-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241217010707.2557258-1-pierrick.bouvier@linaro.org> References: <20241217010707.2557258-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::429; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pf1-x429.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Pierrick Bouvier Reviewed-by: Richard Henderson --- contrib/plugins/hwprofile.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/contrib/plugins/hwprofile.c b/contrib/plugins/hwprofile.c index 739ac0c66b5..2a4cbc47d40 100644 --- a/contrib/plugins/hwprofile.c +++ b/contrib/plugins/hwprofile.c @@ -43,6 +43,8 @@ typedef struct { static GMutex lock; static GHashTable *devices; +static struct qemu_plugin_scoreboard *source_pc_scoreboard; +static qemu_plugin_u64 source_pc; /* track the access pattern to a piece of HW */ static bool pattern; @@ -159,7 +161,7 @@ static DeviceCounts *new_count(const char *name, uint64_t base) count->name = name; count->base = base; if (pattern || source) { - count->detail = g_hash_table_new(NULL, NULL); + count->detail = g_hash_table_new(g_int64_hash, g_int64_equal); } g_hash_table_insert(devices, (gpointer) name, count); return count; @@ -169,7 +171,7 @@ static IOLocationCounts *new_location(GHashTable *table, uint64_t off_or_pc) { IOLocationCounts *loc = g_new0(IOLocationCounts, 1); loc->off_or_pc = off_or_pc; - g_hash_table_insert(table, (gpointer) off_or_pc, loc); + g_hash_table_insert(table, &loc->off_or_pc, loc); return loc; } @@ -224,12 +226,12 @@ static void vcpu_haddr(unsigned int cpu_index, qemu_plugin_meminfo_t meminfo, /* either track offsets or source of access */ if (source) { - off = (uint64_t) udata; + off = qemu_plugin_u64_get(source_pc, cpu_index); } if (pattern || source) { IOLocationCounts *io_count = g_hash_table_lookup(counts->detail, - (gpointer) off); + &off); if (!io_count) { io_count = new_location(counts->detail, off); } @@ -247,10 +249,14 @@ static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) for (i = 0; i < n; i++) { struct qemu_plugin_insn *insn = qemu_plugin_tb_get_insn(tb, i); - gpointer udata = (gpointer) (source ? qemu_plugin_insn_vaddr(insn) : 0); + if (source) { + uint64_t pc = qemu_plugin_insn_vaddr(insn); + qemu_plugin_register_vcpu_mem_inline_per_vcpu( + insn, rw, QEMU_PLUGIN_INLINE_STORE_U64, + source_pc, pc); + } qemu_plugin_register_vcpu_mem_cb(insn, vcpu_haddr, - QEMU_PLUGIN_CB_NO_REGS, - rw, udata); + QEMU_PLUGIN_CB_NO_REGS, rw, NULL); } } @@ -306,10 +312,9 @@ int qemu_plugin_install(qemu_plugin_id_t id, const qemu_info_t *info, return -1; } - /* Just warn about overflow */ - if (info->system.smp_vcpus > 64 || - info->system.max_vcpus > 64) { - fprintf(stderr, "hwprofile: can only track up to 64 CPUs\n"); + if (source) { + source_pc_scoreboard = qemu_plugin_scoreboard_new(sizeof(uint64_t)); + source_pc = qemu_plugin_scoreboard_u64(source_pc_scoreboard); } plugin_init(); From patchwork Tue Dec 17 01:07:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 851410 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp110669wrq; Mon, 16 Dec 2024 17:10:00 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWKIj43nHfe9StbWg3XzY0fmFo1/dkDJbQgx2FMAnknGZWgesfWNkwnihfAHQlTZPmv9aGzBw==@linaro.org X-Google-Smtp-Source: AGHT+IGOhvWsYNkBwb01eB5zLVrdZ/XGOg2W2p06Kp32fy6j+D4DlznyR+4X3TDb2DGouNUcJHfv X-Received: by 2002:a05:622a:1a86:b0:467:7a27:f3bb with SMTP id d75a77b69052e-468f8b6325dmr26387181cf.49.1734397800493; Mon, 16 Dec 2024 17:10:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734397800; cv=none; d=google.com; s=arc-20240605; b=HtvYjdUBhnC16QKX8999wfaElgJDFqqRDVe+xqn25iekYmposZOZpPcMIfOa4qJ0uw Mrj+GQH3o97Wo1USodAacjUTFAxxRaZWcBhXMsi0wnxhCYYJhRQ0+ht3nDFgJgEzvgzr l6epuVAOG6g7dBfnNwWciCoQG30qCzbrWXy9/sir+uiFLTUzf0tO9kg7nR6HJ3wjTAsj S3SoBzBoG9xTbtivENJFg+scvGf5xNTSMp0eAboiynjYBTJPxP71Wryi9uToaJhb4cFr dhtuwLensSEeAZSkZkyhpFPjQA2fys5BQCFT8i8mfjFpPQxGtAFb4sUEceNu8XIEMeDk xlFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TUx/z/kSAyzvf2YQEv1ycgw2smpEnSTqQjMUa4oS88s=; fh=CFa3ou2Ry4mS7fTsZUswJFlbz+fCeIacXufDVqA7iAo=; b=TiAm088ruZzDgDBXejvZF08pJjQ1KcjGSxqV0LIUkoQp7/fNfbGq0DY0nYC9Ra0Ql7 un7Rpx8RGt8o/dPn4C+9h/7e/RjJWUavMr9r5TghKEgt6TEZzq4pld/W4alCjspb77ip rEo/nuXXWT6GjEMh5uUervM5Pijp8h5h/CPvr9bEJS0Be89qLlQU/Fq046+XYfwUGGyo igEG7y5DaDabfJAdRY+yFc4yunxeAvGZS4i4gK6gG19MGkMpmbMRNLD0EorPZJ2RMQ2T RPZtpS1BaVpMYeDqn5sDgWwzb2UagfISMBvM1URGtbNn24cii6yRQYBDFQJCFEjTVMvk 1y1A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KL+jpnPX; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-467b2e85e47si96200991cf.229.2024.12.16.17.10.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Dec 2024 17:10:00 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KL+jpnPX; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNM3v-0008L2-5T; Mon, 16 Dec 2024 20:07:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tNM3h-0008Ia-Qg for qemu-devel@nongnu.org; Mon, 16 Dec 2024 20:07:36 -0500 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tNM3e-0004zE-8i for qemu-devel@nongnu.org; Mon, 16 Dec 2024 20:07:32 -0500 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-2164b1f05caso43438585ad.3 for ; Mon, 16 Dec 2024 17:07:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734397649; x=1735002449; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TUx/z/kSAyzvf2YQEv1ycgw2smpEnSTqQjMUa4oS88s=; b=KL+jpnPXdUs3udCGlQjsC46UYU6uOZBPcWj9zcp3Up58LNzsOa3jYDXqS+xQkKMbFv uniqjmBW9tMRAculV2+jRSoMZP1CTDYuCwSBfu7ItiziflUqpPxwHTaPQ/2rSSrqs1Gx UT+tGccBBjw2E24FDU2vZeuB44m0vWG3s1DF8qKg3MM/OlIUullcc5fl8hIfg07tJ9C7 z2f8tDGBYszslDNWwTVMz0ehnXNybXfLgUeNyM7rvmeiV67zAGUQl8TSlZ5Wzr/7lmex XUjL/+heAnKpqoYUuu98e2p9PpjCqLrlvc/lueXTbI/zfCfSP24NF/cXpFW0YsnEv4JO rSfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734397649; x=1735002449; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TUx/z/kSAyzvf2YQEv1ycgw2smpEnSTqQjMUa4oS88s=; b=HWXaj/iuWg/jkVLpoUdomEN63lovtxvQwkb1o3zQWenxG22AE3S/oEXFu77/Q8MUdv B+bu/T1BHxYiQnMjfTceck9rfvzkEJ4LGrGrfV6qTmz1oVxrQ96pG7FR6IbpLDHuBWSE 83RI7IGejvwgGNbaAeDf8070yV0SD11ePqAjfyQDeLg1ieADOffdW5pTlXAUkTbjdbFM d/4ubRgCCJpm8rv3Djb9p+Duspj6mwy6mLMvFnLE5S3MnytVJIicLvvd4FZ7ZqmjFMDo OoPyYoTRPaKFfuTnjNLQI9ifC5pr1Azxji2xeeGQS1wvg74WlFAUpEC6e+IsNNzu0pDM Sn4w== X-Gm-Message-State: AOJu0YwE2peagQW4T858C/Q/dXb0KUoOImW6d2p00cinKMV3U1T44/ZB ONQcSBKjhemPyFhkegSyVvglhTtYwKsLwiQpGRWZKt/1snhs1H5G0wigZ0Tj1U3RDOsp7bl+9qH AnX8= X-Gm-Gg: ASbGncsYvbW3d0So5Qm5rA8spj/HkBKC+TVH2sj/cL+UuCsX46gGYEmzlsxPzHORcDk G5TcxXENnOl2aoewvOGOt0/5shPKu50e6QkdDH1xLMpE3Ee+U9eEb1A2x+ZRAQVcIxf8YBTU0XW 5kg5Y6CaO3PFKj5c0PCoJsEFXWnFU+lxWlfw1fHGM9xiEX1zNC6MXH8y5M9902gZATExlFTMC5I P2IbusRJ0sek45CT2J/Zntcnnlt0VVg3slF7ghUR8JFhv90NIrjXTdN/tkJ1En4U5y9L4tj2Zaa plqEntbqWA7rvzc= X-Received: by 2002:a17:903:2c9:b0:216:3466:7414 with SMTP id d9443c01a7336-218c9009468mr24597185ad.44.1734397648750; Mon, 16 Dec 2024 17:07:28 -0800 (PST) Received: from pc.. (216-180-64-156.dyn.novuscom.net. [216.180.64.156]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-218a1e6d0e4sm48746595ad.261.2024.12.16.17.07.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Dec 2024 17:07:28 -0800 (PST) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, Pierrick Bouvier , Alexandre Iooss , Paolo Bonzini , Mahmoud Mandour , Thomas Huth , philmd@linaro.org Subject: [PATCH 12/13] contrib/plugins/hotpages: fix 32-bit build Date: Mon, 16 Dec 2024 17:07:06 -0800 Message-Id: <20241217010707.2557258-13-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241217010707.2557258-1-pierrick.bouvier@linaro.org> References: <20241217010707.2557258-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pl1-x630.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Pierrick Bouvier Reviewed-by: Richard Henderson --- contrib/plugins/hotpages.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/plugins/hotpages.c b/contrib/plugins/hotpages.c index 8316ae50c72..c6e64937194 100644 --- a/contrib/plugins/hotpages.c +++ b/contrib/plugins/hotpages.c @@ -103,7 +103,7 @@ static void plugin_exit(qemu_plugin_id_t id, void *p) static void plugin_init(void) { page_mask = (page_size - 1); - pages = g_hash_table_new(NULL, g_direct_equal); + pages = g_hash_table_new(g_int64_hash, g_int64_equal); } static void vcpu_haddr(unsigned int cpu_index, qemu_plugin_meminfo_t meminfo, @@ -130,12 +130,12 @@ static void vcpu_haddr(unsigned int cpu_index, qemu_plugin_meminfo_t meminfo, page &= ~page_mask; g_mutex_lock(&lock); - count = (PageCounters *) g_hash_table_lookup(pages, GUINT_TO_POINTER(page)); + count = (PageCounters *) g_hash_table_lookup(pages, &page); if (!count) { count = g_new0(PageCounters, 1); count->page_address = page; - g_hash_table_insert(pages, GUINT_TO_POINTER(page), (gpointer) count); + g_hash_table_insert(pages, &count->page_address, count); } if (qemu_plugin_mem_is_store(meminfo)) { count->writes++; From patchwork Tue Dec 17 01:07:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 851409 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp110648wrq; Mon, 16 Dec 2024 17:09:57 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXEfTlxlP3jOuh2SOmBsEgnVDLarSRvf8giZLho/UYEpVPcsqrNZrTKpqDKh2396qkHnKWB3w==@linaro.org X-Google-Smtp-Source: AGHT+IHd29pytcN/OHFIhFWRvdCOMDsyIErvIud4fi8SXRiOHLohyXcFKq7VSOM5mc25v22NDdRS X-Received: by 2002:a05:622a:1dc4:b0:466:9d0e:1920 with SMTP id d75a77b69052e-467a57885b0mr284960691cf.24.1734397797532; Mon, 16 Dec 2024 17:09:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734397797; cv=none; d=google.com; s=arc-20240605; b=RZ3DxpK6IgGRRVLEWyL9qcsc1Hjf+UjQho16MyJfbO8/tKICGU9BxdT4pDNtMFsqx2 Mpi771fVDCHkr5BC/tjbng/j+wU9wU6AmH9hChGhsxDZ5tJqeSMIhmkNUa12Ld+ddHuP R847OObJE2b0BCkepZ5AnYkM7bao9TOiNTcQUHlfu5xPCND+86DKbz5FdwYJPHHh234l J+8Z7G8uDGyZiY6mVFEKQuE5ESiprYll9ArElwN65Ameg7unk8hTvWTXjfOMNRAs7cFu lIivT9O5atkwEb5Y19/64ZumScZnVei1TlnEvzF8ijfJJFwR90Kgf/8XRaSC6F7Eu0AP 5Zlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3xW+LPUYaCaHyMzbWV59CTTMsUuCbv/1PDmcaQ3NGQk=; fh=CFa3ou2Ry4mS7fTsZUswJFlbz+fCeIacXufDVqA7iAo=; b=BhJbNuIlWVQyEgVUP9VUex2MGDk4Yr8t0e4+0IQEILwJnmyMkosbhPKfeBL1sHagfn TmI55gv301jQN6gRmhL+Qk+AeX5vwKr07sNtg/xW4uZP3AQSsaHdqUPJStD/L5wnm059 rwFuPfIyQWnzXIMOGlg4pNym4KeumfdQMYMafKLjO5XCZZTUFJZ7h/N2988B2dFzdzZx 6ig+WcqAIuHGy7TCJJqbmWSQQWen35qVZkIsl15sdGWgasUB4m5qpvgJzj18QNApgu74 sioqUVrIicCuiZcDFCzKg20HSAFO928vJKhwXopM/zmgKvTqYXUYp8uAqp/UlppSEN2c Fg7A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Vgqk60jO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-467b2e93bacsi84364141cf.345.2024.12.16.17.09.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Dec 2024 17:09:57 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Vgqk60jO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNM3v-0008LF-M5; Mon, 16 Dec 2024 20:07:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tNM3h-0008IZ-Q5 for qemu-devel@nongnu.org; Mon, 16 Dec 2024 20:07:35 -0500 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tNM3f-0004ze-Oh for qemu-devel@nongnu.org; Mon, 16 Dec 2024 20:07:33 -0500 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-7292a83264eso1539770b3a.0 for ; Mon, 16 Dec 2024 17:07:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734397649; x=1735002449; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3xW+LPUYaCaHyMzbWV59CTTMsUuCbv/1PDmcaQ3NGQk=; b=Vgqk60jOfLQ9tUw5G8eoC6AuFnp220QK3/an/P6h2A8H1KhcClobiNp7t6KOCpj2EN eAb+qDSwLX+KewxkdLiNmO9GFnwUeIJyN1mnjUxaAUX3tYnhSsIzr6qYyZih8DEP3FEa Hcx/4Zv1/WXSveT4ebd/kNHIXo/nnShK1bmV0+huQnIacttiLheUsl5uzv2qC1ixGVLT bpiMwFzaRp4GoTuSrX+eudyLt5nq0IdczJGv8cleD4aOE5cOi3seRBXFpca5EYo/+5+k ug4+SFb+3wVa9mJsYr188A4rvlrR/iOqdT0RipJbGr+0Qia+T8Mqas6HAjjkhetwgp/X gKTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734397649; x=1735002449; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3xW+LPUYaCaHyMzbWV59CTTMsUuCbv/1PDmcaQ3NGQk=; b=tKBzYAV7WZijz8Vee0rwszrPGx2kRs7dJsEGn+zy4joQc56k+81NlzM1dncAd6/q8L 6+wQ3oqP2UqEaghf7sYt7AnvWlyFGu+kDcy4ckHyyt+1QACOXefGfWHqPXp/1FpSFoXL WylVQ+/VBLluNFmFPK9M72yaZtxisEWN0NWxZK4ywkMBwK5aAnLNAHH0VgrcSZumg3kV aod8Iovpi4IgJaEdE9hIf2yKE7MlqMCaWklCi0HLJCjdubfCP3Vjs457R8LRCtKT4lpv OY/o7/h4g3LWN2/1/y5Yl3aoYmlPTcWYHbDdgcKm6AF45a+dGbkHYwbfNcFtveRC4Fbu JZSg== X-Gm-Message-State: AOJu0YyN4VAvI09bX5htUjK/nGgdn+i65rNRexq1kUHyke085xB+LFL2 QkTZN5AYbdE0U4ft5AftubSM3zceKdbtKjn+G69eykiw5QJZy9ow5ft1ZzDrk6owRXbuGvoPs+w 9pZU= X-Gm-Gg: ASbGncuk1rgg0BowRCHIiwUH7ym7Fnl0OilTgUdS+HPtVNrazEQ08FG/w30VidLIsuX BOWZcl4O/zpN584iVHKUZRlW4SoP9j18ee4opYDjqK5kpwV4Z/hY6E0nZcxYXqHARGOGn2kX1Yb QtaUcqVZmblT/GMZl3oaioTx1VS0UQ+eiiupstMSH8IQHUsHcXf+I1ENVx2x3XprNj21E8uPJHc tonu3CUcPTx7KUoKWyRCdI5UOJ6KTzfZKIrVXKswvfuqgaI+o4GyNnGNa3abeLWtbWzhEqaqcMe xZPxwY228izdu+8= X-Received: by 2002:a17:902:e545:b0:216:7ee9:2212 with SMTP id d9443c01a7336-218929ca98cmr207827245ad.23.1734397649582; Mon, 16 Dec 2024 17:07:29 -0800 (PST) Received: from pc.. (216-180-64-156.dyn.novuscom.net. [216.180.64.156]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-218a1e6d0e4sm48746595ad.261.2024.12.16.17.07.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Dec 2024 17:07:29 -0800 (PST) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, Pierrick Bouvier , Alexandre Iooss , Paolo Bonzini , Mahmoud Mandour , Thomas Huth , philmd@linaro.org Subject: [PATCH 13/13] configure: reenable plugins by default for 32-bit hosts Date: Mon, 16 Dec 2024 17:07:07 -0800 Message-Id: <20241217010707.2557258-14-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241217010707.2557258-1-pierrick.bouvier@linaro.org> References: <20241217010707.2557258-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::431; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pf1-x431.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Signed-off-by: Pierrick Bouvier Reviewed-by: Richard Henderson --- configure | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/configure b/configure index 18336376bff..02f1dd2311f 100755 --- a/configure +++ b/configure @@ -528,25 +528,6 @@ case "$cpu" in ;; esac -# Now we have our CPU_CFLAGS we can check if we are targeting a 32 or -# 64 bit host. - -check_64bit_host() { -cat > $TMPC <