From patchwork Thu Jan 9 17:05:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 855973 Delivered-To: patch@linaro.org Received: by 2002:adf:8b05:0:b0:385:e875:8a9e with SMTP id n5csp1335085wra; Thu, 9 Jan 2025 09:08:43 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUbVQQAhZMzIiQxH/aIYrFRBSmvklwE1M7z4oexZ+X2b5uHeVhgqUnWMt1T/Dzp6SlxGLe8eg==@linaro.org X-Google-Smtp-Source: AGHT+IH91yaDoPaONd3Svew+bgrFNggYakZqvCBEOMRrE/yhrDkj0w6xZHdKaOfi9MAxnMt7Vd4B X-Received: by 2002:a05:690c:3511:b0:6ef:aae1:ac51 with SMTP id 00721157ae682-6f5312dd398mr55551147b3.27.1736442522855; Thu, 09 Jan 2025 09:08:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736442522; cv=none; d=google.com; s=arc-20240605; b=Got4zSoedXMOHZS4wBA0t3KIWYILuiaONNPWATmuOGTLFwEp85ak+EjGq8zQd6tTR8 WMENoWQ5AhnBeuUMJP23ICKxKsVqSIkEMEHA18otyMm9EFpweWjVD7Gbb8zQkUwUkFIS TKU0EiRHwHHgXOsH+FERcaCnHpKHdgKMu0TVSGUVt/spc+lWlwppiQnrSY+GvskIhutb DzQmSflXJTXI0fpLLoe+IUecBwZQNOlOXufW9uQ/mc6l6ZgyHDl3p43qBvJsFVX4om9O n696WMX2oqHG2UVlqe8HZouDG8Oiy3n9uukVNq2kNBTcnd0whH4f2UqCpS+UJ7dB0RjR IKug== 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=5mmFjWAfoOONUODYkZWtQO2ol/JE4H/G6qm2dOWJg5o=; fh=FS+JTz/k+Dh1PAd9s6lkEQMFdt/HYT5+zFPDR3GvHJ0=; b=MxMgDf+qYKYbr5cTpG9a7lp3Z4tx3eGURLQ+2TEapvB9o6X0HtiW4x3HAwSetF37Ys 6rJC+Fb7imjO8LGm6fhUFPMEj1SDzEFHaoNVPJAYrtOTkvYZspoOPxOuhoq/BsORY95b btKSAfgBec7k5rJku0yC/LpquEzu+fAgxs6S1SAZD06ctTshRzUdc7gcT8QCbNOQtWnD 1oPo4AZVOXidWF270+ekfsCfoM617ww3MH+NVGwgG6qQ2ZrPeUi1RpvfzZeHhq5vjfSy OiN5faz4Ny0LW19KEvfmwHyCNHxLKTXKvuCJRnyQuc2Qpv4n3aV7sI5TGfVkU7xumd+n I81w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AAlp7CF2; 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 00721157ae682-6f546d7c59esi11270717b3.445.2025.01.09.09.08.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 Jan 2025 09:08:42 -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=AAlp7CF2; 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 1tVvzR-0004hV-F2; Thu, 09 Jan 2025 12:06:37 -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 1tVvzG-0004gn-Ef for qemu-devel@nongnu.org; Thu, 09 Jan 2025 12:06:27 -0500 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tVvzE-0006y0-Q4 for qemu-devel@nongnu.org; Thu, 09 Jan 2025 12:06:26 -0500 Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-ab2c9b8aecaso130628166b.0 for ; Thu, 09 Jan 2025 09:06:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736442383; x=1737047183; 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=5mmFjWAfoOONUODYkZWtQO2ol/JE4H/G6qm2dOWJg5o=; b=AAlp7CF2ogawLXaWhHYZoAiD4ioyZPQdtodMo/Fm6tbRPEoWWuewV4PNBCLNBmo07g 2p+AJFjCi+UCyNo9K7Ivsu34HgkvjBWmi8XXmKBTCblS9G1NxD75fbHIhMqRxFzO3PGU fWLuCftslFyhq8S90olI6rtWY0iZxSx2rKRBa9B+WQMZBFlbu9O5JhwpzRZnXS3ammb8 Gz4FHy4SOjMqZD2Uj1kxnPPvJXEdizmYBuqz71dsR8/8bOhPViOeU16wk+KJzPBsB/Qr eYs52OG70XZWiExBsH2nWcO0WOeUcWmx0eIBnnbbmT6N7PK6LFMXB9vTOsPQc8ulULow IhAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736442383; x=1737047183; 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=5mmFjWAfoOONUODYkZWtQO2ol/JE4H/G6qm2dOWJg5o=; b=rCo7GNBHFuicngK+il2i0krEqt1dru7JjP1It/e3RcwwdNrzO4AIhGF88Bh3Q8myDV rOXU20hhumoSYUgS+XYqCA748N/jdW2b9WHIwE08uWHqiNu1WsXvdtA1DGn3BV9TVg8N +Esp72s4nQexwMWJeI50vyKSLFSLYdqGN74t420cVtUXInKmLaAzISC6L9IoGGfThtJ9 q2Hv/5oJuJrDd8mzXSHK5GsLhgHWuUVtNaIMwQWo+RFyzlheFtHFFJ/K0chMUeOsf7bQ xQsmeDIybmpXn9+0S9dtT+wwKXzuYzWvpRz+ngdqWJ3A8MeA55bl15k5J9Ta5lnMSyKQ ujXg== X-Gm-Message-State: AOJu0YzvfxqAZQyy4HUEPIlvOhezFbBPKHkwXMFh4yDAjz/8kAjEGaKW G4fzFTB+RkAfDbK9QfZg9SHFDS1TY4LWztoam2woZxHmSquVs4lTC3geaUOkscg= X-Gm-Gg: ASbGncvgOjhxhF0jf6u0k7fY8sWIM4LTQijb32dbRTYsIhBenx7E3Ijx4iq+URX5rE7 e1LDJBPtClz+RbVofS6FlSfs8tGtTCcHKf5P7HwNlxWtedBJd52KC/LYozxeW6a6nshkt7dzQPq I5iaeWw8YwT2vcCs8Xl3xY4D1ZVAD8ySpvEs2jglb50jyZ9qgReb3goyU6Mv0/ZNcngRpkn3o0x 8EYcfrw+5yyYPws1Hg3CsrJtbXWhcI5QDgdBJ4SfO6ikONmfMNFjUw= X-Received: by 2002:a17:907:7286:b0:aac:61b:a079 with SMTP id a640c23a62f3a-ab2ab6bede4mr623988866b.40.1736442383261; Thu, 09 Jan 2025 09:06:23 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab2c90dcbe2sm88985166b.78.2025.01.09.09.06.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jan 2025 09:06:21 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id E0BBD5F915; Thu, 9 Jan 2025 17:06:19 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: "Dr. David Alan Gilbert" , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Thomas Huth , Mahmoud Mandour , Alexandre Iooss , Richard Henderson , Paolo Bonzini , Laurent Vivier , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH 01/22] semihosting: add guest_error logging for failed opens Date: Thu, 9 Jan 2025 17:05:58 +0000 Message-Id: <20250109170619.2271193-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250109170619.2271193-1-alex.bennee@linaro.org> References: <20250109170619.2271193-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::635; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x635.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 This usually indicates the semihosting call was expecting to find something but didn't. Signed-off-by: Alex Bennée Reviewed-by: Pierrick Bouvier --- semihosting/syscalls.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/semihosting/syscalls.c b/semihosting/syscalls.c index c40348f996..f6451d9bb0 100644 --- a/semihosting/syscalls.c +++ b/semihosting/syscalls.c @@ -7,6 +7,7 @@ */ #include "qemu/osdep.h" +#include "qemu/log.h" #include "cpu.h" #include "gdbstub/syscalls.h" #include "semihosting/guestfd.h" @@ -287,6 +288,7 @@ static void host_open(CPUState *cs, gdb_syscall_complete_cb complete, ret = open(p, host_flags, mode); if (ret < 0) { + qemu_log_mask(LOG_GUEST_ERROR, "%s: failed to open %s\n", __func__, p); complete(cs, -1, errno); } else { int guestfd = alloc_guestfd(); From patchwork Thu Jan 9 17:05:59 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 855967 Delivered-To: patch@linaro.org Received: by 2002:adf:8b05:0:b0:385:e875:8a9e with SMTP id n5csp1334357wra; Thu, 9 Jan 2025 09:07:20 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUOn3IXYidT0eCz8WrL6apJrHIowaCdhJAJElhGjUD95LvXnLDchXdZ/gZPv/IEo4q62qxEvw==@linaro.org X-Google-Smtp-Source: AGHT+IGamrezr0mQ/Nr/PhGBmTLitHLDzko6xJ8QjG8FgraT2NvkSpMNonHeMsBgHmb4wo0ewU0e X-Received: by 2002:a05:6000:400e:b0:382:38e6:1eb3 with SMTP id ffacd0b85a97d-38a872ebd18mr7201227f8f.30.1736442440053; Thu, 09 Jan 2025 09:07:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736442440; cv=none; d=google.com; s=arc-20240605; b=jvu9ut4edv+eRCLNNvhUFsw0+0dWpyUEWNmrrdjxEdrL9zal3dfSfKBG3JIXnMY9BW qS6vHL78iqG2yds2Mw66U8hDOrK3D7HiMhrwj5p0rIUbsA9UlF13jLnfDSgtmFoC0VnC 3Zs/eqckUDTdFRPueMnSre/RYL0tKjqK4+VvxB4W+H4xuyH+j8rq4ADGSCOpKA7c21o3 Q0cwvQyemyXxhT2YHAZPI4ApuI0oKpa7EPJrxLDFEHijYty5uIywmICBgpX7+EO1JWZc WD3ScvagPuZwla1LqaGaLwaZ7/mU8xmBDe0pm8FUMrfMyvFrXSb+i2+5GNlOLmj+dmDI fpKA== 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=DjEsdOpQ49q8jWvklUeiIlGfQQiMPZKhuPb/zwxQMo4=; fh=FS+JTz/k+Dh1PAd9s6lkEQMFdt/HYT5+zFPDR3GvHJ0=; b=JkoK+D4SPcibLotw5OU/L0WsuGuJXMgSHuaNkzRTiWilhuhON4UzS3+kgf951kUOzX L+Ei2MFrDrYqiLnL+rxfWmYeFLo6yOkHQFX8EaDF9Yd1f3edI07bq4R+g4WtrZ+6KjZF jql9Z4xI5hylmMS2fslBV1qzo6X/lQTwdkkujSi6926ZYN1dcIo3idLBHTezAA0OIUIh EQDjTm+fF6lx6ohklxOPm9ZJjbUpHzn34WYvDiaT3Hf299s6xNeUglsu77lhuzgGdnjq YRmVLOgsuf5Qk9emDt4crzQRo9lNRCTlZIp9VDbJnFlQxiX6plw4GMaMMTnSZyzLtPkH 1dGg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ICWHP5oa; 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 ffacd0b85a97d-38a8e5dddaesi1228284f8f.879.2025.01.09.09.07.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 Jan 2025 09:07:20 -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=ICWHP5oa; 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 1tVvzX-0004iX-6u; Thu, 09 Jan 2025 12:06: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 1tVvzP-0004hS-96 for qemu-devel@nongnu.org; Thu, 09 Jan 2025 12:06:36 -0500 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tVvzN-0006yu-KJ for qemu-devel@nongnu.org; Thu, 09 Jan 2025 12:06:35 -0500 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-aab6fa3e20eso222872966b.2 for ; Thu, 09 Jan 2025 09:06:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736442390; x=1737047190; 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=DjEsdOpQ49q8jWvklUeiIlGfQQiMPZKhuPb/zwxQMo4=; b=ICWHP5oaVPqalbCZQ9bur6mGgSI/Zle7dN21vSJlV0teh9xNkcqypoTDryt26kP0XA j2JievHuD3+PaUZwTeA7eq9qsegwwfBFevay0T0xkYZn0ksTo3hBcAJrdEE3d4t/X1Le YVILv7MZzh8dWISjBHJ93Gzx9n45rRV/uW3XN3cMDFMjLYubu6ctOuYT+HZay4YYBRh1 A0YwZBu7CDx6d2h+QNYvUCtl1RQjQHnsqcCg1g66GHG0WUDYcYnTWqv7dxvqECbXd1KX AF5BAGBww01tj6eV1N7jd/b+9Q0COWqyruoX/VOHlWEUcaZn1XFXqTCy5hs5nFQTjG15 huUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736442390; x=1737047190; 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=DjEsdOpQ49q8jWvklUeiIlGfQQiMPZKhuPb/zwxQMo4=; b=ohw9SusHBta8Wg9bo9mjC1wIQHPAEgWxEWRw5TXZZ5oo0X43t/Wdy/GVUREONt7l5T J9HO6kKy5BN9UORWJBakue7IA8BFRzpxttZwbri4awHEWxo35QmbOOi6BFrAzZFMt3am Ju0NkELjDugWDdWOwB+VGyJ4DsF3UrTr20G+dhdeG0ljvEguZ32yDcAQfVqQF7HDsPQ1 llGCE9E0FEL8P+h4kICX3hcmwwjxAUeZ9hGDC3VLIQNH7W4H0bETDdNeGnOYb3DS9IXM bYxGv4SDBuw86bXSaKHOsAoA+GfuZ27EUvPz8Aq71fNzz3gV5R0TryPxCaroPfYuY9LQ l6jg== X-Gm-Message-State: AOJu0YzhMkAtIJLdtG+ErbnOQK3z1jINqIxQ0iRGbLRBceFDATABKvgq 6KqoY4rhjFDaLuGGgsczD/jq0A1P3g6RbEt8tu4mCjKftU8CrMbUrd6izFMYvrk= X-Gm-Gg: ASbGncsFrgdmBizJhjxA7QNZUgqbK1mdME2PtN0tE5qZlTwPcfVh2Q4XXgDMWl49yWf +BGg6ivvQmd8VHIzLew/cxjNL9DoMQugAIuNlvzqx8NFXniePbosvd9dTMdWYr5NJNUvttIaPb0 wb8eFbKi1o8LaZs/VsNSCk+O2FstHPrsS1RYiLG0rKEzujIRLcERQRoJS5gwITTIZexfjdml07x iBC5FnmnaBkQx0gYA1CrBMJWeYC7F64u28vYPlu94dL7IH316bPdZ4= X-Received: by 2002:a17:906:fe0c:b0:aab:75f1:e51a with SMTP id a640c23a62f3a-ab2abc78dc8mr688853766b.38.1736442388881; Thu, 09 Jan 2025 09:06:28 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab2c905cd8asm89286566b.7.2025.01.09.09.06.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jan 2025 09:06:21 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 043965F95A; Thu, 9 Jan 2025 17:06:20 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: "Dr. David Alan Gilbert" , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Thomas Huth , Mahmoud Mandour , Alexandre Iooss , Richard Henderson , Paolo Bonzini , Laurent Vivier , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH 02/22] semihosting/uaccess: Briefly document returned values Date: Thu, 9 Jan 2025 17:05:59 +0000 Message-Id: <20250109170619.2271193-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250109170619.2271193-1-alex.bennee@linaro.org> References: <20250109170619.2271193-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::632; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x632.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé Since it is not obvious the get/put_user*() methods can return an error, add brief docstrings about it. Also remind to use *unlock_user() when appropriate. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20241212115413.42109-1-philmd@linaro.org> Signed-off-by: Alex Bennée --- include/semihosting/uaccess.h | 55 +++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/include/semihosting/uaccess.h b/include/semihosting/uaccess.h index c2fa5a655d..6bc90b12d6 100644 --- a/include/semihosting/uaccess.h +++ b/include/semihosting/uaccess.h @@ -19,41 +19,96 @@ #include "exec/tswap.h" #include "exec/page-protection.h" +/** + * get_user_u64: + * + * Returns: 0 on success, -1 on error. + */ #define get_user_u64(val, addr) \ ({ uint64_t val_ = 0; \ int ret_ = cpu_memory_rw_debug(env_cpu(env), (addr), \ &val_, sizeof(val_), 0); \ (val) = tswap64(val_); ret_; }) +/** + * get_user_u32: + * + * Returns: 0 on success, -1 on error. + */ #define get_user_u32(val, addr) \ ({ uint32_t val_ = 0; \ int ret_ = cpu_memory_rw_debug(env_cpu(env), (addr), \ &val_, sizeof(val_), 0); \ (val) = tswap32(val_); ret_; }) +/** + * get_user_u8: + * + * Returns: 0 on success, -1 on error. + */ #define get_user_u8(val, addr) \ ({ uint8_t val_ = 0; \ int ret_ = cpu_memory_rw_debug(env_cpu(env), (addr), \ &val_, sizeof(val_), 0); \ (val) = val_; ret_; }) +/** + * get_user_ual: + * + * Returns: 0 on success, -1 on error. + */ #define get_user_ual(arg, p) get_user_u32(arg, p) +/** + * put_user_u64: + * + * Returns: 0 on success, -1 on error. + */ #define put_user_u64(val, addr) \ ({ uint64_t val_ = tswap64(val); \ cpu_memory_rw_debug(env_cpu(env), (addr), &val_, sizeof(val_), 1); }) +/** + * put_user_u32: + * + * Returns: 0 on success, -1 on error. + */ #define put_user_u32(val, addr) \ ({ uint32_t val_ = tswap32(val); \ cpu_memory_rw_debug(env_cpu(env), (addr), &val_, sizeof(val_), 1); }) +/** + * put_user_ual: + * + * Returns: 0 on success, -1 on error. + */ #define put_user_ual(arg, p) put_user_u32(arg, p) +/** + * uaccess_lock_user: + * + * The returned pointer should be freed using uaccess_unlock_user(). + */ void *uaccess_lock_user(CPUArchState *env, target_ulong addr, target_ulong len, bool copy); +/** + * lock_user: + * + * The returned pointer should be freed using unlock_user(). + */ #define lock_user(type, p, len, copy) uaccess_lock_user(env, p, len, copy) +/** + * uaccess_lock_user_string: + * + * The returned string should be freed using uaccess_unlock_user(). + */ char *uaccess_lock_user_string(CPUArchState *env, target_ulong addr); +/** + * uaccess_lock_user_string: + * + * The returned string should be freed using unlock_user(). + */ #define lock_user_string(p) uaccess_lock_user_string(env, p) void uaccess_unlock_user(CPUArchState *env, void *p, From patchwork Thu Jan 9 17:06:00 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 855982 Delivered-To: patch@linaro.org Received: by 2002:adf:8b05:0:b0:385:e875:8a9e with SMTP id n5csp1335712wra; Thu, 9 Jan 2025 09:09:58 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW33HNnLB1esHOfPrE3StQTU+KIqkURooKVMmjxxeQ9NFfJYTPeqkDSZyOUpwjlXyr4I2rM4g==@linaro.org X-Google-Smtp-Source: AGHT+IFt6JRqgHQn3vl28qRZaXKsve8/n8wUsPqCb2P9M0yrROPg2ayQAUm/euIIigw+k6YcXgd6 X-Received: by 2002:a05:6102:578e:b0:4af:eccf:e3ca with SMTP id ada2fe7eead31-4b3d0da8a8cmr7116601137.10.1736442598774; Thu, 09 Jan 2025 09:09:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736442598; cv=none; d=google.com; s=arc-20240605; b=iYuuZY2+BlYR1YamPrFDFDlJanISNtdiw6e4srUZnWcNizqAXLSfUWtGWOmNdhOtq0 eJEJi+XIIfi2NjG5nA1yzDTZVhfjzn4O1KOEoTfLXIW+NPHO3MqpR4F+lZZzTqJqxwTn 5pGltQlWyG5BCA4DZgy2wdNh5Rn6QTCpsOkoumVFYDYEAjM4tTghPM0PLwOrOLyq2qRV L8uq7AKU3KGJgTLQa6LilMNwD/e/HB37+9ke0/me2Qw3cZnLHsrX82wGdfPss4Z71Dvx kQ1UFeDQuaLdNuAvGnLZzHlH+N9pUTFs7/T6NHdGHkteb3qAmtuqjVkuI+rCh0rFHKFG pqMg== 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=swWbfqbBQuWTwxy/6Yz7+TAY9SVPbs3mxyJnC781jXo=; fh=FS+JTz/k+Dh1PAd9s6lkEQMFdt/HYT5+zFPDR3GvHJ0=; b=buHf6sslVuODWGRl6uowUaBiW7uGrP/e1N4FQ6Jj9pOGKX/bBWTytmjHoOEgzpFedM vPOKndhyZaMniex6mDR5MOIc/3kWT/GbD1cibQXd/5BoAH8zLqSIn+4mpMX0Bj1zx/XO AAhN6b+vhL+LCRfQNtIaRqwObOGFEqKj9VdHipD3U0VOsEE+Zpby+hLmhAWsZrKpMD2h 50d2Zy6wya2zdkGXSlxfUlQst7TGNRhSNx8rkm97xBahSNV7cK6GuoJWMLlrARJVzu+O a7iCXk9sQzF5Hm61OIIYEKZgD5JAI5mTr0EqT7yHGu7O78ihfVciKBKRWpZx1WxQXO6q lVrw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Q/rsOCOE"; 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 ada2fe7eead31-4b6093a34b9si639188137.615.2025.01.09.09.09.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 Jan 2025 09:09:58 -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="Q/rsOCOE"; 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 1tVvzf-0004lA-86; Thu, 09 Jan 2025 12:06:51 -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 1tVvzW-0004iV-1Q for qemu-devel@nongnu.org; Thu, 09 Jan 2025 12:06:42 -0500 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tVvzU-00070J-Hs for qemu-devel@nongnu.org; Thu, 09 Jan 2025 12:06:41 -0500 Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-5d414b8af7bso1910932a12.0 for ; Thu, 09 Jan 2025 09:06:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736442399; x=1737047199; 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=swWbfqbBQuWTwxy/6Yz7+TAY9SVPbs3mxyJnC781jXo=; b=Q/rsOCOEeT23asef+rYJ21t/Vjufbdm6n40fdMz26p922+qioo4YGV60KCTRfeoM1P XqttUz7o8tR5ySntKzsjKwDYkLRoForh+KyZcPlt3hKxl8/ku6be0iKZsbRhLPEbK3+C ebZSadwlVZpY7YIuJVdoadtVXd1tmoLizyeSz+RN9DgcymzOMa+OUx14xG7reFHVGJqB Kj4XxmPIi05iV07GCK3/S+otvdMwOwXaAXhWN8xFQJurxBebf7AwapSIVAvWY/vPLYkZ DwjEfzmCcJ1QMdUF47VKRG81Kp5oo4vck4gE4nWtIuEdfscIazgObHJBS+/0gpViRwrk nevA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736442399; x=1737047199; 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=swWbfqbBQuWTwxy/6Yz7+TAY9SVPbs3mxyJnC781jXo=; b=dFQFU+OyKy1DGCjCDPtQNh5iNU1S02vLNZTSlQj0AlzhlP3QYTBLSYaQYOPB93TPla dZzL/aFHpsYVIwjTBHspUgHZSDmiVtFYZPjWe2RgtaJGIQiUhJPbZlFclWP1jF0dGez5 O0v3tBOhIXlo9TmPAy1rm3Apnw+GVk82kcT492pzq/g9SYENr69i3j0oPQyhyjrsWHzJ LVlX711hyMFgq9HK0rpwDmb4XidfomXo2DcB7gwS5o4B4NSdsgL88bXiQMppOWK03V84 gbBj3iaT0dIZm/0CDwE/Hbj2D0+7Xgl8JeuQiRnYipH8j1x6AlMlSZwgsFWrup1QoXxa GFBw== X-Gm-Message-State: AOJu0YwJ1Pu3ubWDIVje4oEJ9Zg8BZn252NMAyFMYgo0/vxCersqhEgh r690EdlVgg5t5tzorfTavksUlVvlJ3rWxFhSwo2zKwkNNkePb61hQLG42PXeFG0= X-Gm-Gg: ASbGncsOxpUJNC966tmI675GDwjFf6fe/HzTQ3qiQafXXvjSGu7xVBqT/KErbbLi6vg K6fes6RY/5p9AAbzMcdLeRyjM57vKOLL18vtmHXJn+i7/oTQYrwOZ3/UUIr4eoauSpAesAbRqyp inzqVK+ov4cp8T4KdVZ781opZA+OwO7Ic6/dX2TarN6IWq97ov/sbibZcE0LRsJkO+UJVWnCuyk UF0Ou+xJoUuv2k/ZDWATGj79+Om6dqbN3tBw6UyIEo4JwbZQHnJlgc= X-Received: by 2002:a05:6402:2355:b0:5d9:a55:4307 with SMTP id 4fb4d7f45d1cf-5d972e4eeabmr7141883a12.22.1736442398763; Thu, 09 Jan 2025 09:06:38 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5d9903c32a0sm805980a12.44.2025.01.09.09.06.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jan 2025 09:06:31 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 190EF5F9CC; Thu, 9 Jan 2025 17:06:20 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: "Dr. David Alan Gilbert" , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Thomas Huth , Mahmoud Mandour , Alexandre Iooss , Richard Henderson , Paolo Bonzini , Laurent Vivier , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH 03/22] semihosting/syscalls: Include missing 'exec/cpu-defs.h' header Date: Thu, 9 Jan 2025 17:06:00 +0000 Message-Id: <20250109170619.2271193-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250109170619.2271193-1-alex.bennee@linaro.org> References: <20250109170619.2271193-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52e; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x52e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé target_ulong is defined in each target "cpu-param.h", itself included by "exec/cpu-defs.h". Include the latter in order to avoid when refactoring: include/semihosting/syscalls.h:26:24: error: unknown type name 'target_ulong' 26 | target_ulong fname, target_ulong fname_len, | ^ Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20250103171037.11265-2-philmd@linaro.org> Signed-off-by: Alex Bennée --- include/semihosting/syscalls.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/semihosting/syscalls.h b/include/semihosting/syscalls.h index b5937c619a..6627c45fb2 100644 --- a/include/semihosting/syscalls.h +++ b/include/semihosting/syscalls.h @@ -9,6 +9,7 @@ #ifndef SEMIHOSTING_SYSCALLS_H #define SEMIHOSTING_SYSCALLS_H +#include "exec/cpu-defs.h" #include "gdbstub/syscalls.h" /* From patchwork Thu Jan 9 17:06:01 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 855971 Delivered-To: patch@linaro.org Received: by 2002:adf:8b05:0:b0:385:e875:8a9e with SMTP id n5csp1334947wra; Thu, 9 Jan 2025 09:08:26 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWVAab8CUJPHaE9Me9nTkfvqxKMSHco4I0bZ2/RFe7IWNGi7jb5uU/5xiqDZKvLuxqLEtfmKA==@linaro.org X-Google-Smtp-Source: AGHT+IEp7UHjJxfb5ZaTjrQ4m+EFOxaD85Eh+F7H+il3f/TJSBt/IvPFf16OsYKVm7ryqkwKppJt X-Received: by 2002:a05:6000:1547:b0:386:34af:9bae with SMTP id ffacd0b85a97d-38a8b0b7fd0mr3504850f8f.4.1736442506551; Thu, 09 Jan 2025 09:08:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736442506; cv=none; d=google.com; s=arc-20240605; b=TyFOyPqAbGmJ37Qa/4J82nHgTNX3X/ZNwB53JCLjT5OYd1/zbNsmA6uBlbz4GDq+R+ THYKgRcjUq+MHGnR2oZED3xaxSo5FK+31G9WQs93OokuccJ1M9e9Zt6f7nWCpwWCnLdh e14DW9p+FKiyMaYVavwulYae1k049Ikn8WMxiGiIyrU56H3qeDt4tRzWQsqZDGLXoUBF Es3uniUp83i388ks1hCrXLco0bhQA45wcTW2E1Q5wIUc2zhGEgfoADYD7WqDrKORkH2n ULXmsdxiB+N5ugmdmLzTv1zBEiR01WKBA8dw2Btx6CJS7KOZN8H1ByBYWAwlShZyHZCp oyTQ== 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=7fkCPXOa8A9Xl79fpL/YYXVm1xiiiaH5KvVpCQywK3U=; fh=FS+JTz/k+Dh1PAd9s6lkEQMFdt/HYT5+zFPDR3GvHJ0=; b=GIgArjBE62XlYGL+dkDd4gxiNTPCOeNnzP7A6xkf4UvAYC8yo+vvOHRGGmtb3vCawy F/o9nLvnhkqN+wkDGMGtMkqk3Dh4a8hEBWg2qduKAEERNrjmB+I1bs75gVprceKf02L6 dYwE5EcrwxH6H57+qlrpACNi0ijvMjiqM1RCnOheIHNTr5O14y/RqXqKyMbih/cD8Zm0 2MsWuTrf0QfdYc08GJEiCdJftTv6IkfH+P9vo/r9SeKPex53BpDJv7eg4WORhczlZ8qC 5oAGq0p2iW2aQNqQJEJ+fEJncuMWMoTT5WwvkYfwQILkgZ/P3G4eiQdgejxx+liDXEZQ 1/Mw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="zjI4v/Zp"; 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 5b1f17b1804b1-436e2da70f5si26102175e9.22.2025.01.09.09.08.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 Jan 2025 09:08:26 -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="zjI4v/Zp"; 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 1tVvzV-0004i7-F1; Thu, 09 Jan 2025 12:06:41 -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 1tVvzP-0004hN-1b for qemu-devel@nongnu.org; Thu, 09 Jan 2025 12:06:36 -0500 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tVvzN-0006z1-KA for qemu-devel@nongnu.org; Thu, 09 Jan 2025 12:06:34 -0500 Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-5d3f57582a2so4314782a12.1 for ; Thu, 09 Jan 2025 09:06:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736442391; x=1737047191; 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=7fkCPXOa8A9Xl79fpL/YYXVm1xiiiaH5KvVpCQywK3U=; b=zjI4v/ZpZmk5/FUq9Rl4IPhTdZZU+xFA6VRs22YpCNpikX092Hx7ve/s7sPptvk1Rj wtFLFQcbiqOCKhaH9dH0FTCLHWKfWOfNuj3oD7dlGNZj5ylwTH0lLp1NsuyTyqOGUbva fLgUItDi3oTAn29HawvUZFBukcf7lR/57bUghRF+EZamCEDfG+GbrMAkpJWm7QYccxV/ zTVE5jM1e8X6YEwWH0eE6B/1qhYPuuw1h9isqixFrnVq11vqyOi4NYs4j0PqDoCC5nJH Xpn06Wn6gtO5xHsetmQ3WOH8W+zKldzdTpSTND9szE4/c7F8e6dwHO4NNAZFpGHUV2qW ZVDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736442391; x=1737047191; 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=7fkCPXOa8A9Xl79fpL/YYXVm1xiiiaH5KvVpCQywK3U=; b=PCcJLQ2VzH/qosjanuPAYd5gtnB0r0BqDN1P1xRjx2dIL/6G10OcQJpHP2pc+belZV aMZv7B2sscbcUScnHMtWCHJts87pYXSRyvzva07+So5OgO5A6KuSIurJgxlRJDgyKJGb x2eh43peFuO2I9lgvc/vsFvAcX90/xopLv32MzYPHDiDajk/a66jEmR5oAY2WHOZCzAB y7FoGMe0Htui5ZHet7yMvAFSvWZ1hsRDCvUHU2828xQ4Uzs97OPI3Vs5qsB02w9GpI1G RthyUOgYi32qb7/RL7Xt03/YLg+iDt3t7M54UU5Wcz4fZmwMU48W4jkjxuKnmYLu2izG gSjw== X-Gm-Message-State: AOJu0YxVHQPeCDr2UmzZOCXNxpw9lNpDxQFD9D2+78ytsa5SwRF0k9Xx GbS49FSA4E5J2PCk8l84JsnsHB4/T9YWsZKZtXMswg0bMgKy08A1bCEeBv99Xrs= X-Gm-Gg: ASbGncvu4lpN4kBSRKrepjln9TqxTkjRrtbjPBj97exp+Byo5L73fOixeTtGvPGQ8vE K4lRf+rjcODP28sThRmjuyoMSt/uQmrE7lAOpOuelHjFcIgGl93EndKyEIj4blKmUrujKUUokuY kT7lWxWNMsS0H/YC1+kAVs4Tve0D8yjqTDmzkZSM6XA1UWvIIrf6d+Too/NEPzYlONEHQFLzhFa BLPbBn+ROUpg/dKK8ZNxiwW6JfVRD1hMO0D+GCEDByf4sc/mYhF0es= X-Received: by 2002:a17:907:72d5:b0:aab:ef03:6d46 with SMTP id a640c23a62f3a-ab2c3c63f95mr363175066b.4.1736442391046; Thu, 09 Jan 2025 09:06:31 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab2c913804esm88921566b.84.2025.01.09.09.06.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jan 2025 09:06:21 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 2DE1E5F9D7; Thu, 9 Jan 2025 17:06:20 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: "Dr. David Alan Gilbert" , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Thomas Huth , Mahmoud Mandour , Alexandre Iooss , Richard Henderson , Paolo Bonzini , Laurent Vivier , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH 04/22] semihosting/uaccess: Include missing 'exec/cpu-all.h' header Date: Thu, 9 Jan 2025 17:06:01 +0000 Message-Id: <20250109170619.2271193-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250109170619.2271193-1-alex.bennee@linaro.org> References: <20250109170619.2271193-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52f; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x52f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé TLB_INVALID_MASK is defined in "exec/cpu-all.h". Include it in order to avoid when refactoring: ../semihosting/uaccess.c:41:21: error: use of undeclared identifier 'TLB_INVALID_MASK' 41 | if (flags & TLB_INVALID_MASK) { | ^ Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20250103171037.11265-3-philmd@linaro.org> Signed-off-by: Alex Bennée --- semihosting/uaccess.c | 1 + 1 file changed, 1 insertion(+) diff --git a/semihosting/uaccess.c b/semihosting/uaccess.c index dc587d73bc..382a366ce3 100644 --- a/semihosting/uaccess.c +++ b/semihosting/uaccess.c @@ -8,6 +8,7 @@ */ #include "qemu/osdep.h" +#include "exec/cpu-all.h" #include "exec/exec-all.h" #include "semihosting/uaccess.h" From patchwork Thu Jan 9 17:06:02 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 855976 Delivered-To: patch@linaro.org Received: by 2002:adf:8b05:0:b0:385:e875:8a9e with SMTP id n5csp1335152wra; Thu, 9 Jan 2025 09:08:51 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXLcjwcrlgX46KMhLlfV3fMF/iCColeaZnKBG+yVdmDdRaKdujh4kPEihAwjsQvpTCHqD9lEg==@linaro.org X-Google-Smtp-Source: AGHT+IEAx3ojZMmh6avLzKC6Zgac9AW1efVs01CfvgXzA7mbi5Sco8j1EAE0cwZJyc7ZUGtlkvcz X-Received: by 2002:a05:6122:8f82:b0:51b:8949:c996 with SMTP id 71dfb90a1353d-51c6c48f340mr6230605e0c.9.1736442531162; Thu, 09 Jan 2025 09:08:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736442531; cv=none; d=google.com; s=arc-20240605; b=Jc8xZT1s+d3UCTBE3ICH+jxhNQBMMokvFY6qcsUqGRxpaiFljx68Z5EVzU3BCLRupU AT2LfdsWHe/kyGpRur9C0Pd3rmYKoDZ7JXbpIlSAi5vzCXBEdWKiZhCVwmXz5zbn4ksu aZ//wtM9BXw5NcCtkBZbAPXzVfizLiBlRG2BbXdKU5YxkrWbzSRN9ktXdIGetVCzRenj YHt/t7/SHqdjcxSc/IDmUO3Wfu+1b9aCiBUxwcXTzscP3LEvbtwHoKDL+jmEiwrK41PV KqOkMg8LdQEafNeeQhxZXpG1RjY+y7J7+Tq2y1SXXreUs9py8Son+qHj7C5BWYjewzCh dWgA== 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=8J/ApKgPVXOVC7MF+COAj1wGpBADeRQ/mLFnBALjiW0=; fh=FS+JTz/k+Dh1PAd9s6lkEQMFdt/HYT5+zFPDR3GvHJ0=; b=hqk7ax0VtVffVKHw3QGy+jdtAkdwC9wmQ9T7zRSUYiQYQRtGvHKAYJeQJavzcZgR/y XYOJqZCHd4piH68HVZWGVqloNy5rkHPwIfyoe3y26d4F7sQjNiP9Mt2BVy/GLXdwXAnK lxEq2ueB0r0EMVhZgtdMuf1NP8N4V5NjWvUMw9Pp/kjZ3WwCg7+Hn8wp381eqS2oqMeT LipQSAEI/nmDKRFxliVJPEiHsU7ZAc7EtBpO43b7t5Apw0DOqlRQ4h3k87Jv2w1Ij99r sczrQCDccgX5lIesavKJlGmHau0/d/qJ9pNUY9kx8mT/4u2TnxeA8+4hBkUxaPKS8BEQ gsjA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=K9nnGKhQ; 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 71dfb90a1353d-51c7fba07dbsi744756e0c.14.2025.01.09.09.08.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 Jan 2025 09:08:51 -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=K9nnGKhQ; 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 1tVvze-0004l1-UW; Thu, 09 Jan 2025 12:06:50 -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 1tVvzQ-0004hU-70 for qemu-devel@nongnu.org; Thu, 09 Jan 2025 12:06:36 -0500 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tVvzO-0006zA-Kq for qemu-devel@nongnu.org; Thu, 09 Jan 2025 12:06:35 -0500 Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-aaf60d85238so230470266b.0 for ; Thu, 09 Jan 2025 09:06:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736442393; x=1737047193; 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=8J/ApKgPVXOVC7MF+COAj1wGpBADeRQ/mLFnBALjiW0=; b=K9nnGKhQ3+F9O4UwB+iuOo1BoAbqrxPaGr3GakRokLdrUEpxCIQpP+/C4dBT5jZ1R0 bNuPPwPH24wd565j7i3b/9krWgcQr2u3ZW9nTtyKz/PLzc7wj7BeqbUu6t+h1oPWv0ob fhfPEsy/0XQtwax2AzlFt9DkS4++T8U+vMc2mwsG2GnaVeCf5msmuuE0UP7r2vqikxXE Ed7rDbyIK58Wt6iTP8wa2ee7cNKexIlI09YER+4XE4JmQouI/Se/l2bPKng+8nyqlTQU TM04USxfwfq+PdS5OTuffIJxoj5GWfO0OaC+ZEIFVhmdtgca1YMSYjS/OI3psKvZ2KfL KhKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736442393; x=1737047193; 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=8J/ApKgPVXOVC7MF+COAj1wGpBADeRQ/mLFnBALjiW0=; b=DuDv2hT65uSZZ+BGd9bGC+rPQMFAvwA+O9NaoZLr37QYtJM5eN5B0wvuqO4tvAsZC6 OKf0tBld5EnocTQjwosrPJxy8kjHXax8sZHpNUNsHVTKt440HKdk4Z3Y3lZ2ALJQKf+h 8WLCE82ehc+Yba17AHAAel15saT4IJAy7uOUnKMC15ABFM+a+1nxTSIHYcyM3a9sqaY3 S+GisIttI7S9DuRbKEqGAcRdVlyGF5/TN9qy9xsLhpydkml1Lk04mqnRRS5HQFQgo/qb rOIKzKGhPcDyIcMSygMpkLZ1JtWpAs+rYr3AwXbgMb7q8mn7o//ShpQqDjatqoDpD0sG H3yA== X-Gm-Message-State: AOJu0YwFBXQlmK6KOAUS8CQcI7QCElhMZGE+bln2TeYQo5mSu6zAcpTU zsAssses6G9bRgN5y0UXxcDq0B47KKbLkzcloTuOZNitgJW/WAPUBZleCWP7opo= X-Gm-Gg: ASbGnctSmfeo/fTdz7qMtlu19OSePcA6CiZ4pboBd8+sVHQtv19KhfJyQ4Tm+nvVWm/ T/nS5H2WILntC0Inx74Z4+lbSmrjAVS2D1KPRGmRG3kRhsV+2zBBcYhwwZrZiCp/T10oDiygpjC t8As0QpA0/kWOB2cmsEFOVefdejoQq+THZTJOqUwka58If1WaOMWBL+9cC4tplgGPYGi1M86HqE QeOSz9jzc8z88llHm4X7dOK4E2zAiSwVU6mr2IzYpMQs8DsLL/hcqw= X-Received: by 2002:a17:907:971e:b0:aa6:800a:1292 with SMTP id a640c23a62f3a-ab2ab70be05mr581209066b.25.1736442392804; Thu, 09 Jan 2025 09:06:32 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab2c9564865sm89347666b.108.2025.01.09.09.06.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jan 2025 09:06:31 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 4311C5F9E2; Thu, 9 Jan 2025 17:06:20 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: "Dr. David Alan Gilbert" , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Thomas Huth , Mahmoud Mandour , Alexandre Iooss , Richard Henderson , Paolo Bonzini , Laurent Vivier , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH 05/22] semihosting/arm-compat: Include missing 'cpu.h' header Date: Thu, 9 Jan 2025 17:06:02 +0000 Message-Id: <20250109170619.2271193-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250109170619.2271193-1-alex.bennee@linaro.org> References: <20250109170619.2271193-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::634; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x634.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé ARM semihosting implementations in "common-semi-target.h" must de-reference the target CPUArchState, which is declared in each target "cpu.h" header. Include it in order to avoid when refactoring: In file included from ../../semihosting/arm-compat-semi.c:169: ../target/riscv/common-semi-target.h:16:5: error: use of undeclared identifier 'RISCVCPU' 16 | RISCVCPU *cpu = RISCV_CPU(cs); | ^ Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20250103171037.11265-4-philmd@linaro.org> Signed-off-by: Alex Bennée --- semihosting/arm-compat-semi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/semihosting/arm-compat-semi.c b/semihosting/arm-compat-semi.c index d78c6428b9..86e5260e50 100644 --- a/semihosting/arm-compat-semi.c +++ b/semihosting/arm-compat-semi.c @@ -166,6 +166,7 @@ static LayoutInfo common_semi_find_bases(CPUState *cs) #endif +#include "cpu.h" #include "common-semi-target.h" /* From patchwork Thu Jan 9 17:06:03 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 855980 Delivered-To: patch@linaro.org Received: by 2002:adf:8b05:0:b0:385:e875:8a9e with SMTP id n5csp1335385wra; Thu, 9 Jan 2025 09:09:16 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUbLqC75lCYFHUTm9JWExoKzECP4/VFfgdiYhC5Ev8OEaFLCPqnZz7D4iNqAcO0F+/fePWzRQ==@linaro.org X-Google-Smtp-Source: AGHT+IG5GjMCjWmVqaXssrWnR+jlVlyfzjkXxNG6nemuZnQPArGB+zWWAeJ6eQUlTTonNXCW8PFE X-Received: by 2002:a05:690c:601:b0:6ef:993a:29b4 with SMTP id 00721157ae682-6f530f2737emr65466817b3.0.1736442556373; Thu, 09 Jan 2025 09:09:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736442556; cv=none; d=google.com; s=arc-20240605; b=IdTyzjmvZ7zJdjyHcC6KpMnIuvfCqA2LCKgoH1JeV9oJrsNMBd9O4YdZ6SVjGmoXlV cM7/iTBDZpSvvzU1kydeAeFreprMigLgNlhs9PI3aEX3fed6KfmaIlDKh7kKen+bWSiR WnV3oCaCHcALHt8O1BsYbInVesalfNuFJXoAuDX2PF49HCjjJgrm1FKfLovnftB7zEsh NdwVSDLDBIlU8IZCSJ5JV4pzO8R2EuEyTHD8KVFeW8UzOCf0a4c6laKyRC4cN7XKS5cn vtCt/8OY6CPmi/DigivL9BE9HTAucEc6WFvFCBVtrypn4eaaLGaCQllnMlEG+gl/X1zo Xv7A== 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=q0SipZjZSJ8RGOzW6wWIIrmkUJqEseFLNGa6w4kFsPM=; fh=FS+JTz/k+Dh1PAd9s6lkEQMFdt/HYT5+zFPDR3GvHJ0=; b=UcSilCD5uDqeAa0UCL4DnGg6fDhQQVyf2vm6+jYBMTbJ3dyf1KY0oUMm7/x/ATcM8w HsIbgA7BKs5VD8BqMdha/o0iItEbT67yzPETf/TlJ1r5n+a7iIWdlIydFa3CdDMBobDi 14wGm4ZXH75JJl7KO2IGvV1ivgCqVO66Xnp5R7CptA8Vq+w1xmt+MaiDvpYuvyHO6FI0 TnoZV3y8pTgqwWsVN1t9DQQUvnDtm0tMVsKIj5Bcq2t1J4E4/xbb6rgkrjdpwFfoTknq 0ER9eY3fx1ZbmLI8Jxwbmk6Y/3zTsZdf/lz0AyzP7BYl9+OHxjHX+Gt9N0B9s2uy+mhl oW3A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="F4l/QF1k"; 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 00721157ae682-6f546bfe567si11619757b3.143.2025.01.09.09.09.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 Jan 2025 09:09:16 -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="F4l/QF1k"; 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 1tVvzh-0004n2-N4; Thu, 09 Jan 2025 12:06:53 -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 1tVvzT-0004i5-6a for qemu-devel@nongnu.org; Thu, 09 Jan 2025 12:06:39 -0500 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tVvzR-0006zd-Cc for qemu-devel@nongnu.org; Thu, 09 Jan 2025 12:06:38 -0500 Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-5d96944401dso1781462a12.0 for ; Thu, 09 Jan 2025 09:06:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736442395; x=1737047195; 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=q0SipZjZSJ8RGOzW6wWIIrmkUJqEseFLNGa6w4kFsPM=; b=F4l/QF1kwZmBWiJ10uYOKqvAH27v5Q8KA2bmLN2FNSjn6wTHnz1v9WcY+7sYkWBFcY g+IMBAjgDPlvvagp+Pu+uxL1bZ4isBVXTDA09iYkTk+RdTJWOGJk2gpLlvqK5G2YawBg nOQBnYSNhm4Iiy0GwOwbPDhvoiA4MhqwT8gOsdCWlEK/Fv1HFYLuAzBKLd8gW4V411pW usAD3+XHAaPbGsy3KJixTi+pAQmCBDDu8Pf+YD/tGW7H9DWkd1NkhUUt5lDEQaPsfxjM S6aJvo3d35lylIwX8F3Qn4gXDz6hvj0hpuZBQVQHVxPpx5yAvtrMy+q5Jtsl8CKdqIPn Sw9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736442395; x=1737047195; 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=q0SipZjZSJ8RGOzW6wWIIrmkUJqEseFLNGa6w4kFsPM=; b=Czu7w+QtuTFi5zt9y0VxNOpdurZw9g86tEqtv8kmYyIL3JUMoSv67zki7eE0EEH7IN 1YPeS8Hxhc1zQgw4x9Rl6MRd0r7VY1FVRhYVQ23IC07uiWFVDhgtRpvCHlHhpaFl+oLe 8UuopdZNiwOLiG0NMS223dl+deF8cwspWJYgTBvaegz2YxtHrk5zgCC3HqaeC9WW+FTU 6zPQF9Lch1ra+1YclgSjNND13KkE85zsdv0yciOHcTDYo4h5TyjSP2ITRlXLXlCYX8rI j2W3EwawwkRVSz0U2VfT1qSquddtbh5hf1/hljLJrkoWI14PNfwb+tE37n9222/sR1sx KZ0Q== X-Gm-Message-State: AOJu0YzuUi6GMrOZ566smfpRiIZEStVhxGBzo8e+fj4AnUsq+5JkpSiJ Ei8M/jMS4hT2jSSRYpUwFpmM5FRVeXHMP7mCcZtVDMD9+w4uwTvGHZhVbOgRddg= X-Gm-Gg: ASbGncui5Pbp6x7aLcVCyCU+Y5cJssd0y07stX27TkqyC8ZUN2Udv3UvHaoHdzq36Q3 GwawyyuWj+0rZBhIvN9VtpizmzO9YO35dHhOic8Xcv9hqgpHwNsH66cK7TI6THxb3nDW27SiU05 JlHNKQkQaWhc8j2LCfz0jLsZt3qOaqWMZ4FfAM0klKcG8Lar2zmHdw1dYvcQVLAYZxgQgFudWyt mUkflT+RUx7DtRHJ06IEYA9NdGLiVUK3fOAQ2qk4OYkn9HCFeV/G+o= X-Received: by 2002:a05:6402:3225:b0:5d3:cf08:d64d with SMTP id 4fb4d7f45d1cf-5d972e6f2d4mr6960979a12.32.1736442395025; Thu, 09 Jan 2025 09:06:35 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5d995985a6asm571183a12.37.2025.01.09.09.06.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jan 2025 09:06:31 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 5F4B05F9F7; Thu, 9 Jan 2025 17:06:20 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: "Dr. David Alan Gilbert" , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Thomas Huth , Mahmoud Mandour , Alexandre Iooss , Richard Henderson , Paolo Bonzini , Laurent Vivier , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH 06/22] semihosting/console: Avoid including 'cpu.h' Date: Thu, 9 Jan 2025 17:06:03 +0000 Message-Id: <20250109170619.2271193-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250109170619.2271193-1-alex.bennee@linaro.org> References: <20250109170619.2271193-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::536; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x536.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé The CPUState structure is declared in "hw/core/cpu.h", the EXCP_HALTED definition in "exec/cpu-common.h". Both headers are indirectly include by "cpu.h". In order to remove "cpu.h" from "semihosting/console.h", explicitly include them in console.c, otherwise we'd get: ../semihosting/console.c:88:11: error: incomplete definition of type 'struct CPUState' 88 | cs->exception_index = EXCP_HALTED; | ~~^ ../semihosting/console.c:88:31: error: use of undeclared identifier 'EXCP_HALTED' 88 | cs->exception_index = EXCP_HALTED; | ^ Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20250103171037.11265-5-philmd@linaro.org> Signed-off-by: Alex Bennée --- include/semihosting/console.h | 2 -- semihosting/console.c | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/include/semihosting/console.h b/include/semihosting/console.h index bd78e5f03f..1c12e178ee 100644 --- a/include/semihosting/console.h +++ b/include/semihosting/console.h @@ -9,8 +9,6 @@ #ifndef SEMIHOST_CONSOLE_H #define SEMIHOST_CONSOLE_H -#include "cpu.h" - /** * qemu_semihosting_console_read: * @cs: CPUState diff --git a/semihosting/console.c b/semihosting/console.c index 60102bbab6..c3683a1566 100644 --- a/semihosting/console.c +++ b/semihosting/console.c @@ -18,14 +18,15 @@ #include "qemu/osdep.h" #include "semihosting/semihost.h" #include "semihosting/console.h" +#include "exec/cpu-common.h" #include "exec/gdbstub.h" -#include "exec/exec-all.h" #include "qemu/log.h" #include "chardev/char.h" #include "chardev/char-fe.h" #include "qemu/main-loop.h" #include "qapi/error.h" #include "qemu/fifo8.h" +#include "hw/core/cpu.h" /* Access to this structure is protected by the BQL */ typedef struct SemihostingConsole { From patchwork Thu Jan 9 17:06:04 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 855984 Delivered-To: patch@linaro.org Received: by 2002:adf:8b05:0:b0:385:e875:8a9e with SMTP id n5csp1335977wra; Thu, 9 Jan 2025 09:10:32 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW5w7Sm5gVQcXdINX03fuJxL/oFWILZntoYCARUADBYFUfad2OSb0WPO1WBeJ2ae21RA9z8PA==@linaro.org X-Google-Smtp-Source: AGHT+IFpTxLrLCocZOIxHPaW8F1mu64SRtiD295pTK1LxwavCayi72V7CqR4fJs4z+7vSiZ5IWzS X-Received: by 2002:a05:622a:558a:b0:467:7eb6:a007 with SMTP id d75a77b69052e-46c710e1747mr119058861cf.37.1736442632524; Thu, 09 Jan 2025 09:10:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736442632; cv=none; d=google.com; s=arc-20240605; b=j4zUw9+albE+BU51MQyvG935Bo40m81BGFApZAqj6bn9SCTjSVln56gDncYGYCh5VT cPQQSsk0jrYS8oS90OIyGWAvn2v3IKNsSyew0uiKZfVN7PUpZd954EhAO0Misf68UEXP phWFtX7DNU8lqbgJxDVIWHdicQW4vfcBqjZ1rfYjxdue0tAjv4FGH2Fs5mI9Mvga97Th nOY2c258T66MXaXerc/+/4e2TGYuIzkJsJPXjDoBfDaoeyMh7Qy5bfp811Y2TVRC1r8m zpTfA1hsd0LLrwVwm/oyYX5aQHLZR3oRJ2PwYpJYjfub+E44MqGHI8q7X732JrVkjhXc TFEA== 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=gi+ukBCOErHL45ERN6Ib1p4GgIF2LltQZlgS/5QMd38=; fh=FS+JTz/k+Dh1PAd9s6lkEQMFdt/HYT5+zFPDR3GvHJ0=; b=NMM9nKHpR7RIIjj3GPcnXGRiClIMU4ULn/hJInx4hmRzseCKpa2reeIR5iJpHXC04f PMkZXCrEWX3KGG1PB0ykTvVY0nm/6EWmUNCiFJxMU9x5GAz2ReKDMoxuAzcxo4Y1TGtK x37PrelfLB+ZoAwo4hxa4wbrg6XwbLgWkHsGUA1Nfx3MPQf2jXa21QM7Yc81+r1lpRHH L/tmYX9nEvdGFUIRMV6IyS/XlIwbQZmTDjGN7Dh60qMaCAHKlvEuLNufMAblVckKrW0V BP+62gKRNWutD7PIBx2wNaUzSRu/i9c4DJCgFIYoXUrgba30FEx2E2Z48T6JPDAGUI2k FFww==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lTHequDd; 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-46c873fc927si372491cf.408.2025.01.09.09.10.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 Jan 2025 09:10:32 -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=lTHequDd; 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 1tVvzg-0004lM-5j; Thu, 09 Jan 2025 12:06:52 -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 1tVvzV-0004iT-Na for qemu-devel@nongnu.org; Thu, 09 Jan 2025 12:06:42 -0500 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tVvzS-0006zu-Vu for qemu-devel@nongnu.org; Thu, 09 Jan 2025 12:06:41 -0500 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-aaf6b1a5f2bso429795966b.1 for ; Thu, 09 Jan 2025 09:06:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736442396; x=1737047196; 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=gi+ukBCOErHL45ERN6Ib1p4GgIF2LltQZlgS/5QMd38=; b=lTHequDd1XDS4yne+HhQQTdVt23zzJdgxKV7AFRIyWLjtGS+GaKfKQKDgZR6mfdnjW Wd6fa48lnhxWkdPbS7+E4LwFUmSOVrLloWpWV/xSa7/1aVGeZs0bx0jiwS81+pjPuEql D1ccyoAuqU7hvQp/+MrcV8J7Ruyun1+YPsSRZDS+dzMS/Op85g8hGG1yp2BQzBfER7bY cbvSTLtR5xnIAaEnLSUIFsaJvWUTmotY8AskkwkMlcIB5p0cWMYBeBK5ZcLwzG2rE/sU lUL7EnXMajnA4jqSkkAeOMtQBy+tsSgl139dltxP8tQJB/LKI8om5D8ehv7bSp6PvBPx KBjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736442396; x=1737047196; 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=gi+ukBCOErHL45ERN6Ib1p4GgIF2LltQZlgS/5QMd38=; b=Q6uJdRsp98k5WaiARLL1rZvIml5la7DZNIJ8JoRF1Nc+73VEYHy57SxlANgCA2I316 tfgFsAy2gvf/WOcg1Tp8ma2S0Z8+Zx1IYScvwLAqKHplimIJCOrNMauQrioAUnFTL2X2 L5vuoICA11fbhY1gfcDZo2uc5aMgZsGnLfJMxN7tmMzzjN8BpgyhSj4YxKr3XzE9MT7G 3xcfJpMBffV1kNkN3iA2HZtqIMYJc/6W57MLG3vx21GNPUD/FvnKqs4pJCfgOHpedT+K DHjHwdBPrd+n+Mn0kTk0nz9kzroZl6FIXCll8fZXg/3Zaj5dcHXepV8jCO0l9J+gZWCh NSDw== X-Gm-Message-State: AOJu0YwKnO03GpPeryJZlzA7Xv69d3WAgDdbNV2JKkAr2GpQpP897ipC Liqj2avYpIfixxgH6+kChIqdl6EEVsleodIHAX95cgA8o3QM2+cFk3+Q+krbrg8= X-Gm-Gg: ASbGncut8oZb4ZmxReAmMnPuP6hm+6HVGjW0p9Ej3DAlfAXpk3hZV4eAt7L1YlAVxH4 FPvKaoEdmctdsofvgisC+SPeRhpwhwLk2klJb0fJkyF/33aFRJo5IDXICQzGtU7Rhr3oRX4FEY4 /KqhLzXExsBUJlQlitK4HdvO8HO8MpS4/gCJjP/gH4TmzXzqwtvNkCHN5NNew5fzN5AARo+FuBx C4DJMfYXsK0SS7ZPX/a+XO5oWwoGWPfpDGJye5LW9ARzPZjEOTHqks= X-Received: by 2002:a17:907:1b05:b0:aab:a02c:764e with SMTP id a640c23a62f3a-ab2c3c7a0c6mr416537766b.14.1736442396325; Thu, 09 Jan 2025 09:06:36 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab2c9563b06sm89348266b.100.2025.01.09.09.06.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jan 2025 09:06:31 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 743DE5FA29; Thu, 9 Jan 2025 17:06:20 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: "Dr. David Alan Gilbert" , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Thomas Huth , Mahmoud Mandour , Alexandre Iooss , Richard Henderson , Paolo Bonzini , Laurent Vivier , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH 07/22] semihosting/meson: Build config.o and console.o once Date: Thu, 9 Jan 2025 17:06:04 +0000 Message-Id: <20250109170619.2271193-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250109170619.2271193-1-alex.bennee@linaro.org> References: <20250109170619.2271193-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::632; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x632.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé config.c and console.c don't use any target specific headers anymore, move them from specific_ss[] to system_ss[] so they are built once, but will also be linked once, removing global symbol clash in a single QEMU binary. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20250103171037.11265-6-philmd@linaro.org> Signed-off-by: Alex Bennée --- semihosting/meson.build | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/semihosting/meson.build b/semihosting/meson.build index 34933e5a19..86f5004bed 100644 --- a/semihosting/meson.build +++ b/semihosting/meson.build @@ -4,13 +4,16 @@ specific_ss.add(when: 'CONFIG_SEMIHOSTING', if_true: files( )) specific_ss.add(when: ['CONFIG_SEMIHOSTING', 'CONFIG_SYSTEM_ONLY'], if_true: files( - 'config.c', - 'console.c', 'uaccess.c', )) common_ss.add(when: ['CONFIG_SEMIHOSTING', 'CONFIG_SYSTEM_ONLY'], if_false: files('stubs-all.c')) -system_ss.add(when: ['CONFIG_SEMIHOSTING'], if_false: files('stubs-system.c')) +system_ss.add(when: ['CONFIG_SEMIHOSTING'], if_true: files( + 'config.c', + 'console.c', +), if_false: files( + 'stubs-system.c', +)) specific_ss.add(when: ['CONFIG_ARM_COMPATIBLE_SEMIHOSTING'], if_true: files('arm-compat-semi.c')) From patchwork Thu Jan 9 17:06:05 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 855975 Delivered-To: patch@linaro.org Received: by 2002:adf:8b05:0:b0:385:e875:8a9e with SMTP id n5csp1335109wra; Thu, 9 Jan 2025 09:08:46 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX68yZPu7m4f6Z0uFuhM3sRv5n9NDwFZRpuCsaxm838x/0GQVrDeHuDguMd3uxa35VoPaOqtQ==@linaro.org X-Google-Smtp-Source: AGHT+IGQkcFkEjtwpWB3JVyT9m5tS/zPLEVsudfR0benvxlRAkT/Vv7AlT/4wQPOY3KAWy1ok+22 X-Received: by 2002:a05:690c:7481:b0:6ef:805c:ea0d with SMTP id 00721157ae682-6f531227526mr68245677b3.16.1736442525759; Thu, 09 Jan 2025 09:08:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736442525; cv=none; d=google.com; s=arc-20240605; b=O5SrDU4jeRi7m8Ifg9SvMdEc6nbV88w1Zflhh4Mzorroh+0ZNw1/H74pIGI1/2kPwF 2+TuSznpod9dxoip4uuCjx2p7ziChw4q4A54I1yZwqcuHjCxLzy/WyIln1f7dcZlEv7I Oy3aiWFIWSTwtJLor/3zK0uP++KJ5LTf/Mkmw/fFWhpjD5udhw7urJAVWnN+fZzS3pGq G83LS0XkYfpMD5se2G78dFMJRq7pVf1XYHA5VANYaPXVepMsaIiDjMkM4+dm4MDHTvGC E/ljuAuuuJiZPo+fu3Qc34qfTpE0x/+RiIdyED4K490/8KYRSjVmTyurfqEW15V4nVuF rxzA== 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=m4HscSGSbgGDvVgJtmItkpjxqeI2JXO5tblvojQlyxc=; fh=FS+JTz/k+Dh1PAd9s6lkEQMFdt/HYT5+zFPDR3GvHJ0=; b=P4RzKnc5GQBzsAiWCYxxH+xHFBoS0L1mHoKrwKsYkeb+w1IksVrIZiLc5YyBn31K8v DGSj8bvjL1rU4AQGuKQOpLEbdvpjFpf4g2oLVnTFceMvF+dbgDv8eaYsqX1kew4yFjSf A/qo0BzfV/sV2hayzYVI4kgeF2vNPnU5/oKwRZNJEP+t419UfCFr/uh2+4sdOez61ig3 G48e3fteaId7duME4iwTBRxuDCeNokiobn8Qg0etD1Kp7ul1iGsUNEvdPZ97klFAFfTU pS3Ia+VvKN+r4bCQ5wJKa1zs3fm3NIcf36gquMLJMt/SUccT1hKmZWAhVuO1gfeAlju/ ja3Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HeUPOBUY; 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 00721157ae682-6f546d157bdsi11763187b3.217.2025.01.09.09.08.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 Jan 2025 09: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=HeUPOBUY; 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 1tVvzb-0004j6-1B; Thu, 09 Jan 2025 12:06: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 1tVvzQ-0004hW-QP for qemu-devel@nongnu.org; Thu, 09 Jan 2025 12:06:37 -0500 Received: from mail-ej1-x630.google.com ([2a00:1450: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 1tVvzP-0006zH-65 for qemu-devel@nongnu.org; Thu, 09 Jan 2025 12:06:36 -0500 Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-ab2aea81cd8so164078466b.2 for ; Thu, 09 Jan 2025 09:06:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736442393; x=1737047193; 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=m4HscSGSbgGDvVgJtmItkpjxqeI2JXO5tblvojQlyxc=; b=HeUPOBUYQQFyA25g4kvtKrB1ujRne8ADc2aJYvjaYbm0G3JmH0XW6LSBueQew/++gU RPlktqkiNFTcCsIPTQCUHcXxmuDTGkBAtH7bVk5i20nX3wcNEuBKQOI4zF3En983vWsw Snbzu8Z07VLPlecPuwAqEU+YRFV7gn0DgVAA3rvxw8N0o1maUg9X19jWW3Hhj6/08cuK NznReSjWdPOmP2FcOQq+3EXgJiDuJBTBYePJ4k9NyoGv0ifpWDqZ5Pu0RBIx4iZqVOrv /0Lz6rld7LVGZY5hEkeR3RVWb5u3Vpp5F4jAEF978inreU3RoP4X+yr3ZuX9aUQh/o16 DNCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736442393; x=1737047193; 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=m4HscSGSbgGDvVgJtmItkpjxqeI2JXO5tblvojQlyxc=; b=CM555AMAjX9bPkK8d554e4fdcY+aRz8jL+E21xCMNWwzBmRRZ3yiJdst6oY/Ux3jRh rpZUuT7r0CncUTrdqdbf1/27WZeDHj1fOAFdiRhFofHTIk7CFK8YeY3sytX+rWv3e0wz Q0XSDDSD111A4MyAlZSxjs/pZ4Clf3YEZTmFSqhg6apkUkGWyM4EzZsl8XO3Y7QoJL9T MFRIrZhMB7YZv8eBFk3ladb/pxpR+vBQIR6ZOXh1qM/ZlGylBVF4SbCjOKwNzOdtADOX LKqs8iXg4JSZNg7xMQ5P9iXsFjhocxTV/w2WzROgUx5e1sEqcJMINhEcFyRt9PCg08O8 Fp+g== X-Gm-Message-State: AOJu0YzEZE+DhbXffMK0ikeASCyLPPA/9qX+kfeYBf3difQ9nHnsQtIq hSSw5lztc51C8FiBjg8u3tPE2Hlj2y5/UHnmvihxbVKFxIMHKzTo+ZGxmaqtyDg= X-Gm-Gg: ASbGncuzESmsoE1Qgy2rwj2qy9teQFU9OCfu5KI1ejVeFUn+ktdG59GiiCTakhZH5jP zZiYWcmlqih1mA/mUPMaE7fINeudVk0/FKVA+y4NzwUmfGoYrGJEkWfHZm739sJn4aHKrXVcIVC vzcQeQqYvMH0PhZ3MYS9W6HaSyDD3U5cjLyZ3ZZoUcrGixkPmgoZpi/x6S0E52dxV5SFlBI+/Yo P0tM/nox1KwPzsj+w4jS2ztR2hCdiGQZBtXcKJ/zQ4SMqh9DSYgyko= X-Received: by 2002:a17:907:7e86:b0:aa6:92de:ddae with SMTP id a640c23a62f3a-ab2ab6a3fbemr654526166b.16.1736442393404; Thu, 09 Jan 2025 09:06:33 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab2c9060a4fsm90134366b.15.2025.01.09.09.06.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jan 2025 09:06:31 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 89A8C5FAA7; Thu, 9 Jan 2025 17:06:20 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: "Dr. David Alan Gilbert" , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Thomas Huth , Mahmoud Mandour , Alexandre Iooss , Richard Henderson , Paolo Bonzini , Laurent Vivier , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH 08/22] system/vl: more error exit into config enumeration code Date: Thu, 9 Jan 2025 17:06:05 +0000 Message-Id: <20250109170619.2271193-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250109170619.2271193-1-alex.bennee@linaro.org> References: <20250109170619.2271193-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-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 All of the failures to configure devices will result in QEMU exiting with an error code. In preparation for passing Error * down the chain re-name the iterator to foreach_device_config_or_exit and exit using &error_fatal instead of returning a failure indication. Signed-off-by: Alex Bennée Reviewed-by: Pierrick Bouvier Reviewed-by: Philippe Mathieu-Daudé --- system/vl.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/system/vl.c b/system/vl.c index 0843b7ab49..25d9968ccc 100644 --- a/system/vl.c +++ b/system/vl.c @@ -1307,7 +1307,14 @@ static void add_device_config(int type, const char *cmdline) QTAILQ_INSERT_TAIL(&device_configs, conf, next); } -static int foreach_device_config(int type, int (*func)(const char *cmdline)) +/** + * foreach_device_config_or_exit(): process per-device configs + * @type: device_config type + * @func: device specific config function, returning pass/fail + * + * Any failure is fatal and we exit with an error message. + */ +static void foreach_device_config_or_exit(int type, int (*func)(const char *cmdline)) { struct device_config *conf; int rc; @@ -1319,10 +1326,10 @@ static int foreach_device_config(int type, int (*func)(const char *cmdline)) rc = func(conf->cmdline); loc_pop(&conf->loc); if (rc) { - return rc; + error_setg(&error_fatal, "failed to configure: %s", conf->cmdline); + exit(1); } } - return 0; } static void qemu_disable_default_devices(void) @@ -2044,12 +2051,9 @@ static void qemu_create_late_backends(void) qemu_opts_foreach(qemu_find_opts("mon"), mon_init_func, NULL, &error_fatal); - if (foreach_device_config(DEV_SERIAL, serial_parse) < 0) - exit(1); - if (foreach_device_config(DEV_PARALLEL, parallel_parse) < 0) - exit(1); - if (foreach_device_config(DEV_DEBUGCON, debugcon_parse) < 0) - exit(1); + foreach_device_config_or_exit(DEV_SERIAL, serial_parse); + foreach_device_config_or_exit(DEV_PARALLEL, parallel_parse); + foreach_device_config_or_exit(DEV_DEBUGCON, debugcon_parse); /* now chardevs have been created we may have semihosting to connect */ qemu_semihosting_chardev_init(); @@ -2670,8 +2674,7 @@ static void qemu_create_cli_devices(void) /* init USB devices */ if (machine_usb(current_machine)) { - if (foreach_device_config(DEV_USB, usb_parse) < 0) - exit(1); + foreach_device_config_or_exit(DEV_USB, usb_parse); } /* init generic devices */ @@ -2718,10 +2721,8 @@ static bool qemu_machine_creation_done(Error **errp) exit(1); } - if (foreach_device_config(DEV_GDB, gdbserver_start) < 0) { - error_setg(errp, "could not start gdbserver"); - return false; - } + foreach_device_config_or_exit(DEV_GDB, gdbserver_start); + if (!vga_interface_created && !default_vga && vga_interface_type != VGA_NONE) { warn_report("A -vga option was passed but this machine " From patchwork Thu Jan 9 17:06:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 855983 Delivered-To: patch@linaro.org Received: by 2002:adf:8b05:0:b0:385:e875:8a9e with SMTP id n5csp1335923wra; Thu, 9 Jan 2025 09:10:25 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUfQKjmDAFfmrd2szJbjAlK9wyulBf6sZvmStSmwmUzLD4E0ooD4R6+EW30PU2DME3u3neqdA==@linaro.org X-Google-Smtp-Source: AGHT+IFhHe0N8DNsaG5otmqfh8nuMIF/gqMMiR/y2vt3KU8EUg1eL4HDwZEH39omsDS8JFnr4B82 X-Received: by 2002:ac8:580a:0:b0:467:652a:2c77 with SMTP id d75a77b69052e-46c7107df26mr130698011cf.3.1736442625503; Thu, 09 Jan 2025 09:10:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736442625; cv=none; d=google.com; s=arc-20240605; b=TQRdNrWuZw6oiFPNFoHSZakj2p/F2YBBT8Oee1uKXdTIkFbTnfWgkexoyoFH0mGPou 7JhLnXpgo61Q28nS3fC98UY1X34DQW1CnYhhl9G+aQFRzu3n2ETHA3wa3ZwfgnnyE7K2 6gncaR8vvrXTgUwfkteYlNdCkQZpheBrYcAT5YkI68KBTkNUdu59uNm5oEa8sPmCOiQm 2oDghSLheAPHNz6V9EEhmMZI1qlPeFOQBZwNtociBWNgRrohVtXv1XfsrJ0jyjbmYQCX qI+xz+IoYwTxPiuyMUmRCwDIWndEcnZcIx5Ui2Rs7tTIBv/ObgPlmDOLfFsnYH5K1pH4 hjxw== 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=25f+kPpL70YFXNAUtEYMY9S3pngwqu7v/kUd281l17o=; fh=FS+JTz/k+Dh1PAd9s6lkEQMFdt/HYT5+zFPDR3GvHJ0=; b=jdvuUpMTJq/VfcK0/JwrmUuaFH8crh0Hymio3vrLMpeI9eLOG87XkQ5YPn2ntrgt4n 6URLd4cxq5TNH96dioj6wdQ6DWh0GvlIeFqLPT6y+1JrM4XPhZI2ELePiUiCGZMephJy 59upRPyg5/lIGlg0V1jGVn9S6LFnmtD2iTG3kcedcN8JJvpdnr12PMoRtwe/J+IsGrcN ZHducbHsJQ4Md8R4mtcJAjOicq1694RIAN0Rm8qJUgk+vIg9WvBW5/EPjvErLaEjoB49 /FcnqH4hO/K7I0MccPeYb6bxdhSfvxFqDjqyIe5gymX2oZ/LmxNeEBaR8tgmvIpgPnjL 51FA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AaDDNfhq; 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-46c873312e9si548671cf.96.2025.01.09.09.10.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 Jan 2025 09:10:25 -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=AaDDNfhq; 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 1tVvzf-0004lC-Fh; Thu, 09 Jan 2025 12:06:51 -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 1tVvzU-0004iF-FZ for qemu-devel@nongnu.org; Thu, 09 Jan 2025 12:06:41 -0500 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tVvzR-0006zn-Sp for qemu-devel@nongnu.org; Thu, 09 Jan 2025 12:06:40 -0500 Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-5401e6efffcso1221374e87.3 for ; Thu, 09 Jan 2025 09:06:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736442396; x=1737047196; 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=25f+kPpL70YFXNAUtEYMY9S3pngwqu7v/kUd281l17o=; b=AaDDNfhq2GJblNOZTwu9syDqYPi6m+rbbpfp+M+VJ5x7XBh15wf7KUJCTUHtTGlW9Y hMeZjc+WfBauVfoxc1PQPJYTMiLfdJE0JMIPe6zcpPzJYw6gf63NE0cj8sC0PRLCrpVE vn0XeMx9BruVbMUaFltvZi332vNUw01JZkwdnJnIlxco4MrmAbOAUIhBJYXraTcTvHWN bQZR0jzbyYvuqSAtvpmGTH9fm9KcRiE4xlPyKD8h1/xUapGQ4dwq8V1wxu9/cn5GccmZ hscAgjvndGy+eMFbzZgMpm+aUw8aHVXE2VCaUya910gGDeIFaJSaJXBaH4YCtrdPISNq pCZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736442396; x=1737047196; 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=25f+kPpL70YFXNAUtEYMY9S3pngwqu7v/kUd281l17o=; b=RClLXqoZ/TCFQhdDOP56yX91B0DFXCGzF5w4zNP9SeswvBSihGu6XdLT7kxRbdefrT QbPo9yi/2rBgYzKvvnVOPEZW6wVcmFXEj7PAVeLkbNQj6W+MKy5h1//2oWSiQpVy53Cs QdiTLZehLONrxFYwZcFiubyyseH0v85lH7CwNdUW5qaIPPcr97Xa6ExtHktCsAZsDSyO 6OTxMbH8TkAtPzGIMyOAQ5GHrPfY9APHXl++6npwDAEGbaIdMtqpUuX57jhB0cNYMm/t w8UiR4yKVabyp+XnOf+3v3WdpnL9JL9arHxWf2nAxnr0+eRvguuGehXtwwr8nWHvKWS7 +HNg== X-Gm-Message-State: AOJu0Yz+DL4hVrbp1IE7wYRcXC64uR872SqcjRO/guGHvb6iB9dI4zlX i2+c/Vz/Ab2FEI4lGaYLlNhiKSSvmrLqz1J6CYPvq1mqTIJpi6QzEqqsyXv1ML0= X-Gm-Gg: ASbGncsk22KqZly6YeC1XMkHlEz72sB+YlTOuAwskYoyBRTua2kz5j5fg+f8wfly7Yx ScwSihBqzMIxxcbf/YUwfXRwVx1vTrKa94eaZXQpuLwP0zy9kaC6C9yRerDeiygkiLqLvjSrNEL ZLR1KdF3YsqnYRtTVimvti2SN3fUjYNrlqgUGQWclA4dlZPKt9pBjpVI94ItnuzcWMOECc37vxi yTNfgYeFe2GXAT8Oa3ZH2yo8Mb9bPZCm8UtM+Ty5i0VzFU/fTfM2B4= X-Received: by 2002:a05:6512:2399:b0:540:1ea7:44db with SMTP id 2adb3069b0e04-542845b1aedmr2713250e87.4.1736442395726; Thu, 09 Jan 2025 09:06:35 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab2c9562583sm87989566b.110.2025.01.09.09.06.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jan 2025 09:06:31 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id A06125FB65; Thu, 9 Jan 2025 17:06:20 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: "Dr. David Alan Gilbert" , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Thomas Huth , Mahmoud Mandour , Alexandre Iooss , Richard Henderson , Paolo Bonzini , Laurent Vivier , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH 09/22] system: squash usb_parse into a single function Date: Thu, 9 Jan 2025 17:06:06 +0000 Message-Id: <20250109170619.2271193-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250109170619.2271193-1-alex.bennee@linaro.org> References: <20250109170619.2271193-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12f; envelope-from=alex.bennee@linaro.org; helo=mail-lf1-x12f.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 We don't need to wrap usb_device_add as usb_parse is already gated with an if (machine_usb(current_machine)) check. Instead just assert and directly fail if usbdevice_create returns NULL. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé --- system/vl.c | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/system/vl.c b/system/vl.c index 25d9968ccc..df59cff865 100644 --- a/system/vl.c +++ b/system/vl.c @@ -811,31 +811,17 @@ static void configure_msg(QemuOpts *opts) /***********************************************************/ /* USB devices */ -static int usb_device_add(const char *devname) +static int usb_parse(const char *cmdline) { - USBDevice *dev = NULL; + g_assert(machine_usb(current_machine)); - if (!machine_usb(current_machine)) { + if (!usbdevice_create(cmdline)) { + error_report("could not add USB device '%s'", cmdline); return -1; } - - dev = usbdevice_create(devname); - if (!dev) - return -1; - return 0; } -static int usb_parse(const char *cmdline) -{ - int r; - r = usb_device_add(cmdline); - if (r < 0) { - error_report("could not add USB device '%s'", cmdline); - } - return r; -} - /***********************************************************/ /* machine registration */ From patchwork Thu Jan 9 17:06:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 855979 Delivered-To: patch@linaro.org Received: by 2002:adf:8b05:0:b0:385:e875:8a9e with SMTP id n5csp1335335wra; Thu, 9 Jan 2025 09:09:11 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUk2coM96NNhhAuxJfHWz5OCJsw2IWofc5xpCo0C9kcNXrXLTQKzFsLxH5G4PURCezV3j1bng==@linaro.org X-Google-Smtp-Source: AGHT+IGMxLB9w+TcyQ2uJIhlZ9AVLWe16jtcmeleFDA9kTDqGYyKaef9m1ttFsZSTaq22MbnYNwf X-Received: by 2002:a05:620a:178c:b0:7b6:e20c:1a0e with SMTP id af79cd13be357-7bcd9787b48mr1018327485a.51.1736442551490; Thu, 09 Jan 2025 09:09:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736442551; cv=none; d=google.com; s=arc-20240605; b=P6AIz0rEvu/Uaqggv9uW8ubDa8CZsp7ykMbICOEBnWrdcn4ESDEArOB+Lxk6InQ7uY /slGEvb48h7WKf/CDRK9jrUNf+sODz+z4uoJL87c6WsWFLCV1EFjXbhDzUUEwK/ey9hB FB9crAvl2b3wWQBxRq/tVSNOqHO2hgguX/VINYh2yqhW450bjprvZEWqqq+GGJtfVzdv hch1cWhhq7BCfCM/glLYIeVpVzU9tftRo2ONo4Jn07IMGIG1bj28r+ASdI0xmybwVhZT /35C/QKqL5aFKeBG4JRO3cE4Q7wsvPE0F7H47UqslRVRgu8sgMsPwqL7zT7PfTtS8Jdl 0zHA== 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=/WL5/vy6t1Ak67+R9S2PoF5hou1a9eAangsk5iwlrV8=; fh=C023il+t/wuXkBC+i6FIAWEg05cByuc5LnU/pyyfyxg=; b=iRHPVYqvOYfpKOl8F0LaSsLeQMQkyiAPZ6aRrWL6wx0PaH9O9PU6JvZmA1njS9f85l SzsfMMO7nmgz+kzDH1VxEY9N+HFVQnI6U2JX+ptj94ZcmM63TfHVGmuh5yqaenDBKJ4m h5pFU55+/b36UJ2cCWJqihHHtQWasuDBf6e4ArYnDl7ACrLBjyOlqU3Q1PMD0mpkU0TW RBrziDKTu1GwuWZoSPC+bb8dIy5WoNlo8XNTS329/0BZ8jOMqcR5Ndl6UPwyO3oZf5pb /QNdAIJI4THdT2EFkaQ656Tt1tg/k1KSksFlRxvLTHm9729ul+AVH1ROERzketaqQzed te6g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Tgi5n1Pf; 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-7bce3237011si186476385a.182.2025.01.09.09.09.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 Jan 2025 09:09:11 -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=Tgi5n1Pf; 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 1tVvzg-0004m5-N9; Thu, 09 Jan 2025 12:06:52 -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 1tVvzX-0004ia-3S for qemu-devel@nongnu.org; Thu, 09 Jan 2025 12:06:44 -0500 Received: from mail-ej1-x631.google.com ([2a00:1450:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tVvzT-00070B-Kl for qemu-devel@nongnu.org; Thu, 09 Jan 2025 12:06:42 -0500 Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-aaecf50578eso228730366b.2 for ; Thu, 09 Jan 2025 09:06:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736442398; x=1737047198; 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=/WL5/vy6t1Ak67+R9S2PoF5hou1a9eAangsk5iwlrV8=; b=Tgi5n1PfTeHliZFXC88QYiFDFJugzPUq15Xq9kB1+uqs2HOKGzWTdwyFfkiJ81mA6s 9RaU+47xGpSri8to9gJN87I2pPJnoKTXD0bXkawxh0uCr5mnjUdMgyaomVLG+2bK/KAH abfkzDIHa8PkS9uLfvwS8yTw7nWBHalgkpFza40VSZ/u8lWoQYcj4vyeiuDoiDqWpE/r DCGtSEBdYo/NjnUOVErIJ2euBlhBQXv+a/vTrVELyFaYfLs5AAbLPxN9RhKo34eKrvGy 3eFfSI7m+ADItg8fXWAwh7pk6dbAJrafxFfTYblW9x+d1JI2mmae+NSuvEZFzOHvXD1t FdXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736442398; x=1737047198; 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=/WL5/vy6t1Ak67+R9S2PoF5hou1a9eAangsk5iwlrV8=; b=c2nnYk3VDmWSuuLWXZLvVA/6OLjabhs5NfPwzXUQsfEszNaGfG0JaBCYYlClrvgDRE r2y+hJw4guYuP8kuFYKev36koh9kzKJ880to9Oysc8i8vWuM7be/7uho2af+z/n3gDOq uDb14Ui4tJpZ+SC2geTgWuuGYNKwuZXp14MaImBcPlbDF+U5kBYNOKnpRfbNUL+1O8ga Jl5qqJwXkGgc32m4G0Nhu3E3ugsYWj1S1k9Mg9PA93MfKU59bLfi4khWYvUtNdmjWhKg 8/ddhCy3770IP6lEJNChKdFRr4Pf1RfPRqQF4FyY+2xTU51c4eLlD3zNpLjpr3Z6Qp9v UTIA== X-Gm-Message-State: AOJu0YzS6xZolZiumqw9OAhyIxJ4s3jWVhYTICaVh+eB8CBG5BwnYAAu 8D2qlK3KKj5iyHPs7HUoon+RYJYpind+ksd4fFezD5FAoRiQrsp86fLEClSHKqI= X-Gm-Gg: ASbGncv4Z/TLLfERgQcpWY4pfi+fjH9e/AxNYcYZaZhQ8vdq0WgDCe5Zt3G+vhkP4tc 3nj39urdihdZqsr7EhuEWCd2KZAE8D6WZrzyvsPeuQ4CT+zBGszbRYANCU78LBEDlyUf8I5Gorb jl67Ub69vfvV7okld/wYfEUnCMar84pKv21I5ld8ssldT9uv8gHdCcHFqtrSJeTa38Eb3jX+A3M DoZFqk+wlCcathdxPPo0UGr20bMrzxYNETjRRoHq+Ii+OZsbzJaNUs= X-Received: by 2002:a17:907:7ea2:b0:aa6:7737:1991 with SMTP id a640c23a62f3a-ab2ab16a902mr676412566b.2.1736442398058; Thu, 09 Jan 2025 09:06:38 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab2c95b72ebsm87376466b.165.2025.01.09.09.06.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jan 2025 09:06:31 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id BD1555FC6C; Thu, 9 Jan 2025 17:06:20 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: "Dr. David Alan Gilbert" , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Thomas Huth , Mahmoud Mandour , Alexandre Iooss , Richard Henderson , Paolo Bonzini , Laurent Vivier , =?utf-8?q?Alex_Benn=C3=A9e?= , Ilya Leoshkevich Subject: [PATCH 10/22] system: propagate Error to gdbserver_start (and other device setups) Date: Thu, 9 Jan 2025 17:06:07 +0000 Message-Id: <20250109170619.2271193-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250109170619.2271193-1-alex.bennee@linaro.org> References: <20250109170619.2271193-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::631; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x631.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 This started as a clean-up to properly pass a Error handler to the gdbserver_start so we could do the right thing for command line and HMP invocations. Now that we have cleaned up foreach_device_config_or_exit() in earlier patches we can further simplify by it by passing &error_fatal instead of checking the return value. Having a return value is still useful for HMP though so tweak the return to use a simple bool instead. Signed-off-by: Alex Bennée Acked-by: Ilya Leoshkevich Reviewed-by: Pierrick Bouvier --- v2 - split some work into pre-cursor patches --- include/exec/gdbstub.h | 8 +++++- gdbstub/system.c | 22 ++++++++-------- gdbstub/user.c | 20 ++++++++------- linux-user/main.c | 6 +---- monitor/hmp-cmds.c | 2 +- system/vl.c | 58 ++++++++++++++++++++---------------------- 6 files changed, 59 insertions(+), 57 deletions(-) diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h index d73f424f56..0675b0b646 100644 --- a/include/exec/gdbstub.h +++ b/include/exec/gdbstub.h @@ -49,12 +49,18 @@ void gdb_unregister_coprocessor_all(CPUState *cpu); /** * gdbserver_start: start the gdb server * @port_or_device: connection spec for gdb + * @errp: error handle * * For CONFIG_USER this is either a tcp port or a path to a fifo. For * system emulation you can use a full chardev spec for your gdbserver * port. + * + * The error handle should be either &error_fatal (for start-up) or + * &error_warn (for QMP/HMP initiated sessions). + * + * Returns true when server successfully started. */ -int gdbserver_start(const char *port_or_device); +bool gdbserver_start(const char *port_or_device, Error **errp); /** * gdb_feature_builder_init() - Initialize GDBFeatureBuilder. diff --git a/gdbstub/system.c b/gdbstub/system.c index 2d9fdff2fe..8ce79fa88c 100644 --- a/gdbstub/system.c +++ b/gdbstub/system.c @@ -330,26 +330,27 @@ static void create_processes(GDBState *s) gdb_create_default_process(s); } -int gdbserver_start(const char *device) +bool gdbserver_start(const char *device, Error **errp) { Chardev *chr = NULL; Chardev *mon_chr; g_autoptr(GString) cs = g_string_new(device); if (!first_cpu) { - error_report("gdbstub: meaningless to attach gdb to a " - "machine without any CPU."); - return -1; + error_setg(errp, "gdbstub: meaningless to attach gdb to a " + "machine without any CPU."); + return false; } if (!gdb_supports_guest_debug()) { - error_report("gdbstub: current accelerator doesn't " - "support guest debugging"); - return -1; + error_setg(errp, "gdbstub: current accelerator doesn't " + "support guest debugging"); + return false; } if (cs->len == 0) { - return -1; + error_setg(errp, "gdbstub: missing connection string"); + return false; } trace_gdbstub_op_start(cs->str); @@ -374,7 +375,8 @@ int gdbserver_start(const char *device) */ chr = qemu_chr_new_noreplay("gdb", cs->str, true, NULL); if (!chr) { - return -1; + error_setg(errp, "gdbstub: couldn't create chardev"); + return false; } } @@ -406,7 +408,7 @@ int gdbserver_start(const char *device) gdbserver_system_state.mon_chr = mon_chr; gdb_syscall_reset(); - return 0; + return true; } static void register_types(void) diff --git a/gdbstub/user.c b/gdbstub/user.c index 0b4bfa9c48..fb8f6867ea 100644 --- a/gdbstub/user.c +++ b/gdbstub/user.c @@ -13,6 +13,7 @@ #include "qemu/bitops.h" #include "qemu/cutils.h" #include "qemu/sockets.h" +#include "qapi/error.h" #include "exec/hwaddr.h" #include "exec/tb-flush.h" #include "exec/gdbstub.h" @@ -372,15 +373,15 @@ static bool gdb_accept_tcp(int gdb_fd) return true; } -static int gdbserver_open_port(int port) +static int gdbserver_open_port(int port, Error **errp) { struct sockaddr_in sockaddr; int fd, ret; fd = socket(PF_INET, SOCK_STREAM, 0); if (fd < 0) { - perror("socket"); - return -1; + error_setg(errp, "Failed to bind socket: %s", strerror(errno)); + return false; } qemu_set_cloexec(fd); @@ -405,31 +406,32 @@ static int gdbserver_open_port(int port) return fd; } -int gdbserver_start(const char *port_or_path) +bool gdbserver_start(const char *port_or_path, Error **errp) { int port = g_ascii_strtoull(port_or_path, NULL, 10); int gdb_fd; if (port > 0) { - gdb_fd = gdbserver_open_port(port); + gdb_fd = gdbserver_open_port(port, errp); } else { gdb_fd = gdbserver_open_socket(port_or_path); } if (gdb_fd < 0) { - return -1; + return false; } if (port > 0 && gdb_accept_tcp(gdb_fd)) { - return 0; + return true; } else if (gdb_accept_socket(gdb_fd)) { gdbserver_user_state.socket_path = g_strdup(port_or_path); - return 0; + return true; } /* gone wrong */ close(gdb_fd); - return -1; + error_setg(errp, "gdbstub: failed to accept connection"); + return false; } void gdbserver_fork_start(void) diff --git a/linux-user/main.c b/linux-user/main.c index b97634a32d..7198fa0986 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -1023,11 +1023,7 @@ int main(int argc, char **argv, char **envp) target_cpu_copy_regs(env, regs); if (gdbstub) { - if (gdbserver_start(gdbstub) < 0) { - fprintf(stderr, "qemu: could not open gdbserver on %s\n", - gdbstub); - exit(EXIT_FAILURE); - } + gdbserver_start(gdbstub, &error_fatal); gdb_handlesig(cpu, 0, NULL, NULL, 0); } diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c index 80b2e5ff9f..0aa22e1ae2 100644 --- a/monitor/hmp-cmds.c +++ b/monitor/hmp-cmds.c @@ -285,7 +285,7 @@ void hmp_gdbserver(Monitor *mon, const QDict *qdict) device = "tcp::" DEFAULT_GDBSTUB_PORT; } - if (gdbserver_start(device) < 0) { + if (!gdbserver_start(device, &error_warn)) { monitor_printf(mon, "Could not open gdbserver on device '%s'\n", device); } else if (strcmp(device, "none") == 0) { diff --git a/system/vl.c b/system/vl.c index df59cff865..3c96fc957e 100644 --- a/system/vl.c +++ b/system/vl.c @@ -811,15 +811,15 @@ static void configure_msg(QemuOpts *opts) /***********************************************************/ /* USB devices */ -static int usb_parse(const char *cmdline) +static bool usb_parse(const char *cmdline, Error **errp) { g_assert(machine_usb(current_machine)); if (!usbdevice_create(cmdline)) { - error_report("could not add USB device '%s'", cmdline); - return -1; + error_setg(errp, "could not add USB device '%s'", cmdline); + return false; } - return 0; + return true; } /***********************************************************/ @@ -1298,23 +1298,19 @@ static void add_device_config(int type, const char *cmdline) * @type: device_config type * @func: device specific config function, returning pass/fail * - * Any failure is fatal and we exit with an error message. + * @func is called with the &error_fatal handler so device specific + * error messages can be reported on failure. */ -static void foreach_device_config_or_exit(int type, int (*func)(const char *cmdline)) +static void foreach_device_config_or_exit(int type, bool (*func)(const char *cmdline, Error **errp)) { struct device_config *conf; - int rc; QTAILQ_FOREACH(conf, &device_configs, next) { if (conf->type != type) continue; loc_push_restore(&conf->loc); - rc = func(conf->cmdline); + func(conf->cmdline, &error_fatal); loc_pop(&conf->loc); - if (rc) { - error_setg(&error_fatal, "failed to configure: %s", conf->cmdline); - exit(1); - } } } @@ -1445,7 +1441,7 @@ static void qemu_create_default_devices(void) } } -static int serial_parse(const char *devname) +static bool serial_parse(const char *devname, Error **errp) { int index = num_serial_hds; @@ -1460,13 +1456,13 @@ static int serial_parse(const char *devname) serial_hds[index] = qemu_chr_new_mux_mon(label, devname, NULL); if (!serial_hds[index]) { - error_report("could not connect serial device" - " to character backend '%s'", devname); - return -1; + error_setg(errp, "could not connect serial device" + " to character backend '%s'", devname); + return false; } } num_serial_hds++; - return 0; + return true; } Chardev *serial_hd(int i) @@ -1478,44 +1474,44 @@ Chardev *serial_hd(int i) return NULL; } -static int parallel_parse(const char *devname) +static bool parallel_parse(const char *devname, Error **errp) { static int index = 0; char label[32]; if (strcmp(devname, "none") == 0) - return 0; + return true; if (index == MAX_PARALLEL_PORTS) { - error_report("too many parallel ports"); - exit(1); + error_setg(errp, "too many parallel ports"); + return false; } snprintf(label, sizeof(label), "parallel%d", index); parallel_hds[index] = qemu_chr_new_mux_mon(label, devname, NULL); if (!parallel_hds[index]) { - error_report("could not connect parallel device" - " to character backend '%s'", devname); - return -1; + error_setg(errp, "could not connect parallel device" + " to character backend '%s'", devname); + return false; } index++; - return 0; + return true; } -static int debugcon_parse(const char *devname) +static bool debugcon_parse(const char *devname, Error **errp) { QemuOpts *opts; if (!qemu_chr_new_mux_mon("debugcon", devname, NULL)) { - error_report("invalid character backend '%s'", devname); - exit(1); + error_setg(errp, "invalid character backend '%s'", devname); + return false; } opts = qemu_opts_create(qemu_find_opts("device"), "debugcon", 1, NULL); if (!opts) { - error_report("already have a debugcon device"); - exit(1); + error_setg(errp, "already have a debugcon device"); + return false; } qemu_opt_set(opts, "driver", "isa-debugcon", &error_abort); qemu_opt_set(opts, "chardev", "debugcon", &error_abort); - return 0; + return true; } static gint machine_class_cmp(gconstpointer a, gconstpointer b) From patchwork Thu Jan 9 17:06:08 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 855969 Delivered-To: patch@linaro.org Received: by 2002:adf:8b05:0:b0:385:e875:8a9e with SMTP id n5csp1334917wra; Thu, 9 Jan 2025 09:08:21 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU6NVAVy3FWmKeAG0PwQSYxBj7buAvzZ0aJlttcZ4gvuzmqrGRMz8/nc84/ccW+z3Vi+vxwHg==@linaro.org X-Google-Smtp-Source: AGHT+IHFp1UGiPDOCaOmX+LlhqTm83k+Ez0V4tfYZqNxSMRrIqDFPWqqWseSaIiCU8BEHtW1aZpy X-Received: by 2002:a05:6102:ccd:b0:4af:f8b9:bea0 with SMTP id ada2fe7eead31-4b3d0e8d0d4mr7587770137.18.1736442501095; Thu, 09 Jan 2025 09:08:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736442501; cv=none; d=google.com; s=arc-20240605; b=JBmdLizIx75zMrCDZ1zVdRNEssRtyUfqQQPtTiqMMzDxYSHJBhP4hmbDWmZ15h0FEq G2GGUL7mUJCfUaCSGcmnlvvpxb0Ls/TOr59mLh6LfSK6f/PMpXb/A0kYpNSOskZQzTv8 KZ8oA1hrXd56d2kbzJmGKIpfIv4x47eDeZh2rrasv866iRJPQDpzc6GKXjAqR4HWbzXB qgGF+S+Met2YPzNjFenAOL/O8Lr8LCKwl8AhwCPFH5maDePb3G8UiFh8tPcbs2P81lt3 /cD2cqY1fLF+nzzwizhP/4YNtcXf7zztt0qqGvaz5OKSjNaiwfFik2KB0EBdbe1n4ETu 6xEw== 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=YoVYHxIQ6FzVx9Ejwb1qRhaSC8vYXzudlK+d3/Xo6Gs=; fh=FS+JTz/k+Dh1PAd9s6lkEQMFdt/HYT5+zFPDR3GvHJ0=; b=GyyC93k+CKhPz2j6fxiolf20C4LHHuXl57bNp6O6Sda6tmGJX6WC2c67vaYWmeytqk SoS1jnfnKofzlUm7pWuii6p9Zdkwfb+znRr0qecJguuz2aRP4Aq983VBE8y6xQMgD5fV IvVstepdXRE6Q4r/qW3IiOVVKnkpPCCsc5KMbosbmI6YoYDCeP1Hc+ykAPVFtACsyKtn yj8ORVGbTomYiixiDswGvl+2WyzsO7cS8ybYic2D5cW79Kq4uMQfwcBNQKIOxR6Dd1tr /As2RLFXon0n9+CkSIEH6Nq+A4cXO0QZAtfB9E+ExKDQMqqerXnLlv7zV2gtVjAgqFbs BuNA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LS5sJYGx; 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 ada2fe7eead31-4b6093e0366si632894137.671.2025.01.09.09.08.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 Jan 2025 09:08:21 -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=LS5sJYGx; 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 1tVvzg-0004lZ-AP; Thu, 09 Jan 2025 12:06:52 -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 1tVvzY-0004jG-UL for qemu-devel@nongnu.org; Thu, 09 Jan 2025 12:06:46 -0500 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tVvzW-00070V-SE for qemu-devel@nongnu.org; Thu, 09 Jan 2025 12:06:44 -0500 Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-ab2b29dfc65so189233966b.1 for ; Thu, 09 Jan 2025 09:06:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736442400; x=1737047200; 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=YoVYHxIQ6FzVx9Ejwb1qRhaSC8vYXzudlK+d3/Xo6Gs=; b=LS5sJYGxgl0bHdUEUNXEUY1wdMJjAHXIHyfLpsI3LRpL35z10ap8+KUOGxqxvl/Dtx C+GlJPjFTcpZaUHMGBcLyRr3s2e010cab8R0iQ/MmdTyPQKCS0R/0kaexXG70p7DXucf 4B+tvWTXsCtRKyiFU6M1C3XWhpokqj6rsV/zfZbJHDDgUMwK8EZFKsgUa7xnNqaBXesi qvNLevkthpIH8vItIRjGxEOKUbj7dgAPRZ5XfMtRgjYyq9pKXSxxG1Q6psG6BL4+LN14 /Hp++BmmnMoZV7VMmHP4b6HPTbieD0vZw44rjmkhqcHBzFikkKeJob39oGSE2J85qAst ao9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736442400; x=1737047200; 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=YoVYHxIQ6FzVx9Ejwb1qRhaSC8vYXzudlK+d3/Xo6Gs=; b=rakxKqftRXd69JEzkHFlQRAsAtZkn5j17ywhXzz50sXv2g6dYtvxXgvFIHNfoBdlvw OZEQCyPFjsksAXu/1VEmhENwf5cV/jJ/fqrz754uepmPiBoHKash3AjJL3DG4o9ZAuaF jSJUpWySVjg8wia6/cW/VRWFhHbfPYiNIsZt1duoJIn6uHwsNGxFp5GDgWfk26jvYGkb /NMbw8vkKhSb0K7CSjcbEXQU5F6ZWdmwdsKMFEQykkZZ4tFo4NYkIRs9hOcyj2Uy1C0+ EEASDh2DpiYfegEL8D79TxSlzqFmO7+9XiHHUUVI+M6CkyjEQL4f4aXlBEQiCvSGBmLa Dr9A== X-Gm-Message-State: AOJu0YycAd+WH0mVU3pcKO0ViauneXWCaXlXlhfmD98W+ZByq649I0WX xfybk1hpAzMiOhAgOjQhgpwmzz2INgh2c962O3M61IpbNmdJAgsVCFsxEoTNvw3azTyYpYeILKp TGrQ= X-Gm-Gg: ASbGncvOrrMrNmuVDj4lzwxWSSdavcCUIA0JhHstpqPCXFY6qbh3XqmIr9Eix1QtyXu yzHZKvEyeecFHiql+aYp6EOEoAhxipQE/ecJRgAjzha1pWh4HJt789PBDtyMduav5WODeDYkHYl gZEj66LuQDO06gAWuLgcFJO+Wox/zhGg/FydZKOUO0vZ7JFsl/3By1v/Oc6oBV8aVHhWyIY6b48 PPS3jLv36WkjeGS0bFkZvcMTXn/Lr6IumTrMgFsSSYDdfm9eDWGr8A= X-Received: by 2002:a17:907:72cb:b0:aab:daf0:3198 with SMTP id a640c23a62f3a-ab2abca7800mr620002166b.40.1736442400418; Thu, 09 Jan 2025 09:06:40 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab2c9060f9asm88891966b.1.2025.01.09.09.06.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jan 2025 09:06:38 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id D57BB5FC85; Thu, 9 Jan 2025 17:06:20 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: "Dr. David Alan Gilbert" , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Thomas Huth , Mahmoud Mandour , Alexandre Iooss , Richard Henderson , Paolo Bonzini , Laurent Vivier , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH 11/22] tests/tcg/plugins/insn: remove unused callback parameter Date: Thu, 9 Jan 2025 17:06:08 +0000 Message-Id: <20250109170619.2271193-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250109170619.2271193-1-alex.bennee@linaro.org> References: <20250109170619.2271193-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62d; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Pierrick Bouvier Reviewed-by: Alex Bennée Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier Message-Id: <20241217224306.2900490-2-pierrick.bouvier@linaro.org> Signed-off-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 baf2d07205..0c723cb9ed 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 Thu Jan 9 17:06:09 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 855977 Delivered-To: patch@linaro.org Received: by 2002:adf:8b05:0:b0:385:e875:8a9e with SMTP id n5csp1335209wra; Thu, 9 Jan 2025 09:08:58 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX6RgVHPsiVW90Elqf3mGpevh2OamB3XK4D8IKXnkJjwCOB0HremrgpSNP/vAgm4RGVUfo1Ug==@linaro.org X-Google-Smtp-Source: AGHT+IEmkwEdAtPz0Im6uRoJ3l7wudqHy3zrCvHCzyMahIJGaBe0ILcGEoshI0Kl6ID8gpgRDRtl X-Received: by 2002:a05:690c:9c0d:b0:6ea:ef9d:fcba with SMTP id 00721157ae682-6f5312230f6mr64546897b3.6.1736442538019; Thu, 09 Jan 2025 09:08:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736442538; cv=none; d=google.com; s=arc-20240605; b=QRlTPkXT/eD+f8/korxCcd2bsmGzLMZla7X1Um42fMGNMllLEQYCBfbLlR8scN7/Tf OFJwdp+8wEk8Fio1gIAMupR9fDs7FUnmJzzLu9VI7spJAqEUrMM6uJF1ooeGwO+KD+pe lNMeYT2uRZS0rWZ2EaJfRnEpYDMa6oNNewNqOefDaUTwl+1ZewWhvGBcOShqYRsxBwo/ W0IyPSozxRftg1ODlAe+KspfCxt0A/DrwH2giAij+8NOqb3fDbYjiMHyWeSR3Jtm/S6T aH2ql9/FBM2AlJGj1vOftOWor2DPpcUWieHX4oD3ipQLZCEvlQ4VV4e1JbcKIu/IgRbM QQUg== 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=4WxsgJL7chOGbG+/17n3vpjWqUAThC5sUhtSd92NFE0=; fh=FS+JTz/k+Dh1PAd9s6lkEQMFdt/HYT5+zFPDR3GvHJ0=; b=alKjEteI2o24rcxFwfY/F+/l5FPfRe+oUDTieiEfd8LAHoRqYRzbH2V389Ym6agZAE JZvJ+CYczfkHjUDPBKlEZizKnCrvrSUZ/wmld2RDRIa5WPYS+nex4OPGMIHSDKqVfkiq xYBSaCtDp4VjFRB++6CMdIDXRp4cuBiDoS8TGUnqsdz5h+I1lmnpIDSCvYSUBOc7lyxr YM/5i3Xfy57cW4QOBNxTFX5Tz/ux/FV0ts28iYPMySoDxLhNw2VRg2NZaQZKoXnG7HmK Pw7xOurQtV+AWBpZubRVz6GheseKRwr26L1Ym+qfdm+1PZxLAZizI4zCXqma3q0C+DRE 6hrg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vvYBbl19; 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 00721157ae682-6f546d10593si11545697b3.238.2025.01.09.09.08.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 Jan 2025 09:08:58 -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=vvYBbl19; 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 1tVvzf-0004lD-NH; Thu, 09 Jan 2025 12:06:51 -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 1tVvzc-0004kN-60 for qemu-devel@nongnu.org; Thu, 09 Jan 2025 12:06:48 -0500 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tVvza-00071d-Ji for qemu-devel@nongnu.org; Thu, 09 Jan 2025 12:06:47 -0500 Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-5d982de9547so2088757a12.2 for ; Thu, 09 Jan 2025 09:06:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736442405; x=1737047205; 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=4WxsgJL7chOGbG+/17n3vpjWqUAThC5sUhtSd92NFE0=; b=vvYBbl19KP5MVN838skQ62mP6o9yCISQmJlcMNkBQKUcDU2oIvnOAXC+UNccEQqLhf aj3muIL04sgnp6swsixCxArVBc47x7kl7OJ9RInQQM+e/8J2j0IEs6D7s3slBytBG4u0 UjeYuUhaAnNGgfJo0mnJ20R9M30eiX78Nh68Odu/W+pv/+5s6AMiCgb33EOiTpB3v6xw h+5eapFeuNLcy6dVfg54uzaMM7GGr48nzzBhrGXM4jWn4spKycECA545U2EdAghV3MHG Y1X4nPczhIx+1MogoJB767t1WA23wHED9Css9aVDlBTgJsbz4rSmKnkxqMokzSH3wp8Y 2RdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736442405; x=1737047205; 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=4WxsgJL7chOGbG+/17n3vpjWqUAThC5sUhtSd92NFE0=; b=to9HsttrdUN4YnBtfyK5eRAalgoYxl/QLvbgz6xQr43h9mMOyU72F0UHMuxbliloGP v5glvv3ib+d7MkcAIupU+NMuaBfh4vSUrv8rZ8HXqrxVGZSuz7aHuT42bHIZs7FOmiFW WHop7a+WzvWYwE5Fyi2LAcbBcI8vebJajib3FuIjpo8zIP6oG/gVNNS7tiK3l9M254uf T3F84mIkB4OFQtpQ5ZVdkQ35Cy5X5Xa9aUwa3kRTXG6sCW1LjimgCkduKw58h989RZsN PLaFubBolWHuqwvQvFwV4ypbdtbuYiAVcGgr8+4YJyP0P+vdeKHYboOrvJi0vhv6LhUI OWWw== X-Gm-Message-State: AOJu0YxoIW32tpR5dKQaOmFxcuEYJGIppM3fbjxy17AhYYzbIaq1sZXF skSPMkLwk/SRTVlCZtZrIUOg9qq8KM53ciZ7czoVlO5Vz2q6z05WEe7sWAige+E= X-Gm-Gg: ASbGnctEvqTuoQUo0X1LHS24NyNQQDIhDlraGtaiG7VCDCiuoxIjDf+ZIWEtb3diGVK ie+/rjddrJOJ4/hxbZ+jwmhhkJvRfc6cwevHzOXLVOTuhnwo5ECjtnQUxYTyV6HSTN8of+TgtUy xOwANk4z8O2ldKKJlUNmjSv27OOvZ02WNNxGYoZjzNkrJyZ29s+rA4CKfoNMYxtFidR2HFrzYT1 tb6D9i8pP6fz+ThOQmtRzuEJyE5mJGiNLF+Z599w9GAuvY17a1R4y0= X-Received: by 2002:a05:6402:26c4:b0:5d0:cca6:233a with SMTP id 4fb4d7f45d1cf-5d972e04ba8mr7336880a12.10.1736442404696; Thu, 09 Jan 2025 09:06:44 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5d9900c4b2fsm759923a12.29.2025.01.09.09.06.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jan 2025 09:06:38 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id E8B215FEF9; Thu, 9 Jan 2025 17:06:20 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: "Dr. David Alan Gilbert" , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Thomas Huth , Mahmoud Mandour , Alexandre Iooss , Richard Henderson , Paolo Bonzini , Laurent Vivier , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH 12/22] contrib/plugins/howvec: ensure we don't regress if this plugin is extended Date: Thu, 9 Jan 2025 17:06:09 +0000 Message-Id: <20250109170619.2271193-13-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250109170619.2271193-1-alex.bennee@linaro.org> References: <20250109170619.2271193-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52f; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x52f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Pierrick Bouvier Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier Message-Id: <20241217224306.2900490-3-pierrick.bouvier@linaro.org> Signed-off-by: Alex Bennée --- 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 9be67f7453..2aa9029c3f 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 Thu Jan 9 17:06:10 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 855972 Delivered-To: patch@linaro.org Received: by 2002:adf:8b05:0:b0:385:e875:8a9e with SMTP id n5csp1335028wra; Thu, 9 Jan 2025 09:08:36 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUHQiQvY5h07Z45rZadvy7hj5JjWDaYHU6RfN7CRSzFfoNBOm+we+Dp/xceI931k0PpyHtuHQ==@linaro.org X-Google-Smtp-Source: AGHT+IHRTrPDmD7hrYF6D7pRPTaqxoCTCriRx3Y+m/F2i/WqUPDlaSaETom95fc4dmGoicODI0dO X-Received: by 2002:a05:690c:4681:b0:6ef:4b3f:3bc3 with SMTP id 00721157ae682-6f531220b53mr67194867b3.16.1736442516183; Thu, 09 Jan 2025 09:08:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736442516; cv=none; d=google.com; s=arc-20240605; b=CWsIGoIIrCFrjsi3p6JHpuEvp4rhAQ6DzN8tDU1fT6cjGkRx3L+f6uPdgHzFNFFJby vWpKMRBJX+2aq0583luG10H6TkVjNmwA09r0ZKDvwVtTC1/yqPf3FmiNAFh81LjpANPF gLBHMGaA6f5kazrO8LtMlaeG9W7I+biYjd0LbZOkJ+pMHHML/G2Sfj9w1Ri9JSS/n5yI 9YoShq9ZHRipdMn34YENa2hBdlpnEFjbq563b9jI3TMPudmArXqHcHSmrdIZMIkbIEBH YdF7DqoG+7ml/plIoy5PRkUKfvVl2CuGNXKhh3t6WxVLRahpeX9+U7nipY/Z69psFeWU kuVQ== 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=v2wuVbnc7sEvmDoO7gmBrl9t4VirrSgx6WEqdbF/SEU=; fh=FS+JTz/k+Dh1PAd9s6lkEQMFdt/HYT5+zFPDR3GvHJ0=; b=U3DqeY2hXmYwk353qlqLTt0UO8QfenREdyZGjsuMcc9IsqaYpZ1djsu5CIcVZFlD38 HJ798Ofp+azriHHx5gzmK1of/wjfhm1wA1QQGMUGH49dn9pcVc9kTkMXOA4c5nSgiNhY YAzfKu9eyl/sk0mWcn783P2mgvwazkoucPGPl/l8a+0PtVkQNWkYyF2j/2LVySAGVjN8 L4weTGkfxJRt9z7yRLqeNwK9CgU/y7ODPaVV7jRxX065dE3u+MV6xn8vh3RQM87u3Pat njVaFAYVsZDcqN0fuGuD5sbBf66gW8dWTArRBJeV8jVubnr21kXt98OVphiJPdGQHv1/ 4MVg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mCHYkwnL; 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 3f1490d57ef6-e55be25dd95si38506276.241.2025.01.09.09.08.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 Jan 2025 09:08:36 -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=mCHYkwnL; 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 1tVvzi-0004nc-8T; Thu, 09 Jan 2025 12:06:54 -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 1tVvzY-0004jF-Ua for qemu-devel@nongnu.org; Thu, 09 Jan 2025 12:06:46 -0500 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tVvzW-00070h-Sk for qemu-devel@nongnu.org; Thu, 09 Jan 2025 12:06:44 -0500 Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-aa692211331so220715566b.1 for ; Thu, 09 Jan 2025 09:06:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736442401; x=1737047201; 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=v2wuVbnc7sEvmDoO7gmBrl9t4VirrSgx6WEqdbF/SEU=; b=mCHYkwnLpwt2v+1fH9+Oi1r3b2jCtd7AM4Wm+aDuu2Q1myIHVBsf6G+ikKS0+Dk0LM yk5bWsGI9ZPFqnkGUILduPzyhGgwGDaNRp5BLmk0npjYe6peNS8tATr9Fu4ma4XyI5a4 PotSxFiBDiZUxLwV/BH0Rrzym+TpqeCpbRRos2WQ0kPdGgwblMXjs6fNfGo/gaOZv6E6 aKEEMSiV1sZ0NXCGaCMUVNLOpA/8ZGZgne8E4fVXL515TPRA14cTSaRQM9Pub1dckmn4 J2Ch9ESE1krx/ebqcFQZdXR0D67jEt/o4K6Ks0LBYVIJXBZSGHfCjMjwvfxzmVtum05k 285Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736442401; x=1737047201; 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=v2wuVbnc7sEvmDoO7gmBrl9t4VirrSgx6WEqdbF/SEU=; b=UcfhxehFNUa2LpJbo6Acc26WgNqgiahOMwa6DtdKR/w2FyIk02liU9fpD3qJr6QOj8 ROGh/8zyHowWxDbkO+ZLY/r59BGQbvq8TSQLaYNQCB25SGx/MqKtQg8AuKy1wFCUzk8x U4dEOJHSg8OQjKeTcG1x4JDKyEz++9eXJrMtWdb2wV+E+LPQGwAGtnGmUhQvBNSvUpaI 9jDop9MJwYPtL1pQipmCX5Sb8UxKsPRiGke721FPfWyfnat2K4A9Yv2IWgyEw6IHyxGr U0wgNd38F8C7kOZeWpiM/ViTn+coLpER9ZPXwf7KIrJ90DdJeXsxEpVGDdrfIDoyudFL EdVA== X-Gm-Message-State: AOJu0YxKPVh/nSnE+RB8iLsZ/S3fDWPQFqBBMR9q08X7DoxenVTOLtwD Ue3Kon5nqz9FtKE84Yj3K+Am8qv8N+6YGn7rvTcslcN71GDAu41e6/FYUHYetIg= X-Gm-Gg: ASbGncsZ/uykLGPrE/vqRBJoqAXOOP86Tb2Mc2zUtlpWUPGU5fkhL7btlS4emrxF7Qw JjugwuFAAc2WNQoA0Jy+p4WG9vWbscJ8r6+O7U3/40yZVsGdylVGi9vD113U+ul5hkYd+yaP23g YxqCxSqHzscRLw3b3SrgaDzYdXgwVYbwsAdowAvtwpryYQHbdDvbgiRqZ8jJ8I0/cXI3x6ntqkI s9P/7n73vY7Ffn/54oPxz3KP1Je6FINfHwgb5OBQeBS/9Se8NWO4Bc= X-Received: by 2002:a17:907:1c23:b0:aa6:9d09:b17b with SMTP id a640c23a62f3a-ab2c3daffc0mr320885366b.28.1736442401006; Thu, 09 Jan 2025 09:06:41 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab2c905ecb7sm89462366b.26.2025.01.09.09.06.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jan 2025 09:06:38 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 0C85A60030; Thu, 9 Jan 2025 17:06:21 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: "Dr. David Alan Gilbert" , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Thomas Huth , Mahmoud Mandour , Alexandre Iooss , Richard Henderson , Paolo Bonzini , Laurent Vivier , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH 13/22] tests/tcg/plugins/syscall: fix 32-bit build Date: Thu, 9 Jan 2025 17:06:10 +0000 Message-Id: <20250109170619.2271193-14-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250109170619.2271193-1-alex.bennee@linaro.org> References: <20250109170619.2271193-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::629; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x629.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Pierrick Bouvier Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier Message-Id: <20241217224306.2900490-4-pierrick.bouvier@linaro.org> Signed-off-by: Alex Bennée --- 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 ff452178b1..47aad55fc1 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 Thu Jan 9 17:06:11 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 855966 Delivered-To: patch@linaro.org Received: by 2002:adf:8b05:0:b0:385:e875:8a9e with SMTP id n5csp1334356wra; Thu, 9 Jan 2025 09:07:20 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXa+UdN8FcUGolzTZfqtNO67d1Abb57J8o3JH0fin3ljFrlc0sqKu+ixhn6r2bCxufAUEpwpw==@linaro.org X-Google-Smtp-Source: AGHT+IGkbstkn7F74IuRGBLUxR1h9q40FcNSOQFm8mjLmW/U/d9fI5X9nfhPQ7OcUOZq/dzoqVn8 X-Received: by 2002:a05:6000:184d:b0:388:e3e6:69cb with SMTP id ffacd0b85a97d-38a8730e022mr6856066f8f.37.1736442439977; Thu, 09 Jan 2025 09:07:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736442439; cv=none; d=google.com; s=arc-20240605; b=gocsSCJH19WVqhxzNZX1RqgRJeGx8MpsLybsZJk0bs0GA69EoTocTdcCTohRoLi669 ywGiVUKPoex9aVGaW08EP43tvo6KIH4dIYCli/d1e6EYjKvSOmC6ahLg4n11BWvniaYk vUGQlwlFZ7jDjJhPj++gEDQTDl/LbVX3FFdaDitUTPA6EuObBETlyW4iefLndj1QyBIn G/r+YvloAHblb7MvljCmyHUHAACvtR5/DDP1Ea8PmwCErcGp9y5WCWGICvZ9+ADeI0Dz A4NuSgb1t7rW53hnTHMIrbt1bHf/Aaw28FJYkH4n/JyWLJwaBh/+/FXRID0DymmDu0Ee hbTg== 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=xbdq8PuzmcKgRuOS6aY93DBa464+R41QKxYxX1E5oro=; fh=FS+JTz/k+Dh1PAd9s6lkEQMFdt/HYT5+zFPDR3GvHJ0=; b=F5eZIcszojqdWYrdRmPAJj3VHZJBJx3Eofk8zhIa5kH1XIMl9XQ2rjx4fFLg3AWvSN z2H+OW7nqLwIwp+Nrscy/qenJ2fvtH4tFD77cGU5DTucqVndqqfcGD2R8H4aMihsYacF gK519aiTzdqSc7AiwbIoQeC2uNejqyZXEjnjnGd7hbXan/QSCYGe79cvIgJslV3GVswF HY5f3O4I0mW9oA7IjDkg7ZbddzewttPJ/XQ9f0BTtH1byLHyWiXPwIVimxja8TX7x7vY rv7sICKdqmI63KAFOPeziXIoC/vxVSODUsI6Fr88voM0PKun4yReY0DnGKhAmnVcudWi VgHw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qRA0C7Pn; 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 ffacd0b85a97d-38a8e4deeedsi1204172f8f.808.2025.01.09.09.07.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 Jan 2025 09:07:19 -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=qRA0C7Pn; 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 1tVvzd-0004kZ-7T; Thu, 09 Jan 2025 12:06:50 -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 1tVvza-0004jf-QO for qemu-devel@nongnu.org; Thu, 09 Jan 2025 12:06:47 -0500 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tVvzY-00070t-NH for qemu-devel@nongnu.org; Thu, 09 Jan 2025 12:06:46 -0500 Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-aa6a92f863cso241074266b.1 for ; Thu, 09 Jan 2025 09:06:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736442402; x=1737047202; 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=xbdq8PuzmcKgRuOS6aY93DBa464+R41QKxYxX1E5oro=; b=qRA0C7Pnvk3CrPfvG/QzWuEmWmTOkfgRfg7E3BjXjo/94RdsMctt2qs1nxzgS1+Jog qhhQhpvTuVmSiP8tJBEtHive7Bq27gh4+2XnpzluT+3y3Fi6kuLRlvNmSNuVZsaN0MM1 Drlbj1f2iEad/1JRWWzz841u+J3v4ne5h6sRa4WyRyNP0Wq3kpT1WwDsybcIaP51aOMo 0UQ5uXTj1mdpimt5CAHbPxnr64ncrijF71sTpsxA3SnrqUuz1G4UFMBwFYOZucrwVbui y4lT80mn0HF65dZZPzfS3Rs0SkeSFYS9THd0I/Bg6ifamU84Eknklefl1KFkER7YrpAB YFTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736442402; x=1737047202; 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=xbdq8PuzmcKgRuOS6aY93DBa464+R41QKxYxX1E5oro=; b=FleZ6/KJXi8I71HefJdSeZctby8QVG8ZcsQEK81HXy5xhD9TkxMNocCMgcdNOhUQgv BqiF+C18kPGA52UxVytzbe62bRamvWMecLZ6Gz7QXY0y9Cu6WUIVjkqZ8ni4/0cNsSIf TiuxRuKdLB7r2gNng2XbYjM6oHBpgbrLwVa6Linu1gk7mJM3ckBeA54buCfrNvDUUm7J eCmoLtj3ZU0c+fA7lkN0XDiTWYIjIrsLv+ANNrwReHF0KdP9UbSNO+l11fxsvzmOTnC9 D1y8cNWTni6//sqq+MWkkID2BDrUkVcvECedLAWQGPlbx6UFXOWWj+GYsQ5d2WQ8hjzh +/tw== X-Gm-Message-State: AOJu0YzacUn5LIf6VmtWE5cKTjEEaHIobe/P9cLEvLsFAPKy2m7IuHI6 WTRAsRuZ0umsgKfoixYAZgjck/M0fKkcbDVUfIhJ3BtyDH1pdceBHubM0yAFY/I= X-Gm-Gg: ASbGncvdWR4lW2X+yGvbGXV/htEeHO9rGjuuxIiALK+zEA/viH6U+TBP2lS/+4A2eA2 vK+tlit9KltXJEdi8F1sAN8HIZ1K6yHw4FU5FgK0h0TWNBG13iUFnsY8i6yDI+YCUTkkS6oTt1F Y9g3g9jclqG2sf3Ln5CAYebioB60r6IE5rp9fZAL5244CskdXuGyLDQvjhk6bqVUo6sPGhzHoV/ JvWEWWvCClOIzZhelSR6zu3E3ChElILazZNfVO5j6i804OB5FScOWk= X-Received: by 2002:a17:907:3f86:b0:aa6:c169:4e21 with SMTP id a640c23a62f3a-ab2ab6a8e8emr619263266b.6.1736442401987; Thu, 09 Jan 2025 09:06:41 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab2c956258fsm89110266b.107.2025.01.09.09.06.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jan 2025 09:06:38 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 2436260132; Thu, 9 Jan 2025 17:06:21 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: "Dr. David Alan Gilbert" , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Thomas Huth , Mahmoud Mandour , Alexandre Iooss , Richard Henderson , Paolo Bonzini , Laurent Vivier , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH 14/22] tests/tcg/plugins/mem: fix 32-bit build Date: Thu, 9 Jan 2025 17:06:11 +0000 Message-Id: <20250109170619.2271193-15-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250109170619.2271193-1-alex.bennee@linaro.org> References: <20250109170619.2271193-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62b; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Pierrick Bouvier Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier Message-Id: <20241217224306.2900490-5-pierrick.bouvier@linaro.org> Signed-off-by: Alex Bennée --- 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 b0fa8a9f27..d87d6628e0 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 Thu Jan 9 17:06:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 855974 Delivered-To: patch@linaro.org Received: by 2002:adf:8b05:0:b0:385:e875:8a9e with SMTP id n5csp1335093wra; Thu, 9 Jan 2025 09:08:45 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX/1Ed/hqz9M77GUAViIxMJMQVGWE6FtEl0xMpmFkd4srv1DDATut0EffAzublC7izhWiHrxQ==@linaro.org X-Google-Smtp-Source: AGHT+IHWOmx/28YhSFzQlXNJwglqkH244o+Sz/6cUqSHqVPluj5a9LAZkObV+6xmWxHpCP3ZABW0 X-Received: by 2002:a05:690c:23c6:b0:6d4:4a0c:fcf0 with SMTP id 00721157ae682-6f531241ec8mr64538537b3.20.1736442524767; Thu, 09 Jan 2025 09:08:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736442524; cv=none; d=google.com; s=arc-20240605; b=H9ar4MyJqhTVRRhjz3xzsCrnWWvL9OgBUe/MzELWe+XV4K2Knqos6TGqKjhxuTAvkN 4iiibQrAAwulwu2tdTxhyYZJh3YwpZ7xH1TAxa269CALvusz29JoZpzTRDSz/gGzMBvc DuMsKKUds/wyO7os7jZoAnRWEO6ZhgFDo+Ai4l1bZHMLMlMTjWfKe/+pbBfTdsctk5sa dCeMetxd9EvrHCTBWSbMe/nPr6x8Q6IBjZyDrrM2lYYV2ho+6pXdwn9Db8HBlf1MTy91 vc8/eq31jmoZn3F96hp8i0/bILg+QhU2381VtCo5UsMZqOVx5e91ATbm/OjWoP439FyD S/pw== 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=Ut5L3H7ENukAVXMf9ucpT4mEYkt3Qt71rdTcSo9h+fA=; fh=FS+JTz/k+Dh1PAd9s6lkEQMFdt/HYT5+zFPDR3GvHJ0=; b=L1qKnY06VKvquEc9jjSZ1B0MhGQbsbU5TxwQg5Bpu/jwSG+f5j6mLEgn2LKJ37Fx9s iVFUejeOXGHrnc5m1MPBMrhWirBHXqlDgq1ypHE5KCqCoferznfEfymccLi++pZ1+DnC mYGaYNk4HrMhEunuNjWpPlnysrLn+cKrTS9/6MBUreQnuPRljM8gWF4Oo4l5YUtr0KME xj1H0kPqjs51NHIEv9ZxttNC3kUF/omFFvSKz+A5r/z5pAVvElKytBizS9YhyYoI+mxH zb+Qy1+qOG+rqoKE9YDngs402/9JJBtGbqev3va+cy/7R5fgmI7nq02xQL/KjqhCLa3Z MVqw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pNeAFtsS; 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 00721157ae682-6f546d81a71si10589177b3.460.2025.01.09.09.08.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 Jan 2025 09:08:44 -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=pNeAFtsS; 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 1tVvzl-0004pl-K9; Thu, 09 Jan 2025 12:06:57 -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 1tVvza-0004jg-QK for qemu-devel@nongnu.org; Thu, 09 Jan 2025 12:06:47 -0500 Received: from mail-ej1-x630.google.com ([2a00:1450: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 1tVvzY-000713-NS for qemu-devel@nongnu.org; Thu, 09 Jan 2025 12:06:46 -0500 Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-aaeec07b705so201615366b.2 for ; Thu, 09 Jan 2025 09:06:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736442403; x=1737047203; 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=Ut5L3H7ENukAVXMf9ucpT4mEYkt3Qt71rdTcSo9h+fA=; b=pNeAFtsS07JUQGrjKwQwmhuF9qR1RGXeF3fcCo1I+gLfofvYdPG4NZmelf2jY4QkiL 39FgRrvQ0TG7ZkcBAxsdpKM4s/pVbS16CaoWzETbeq6/Qnv/iCI9E/inPm2ibHFQlAjC TR7i7lHPxI4to9rFIQ6tIUnaYGUH7Lusi1TexKjJYBQB7L99XsQgujx0lREu/0c1dEg0 AHxn2Qe1HVoTPBWTVyMFC8n6Rq5ojqcUbWQnM8Rw5bRnWlLa1ANbuDS6ksZ+FzTD21iq CZxwVzYA21JzATlro2c50oKuokE3tPwGcRQFIYJk3F1s1/9Joe/4xIjyqaNzAY5HuvqX WfHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736442403; x=1737047203; 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=Ut5L3H7ENukAVXMf9ucpT4mEYkt3Qt71rdTcSo9h+fA=; b=A9CVImicdtzlmfGkqG1xyy8geLgXkeZNuQA1IBCQzv6ud7mRoyqv2jsphsmVu7EGdO 3kFtsLz++2Mk3IFoFbLook17h7fJ4WAWMpXMPei4BxxcGcfFRHyYkvheF+ErlxQqBtrO 2U1x1Khz0DxfAQGZoFL2gf+958aSk9QQkoZp2o/3vGILITWgOVf8Ke55Ud3Ep8hnv4sr u3gC321T9JHh2o5xUcKfx32dhdK8gVe1TtO9bTKwRm08lnAOqvniGiT7b2o9qrPwNOG+ C5Ol48G4Npqa8COrdiQGBaXLe/ee/6/gqFegx+IKHR+3zTpmKzZKIfZplzDCrmCw8JBM Sl2g== X-Gm-Message-State: AOJu0YzhP6avJFVJfbW4joBIPte3R6V9hQBXr2RYPIiXwN1HJMUWDlni CF+5GDRURN4OC4kYrvSMnDlcPZr3yXxS0CqDyEqE3VhFxSz+Dz7rbD9LsaGhZf0= X-Gm-Gg: ASbGncsEexvFagnPyTUP1APjDvKTJvZ92smEWUaBWQRP9r/nX++qchc9R00VzcVeAs6 QY3IGkcTmudj6otDk+D4v5fVS5aJZtksUhpaVAUlvQgNvuCRcZREAdgQW7OndB32ixK7s3Ejml/ Q6x6mSjJW+Z1HYcvL5rkXCdnwPr9s10vfaV44oFmof4hfnE8Ht1SGyvbaN0jqNE/M1YeQRBi3Ny 5I4EsdBKQH+cyDu3CcXp6YkBPzX0oa+PNrYJPbzmcCj7I3apRCp254= X-Received: by 2002:a17:907:9722:b0:aab:d8e4:2062 with SMTP id a640c23a62f3a-ab2abde5646mr767667166b.56.1736442402883; Thu, 09 Jan 2025 09:06:42 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab2c95b0ab6sm87944666b.155.2025.01.09.09.06.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jan 2025 09:06:38 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 3A80D6017C; Thu, 9 Jan 2025 17:06:21 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: "Dr. David Alan Gilbert" , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Thomas Huth , Mahmoud Mandour , Alexandre Iooss , Richard Henderson , Paolo Bonzini , Laurent Vivier , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH 15/22] contrib/plugins/stoptrigger: fix 32-bit build Date: Thu, 9 Jan 2025 17:06:12 +0000 Message-Id: <20250109170619.2271193-16-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250109170619.2271193-1-alex.bennee@linaro.org> References: <20250109170619.2271193-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-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 From: Pierrick Bouvier Signed-off-by: Pierrick Bouvier Reviewed-by: Richard Henderson Message-Id: <20241217224306.2900490-6-pierrick.bouvier@linaro.org> Signed-off-by: Alex Bennée --- 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 03ee22f4c6..b3a6ed66a7 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 Thu Jan 9 17:06:13 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 855978 Delivered-To: patch@linaro.org Received: by 2002:adf:8b05:0:b0:385:e875:8a9e with SMTP id n5csp1335287wra; Thu, 9 Jan 2025 09:09:06 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW73Pz8q1H9yJIjL5VlbQlSXyr3uyzZ+6HeSZPtupUfSyBEEkPNWZEZ3tZ7h+F7/LEbef39dQ==@linaro.org X-Google-Smtp-Source: AGHT+IGfAADsWXJEtczCKO/CMD8dzQICxTGYUoR7FLx1ykcDNYf6XhhJmbJL6EgHn3jqVzwmpbFE X-Received: by 2002:a05:6102:38cc:b0:4b1:1439:b4f0 with SMTP id ada2fe7eead31-4b3d0e651e3mr7352839137.20.1736442546468; Thu, 09 Jan 2025 09:09:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736442546; cv=none; d=google.com; s=arc-20240605; b=XM7xNWm8vRwxGNHRtyJMvFlqPIaO4nlJZBpdgib+CU+BXN76fp6EQJ//KXGiWi3+xa fI9Vk1o8LlMOeUn4GbdkWIFW5f4uyi7Fe1gG30Wlumibq69ObrBYeuUDEYjcQYKDsw4+ kG/WTQReGmqJzh+qGZEErWHDoizgwoded60egoViJdIWZkVBeBEHKl9z2iodUDRYboGg HE9ptcoFP5a29EEdmKp4ocC6TR6JckhM5XNtTXrq2LaAB6lh8jiOnOe8lPr7bi/DfJ/q FJpjnVF+q29qhZH51SQm36T2WTUuu0aFXyXwwd3Ef/Ymq0Vr3NMzMGPANc1o9F6WcSFJ v5GA== 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=Z/fE5ihsW9j0TdJrNyGqxXoPll6S7jQ7QqKUoC+ldgQ=; fh=FS+JTz/k+Dh1PAd9s6lkEQMFdt/HYT5+zFPDR3GvHJ0=; b=T4JVhJxafHTFiO/O3idLe2IPKdYOT5dskiyB0xEIhtzzuVDx5LqgTur5sOyyVLGxy7 /oUdD8m1MS4OIGWjtbc8GXwKwP2PSGa/1gpFeI2RBstUgHVesyVC258dGR2E94S0XRca bQuj/yEbFXGEN8R6apXTmdvECssTujW/Q7aPa1b/9OvjX1WtoimmShUV4xJnl3WnrqiQ yaSd4ate6BJ2DIfNNdHSbywUcsbItu7RIpptm0dJLG1kUmIfZOu1APwRZTL8YniFzPcQ rgLzly/jSEDD2iT8NtOALCmxeDDZc0+tqPkdot5nKjyrJb2OC0owbQvPV+xxbBpaZ4vq APXg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=b9ftj7sS; 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 ada2fe7eead31-4b608fb2f02si629383137.65.2025.01.09.09.09.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 Jan 2025 09: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=b9ftj7sS; 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 1tVvzj-0004nn-3N; Thu, 09 Jan 2025 12:06:55 -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 1tVvzc-0004kO-69 for qemu-devel@nongnu.org; Thu, 09 Jan 2025 12:06:48 -0500 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tVvza-00071K-JQ for qemu-devel@nongnu.org; Thu, 09 Jan 2025 12:06:47 -0500 Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-aaeecbb7309so234906566b.0 for ; Thu, 09 Jan 2025 09:06:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736442404; x=1737047204; 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=Z/fE5ihsW9j0TdJrNyGqxXoPll6S7jQ7QqKUoC+ldgQ=; b=b9ftj7sSxHdokjBEEBrjOQX2wnzS0epXNEezILVAfdlb9xm2vWxXnlZrW2tvCfqcl3 n3amqxactCykHJt1TQIZb5GIqy+xFzEMX7BBPW1F5wCMc/+RdX9MyfuVOz3IWslfR+6+ 0gIznNvaM95Qc7Xhv3qZgBLeqP26xo4JknfNCkIlLU8+FT1vxwI6yzrICp23ZQrBXEgl qeMgAuch9d6D50I8Ga015JGG4wpK4Xv0Je2fGlvTeCBgQWXcnF57/j7IP0vi+BSA/vSp yIFG9RQ9vayZKoyRqnZB/2sc7PqZjp4SDiucXAn8pwFKjTO4zd3hhLfMOJ947xF9//X5 vFsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736442404; x=1737047204; 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=Z/fE5ihsW9j0TdJrNyGqxXoPll6S7jQ7QqKUoC+ldgQ=; b=JzOvBF0x22DAc/l4qL7FIGFKhkYxsnOxdPNIYeOuBlXxVKllDq0k+zy8fHZJ0aT+V1 0oyfbIz/mz/O6st+R4ig5u0KL20NraPkp/ADB5IO9L5Q8HfB/XqKNzyPf+EcEQsbwjb3 mQYJbeRzdHF/QGSDczRaVXhSF15e53GXtsnlQnkm/iILO1uPSrYXG853ZrKH2iMX7qHu SE511qnoF+XvNWJRyDOPFNOoF9AdvL/Ext2b4yGM1J84MpwpFrzHsOWeZSbg7WIAt4Fw k3mDlC1QWHZVsR4gpuUR8mpulGcG5iZQbR3O3n6CLKSnMN9BjCwwoBf7laAr888+CDAu gQHA== X-Gm-Message-State: AOJu0YxYw3GEIBajBQcgaJOZepFD4OG+fdNUyhC9xqlDOMYEzxGVIkEr uOZ7ugrQk31UvNMyHuyp58PheP2ciOuTTAXZtdAdngGR85eoGB5h9nfACeItcXuG784fcr2QH6m r8ZQ= X-Gm-Gg: ASbGncs55PrJTBxyN7qA21s9NwqtuO8R0iSldEV1+1ANCn6JXj0VL5vu4K6dZWpxm75 /cSiAytFXLPZBCKMGFmr5zuUhKWo+TDfhIPf8pi7AXrT/eGgrL9hNr0jOIUYbCZHqeFBO96637K ixcP+1zjI+pLQmT5CMJEM0VKp0zjKxym7yY4vIELDE2ibdJgOYozE+AaqQE7fIs6PU//4L4RxZJ 5JBeo7QnglLiarfh+KmTVJ+NmocX/utJcBthX0erVU47Wv0JbUFVHQ= X-Received: by 2002:a17:907:930b:b0:ab2:d829:cf4c with SMTP id a640c23a62f3a-ab2d829da15mr101212766b.33.1736442403817; Thu, 09 Jan 2025 09:06:43 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5d99008c29fsm765151a12.9.2025.01.09.09.06.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jan 2025 09:06:38 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 52BDC60679; Thu, 9 Jan 2025 17:06:21 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: "Dr. David Alan Gilbert" , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Thomas Huth , Mahmoud Mandour , Alexandre Iooss , Richard Henderson , Paolo Bonzini , Laurent Vivier , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH 16/22] contrib/plugins/cache: fix 32-bit build Date: Thu, 9 Jan 2025 17:06:13 +0000 Message-Id: <20250109170619.2271193-17-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250109170619.2271193-1-alex.bennee@linaro.org> References: <20250109170619.2271193-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62d; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Pierrick Bouvier Signed-off-by: Pierrick Bouvier Reviewed-by: Richard Henderson Message-Id: <20241217224306.2900490-7-pierrick.bouvier@linaro.org> Signed-off-by: Alex Bennée --- 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 512ef6776b..7baff86860 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 ? (uintptr_t) 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 Thu Jan 9 17:06:14 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 855970 Delivered-To: patch@linaro.org Received: by 2002:adf:8b05:0:b0:385:e875:8a9e with SMTP id n5csp1334918wra; Thu, 9 Jan 2025 09:08:21 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUUukeu2+NrXWz2iQpiyn4Obdo9T2JQkcUuXA5BfdbQWElRDMoGHpQshOzHW6BjN9phLwZOIQ==@linaro.org X-Google-Smtp-Source: AGHT+IFJDJWN0RC5et2GOBjT4bkaeot2QVSjDNHcbb6z5B54CiL3zOF/p/iEs/XMecpwAqTlYsEb X-Received: by 2002:a05:6102:370f:b0:4b3:c658:2a36 with SMTP id ada2fe7eead31-4b3d0f8f840mr6202106137.8.1736442501209; Thu, 09 Jan 2025 09:08:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736442501; cv=none; d=google.com; s=arc-20240605; b=I0w9IfPz1YXaIAFm7G4sORvB+PLEqVQ1KnO0mfLTP9fhlGDoGIu48dMeHSc3PrdFnb kyGz/K7Ox+Q5nbfitCHPNUDhorMsu21LvyaXJbsJ3PfZpo8TXO7o0BKIGXrQLciKOdv+ CG6JKPc9cGevhDHomvRYXTlnOqCafPWJOI5zhNa9E5bjrgGp0VT9BEUHFPdGpwrSzJse m5ccjsz18A7Cyy2ktBjIPJ/QyRBr1gl2qbLm24/EBu62khNlx0fTgQ9MTeZVQgQB4gGV 0J8hnhFkuI+BD4GoUx4zx2jcYPsZYZqjmq7kgQYf8r1hdEj/pR3Ka5R/sjiP0x4WINqE C+Dw== 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=2F/PrPslSIW6Y9g5K7Gs/QX6OA8vuL+PxeLCYDC6PuY=; fh=FS+JTz/k+Dh1PAd9s6lkEQMFdt/HYT5+zFPDR3GvHJ0=; b=h9roIFK1YGo1w9/DcIu+wtDPJa+p3iNK2zmXa0FqitlCYbKFfArCb6Ay+BnWGA7c1u Cm5Nso2zeCYF6yRmXfie+4EKd3B702yzSIUrlSK9wbowUP1OrOiLG6HXGyFB14N77B1N MSoohuxL5Xz+SJYUEb4XOR89sJmVUzNw/qhj5lzn59E2gVNhDb1Ie6c8HSVv71g5az/T L7HTEJwjxmRAni5kBWlAaKQot7EP7rCwprciIq+ROcunCqzdP5xSwXRiJva6nQDrrMwb no+WiEIyur//IRjxKR9lprK+pyBbtHp8OuFIJyk7MI1+ujC2pS8SQzvFVzkP1bBfRx9L YezQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iriQPbtt; 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 ada2fe7eead31-4b6093810dcsi742480137.584.2025.01.09.09.08.21 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 Jan 2025 09:08:21 -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=iriQPbtt; 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 1tVvzj-0004oG-NI; Thu, 09 Jan 2025 12:06:55 -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 1tVvze-0004l3-Vs for qemu-devel@nongnu.org; Thu, 09 Jan 2025 12:06:50 -0500 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tVvzd-00072B-95 for qemu-devel@nongnu.org; Thu, 09 Jan 2025 12:06:50 -0500 Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-aab6fa3e20eso222923466b.2 for ; Thu, 09 Jan 2025 09:06:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736442408; x=1737047208; 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=2F/PrPslSIW6Y9g5K7Gs/QX6OA8vuL+PxeLCYDC6PuY=; b=iriQPbttMtiUPNR7aL0ojXwpi9tYW/wZyZgXaG/hyZ6wLIkkT5fA318dcga0MeSDnV 7s795eJiYjXFtGbPryTAvWK1Q4XLL67CYgzr3mu9AaY/6/blLWLNU+rfu3KMKdGcnBqJ 9Qme2C+9IvuBlShBX2EBfCAPgolDKQCHLVf7WiQ4VoIYwHoyngd7Nhe3NeiZbxRcQFY1 wNZmF/3YHefefArnLL9IJ3vd1mZNtnGebVL+cXUzyKkPvH9uo0tnTiILCx29AxS3kzfl 9BNaaFTzjvDv0zDBnY9WHPt5B1lFeR4ANv2mky3tFXg/6kuJ7FWpVyNMdmWeWRhz3/nI Ty2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736442408; x=1737047208; 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=2F/PrPslSIW6Y9g5K7Gs/QX6OA8vuL+PxeLCYDC6PuY=; b=WLJhgrqs9izeae8C8Oude4/7s2VHqWoaHKHBlvUxWTpq3v44Vdj865J6fqX3fPArNZ 2kMSALSzV1Rq5CK1eQiHqmP9BNEgUaXngbl1JD12P/JU4BHsVQ624vFaDv+jNcBqpNAP Dowm4RjN1mrRZ2Thja+bKgCn3CYu6ZmK1J1v8nkmleY2vHnis3kpfeEJRNFVgsb6vvP2 VCVNnmkRV2rnh0J+Q4CpDZ4ZNkldagcOJJy5mqUeeQJXP4Y1J1OypU8ClSWLqD2tJ8+X eqsZ2ysWMLTFyMIpzqU3Q4DzRocW5hsLLcdCPbB8n94R4jE9JretwlHODfmkLnyNnfbc GkPw== X-Gm-Message-State: AOJu0YzgqedBRTwiGnZbnrtC0bSTYagV7LKAQ+addq3qU/wcqmKaGLsb acDd07WaL6RdJ7xFpC5b+EVAocPDCfY1rbIfXvr4+SUyaKR0yRhU+GkVQW/1xMw= X-Gm-Gg: ASbGncs+Po41Ax9DEAzscGxIJvAecoMhmSsBFjH9wl9lAZjs1t4WMSYu+7QBTmLzHT4 hqeF24bK07BCWWWZRucZ3dNZW4Ig0LgmeyDF7+vm04al6t650k1G4/kFS3t9RxsG2Ll2vt2rICl 5q4U7JEta/2bIYGXbzD7Ap+2QN8AOtUxLN7C+E+HIjO16p49QiIuw2SC9awAkT2HwkbV34G9SJ9 5vgOCKhlW0owmL3LyzePMd8a2r6e+1HyUcaCvATdZ15TZIGunOG7ww= X-Received: by 2002:a17:907:9687:b0:aa6:912f:7ec1 with SMTP id a640c23a62f3a-ab2abc779dcmr717675866b.39.1736442407621; Thu, 09 Jan 2025 09:06:47 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab2c96461dasm87969866b.168.2025.01.09.09.06.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jan 2025 09:06:40 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 692BD606A6; Thu, 9 Jan 2025 17:06:21 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: "Dr. David Alan Gilbert" , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Thomas Huth , Mahmoud Mandour , Alexandre Iooss , Richard Henderson , Paolo Bonzini , Laurent Vivier , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH 17/22] contrib/plugins/hotblocks: fix 32-bit build Date: Thu, 9 Jan 2025 17:06:14 +0000 Message-Id: <20250109170619.2271193-18-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250109170619.2271193-1-alex.bennee@linaro.org> References: <20250109170619.2271193-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::634; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x634.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Pierrick Bouvier Signed-off-by: Pierrick Bouvier Reviewed-by: Richard Henderson Message-Id: <20241217224306.2900490-8-pierrick.bouvier@linaro.org> Signed-off-by: Alex Bennée --- contrib/plugins/hotblocks.c | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/contrib/plugins/hotblocks.c b/contrib/plugins/hotblocks.c index 02bc5078bd..f12bfb7a26 100644 --- a/contrib/plugins/hotblocks.c +++ b/contrib/plugins/hotblocks.c @@ -29,7 +29,7 @@ static guint64 limit = 20; * * The internals of the TCG are not exposed to plugins so we can only * get the starting PC for each block. We cheat this slightly by - * xor'ing the number of instructions to the hash to help + * checking the number of instructions as well to help * differentiate. */ typedef struct { @@ -50,6 +50,20 @@ static gint cmp_exec_count(gconstpointer a, gconstpointer b) return count_a > count_b ? -1 : 1; } +static guint exec_count_hash(gconstpointer v) +{ + const ExecCount *e = v; + return e->start_addr ^ e->insns; +} + +static gboolean exec_count_equal(gconstpointer v1, gconstpointer v2) +{ + const ExecCount *ea = v1; + const ExecCount *eb = v2; + return (ea->start_addr == eb->start_addr) && + (ea->insns == eb->insns); +} + static void exec_count_free(gpointer key, gpointer value, gpointer user_data) { ExecCount *cnt = value; @@ -91,7 +105,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(exec_count_hash, exec_count_equal); } static void vcpu_tb_exec(unsigned int cpu_index, void *udata) @@ -111,10 +125,15 @@ static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) ExecCount *cnt; uint64_t pc = qemu_plugin_tb_vaddr(tb); size_t insns = qemu_plugin_tb_n_insns(tb); - uint64_t hash = pc ^ insns; g_mutex_lock(&lock); - cnt = (ExecCount *) g_hash_table_lookup(hotblocks, (gconstpointer) hash); + { + ExecCount e; + e.start_addr = pc; + e.insns = insns; + cnt = (ExecCount *) g_hash_table_lookup(hotblocks, &e); + } + if (cnt) { cnt->trans_count++; } else { @@ -123,7 +142,7 @@ static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) 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, cnt); } g_mutex_unlock(&lock); From patchwork Thu Jan 9 17:06:15 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 855988 Delivered-To: patch@linaro.org Received: by 2002:adf:8b05:0:b0:385:e875:8a9e with SMTP id n5csp1337791wra; Thu, 9 Jan 2025 09:14:11 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW7bkg5yN5wUKaDoiMs1ilXDuUQmLgYDCUWrnppF0IBZzibumf+vcuchFxfHSYMxOSFC2XDKg==@linaro.org X-Google-Smtp-Source: AGHT+IH2nJnICH+i4GspA2tZQkSVh72IxMO2WvRDNIj84dkEsWH/9LrsSZZavOIRK5ydDMYAnvho X-Received: by 2002:ac8:7c4e:0:b0:466:ac8d:7341 with SMTP id d75a77b69052e-46c710841e4mr93285371cf.35.1736442851421; Thu, 09 Jan 2025 09:14:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736442851; cv=none; d=google.com; s=arc-20240605; b=WLt6OqZE2lOwtuQA86qGBo4eC34ZPjCnJzww4Bex8KmOhNWrqezVnPgmtdkOZFgVA4 Su+pvb5oatLpETMwihvgj92JPZkUQuNruqd6TsE302UzAGT0RbCYiA/sAEpygYxISqS9 cPhVRMnLuffUn2TqpXwJ9STSTz+suql1MDSf3qdLpDZwN+OlKdFKUfY1hAhfD8dio69P Hv0u3OOxb3tV4MnI2xDIy/FMVW4kqD8jllBHUK8BFhHIlr8j+0oRWttrKAklIP7tw2w/ pOqlj7UOnXnhaVMPL6msubSMHfiMm0n0CddmnuHUzTALwQFur+G62oWBxY2IyKiO/MAr wknw== 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=1tw2ZvpgzU+NWUchIsRD68y5QyIwwYntbgovoaeHxtY=; fh=FS+JTz/k+Dh1PAd9s6lkEQMFdt/HYT5+zFPDR3GvHJ0=; b=CenAT88PpwhaoCSzOoIjV+r5zu0ayzR6T9I2azoxY1LNJWkRCLHS5Jem4LhnLIXXZT RWvCJEM55M3O2BByXCpv028NziLS/hy9sLfdg3I8g61wxoZZNBHGrceNK6HRR0HbfFpC SYGAd7bQAl89zulSNrpVxSHgTbyLoxpJGLndnNLBm+VrrKIVyvjavnGQEPF4mU1WAUeE jhyBpUpcdKw0S9Z7VaPrpin0zwV6TApGfV8Nz/Lt2zo++gA2EV+lFE/bSgiaTK3DOkUh 0074AsExhR3znF2KdFdBHdPegwS3ymCVsv0yeR8LYzNPH8tsIThKPZNwarsqZwuIO3Kw 28lw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iLe928aq; 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-46c873e4accsi436071cf.285.2025.01.09.09.14.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 Jan 2025 09:14:11 -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=iLe928aq; 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 1tVw62-0007PG-JM; Thu, 09 Jan 2025 12:13:26 -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 1tVw60-0007OR-5E for qemu-devel@nongnu.org; Thu, 09 Jan 2025 12:13:24 -0500 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tVw5y-0007uv-GA for qemu-devel@nongnu.org; Thu, 09 Jan 2025 12:13:23 -0500 Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-5d3d143376dso1485586a12.3 for ; Thu, 09 Jan 2025 09:13:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736442801; x=1737047601; 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=1tw2ZvpgzU+NWUchIsRD68y5QyIwwYntbgovoaeHxtY=; b=iLe928aq5pk/9aboFFlMCs+N7VYpc8creQ/fAGp7gPYwm23II7r8jbOweSvGMxOsTb oUJydqVwm5vzNAAJtJh06i9YVXM5IJF29CEeN3HJpMP/K7ROvGQzEOLwf4NGbkI91f2O RPjCTXdBv99XX6Krkg2uPc2UNRExQ9HMxc1gUioWhwTK1GMyqyuSh2I4bNIl342GUEvP viPZ0UbfqmlJxXfk24PLnM4nb5jXYrKJFUuVx8gb0/1oUoabbCxJrZkq40ISDfTo7p15 zQkhsfLjugbKe6T+qjlJs+IZvib87LNLvU1qxxf15JTXSXCbeQvX9u7lwM6Z31IgddBa jNvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736442801; x=1737047601; 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=1tw2ZvpgzU+NWUchIsRD68y5QyIwwYntbgovoaeHxtY=; b=IPUCrbUTYPy87uBp/FNwU7Eu7RKzMlHvYeWkxtm7JjeaaRB1ij0kcl+yXUV34Eqf+j TLvUceEQF9KTDgOkRicrHlREX3JGM2sPDJEwMgOj1P8/mejW9k334G05HvBHQBbPKmg9 u8HuInKYY0I7tccMGtL4MjteTxc3foFDPoOdbKemDTvvDb0UHhNtm2zLfvGm3Tj0OgG7 xmbp5UEfhnJeYbHsLTdQAHXYQtbdhAtu6aqwRTAflqyrQt7UJ0ukCQRuWxY/vkoyW9xD KSfHTFz+rEn6c+++ASwzfHwOzujoC+F+VydwbfR9uMU+fH+aLK7stBaCqUUE9dKPMktt ijNw== X-Gm-Message-State: AOJu0YwzEWlTo4EfGH2/uYqOYC3RP/hWdNl0Ua/I+z8s+tqq8BU2Zkdz SmD1D8xDCn7t2UozzVaRyu1V06HaTQvaAuCRzV7WNLUVYzI/uxcz/IFIJXRRkGg= X-Gm-Gg: ASbGncsKsX22ze5fEt/yUPAZCE+7ME8hLRj4eFkhXDs93DKcnvZOXH7GOteaEkx8jc4 4mnKIwRa3O/uvNkaOo/W4YTMqEA+ExEkKfuq5XT5JtO+JTBKmm3qcCkf5nlDWt+9zUyl/38rTPq AxyhRCKa2tqOPFf19A8hgifCyK/fI7USghYgZ84Eu4bAzO6Jqpt+wyRyD0aE4Cadj805knXrkkS t8XD8QVhL7cZ2k1uuaDGvqxF/iF4Z7h7cyXOZ9GDimc83qirTYGFjs= X-Received: by 2002:a05:6402:348d:b0:5d9:6a8b:468f with SMTP id 4fb4d7f45d1cf-5d972e6d1b4mr7574774a12.28.1736442800730; Thu, 09 Jan 2025 09:13:20 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5d9900c4326sm762431a12.23.2025.01.09.09.13.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jan 2025 09:13:19 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 7F9F4609B6; Thu, 9 Jan 2025 17:06:21 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: "Dr. David Alan Gilbert" , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Thomas Huth , Mahmoud Mandour , Alexandre Iooss , Richard Henderson , Paolo Bonzini , Laurent Vivier , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH 18/22] contrib/plugins/cflow: fix 32-bit build Date: Thu, 9 Jan 2025 17:06:15 +0000 Message-Id: <20250109170619.2271193-19-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250109170619.2271193-1-alex.bennee@linaro.org> References: <20250109170619.2271193-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::531; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x531.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Pierrick Bouvier Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier Message-Id: <20241217224306.2900490-9-pierrick.bouvier@linaro.org> Signed-off-by: Alex Bennée --- 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 b39974d1cf..930ecb46fc 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 Thu Jan 9 17:06:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 855987 Delivered-To: patch@linaro.org Received: by 2002:adf:8b05:0:b0:385:e875:8a9e with SMTP id n5csp1337678wra; Thu, 9 Jan 2025 09:13:57 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV6pc3RiztPxkWD+HS2ixooy5qWWaf4wTTrenHxmTcn9pupS7GmMNJhmoHGMH0t4AUNHEqj6w==@linaro.org X-Google-Smtp-Source: AGHT+IGmpeD2vnrr4vMmIF/VJ4l1/XruGzTRegd0FM3PaQlr8VoJAuKZXd0mCterNvtGAfhpbkl9 X-Received: by 2002:a05:620a:2b9c:b0:7b6:d23a:be39 with SMTP id af79cd13be357-7bcd97a7077mr1254552685a.44.1736442837110; Thu, 09 Jan 2025 09:13:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736442837; cv=none; d=google.com; s=arc-20240605; b=S6lR2OKn8NPF/n3N4PlWgZK2JKHJBKZPBB5pjcsn6ra3K6t1onP14sIArFTUwfTXUr jYho1Fxo5of7+To5495GuDNzbehdRUeOx8zeRQSu84YM1Q9nrWK2vJyhiDn3GngGv62t GusxEp7wIR7g00oK+Qz0siX2EsqdeNxMqZEBsvpsiUrUZvxbglPLikUOpBR2tNLzuffO hHMq4UtoJDBQx9cdz0hjVkaeEegNnTo1HJDRQjlH1EKiBrErgtn/+Jr1eeRLg9iPY7aM IFfUpcoNTIL2wcQU8Cz/pVG43UyVBtHffoRWEu0r/+j2Lb5OBLIBleY3RL12rmn1W91s Muxw== 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=kTnA9glybPs3zdhSbJS9OZOTx27Sx361JrQqUOFibUA=; fh=FS+JTz/k+Dh1PAd9s6lkEQMFdt/HYT5+zFPDR3GvHJ0=; b=fdz2sGjxTL+h/7t8vHapsa8vBekIJLMrPPs4KbHmnkIFh7c1YNwLXoGNHVlWnPLgjy fZFNbwPeio9f12i77z9b70sSEcVtRmw0U7cmKDWaTBAvDd3W1dOwCz7thodD2v8wDfkh FuIm42y2M+QfajtshfK7VAumAr7yDAZnzNfC6cerRB2w3LRw2z61sLuw68e5N1FrAH5+ BDFO4pwlsThTNnKykBBE5LJlcHCqdF9Tnf0U04OLNJZE3juuTJvfE7vHrOuFxiCmZJ30 Um8+I15pCuJo4+U9HlCmW4sCbyThaGNUOLb9/yFim+8AXE2TbFt8V98wxIyOHhIXoQ+N Vo/A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jkdp2baG; 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-7bce350a260si189297085a.581.2025.01.09.09.13.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 Jan 2025 09:13: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=jkdp2baG; 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 1tVw61-0007Ow-Je; Thu, 09 Jan 2025 12:13: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 1tVw5z-0007OD-65 for qemu-devel@nongnu.org; Thu, 09 Jan 2025 12:13:23 -0500 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tVw5x-0007un-Es for qemu-devel@nongnu.org; Thu, 09 Jan 2025 12:13:22 -0500 Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-5d3bbb0f09dso1820958a12.2 for ; Thu, 09 Jan 2025 09:13:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736442800; x=1737047600; 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=kTnA9glybPs3zdhSbJS9OZOTx27Sx361JrQqUOFibUA=; b=jkdp2baGInpfO0Ycpo2mnIyayCx1pRbLmKwpdLxMoxkOnkofNhmjSVDyoVR6+nhfyz Dr097ZqWlKxV/sM3pkBE5aQ2IkWBjTmaKyvU9w81I1TtVoFS3jzfs3ZB9U6PnsJXhE6x 62eSvO2iz3tH0bEACl0We6yRxpmnlfeOPVxAbjOIyOJPbda243Qf+5J314aCSdRwAiaV kafxX/ZZGumbhDRMIz5vQJcRxURyGGRhRceOSE+pL4ZyaVvA9Yib1Ye4pdZAPP/nzC74 HEh/39SpDFAgTE/RFOE6/G9gjGfEJKREJQKw9M6o2kvQU9+jOLJbm5f/LM3gRBDpBfb3 X9fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736442800; x=1737047600; 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=kTnA9glybPs3zdhSbJS9OZOTx27Sx361JrQqUOFibUA=; b=AhdvF169T62IwxzpDxeywputU9FsZZbzqwaYN3GS9N6mZN6dF8+04+qyUwbjl9hRMV jwCz4HloUHUyOEaPzLlriP+JWauAe9WaU8IUPL7pw4qZGLJia7TnTCBKrSCahDEcXXh9 L1CvhUP2BEPpOXU0hbum1bYkdLHi71ZaaQHf/2MptV5wlC2l4ANoLh3yd5Pq2wnPGqCW i9Eb+vXaec2rNwFxUmfWFJAnRssRB5MZHg4Fn0PUGssFOJZhINPfXw60JGffVAt1os3n /vo8Vn+AHUfP2OmQRheftqr4ZclWsE/WoX+/wAp/Q6nlV1rcD2UXw5Qy4goAYqFWnPl+ YGeg== X-Gm-Message-State: AOJu0YwrcoxM5chd/mnEWU/ymLW1vwtlF0lF1+BbWHpeXHntyMOgqVLd sxPj6lUny4mTbQFusty3GbYyQxe06K5uNnOSTP6IFSnY5qRapiNObVBocz9U/Ck= X-Gm-Gg: ASbGnctClqpoHhzF/0szASwWmXmLfk8fzRNvd/huZUoGwOKrWB9+6ttzUWwMQeucejY EuYkciKNLhIS/KjAUl3q9/VaRR52UkSs6GCjMXHl2D3uAD/IuUkFuPpMcGIHqQPGyyaXqmGWAD+ 3VxqRqlC5eK/S/nK/AVGQjjUD2Y0nmFGrel37vZ6okRtq2zE9F+MBniNKMX78lkGX2f2H2OEtQZ PD8D5U6bOF8mZcxVBTCcu0jdVVzWHdhSu2yyPIoLBR9OYz1VJtsdgs= X-Received: by 2002:a17:906:c143:b0:aae:8490:9363 with SMTP id a640c23a62f3a-ab2ab7408a4mr733026066b.34.1736442799922; Thu, 09 Jan 2025 09:13:19 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab2c9060f9asm89365066b.1.2025.01.09.09.13.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jan 2025 09:13:17 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 95FED609F2; Thu, 9 Jan 2025 17:06:21 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: "Dr. David Alan Gilbert" , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Thomas Huth , Mahmoud Mandour , Alexandre Iooss , Richard Henderson , Paolo Bonzini , Laurent Vivier , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH 19/22] contrib/plugins/hwprofile: fix 32-bit build Date: Thu, 9 Jan 2025 17:06:16 +0000 Message-Id: <20250109170619.2271193-20-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250109170619.2271193-1-alex.bennee@linaro.org> References: <20250109170619.2271193-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::535; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x535.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Pierrick Bouvier Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier Message-Id: <20241217224306.2900490-10-pierrick.bouvier@linaro.org> Signed-off-by: Alex Bennée --- 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 739ac0c66b..2a4cbc47d4 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 Thu Jan 9 17:06:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 855985 Delivered-To: patch@linaro.org Received: by 2002:adf:8b05:0:b0:385:e875:8a9e with SMTP id n5csp1337577wra; Thu, 9 Jan 2025 09:13:46 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWpkj3e9zzab8Zio/6xs/ZIBM0rSNPMf7gTbpTB/yDU0m0ImLqbt9V2iOgBD1A4e6vgkqpTlQ==@linaro.org X-Google-Smtp-Source: AGHT+IFifcQ1gPxr0MM8O59lijWMSYjAGe9NjG94vj2Ns/WwOL3uoxf7gB94nGEYtISRhenA8nLI X-Received: by 2002:a05:622a:130a:b0:466:a0e2:ae8e with SMTP id d75a77b69052e-46c70fd452dmr110142491cf.9.1736442826064; Thu, 09 Jan 2025 09:13:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736442826; cv=none; d=google.com; s=arc-20240605; b=J53AcWnP+ou+h7c7zwd1bKxZ5ysSnl9RhiVPby/hCafOQ1cgad/Bjk0SdUSQIp8rwl 24PnSm3SAQ94a4+MWTLDUaTQK5UhfhQaiQvbPZCotjLgvzS6H3iOjKOxizQ5TgO9HnZ/ oqixgC0rD56Pq6GhQCoFrRRZd9YKxRPw+XoVqOoqOtx6B8JJwgWfgjZ/g4fJzxgXfNNS Y+NywuOSGg7Qtljh9LX4t66lETy/+Hq+U3BFkajv4oWnZol4FwxtI5QfF1Xl5hTIpCtc mw7ept/rd39R/dbh5qI33wlplUnmfpqmo7aVa2Ztvc3ypbkEGUXrvWZ5GXXzvMqyoafG 6wmw== 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=pERnavJS02WsVkpfgEIKcxRU3EPSk+CF5JdtAAMvhiw=; fh=FS+JTz/k+Dh1PAd9s6lkEQMFdt/HYT5+zFPDR3GvHJ0=; b=EGPKOG26NzCFWHH7+4iYwj6PdTy6nwQXdQtpY9lhjCIdpXr7YSSPB0uj0zjfKakT5Z hCvzwwIMOb7T4iIX2PrTIhUrd5Uk9U1PxW0cQ6BmZS7Z5HyocS61HAEbVU34CtWx3Shi UfM3YiIrbMSVEyYXM14IeKeYuoK1zNCXSTcgZJzN99M293cQa4sttROypHFyHD1aHnHj JTGl+XfCb/D8rnq3stMql5/WLe4I9b7IgqWFTKW+mOKTdfEtEuXEvgv6yG1JxiiuCfqY uYQYTrbLKm4qFSLoU1r8BoMaRofRIh9+t3BQMzJ8VYfUBvjCdMv4SUqu3+FyNZsBwfcg rLdg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=y6zN5sNL; 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-46c8741744dsi308541cf.546.2025.01.09.09.13.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 Jan 2025 09:13:46 -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=y6zN5sNL; 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 1tVw5y-0007Nw-QR; Thu, 09 Jan 2025 12:13:22 -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 1tVw5x-0007Ne-Ks for qemu-devel@nongnu.org; Thu, 09 Jan 2025 12:13:21 -0500 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tVw5w-0007uU-3P for qemu-devel@nongnu.org; Thu, 09 Jan 2025 12:13:21 -0500 Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-aa6a92f863cso242265066b.1 for ; Thu, 09 Jan 2025 09:13:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736442798; x=1737047598; 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=pERnavJS02WsVkpfgEIKcxRU3EPSk+CF5JdtAAMvhiw=; b=y6zN5sNLLiQONLptSrJGCRsYMfKk4LTnGQgTh9r+tLsqMYR+SPdHeQJB1XZA5ENjTG 1ZvCveQga+PjlKe3AAhwhfaGRnhqzl9EXqnNJ154JV+c/JCWThRIXpYYosYIeqOQ76Q4 67In23Rmu2pmVbH+hQ56vYbtOqcWRTC/CvF17fPOXB9yPjo4k2xwo9C9wadBulbp0Ree z8wqHhiPa+wt03LImBDH0wphRhAbZ8BEA/Tds0X3YrGK9TOTBVE1nQDGAnisef8spkzm sR3/3fIlNv0uZuIYb3i/XCnekgTCtQ3P7HsSNgsoFuJfo5IW0faIHcSepWTQOm0RsKy8 ZcFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736442798; x=1737047598; 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=pERnavJS02WsVkpfgEIKcxRU3EPSk+CF5JdtAAMvhiw=; b=WJzZOU+L886W4I6fKW96u/ukGCY6vs+MM/TwZ4VM9UPu+ELgAFv08bSaSxcW9v7eb8 arYroRHQCPsvo11IspO5/uCe2m0L9AEtX2K5EGSbWM1w3IUHfTbDLTecfzoKhIVeC4iy 8y9bpP8LnRizXX9xyEcdjEUi5iPw6i+CJx+M2CKSU9StQevLcYeVvTQkdZ36+Lb1vHe+ PSfHuvMaaPE8rr6CGqsHQFedkwX5Q2q5aESJs5qE+n6XgyzC7HB8IEOjEHG+6XGcPg6m Qp7l+dnC/bdqCcBbJtoAh4598MFDIR7KTlU+hWUohskOSuFdBVgnTZL93Z/r41coafm6 sfMA== X-Gm-Message-State: AOJu0YxfZz0tIux8dW4999nRNniOaJlF+gCUTFa5TvADtrccaeqFmKNT mCmvNedxfzl5r8buarPYhfU9M7i7uwLcnDfCw2V+ppl63UGS8UGheYze9NGxwVc= X-Gm-Gg: ASbGncv+S254AgdrmZOQFy4/KzMsbJhQIEUenoPSBKd7kcuQQliN3AWqNOZzsgEtnKl 3IIsga3a46NsbsdCKBs6wDn11M4Xulw+0eKgkYsCz/p9+811s9MRED2uQ5lsB+z2o0PpUKe97wH BLNPEJKqOwC+mv6HSyZi8lYkLmmidR3/Ac1Afj8ruSEL0H+xm55Xvuecw03CryJE4fEdOD5/NM/ D3+6CFI/zqH8unC5CbaBmIxYS0M+z0CI31OSJD9DWOBaIAcsuv1VEI= X-Received: by 2002:a17:907:1c22:b0:aa6:80fa:f692 with SMTP id a640c23a62f3a-ab2abcb0a84mr757450666b.49.1736442797767; Thu, 09 Jan 2025 09:13:17 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab2c9565517sm89120466b.130.2025.01.09.09.13.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jan 2025 09:13:17 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id AB9116142C; Thu, 9 Jan 2025 17:06:21 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: "Dr. David Alan Gilbert" , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Thomas Huth , Mahmoud Mandour , Alexandre Iooss , Richard Henderson , Paolo Bonzini , Laurent Vivier , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH 20/22] contrib/plugins/hotpages: fix 32-bit build Date: Thu, 9 Jan 2025 17:06:17 +0000 Message-Id: <20250109170619.2271193-21-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250109170619.2271193-1-alex.bennee@linaro.org> References: <20250109170619.2271193-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62f; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Pierrick Bouvier Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier Message-Id: <20241217224306.2900490-11-pierrick.bouvier@linaro.org> Signed-off-by: Alex Bennée --- 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 8316ae50c7..c6e6493719 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 Thu Jan 9 17:06:18 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 855986 Delivered-To: patch@linaro.org Received: by 2002:adf:8b05:0:b0:385:e875:8a9e with SMTP id n5csp1337656wra; Thu, 9 Jan 2025 09:13:55 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVdb6BLcrb6SG0sh4ncuKOqK4aK47ixhZPIfrjAthTvurVPVEA2mLBEjnXvJysSKVL65bGuFA==@linaro.org X-Google-Smtp-Source: AGHT+IHcIhHioCOSlcni7j58lFHQh0BKiRg/QImFP/MG99qiO9enDaEs3SvrKtX9unH9/X1+ZzCB X-Received: by 2002:a05:6214:448f:b0:6d8:e5f4:b977 with SMTP id 6a1803df08f44-6df9b1b4e9bmr127031636d6.5.1736442835153; Thu, 09 Jan 2025 09:13:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736442835; cv=none; d=google.com; s=arc-20240605; b=FWNIsFLHeYhBpQ7HEvdDl1R/wqSjhQiFfsLSurIoLDuizcK6JjmNtxupxi4r1XLeun O6Qs8f29/fOwEEmkK3LWb/AczIwVk6lvlevy1eS7ZBYtTAIlJ8HNLzoP3/+ZJ/u5QCSV Q+hwOm8Uyz1K+Ql/0CfQE5qipCp0nl/HRrpD0M98+w15AD8wEr0VXZR2VDeWnrvmUe+C hTQ1uSVR5hGdwp7A3Y+kBwgKz5yzs5d6eBde3HB3+erQbbcoFm4+ZI1zETIjmrcBwnD8 f1esjJdtbmjT0DfCupym48C7V9HmC+vVvTFOldih+r1kuS+aMRVAPz6RJOJAdJdmgZy/ +E3Q== 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=dqmHD2ejeCU6vyBEybsqYUS9Cxg0cRrbaI6dvUsODH8=; fh=FS+JTz/k+Dh1PAd9s6lkEQMFdt/HYT5+zFPDR3GvHJ0=; b=l3Q06vt+oqRlCqCESHjtFfUvM5B54TmbpEHWAHBVX5G1gcZG52vZ0lAbfF2jLu7Ctj DeuiJhgWXwz5YnIEYgWC16TiuiIesKAci6E4jevt2d+xAeYR3Fz/pt7mTj61qi0eHaTO 5ZcuUesQaiL8lL+RwUlVjQBZ1KbfKOnHnRQeoeALp14qJ3w/HiuAP3QrskC0ZW+OFHtd h6iWcI+BWM0UAFE/jsPnWjEyc+7EAkJLtamf8OHzEkMLhl6j7ptwK9DTGQ70cT0YPr6X RcS+QA6cAwNy/BSMLiSjstICcZ7nQ/j/KdrfMyZadxvyqNKJTBs066XUDGcAG0y282WU WJjw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CrujFPDn; 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-6dfadeddd00si384466d6.296.2025.01.09.09.13.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 Jan 2025 09:13:55 -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=CrujFPDn; 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 1tVw60-0007Od-Sg; Thu, 09 Jan 2025 12:13:24 -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 1tVw5x-0007Nf-Ob for qemu-devel@nongnu.org; Thu, 09 Jan 2025 12:13:21 -0500 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tVw5w-0007uc-4G for qemu-devel@nongnu.org; Thu, 09 Jan 2025 12:13:21 -0500 Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-5d0ac27b412so1359212a12.1 for ; Thu, 09 Jan 2025 09:13:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736442798; x=1737047598; 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=dqmHD2ejeCU6vyBEybsqYUS9Cxg0cRrbaI6dvUsODH8=; b=CrujFPDnEWkNJpTTSV4jemIJhKKXB6wfNHSk9nqnBEWoJQUhdTLJVBgS2BuxqdF/Vq /4oHa1SyRfWSpvSnXOaIg/KbQ2gTH3EzdG64p5Od+Tm46mMQ5sje/XFIDZUO9cNN/GTq aGfeRLKPkVuQlyFtkTac6m2TytmQDvyMhSs6UK62xX5D/frPiLAR3cZKZ6uYX3MUgEPp LGtf74IB92sVxofvo+guDz4nVYG1s8AVHkrvhGcmkddomLcasP5FhS0uts2GMnJ0qEz7 SS8r2Hlwlqit4UhFNlw+lcOiUjNuqK54FnJ1G3p6H6IBLWey2ZS1juuOYhdU75YvKciC Fm0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736442798; x=1737047598; 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=dqmHD2ejeCU6vyBEybsqYUS9Cxg0cRrbaI6dvUsODH8=; b=Q5yLIE0TkrQj38oLXW6uTnlSE3u6Otj/fWmaO871ac9fPYnSshahKvGZvEPGxriv75 Kgb3P1xHDNlqg+UAIU/Odc3sXAkwrW2sugm9oEc1rxIWwKrTjHwADGz2M4NvJEGkZoo2 szr72vI+h24R5cyKa0ckSNFfuRaKah6OtwJ1ZyIYoWXvqaACJtjDF8IW0jJ98WYzxExI NfmpRDr5SjlTx3BHX/P6vceVirLoaM9tY+6I9CwvFZNXBjkWEzLq9X/8JTEGd1EmhPdI yRUQXN660gesQpS/yQ7z7F8CwrXU2u8FjGSID/yaC1WkbHIOT5oLrWFLdwGz2rUohM0f ZKGQ== X-Gm-Message-State: AOJu0YxOBvJJhGl8shTZiXIzYX5cmRihYELIcasiTd+6uzUxyaul5a2X 6/EcZp8BzEU0I1uu8GP3Y37VO2qVDVQwBZf+t2e3kFbFo7KEfi21Uk9bFO8ZJUo= X-Gm-Gg: ASbGncsL0K+gxCsjMFF1rsX9tZvjbwfJI+Hk68Y8MYPhuD1UoUyLCpoCjpNwhHf3hD8 eS8+/rT/hBEBGFDJtDpynVEHRMo1o/Nn9jR4P7FwgCzDhBxP4LUiscnry9+ZmQyP1xBLTmGCFyG 2/i9/REteECAPCPwPylcNYjV3EKtudF3H87mhY1Xm+2RUsQBPHz/u+pLMemwBdqPtoeoj8+ibxJ 3M3ZcPxsia8U67CPjlnoKPEYrOSdvsyoj6pK/uexIZb1Ne7ZR3Ndvk= X-Received: by 2002:a17:906:f5a8:b0:aa6:8676:3b3b with SMTP id a640c23a62f3a-ab2ab749f32mr612531066b.30.1736442798363; Thu, 09 Jan 2025 09:13:18 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab2c90dacd7sm89705266b.70.2025.01.09.09.13.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jan 2025 09:13:17 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id C318A6144E; Thu, 9 Jan 2025 17:06:21 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: "Dr. David Alan Gilbert" , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Thomas Huth , Mahmoud Mandour , Alexandre Iooss , Richard Henderson , Paolo Bonzini , Laurent Vivier , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH 21/22] configure: reenable plugins by default for 32-bit hosts Date: Thu, 9 Jan 2025 17:06:18 +0000 Message-Id: <20250109170619.2271193-22-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250109170619.2271193-1-alex.bennee@linaro.org> References: <20250109170619.2271193-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52e; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x52e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Pierrick Bouvier Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier Message-Id: <20241217224306.2900490-12-pierrick.bouvier@linaro.org> Signed-off-by: Alex Bennée --- configure | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/configure b/configure index 18336376bf..02f1dd2311 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 < X-Patchwork-Id: 855981 Delivered-To: patch@linaro.org Received: by 2002:adf:8b05:0:b0:385:e875:8a9e with SMTP id n5csp1335423wra; Thu, 9 Jan 2025 09:09:20 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX1BTeUfsK1oHMrOiJfXUui315FZPkd3rZDdim5/e4Yo1CmdeCdZ/RcMsD8VoFVrj/V0q1ayA==@linaro.org X-Google-Smtp-Source: AGHT+IGNCEg6nVZt5jpcVJS4tl+utOGwxB9mvYsTm6ZqCJrPtCzrqOgymO6Xgk1y0T5tKhLvW4xF X-Received: by 2002:ad4:5c68:0:b0:6dd:4c5f:b3d1 with SMTP id 6a1803df08f44-6df9b1f6e3amr99995026d6.3.1736442560679; Thu, 09 Jan 2025 09:09:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1736442560; cv=none; d=google.com; s=arc-20240605; b=RuqxL+uEmS1l8MilFZqcnWloObp/6g5eraotXWUpgg9cb6llxa3Ov5BfCjE5u6Aa2O dDvaVw2LV5odyUodu8mURyxQ+Mkjyr4sGvGGhpG4CQjTEoT+uAFfyErOaBECDZc/vM01 SrbokkCWVXLFK/69GH/SW/Dz6zWVXxJWDKpMDlEKk0pU+Oc+XLKFeM8D8XFaJMQZcFcD H56Zs6v+DdLc4AMKt244G7LPKbmxeTZQa4c36lBIXzWnYFbbj/Fo9nK+jOFVBJI0ASoK 76GILweHvuawV06IposXvJE6GukdrPlkB/pW6viE1XEeGRSjMSIC4FOFnyc9X4ZtDkv9 zCJw== 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=jXTY3v0Mhju7JfKzKJdD6zSDlC5CNwIYMzPHdmiHijQ=; fh=onwucmYDX4VceK/ziU87Fr6Xxl9vysp3UUXfHgDJfKs=; b=KZgrcQMxm4i+wmXx875cVNVk3DQqIToq5O5BsEn09xrLpK5LOkqDu7Xb0a1iDqajRu Suao0nLMJ/4LFQNjif3oVDdz0SEif7uZJKLn11/vocrqUCLXJq3jB0thoE7q+05Ybb4G L5FB0b+q1ZYi8cQu1VXbg/YkSpPVvy0RhKdqjbSyJkJ3aJBrL/guLaxY06+Cc25WjnRJ rt2CWFwkVQTZ/BEYimX0PU4g/y4/5yPqxDkNqvFteUn4XoMzesp4D4QD7A2m83gkOItC SqAnaFPyZ/8AUVBh2bvP82qCXBwCiQHPxYe86+bT/5OBmBgt0Lmzy2LCYbLk3Bm9whvz n9ig==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YIZlH3Jk; 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-6dfae015ff1si171016d6.453.2025.01.09.09.09.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 Jan 2025 09:09:20 -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=YIZlH3Jk; 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 1tVvzj-0004no-31; Thu, 09 Jan 2025 12:06:55 -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 1tVvzd-0004kk-MR for qemu-devel@nongnu.org; Thu, 09 Jan 2025 12:06:50 -0500 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tVvzc-00071s-3W for qemu-devel@nongnu.org; Thu, 09 Jan 2025 12:06:49 -0500 Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-5d122cf8dd1so1733411a12.2 for ; Thu, 09 Jan 2025 09:06:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736442407; x=1737047207; 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=jXTY3v0Mhju7JfKzKJdD6zSDlC5CNwIYMzPHdmiHijQ=; b=YIZlH3JkcQBP1MHBIF0VovJFD6kmK2LSJ9wHwh3HoNyKYdQwVKUZA9+cWlsvS/PTOK lZ+IixtcvwNj4umhOsWM38Vsb5MkklTFkqGCy4uzfBgQYPNMJfKIyMdN5CGg7/qfhBg5 zpQCspUGUIaej6uhO/Oi3JBonpqblV8PVZFjZnpCJ1eCYPmyvfWLm7JgpW2CBc7ckKgq zF7tAjgE/bjritQfMHP7vuw1zrocB4Wy6M4Ekf+nc9bjQ4zlp5AkYCDMJ7O+qUUnuCL7 sN0DfwlAlvgWHXHR6bJBCssDtciSruXrQQNjdPMT3LEWvAaIhSkjPowD+g21WZ94WE/7 Z3hA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736442407; x=1737047207; 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=jXTY3v0Mhju7JfKzKJdD6zSDlC5CNwIYMzPHdmiHijQ=; b=Uo1Ju3dAX5aaLYqg9Uy0G/69KKY93y6LjhA338xQfvZSEb4RGjWi+/OZ5lWvePdhBV GO5hQvC/TEdGjso6ticrIr5jwsxf3jtfyz3kmnRSwyfLeaNbcoep+ujD1Eh7OpQ+fNXn Klv2plsn0yO4i162lGqzVR41xyX1fMpL4t2KLABXqp3UkzEyo6ooIMitOB4/pFNujJ// f7BatzTmaKHnwQaGWgH6IJt26QxXvLPV/MRu0xujsW8Cky/P3fOGbQPJgGKTfRCqL5oH hoTLgEW7rw6tfJJ3SoFy4JL01aIio/s17euPfVm/B2lPPkYD++QE5/0Cs46K6kO+bBn8 9R+g== X-Gm-Message-State: AOJu0YwgXZ8a+iclfBO9RQwOTvKIPzF6Hi4eM/7sGFIPqHBQpj6LABhh rEUzYiLwdMIlDxJT771fTWx+8neZwla25sW/TILaGnkPrjdM2hQVfuxZDuIKcBI= X-Gm-Gg: ASbGncse2QaTLafFsDokLHriVnXKyU5BKHfDch28edgyfSW7yl+boXvaJ3fsYLhjh/D xsLbZLBVpmPvZqlElnBP7rBis4m6w67Q1FohPzuZsMHqINON2lEc4FKAr2BFkqy92wyklBgwdPo APtpDc15P8bXH5BWNgJzqTO4f6RMC2/9RdqrUdqFxTkNWqq8NJxp1VFFG5kqy6CfuSXAcI2NSh9 Utdf3s8ztYj1Xz6TyXzDTXLwyf4d08zZIJzrnrcMXvJj8DatuPMWvc= X-Received: by 2002:a05:6402:270d:b0:5d2:728f:d5f8 with SMTP id 4fb4d7f45d1cf-5d972e4dcddmr6326742a12.27.1736442406671; Thu, 09 Jan 2025 09:06:46 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5d99046a17fsm782811a12.62.2025.01.09.09.06.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jan 2025 09:06:40 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id D898C61546; Thu, 9 Jan 2025 17:06:21 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: "Dr. David Alan Gilbert" , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Thomas Huth , Mahmoud Mandour , Alexandre Iooss , Richard Henderson , Paolo Bonzini , Laurent Vivier , =?utf-8?q?Alex_Benn=C3=A9e?= , Julian Ganz Subject: [PATCH 22/22] accel/tcg: also suppress asynchronous IRQs for cpu_io_recompile Date: Thu, 9 Jan 2025 17:06:19 +0000 Message-Id: <20250109170619.2271193-23-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250109170619.2271193-1-alex.bennee@linaro.org> References: <20250109170619.2271193-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52e; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x52e.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 While it would be technically correct to allow an IRQ to happen (as the offending instruction never really completed) it messes up instrumentation. We already take care to only use memory instrumentation on the block, we should also suppress IRQs. Signed-off-by: Alex Bennée Cc: Richard Henderson Cc: Julian Ganz Reviewed-by: Pierrick Bouvier --- accel/tcg/translate-all.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 453eb20ec9..d56ca13cdd 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -633,9 +633,10 @@ void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr) * Exit the loop and potentially generate a new TB executing the * just the I/O insns. We also limit instrumentation to memory * operations only (which execute after completion) so we don't - * double instrument the instruction. + * double instrument the instruction. Also don't let an IRQ sneak + * in before we execute it. */ - cpu->cflags_next_tb = curr_cflags(cpu) | CF_MEMI_ONLY | n; + cpu->cflags_next_tb = curr_cflags(cpu) | CF_MEMI_ONLY | CF_NOIRQ | n; if (qemu_loglevel_mask(CPU_LOG_EXEC)) { vaddr pc = cpu->cc->get_pc(cpu);