From patchwork Tue Jan 14 11:37:45 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: 13938654 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8F1E5E77188 for ; Tue, 14 Jan 2025 11:40:52 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXfFf-00056B-1Y; Tue, 14 Jan 2025 06:38:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tXfFd-000556-BH for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:29 -0500 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tXfFb-0005Oy-Jg for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:29 -0500 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-5d4e2aa7ea9so10497742a12.2 for ; Tue, 14 Jan 2025 03:38:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736854706; x=1737459506; 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=3DqQTTK9Sh5XJ9myCGTy9pkOibsLIRbJz9Tu9rOcYZ4=; b=A4QB1mBlzVVvNZeOklzQs3EHauah8u/7Ii/Qm4ZQO1HhCa20Pv8aEQLcbSOTMUtAfC x01IzwANF9V55m6fsyXs216UHTessl9IE6XESyRuDSk/G51BPAIXGNPINp6hoQU7ljW6 RxghuDEc17RSasRjJLAnRCQyBfXzidwbV4Y34Y0ErL1iX1JQ2KEDVWhETe1RpxbE/qdf gVSud62Z0BELEZ+QOpKaAZ8Y22IzNHPlk0QOPru3EYSVDbT3+S/HBsGNO4QUQ5c8gowi cF7OsIGkimizeCtX7x4NRE3SqqXAw+8QRPb6v6NSgK4fWkL0AZRIfHVV19zYEnSWLtIK o/zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736854706; x=1737459506; 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=3DqQTTK9Sh5XJ9myCGTy9pkOibsLIRbJz9Tu9rOcYZ4=; b=NvOXNH0YJyilQ2Gv+dN+O38oX3+Ov21PsvEv90WiT3KSuI0LvaAlSxO/hXB+ex4a5c 47eKOqqg+yivtYIRT/IgdX8skRh9FY1AdJCo8SK3TcT4AbbTy2FtY2oB5NKllz2rG80V nvV+HPz2XYbiaRfxNPG4No0TdPqvBkDOEV+FR8wxBbMX6EftuK9DXSMZk82I4Db4dONK oGXyQddWUcWdbGebdJvWaQ+4W3xKLZ+7w5dlqfjZNDZ92Wfnfca6JPdgqy3cQEDmXw5o 1O11JQm4NPkr5JFAvRrpQlF8z3sphxdEpPY6nP/Gr6csPXzUy5md28jRuB4lYpSDpnX9 kODA== X-Gm-Message-State: AOJu0Yw4Yv/NCJytCXDGPCXgsGl8R96BeRR3cVcAEPSMzpTmPTVqAiVV f2Z+o3aq9/XdRFspeci8Ea1bmkEqCCTHa7T57VEAuHlVKQlVglE98jpnmwUKUW9xjp5ukwIzsbf DK7U= X-Gm-Gg: ASbGncsMSK26TGrg0e4QkkTUw9kgoQeKEZfZjWjN4Hx3W+IxOLeEKln9hetI4fd4jSN C5a8QjcyynM2A+qNeAGwpAUeOZnyiHuLqrcAJk1VGiPXuFCCBN4zo94T1+teFXnefCxmzx9QblE zDftmeCp53+kbsX7FxlMIsQi6am5oebLSSja1XRdN/FJkoJq3AfM12Z8xkHStXRw/DYDTjgn2n7 GvxWmUX8KPlluZ9bTz9uc1BpXnsC9jILWt/mLL3WT+FPZvfH7yQzXI= X-Google-Smtp-Source: AGHT+IELSQpyZMkTIrI2S414p872NkGhs2AUUkgFQLRAbZ0dznXkH47Tp2d88oamqAHzZh7fh+JY6A== X-Received: by 2002:a05:6402:388a:b0:5d1:2631:b897 with SMTP id 4fb4d7f45d1cf-5d972e08403mr23149494a12.14.1736854705216; Tue, 14 Jan 2025 03:38:25 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5d9900c4b56sm5954625a12.32.2025.01.14.03.38.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 03:38:24 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id DAA355F8B5; Tue, 14 Jan 2025 11:38:21 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Weil , Pierrick Bouvier , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v2 01/37] semihosting: add guest_error logging for failed opens Date: Tue, 14 Jan 2025 11:37:45 +0000 Message-Id: <20250114113821.768750-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250114113821.768750-1-alex.bennee@linaro.org> References: <20250114113821.768750-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::533; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x533.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org This usually indicates the semihosting call was expecting to find something but didn't. Message-Id: <20250109170619.2271193-2-alex.bennee@linaro.org> Reviewed-by: Pierrick Bouvier Signed-off-by: Alex Bennée --- 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 Tue Jan 14 11:37:46 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: 13938668 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C8039C02183 for ; Tue, 14 Jan 2025 11:42:50 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXfFe-00055g-2y; Tue, 14 Jan 2025 06:38:30 -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 1tXfFc-00054Q-63 for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:28 -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 1tXfFa-0005Oq-BQ for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:27 -0500 Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-5d9f0a6adb4so2510967a12.1 for ; Tue, 14 Jan 2025 03:38:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736854705; x=1737459505; 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=BPqPKrdh83zFleyreV9o7NUjIxSBZhBPQipuGt3B3CRliJTPYr66/oycp9/vTRHmE5 7SKUAjdg3s62dRNWlot7fo1qQyBjmX0WXx5ug8xidSLdGCg4W1qf2zPbCDWdcs2oRBKk tLmY+6EvbO7Y9XlRTw6Pg4coEufqViBygiJazyj1QS9hExBiXKdiWig7ytMl5AvJOUSE tN0h1WfD5M4595Myjk0YVulXtm4ld7R+DuXKDCCGKFCA+lane8zaqdfws9wS4PQgE4pl NQZvMWZAKJpHNdIKV1yU0iivpRhKvN43WjqHQiiIU5RCgvO5zwQBUu40KjQeYZVDkr07 6Uig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736854705; x=1737459505; 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=NfA7oEGQSE5a6pBtbsoGNeS/qCLbZG2ekw1U1ZbEMZXLg8OoUI+moLlPWL0mAJOqTx V9RVrimPQ2jxliXXCxy65r8POEfUFTu5Ys1GOt3QjXow/Cmp9Eg56i1fTRz9WjDo4Jhb smbiY204YE1BcXGsFJRGaGqXGYD+C81Ccey7R2XG1dvpuNtpc1ow70qJxjNSwkhJWoIM u3lFUUlQOM7gmiO85vplb/4ByXC9BmuqzNv+D2MjNwY67GgvR9Ma3UJlGbjWxUgwb45l 51WksIKWOMxgtcjGue+TgXXCgQmrAejaRuko1rCGB0DH8MGaTwvSseKrF7sw6KX5S6hY CKCQ== X-Gm-Message-State: AOJu0YzDjFg+ZsLocEN72kjqSlqOC7Du/G52f6POeltn+9WeDZcUVKBR xVLxfx2wyafaONACBaCq/lOQJiX+14aWXsCU/mngQNOyOB5dH4Gxr8C+Pycli+8= X-Gm-Gg: ASbGncvfiOtb+SZKcftKGPMoDQ44oCu7Av/NNRkOuohWFiNlZTVkSMCMlVJCYBv30Xf 7uLqXK4MexG8kmAkjJILF2YDrfXL3m1hN/GO+lRpToHmwUpU9TpTblZgqprMnLvAN6/KoH16U4q Rb3ms6eU25tpXxJF9SptInWt3QFLJEOGAYkxLgJr4hqFqX+L1/TyLgAKfxwKza/UH12mXmFJZ+D 1odDQFDpHpbfoK51RDrnPFxZn3AuAn7V8xUqsV39eGyXlg6YKQd8gw= X-Google-Smtp-Source: AGHT+IGSD9s1d/TdeGuj73QWEAjuBQBDdnXger8Z32G05UFkWFvPAAkrHCypMyEB4mBX5iYNFEf+Mg== X-Received: by 2002:a17:907:7f08:b0:aaf:c19b:728b with SMTP id a640c23a62f3a-ab2ab708d2cmr2339132566b.51.1736854704775; Tue, 14 Jan 2025 03:38:24 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab2c95b0ab6sm615513066b.155.2025.01.14.03.38.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 03:38:22 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id F296F5F92B; Tue, 14 Jan 2025 11:38:21 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Weil , Pierrick Bouvier , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= Subject: [PATCH v2 02/37] semihosting/uaccess: Briefly document returned values Date: Tue, 14 Jan 2025 11:37:46 +0000 Message-Id: <20250114113821.768750-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250114113821.768750-1-alex.bennee@linaro.org> References: <20250114113821.768750-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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.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 Tue Jan 14 11:37:47 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: 13938645 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8F311C02185 for ; Tue, 14 Jan 2025 11:39:19 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXfFc-00054i-IL; Tue, 14 Jan 2025 06:38:28 -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 1tXfFa-00053s-Rp for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:26 -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 1tXfFZ-0005Od-Ay for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:26 -0500 Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-aaf6b1a5f2bso155134166b.1 for ; Tue, 14 Jan 2025 03:38:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736854703; x=1737459503; 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=TNEHmavfEMqqSLUYe6Hr/S1/kFHIHAc1rwruZ9rKrZcgarSkMmoNRzr6NRLsldAw3u hs7aEe/HnBAEoTcAtzmv2ooYZxHZ0Do+/1Lw87ZGB7FWXl5sGhSR2BDM1gpwE933sIb8 iKzdVW+gQrIYMLOzFcqYaN0wJHJRCaVdc6JR3G8JliQvYK0TSg9OJdRO1614YQ875yaa +1nW+6IyMbVpZpjj+GWYSskkxzqJFFLJlcY8MRK9bcz5dJmA66Trzbs2vVC9mzjryQ0w ytILp2BQtXC3O9tM1oXnP5nCijywt9GTjdJKqauyS3cawtt/fqSOOKZKER6sM4aeO6cp iU+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736854703; x=1737459503; 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=gOjPaTlhpkahw/irk9UF+dLw0S3bb1O19hqda8Ys07j34pUiZHGuleYpzJtAaDhWnW 2mJPAVGDebeLdum6QpUn3XSUmy07MPjYO4ZtyLZWeHL0vzovMFjHEt+WTvxrrt2GUVvM 6MofUiNmgRrPoozV5LmMVjZTPxpV9s/agS+VVW/xFLU0wItj0Jn/AULP1nwJjR53/JY4 lturSQPopphJzW3qxJ6y+pCyozzU9fNwY5wDlwla/dleCVRRpOQ+pGJyFFxC4ZOI2cDn asRGAkxjunChiTK8f8QhbWVzlsI0GXr6oJmh3Fdqs8H8alHmpZTgcK60FEzUpxLbYKEs S7Kw== X-Gm-Message-State: AOJu0Yx68OrdmB952xGdqb77iLXJge+lEhIC9sBQ+EMGybdbE5OIgUtB 9PciQ5xxk6rMHfqm/DyPI5Lk7umtnf/fuGkTVVTJwiGIWbjvj4Y0LyLror9Qy5Q= X-Gm-Gg: ASbGncvej+LmF9mbEMCmZE3CNDF6ZI/pxnUcWs9w9A3qxfQ2nA952R4gwpsOzs9MQpy KVaJCWrQaGxCMYaBqnUoY8nFeagy9fCQBh9kcGMOgYTR2wrrvcPm3Lnf5gHOhq84PUltQhS5O34 KTMpTwEHwmUWjiVDcLitO4BW51QpQhv8jH0JnpvhUXEDFzt6uwRQTEiu03KvJ9mah1jx4j0vLWR iCwJcOJaOh7baxWLHOE1VbK6NJxgl8CLbtGJujehutKoeO502HUAYs= X-Google-Smtp-Source: AGHT+IF654gxsZBx/NjacLL0k1wtqmTyt7g3pPocG6DwycMN/lQ4y6g/2NyaLYU64s2G+0cPocpNig== X-Received: by 2002:a17:906:c14f:b0:aaf:1f6:7423 with SMTP id a640c23a62f3a-ab2c3cb6e2dmr1669429266b.18.1736854703475; Tue, 14 Jan 2025 03:38:23 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab2c913605csm615049866b.82.2025.01.14.03.38.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 03:38:22 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 122525F932; Tue, 14 Jan 2025 11:38:22 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Weil , Pierrick Bouvier , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= Subject: [PATCH v2 03/37] semihosting/syscalls: Include missing 'exec/cpu-defs.h' header Date: Tue, 14 Jan 2025 11:37:47 +0000 Message-Id: <20250114113821.768750-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250114113821.768750-1-alex.bennee@linaro.org> References: <20250114113821.768750-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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.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 Tue Jan 14 11:37:48 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: 13938646 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 51C87E77188 for ; Tue, 14 Jan 2025 11:39:21 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXfFc-00054U-Br; Tue, 14 Jan 2025 06:38:28 -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 1tXfFa-00053t-Ri for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:26 -0500 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tXfFZ-0005Oh-Am for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:26 -0500 Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-aa6c0d1833eso328648566b.1 for ; Tue, 14 Jan 2025 03:38:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736854704; x=1737459504; 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=wTA7NefvDK6SBU8FfH5jRXOPPxKsc3aYEbgi8Te6fEmgQgButbzMoeBfoVswgGAIrO AeH4K4DreALiy+Lc8JplMy4RTushZXtoB/3mZCDYaScPNf+Pc2tQk25vutwzNp3YfkqZ t2VozkBmk8lmtLgN5/uSXCJWaeMtsk6AOcRJNAYBFWT861sQaMZnL1WCOrFGeHx4N6Jw j07vQqXQ1JxI9+ZVZYncG2R/Mxgo6ViqFXL/EFqCkO0KMyCWt9uy0BEaErzfylA7Uv+C /lER7z94T2LsKZb0qSB1pO57vKg/84SYqg4dfiQofSTVURFe7k++s3qtZ2eIJsVyBq1V CNgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736854704; x=1737459504; 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=mziYdm5m6fQmfog7+QrB/7nvpSJ7hcm8S/vksvMJov5uXUce/Njl4AWUjgt3x+MhcE j2dbPApS9PcXsdnF3B/8YRQKRZupnLTUMORFMm4XK408++NVF8eAT9mg9ic7OUXXwlpk FAAyA0YDaG8avkG2m1QaqMbcBqEkXnnLMv7YF9hptn5/R7vC/A7Fa4sGFDTsD13xXeyj txwZ38RSCZjZ9X3l6/lIvOxEYLGU1fL/sZ6p0YPr+IRYUleAEdLegJcY/rnetZ9/TzrD d3P03JfQEs30eMZtQO9WjnW9xBIBBzcaqONcfLLeWOochg20soh82PAeCgFj2yBAudus jeSw== X-Gm-Message-State: AOJu0YwXZeyD7Ez1/pvDn8fncOY71zVne8uURVIqJ92T0FyfEn2u7EYx C3EL6Xyu4xYm0WYOboX+Hwir82mUZiuWCVljM5enjuXxNGvDMW2FmkapwWwWRUQ= X-Gm-Gg: ASbGncvoJ9xdePXKKK2x1DEi5o1rtVRhjJw4WHLxd1kb5n//dRKCPhXH7aN/fvNaC4c ZaFfTiBIF97iPbKpCB60yLInZN28SERw3Bb6n02ghar7K3dB1Xf5f7GIFmepgSQPK6E276AYgkf xxSO16AloJup0++QdllLvTw1VET/jn2U+mB3imLRInB8fNjXm3aWWXPE2PmTTjc42Kc6I9QSgo+ fmi86QLspm4r4AtrQSfTz6rUscSNld97LDPabeumwBcc9l8mHGMR/g= X-Google-Smtp-Source: AGHT+IFaOkY7aOAcJd7XLJt22LzsNW/qy3PcS9JBL1OexnR3r+9bt6ign45K1yQsYJiMWZejNxuYew== X-Received: by 2002:a17:906:6a04:b0:aa6:800a:128c with SMTP id a640c23a62f3a-ab2ab6a8dc8mr2510336666b.11.1736854703725; Tue, 14 Jan 2025 03:38:23 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab2c95b2181sm618489366b.162.2025.01.14.03.38.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 03:38:22 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 256B65F935; Tue, 14 Jan 2025 11:38:22 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Weil , Pierrick Bouvier , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= Subject: [PATCH v2 04/37] semihosting/uaccess: Include missing 'exec/cpu-all.h' header Date: Tue, 14 Jan 2025 11:37:48 +0000 Message-Id: <20250114113821.768750-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250114113821.768750-1-alex.bennee@linaro.org> References: <20250114113821.768750-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62a; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.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 Tue Jan 14 11:37:49 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: 13938648 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BB12FC02183 for ; Tue, 14 Jan 2025 11:39:56 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXfFg-000575-Nm; Tue, 14 Jan 2025 06:38:32 -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 1tXfFd-00055f-SE for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:29 -0500 Received: from mail-ej1-x62e.google.com ([2a00:1450:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tXfFc-0005PI-C1 for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:29 -0500 Received: by mail-ej1-x62e.google.com with SMTP id a640c23a62f3a-aaeecbb7309so1009884766b.0 for ; Tue, 14 Jan 2025 03:38:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736854707; x=1737459507; 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=skwqPMm2koecTia8Pn0PTTmmz+U6HycnkxEsEaAEKVyUbQh4I0Fz9BCQFFwoMZaqws YrlYIjrvqQrbiEzcMzt4Al+Gw+aOkDoO5CTx2j49zqumdOuEMDvnJmU8T9aWSPXUBuR9 2PqFQG7Ks1wrU75OFksOfncVD6iM/xQifnRgwJaJN+BrD986Kh9ily1AcM+TIlY1jT5X 3jCSMuoJuet4gpMSB+nMQwgX1i6R4Z6ZxSaPsej5pwl5ivofZqptbfPbAjLn2uWJjPkh ZqrrswjMhURBO+VOu6xOiJSdXtdyJPAD+IGgK7W0vmT7T6mcMtnVhSJYzfYgGTmC548U TuFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736854707; x=1737459507; 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=cw3y/WikX2BZbg+ShYJVjm0mooTTVckx2wFju5awp55lf8uT+dmL3VmCEOK+Vq+E/W 2i3xamYimTqq/if1aLiNp8z2vVTTgqwD8+G/Fe/EXEcYVlWkM2PCcMbxr/M9K8brigz5 P7riR+AvvquBK5JoSBf+VpeT0hcn+AigHaHv4P6I78fBoa+8vdURxXbxYrIwFBBPEdpq nNVGTACEAfzXjOWFM8ip7111QfYAPBnzudh0+xMbi463QXnpqW1RNpJb6gp1YhzDojPS b+GpzWqwSsACd5MvNxO+4zeG12HihbFy4TbTWyUx8wyaXdXKqBTaSG0H50+CGkF7W42k VIXQ== X-Gm-Message-State: AOJu0Yw2+O0UZYQUv6eOLVPV/hDvQv/AaG++QJdqKyfDAJG4pRQlAJ6/ enN+ItBMtOtqODN/xXOSogcbzlyCOoh8mR+W0IdLZPCspPZRXNH9IU91WsqYR1k= X-Gm-Gg: ASbGncvaWT2S/ZcDFZeXrQvZwCZCwkzxAdhUCTk9gkYnDRFhYHeHXAKMPEL+F+QEih8 5GC8KbyptGH3ZwsLv4oSaVbpY09rjE13wBqah1NjOU31qxo2x+pzE3iYrmfRohW8P1M1taEuBkk fnit4u8yaJjuXEEwNenGn7RiE0n+2qc/h/qZ2O6SSz1cpFopl93fcmphydOf5MeerbED7aC2Dot 07SQ2smVBk7cXFVCHp2iqB50B45K6Eo0sEdnKvXt6ciVCOuj8xZDtk= X-Google-Smtp-Source: AGHT+IFfmI2s0No3bDPqKMcwlnQ0CJSA9bK/ou8QIrCmdLdhry0hPg0BzbjdeEsv+pYtiqYnS/hnkA== X-Received: by 2002:a17:907:9623:b0:ab3:3892:b943 with SMTP id a640c23a62f3a-ab33892f542mr205027366b.53.1736854706614; Tue, 14 Jan 2025 03:38:26 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab2c906009bsm618348266b.25.2025.01.14.03.38.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 03:38:24 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 3AA985F938; Tue, 14 Jan 2025 11:38:22 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Weil , Pierrick Bouvier , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= Subject: [PATCH v2 05/37] semihosting/arm-compat: Include missing 'cpu.h' header Date: Tue, 14 Jan 2025 11:37:49 +0000 Message-Id: <20250114113821.768750-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250114113821.768750-1-alex.bennee@linaro.org> References: <20250114113821.768750-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62e; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62e.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.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 Tue Jan 14 11:37:50 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: 13938657 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8A080E77188 for ; Tue, 14 Jan 2025 11:41:08 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXfFs-0005By-Ah; Tue, 14 Jan 2025 06:38: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 1tXfFd-00055I-J9 for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:29 -0500 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tXfFb-0005P0-Ta for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:29 -0500 Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-5d3dce16a3dso2950287a12.1 for ; Tue, 14 Jan 2025 03:38:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736854706; x=1737459506; 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=j1MvElZeUnY5BwersMfw3EM9OI+PtBEKPOBcPyfP947evhGxFILu2qmugHfBZr2BOS NO+8HzM18D2CU5oUyJitYc2cwSnbWLGwj18Iytg5mic18CPC3rlsWCcMU+kXgfUS6FC/ B2CjdVIT1OzU2DJM7TzN4MExdPGL5VuaAXAdjY7hwVzqBbpg2/ucKXq8osmu3ERtkZTS HQ8DDGmK3I8xxPBQEMslOPHrHepK6JyumqNX1voIYHxaETeS8KbX7mDRZEGyO2XTvovL /ETPPRQDucfaV34FW14DMhggIXAwrg3r48lABfzMoJtWEYIiBnlRVHFE7efSeuIrotpJ yf7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736854706; x=1737459506; 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=V+DLz6phcrIYpOvgRNR7pxc4++NEX7m2M9Je6Z0nIbM3t4PEhi8APPCenSYHFTVy2a JpkMbZH+XYuHlSQLv/q8tA9Vg4nQyzqp4eZClHPDN2mbwokU72tsnfYJk4geZXSvljBF /lNdl7xS1pRqu3iXyH1pAWnvpMWSwXsKjRPztFIedW7PrK9fbDC5G9U6tJBUugcMivqn pDwq87bDJjuDH/PmSaNGawCmcg0MSkzw2SgBKKHrx3+uQs0JMGTKtlKwfDaZLwh4W9sB 9Iw5TQcN0EUfAeoOkPIUF8Hyq+fKutZE7Esc7uwvJhv5QPwyAf1t4MhakAxhbwfj81Ux C+QQ== X-Gm-Message-State: AOJu0YxRrr7MxT3q36Fz/a7eyuK94TEm8GvJHlfJeC7/JJ4ay+oRMVmR Qep+1eC8tGERu57/3hM+6NbwwxUkDk+B2Pbz9+CwKaLgIf1vxFNt2Lyi0Yn+6hg= X-Gm-Gg: ASbGncsW5J64gIZr21cGnqAZmWwBkJ9Do5ArM7foMYZHWLDyjJjCYB/QvTK9wsmA11Y t5WYNYm8lC91/XQV8VQQDpFjGzcauNo+BwjcvZh7ULNHADZ9OB8r/z6RrxzKHmp7b7Kv191qDUq pJjxTeAWtiotJd8s+SkZAUeGEhnqfWgU0VZBYHttZhWdhWKHgpoko5Ks65PfLd8gX02FQVN1mE7 kmoebnYSfoaph/ZViEK80hzBSNNctGr8QkJU4JKJMYViBgS37zd4Ug= X-Google-Smtp-Source: AGHT+IEsdf4iZVC3apfhiO0ODtJgm+ywWlh0cRwM9wDem0JxkPyAtQ/tsbOCVAfRqqc3sqITnHMYAA== X-Received: by 2002:a05:6402:5250:b0:5d9:6633:8e9b with SMTP id 4fb4d7f45d1cf-5d98a10660amr17120511a12.1.1736854705477; Tue, 14 Jan 2025 03:38:25 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5d9900c4b2fsm5959449a12.29.2025.01.14.03.38.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 03:38:24 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 50F485F93C; Tue, 14 Jan 2025 11:38:22 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Weil , Pierrick Bouvier , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= Subject: [PATCH v2 06/37] semihosting/console: Avoid including 'cpu.h' Date: Tue, 14 Jan 2025 11:37:50 +0000 Message-Id: <20250114113821.768750-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250114113821.768750-1-alex.bennee@linaro.org> References: <20250114113821.768750-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::534; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x534.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.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 Tue Jan 14 11:37:51 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: 13938664 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D669CC02184 for ; Tue, 14 Jan 2025 11:42:02 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXfFe-000566-9Y; Tue, 14 Jan 2025 06:38:30 -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 1tXfFd-00055A-FQ for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:29 -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 1tXfFb-0005Ox-RS for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:29 -0500 Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-5d7e527becaso8967483a12.3 for ; Tue, 14 Jan 2025 03:38:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736854706; x=1737459506; 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=P0Vy8EKQn2DNVqUaENaXxrd4w37jYc+W8hpJUP/poGho6O447IMG/rc9TD1g/B3Wtv SbW6Gpf9NSAE0bpxggJHmYMOgjxB5hUIoaobWKEc477zOYCaMG8p50gdMs1sx0BxU4/L jqIhZA5qdpJ11OjmaegT3JXvgS3vbZMr19r/sWyiTS2BnjCbhUtTHpFoZwnmpG2b5wK9 zSp6G1DAuksQ0Nd5vEk8mG1QQ1y4LdZqNuWJfR92Hbersv2XvjMIPNSE31EKhpdmDjx+ Zncg+2FVvxduuDsVe3u86vF+elfRgS7w1l3oMfT81yWWyL/qkKVuSGt0Xrz0F8vHUxgf zfrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736854706; x=1737459506; 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=pJR4QNS4a/aGZBfhs+7mBNQMmKWrQHgJ91R9MvF2bUF1NL5tvjEjM91aMyUj7LWeap f42gChM74wh8lZQDT7xckGkX87CQDZLaH3pR0T8/A66P1SPKLBMMdUdjQrvRcuJYOFvv bZQN3jlbr7QkDcywAp4eRtz8iGpqMuh6aPvSWWiUTfW4vjDdDQ/v+SSA7Kd4Br/qveK0 89dEmVM4Q8uliKMs15af6SrH6eg4gkwr/LZDo6eWW2GRwmxxVn7PYV66GZ0WnsKBWv9T XQtXJKt3dOd8wvGv4GoSNrnY9umV+EVp6gI/7WCKseeNHgZopdEY9RtQAMScfYqMm5Tk CnOQ== X-Gm-Message-State: AOJu0Yxf6zDNeQSr/XaiU+V/qQuZpjBxRgVilOnpu73BRGUzsXx4kvWd /+LsTrD0Hbwju+lO/yNUoijWwpd/hbZkoFD9qDV+6cjfWtcBjUvY1ItyDSbilQE= X-Gm-Gg: ASbGncs3lHgfe9HzbgTlDo3zt8WPjSbmY/k7zcpAtfkaBX8jLHEt2S6vqJhOuiJg0Tp XxYGVcY225OU+ZHUtO/UzxCIVLxLCzdUXIQxZLF3KpeNB7HvOSgEs/JisJO+Vl/nvfDt9xzAV/T zGs5vCoTFnQ4HMbdNf4042qTDXbduKeGLYgWVQi+0q5Fs+NcVZ6S2bq7kPutMuQ6FtBbjvNDyzG qhgbI08QcN9NLn1q1p/IInKhDZ9LQIvNHowIzDEJuKvRpob4A5XdFw= X-Google-Smtp-Source: AGHT+IErM1tlIZTvq4ZNTn0gF3vXT/XwiZNqXiD6pGnxLcF7SPv/i3SsQtFz9nEYCbd2nxDHpHP0vA== X-Received: by 2002:a05:6402:270d:b0:5d9:ad1:dafc with SMTP id 4fb4d7f45d1cf-5d972e639famr55412470a12.25.1736854705994; Tue, 14 Jan 2025 03:38:25 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab2c90da8b2sm618578866b.44.2025.01.14.03.38.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 03:38:24 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 686115F945; Tue, 14 Jan 2025 11:38:22 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Weil , Pierrick Bouvier , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= Subject: [PATCH v2 07/37] semihosting/meson: Build config.o and console.o once Date: Tue, 14 Jan 2025 11:37:51 +0000 Message-Id: <20250114113821.768750-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250114113821.768750-1-alex.bennee@linaro.org> References: <20250114113821.768750-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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.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 Tue Jan 14 11:37:52 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: 13938649 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DDBE6E77188 for ; Tue, 14 Jan 2025 11:39:56 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXfFf-00056C-Jk; Tue, 14 Jan 2025 06:38:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tXfFd-00055E-Hr for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:29 -0500 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tXfFb-0005PC-Rc for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:29 -0500 Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-5d90a5581fcso9127822a12.1 for ; Tue, 14 Jan 2025 03:38:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736854706; x=1737459506; 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=acFhJ3tFQm8tIYCY6Z3d4lTsupXAHuvOYJbU2nvujpY=; b=X4uD7h1fq/abbI1k+9JGfjx2D6tP67q+quCrV12byiXQ93Eou75ENGH3vX66eSepDF a1sD44Yfpjs7WQSxdst7UfdfilvJO+kZkMUuhW8DWWvvgUaGuo4WvDXw6L+Sl+yhmFMj xcv/XrLude483AiOi1fU84tm/dUI5m9d57hY6rmzQiHAJtTLnskntnTXogJJ4UwjqJnr 6re81kahnO66bsyztFxu0smQV9n2Wj2TUl+8O1dTYeipJ3tfaaULJUsViftdHGjrjnhs PObSBPPx6RSkvEWRvIypjYHmRAHfbL3R3Cf3a5uS2cQ2UpzqZj8XoyXW3OjgUk4+Qrnb FHkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736854706; x=1737459506; 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=acFhJ3tFQm8tIYCY6Z3d4lTsupXAHuvOYJbU2nvujpY=; b=PmneoYlAks0BwXZrUPO1LWqN/I9GmrYmApQeEGTkBPKC68j/yUCaaAcD1zg8WyYx4z wGvSYMmOZ3uW+96H3QClWiGons7VZmTUTGx1jWp/W1hoNhTjjo0+VP7HU6u+zHLA5XCG Pl/agUW8gIRvKEqp0dDTSs7YofhpcyrXkS+b1jgnQfOwnbY8tqSZLcumthROAgnk6tEf /N6SxkLvrniRKeoxtnixCdP5m8xDPeC4RjOa+a/yzXEo8/B7jlMAvgVLLlLbbVXDfPzY nvd096G3jtryC7J87seuDgq04qc8F4LnQyQKq+OkEDyAU6qPis+Rr+L2R7qHtkFhxbw6 5SdQ== X-Gm-Message-State: AOJu0YytMXWT4YHmvoqAJYKLtmtbg09izGc1NzroF7q4q8XcCykeXe/b T+y05gdC1hIauqAsdZ27gEgks9zGfmE2QnMF4DbJNdpnjVhJC44p9YK5XtkjKrc= X-Gm-Gg: ASbGnctRNeEkT4Xb/6KQj60htGGoRVvSZSBggvu4u9oFwvLYfdxuEDZYYDEAOmE36rV CD62w+52emmM2q0hW3rWYb2zEksJ0uy3GcdmXhm2T8RncoBUJWHhxKe9yrQ9v3MvXOxh/kSMgUB Cukksc1PhTjRw3qbBbJtSIe42gXvDj8hZ3PgN3uOy0e0GrSZIxjl0gCkS8HJpPF0CgktW4fC+NP IJoFVuaFnj9emi3W/mQ4GzjOjpNz4+xfuwQTrQn8FYvGhCuefL7wcc= X-Google-Smtp-Source: AGHT+IFwr32JoqTQVdV3V41OUE/8gz//KOdU1cyXJOWda0AfQpjR9p0hylm10ivAoKDwQ51rzzH67g== X-Received: by 2002:a05:6402:35d4:b0:5cf:e218:984f with SMTP id 4fb4d7f45d1cf-5d972e4e6d1mr21820742a12.27.1736854706310; Tue, 14 Jan 2025 03:38:26 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5d99046d822sm5864624a12.56.2025.01.14.03.38.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 03:38:24 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 7EE785F94C; Tue, 14 Jan 2025 11:38:22 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Weil , Pierrick Bouvier , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , Paolo Bonzini Subject: [PATCH v2 08/37] system/vl: more error exit into config enumeration code Date: Tue, 14 Jan 2025 11:37:52 +0000 Message-Id: <20250114113821.768750-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250114113821.768750-1-alex.bennee@linaro.org> References: <20250114113821.768750-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::532; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x532.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.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. Message-Id: <20250109170619.2271193-9-alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée 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 be029c52ef..7e3e6fb353 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(); @@ -2667,8 +2671,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 */ @@ -2715,10 +2718,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 Tue Jan 14 11:37:53 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: 13938665 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 62E49C02183 for ; Tue, 14 Jan 2025 11:42:31 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXfFt-0005C1-0g; Tue, 14 Jan 2025 06:38:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tXfFg-00056y-Df for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:32 -0500 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tXfFe-0005Q4-G5 for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:32 -0500 Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-5d3d14336f0so9218364a12.3 for ; Tue, 14 Jan 2025 03:38:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736854709; x=1737459509; 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=JhuWbz37w1Y1jozAto2PdaStriGQyF5dVt49ZcJCRfQ=; b=wrPmxuh5qgxEsvFT/w9ColFq7CFUTz2nSqDz4VR5zEiLpR7Zk+bkpPaiZRRkvY4r2Q uVgihEo8WKGuR1k30pR8/jU2h7eTSaWmel3nPZFTWIhpD+NTTS+5mymjiIQPBKss8T+m O3qI257pqgMb3Ga+39+tp5g8EcoeTB8aQhQVIAP0DNDNze7+gzL4EKl6QTzvmwddZfHz 3xD4HkZJlnD+gb0mztEy2htxd+UsxA+IGSQKS4X4ChsLH+a1axpiH8gxiWiTKLSlv13B 2cTxW8rwgmmCAcNiWgrnuyAcw62BKPACBs6hHSO6SQu/5dmzRN4fPvCfDlFj5r5XjO2d nZBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736854709; x=1737459509; 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=JhuWbz37w1Y1jozAto2PdaStriGQyF5dVt49ZcJCRfQ=; b=m8xmPMoOAzqP3yJgty9XGmWdvYOtBNJAQPfR15WtaK6BG/o8puuu4Uxvt3jBj5PYTh VmxjK7ujpWEQkCjMd6s2377PYejqySxTDfbjwYUpXLf7vBJzPCXvDs8Nye0Yh7xMZ8F3 e/7QPIlNjdAnS1dhvoiRv0farjjzWBEDEvF9ulhPuOcLfUbkx2T9tVvWUFNTvPdzOvmi domUr0FcQop7GOX/VjQajuH0Qmh9cJznZT/2FXBRPknvtdhbHzKBQDpY6H6DCCQO3EhM Iui1RFrZ8i4eUb6245C+pqPvtHp7IGsLq7OOIRLGtbKn4ERq43WbChINC1CrDteYeotv lg5Q== X-Gm-Message-State: AOJu0YyqEpnGMNBJcBaFt3X8nQpc8Br3BPKv//u9VTGGqFqVMo7ItJkm iIKAHyMFcScQmavlw26JGWF2ec2aeQJMPYVtRYj+Kz2CZu4n9n3n2jLvh4nayF9meuEac5jTGls B8v0= X-Gm-Gg: ASbGncvwygms+rTwcPLZ2JeCSXbLXrpqq21bFRoW2hnUY5N3YxqOL98C6+oDhGqy0LW r5Iu3gEf4s4tLicxMG5CeAkSDKd539v5i9sdb4MHcB4O0n2zgOzRLywYYAE2NyD+MgoP4y3TRMK bkZG3CgPFMv6G+d8x+YYWgS7PXxKq1CemiGFSRZZ17LgPbQm5xJpzKekN/gXMbLddF8Q9lZR18c dvlf7ACKUZrTQTymE6zcqbs5rtcr5S+tSLNy9Hwz4EGcfTHOT7QzkU= X-Google-Smtp-Source: AGHT+IFKkemRyuRcCVj7lg8AL+r70yww2bUC5tH0NctssZn6fTQWNnEnN8ayHWo+c4iWUXkUTvUR9w== X-Received: by 2002:a05:6402:540e:b0:5d0:b51c:8478 with SMTP id 4fb4d7f45d1cf-5d972e0e274mr22202061a12.12.1736854708901; Tue, 14 Jan 2025 03:38:28 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5d99008c37csm6173423a12.6.2025.01.14.03.38.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 03:38:26 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 946EF5F9D8; Tue, 14 Jan 2025 11:38:22 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Weil , Pierrick Bouvier , =?utf-8?q?Alex_Benn=C3=A9e?= , Paolo Bonzini Subject: [PATCH v2 09/37] system: squash usb_parse into a single function Date: Tue, 14 Jan 2025 11:37:53 +0000 Message-Id: <20250114113821.768750-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250114113821.768750-1-alex.bennee@linaro.org> References: <20250114113821.768750-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x530.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.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. Message-Id: <20250109170619.2271193-10-alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée --- system/vl.c | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/system/vl.c b/system/vl.c index 7e3e6fb353..e769132ba3 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 Tue Jan 14 11:37:54 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: 13938662 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C3E20E77188 for ; Tue, 14 Jan 2025 11:41:43 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXfFq-0005Ac-4T; Tue, 14 Jan 2025 06:38:42 -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 1tXfFg-00056K-1g for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:32 -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 1tXfFd-0005Pn-U4 for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:31 -0500 Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-5d96944401dso9085060a12.0 for ; Tue, 14 Jan 2025 03:38:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736854708; x=1737459508; 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=xzCUV5Z+Rd15+4XyPb7Dt11oNiPj3EBynkgRISvNgR0=; b=ixa1qOf8bfHMmsVirReLSAbZ58TcMTiGz8bU/vLwEjcmVqRbdMoJGqzTOaDRizVCzl n1PGrEuQHWitWME4yo4J4fmQU/5mogiD8edDw4r17RpL1d390bl68YhJLZQ1UpXNy5hc 9odqKs6ovBgXozxu7q0p14jJmZg2HCT2Aapar2FstKCx2UEnpWmPRBspigwkwOwtM6Up nK72yItr339Db2L8wVAil+h4/B/hD7t9opR1Xv2vI+6pQWY2h5qCOCHk0V9gJsSsaDmN twZdq92CnwSi4uNuBec8balFCV8mr5DtT1TczCXhZp5/0dJtKVP3vEI6wSGssQaU8ajR Q80w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736854708; x=1737459508; 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=xzCUV5Z+Rd15+4XyPb7Dt11oNiPj3EBynkgRISvNgR0=; b=lixDSsm6MXK2RMgOJFGgQ2Pqo5fFdAsGnv5N2Ok2qiTGK0EUEaRhf8HqaL7yc84CMp 0MbT0aKN81Q4EYsywTfw0Jr08orMA1K9U+jX6fyxycjobeplhkfA9K8ZXQBjIxAU+9B8 IrIVo30KOimmxw5iGvXMUpn7XwGVovmfja8C2TBeYujcxPW2vXV8NAkG2/7TM5xJrqCb HpKzp/ZB7bHmQ7fWKfp6bSUGcPV7P2cf4eS50/rxnjYAsqCUsu6lgqLle6FojlU1Mgrv n5ydp7jFwOoiGGOVLoBevklggOFFAZ4f9/VT5Kj+sb0llhW7YQKCV84XTVluauY4Cjki DZEg== X-Gm-Message-State: AOJu0Yzs3Zk+lFLXty9ThpTv36kW189YQ6iwkBVWPNrRwU4Uor/BB5KT iEIiwJTavEahR4ngj3Cerf2/lS3noASI8bOhoKhidnS6B0l2wNgVZxbyx36zalo= X-Gm-Gg: ASbGnctVXAad/vKudOmvL8BVJ0F4H76ffzmtbZGOcuLF5tFgPuJZl9X6i3d7Q/iHuLS tcEgn8ALO125FiWlpKXGuMIlEEVSbeaRk4tglvsfOZpONffxv9I8FGX1s7l46BiTQnKMuyyy+ik yBvB37NbbYzCNfV+rnRfh8FGpUQ/iuZmkdOX/EqCii94jieZCD9QiAoQ4QNVOD5lMEcz1sv5FOS rReaJP1NzRiq+HPInXOGFQmqjHPkcbgHYib0sP2T4YbFTwwPb5VM+M= X-Google-Smtp-Source: AGHT+IHnSND/8iUXfR95L4d13ZQhNKMbxQADfbkmDkBKCJnlJDqYQ9P0s0tYUWV65bsda7OiHN9yxg== X-Received: by 2002:a05:6402:3225:b0:5d3:cf08:d64d with SMTP id 4fb4d7f45d1cf-5d972e6f2d4mr24706686a12.32.1736854708281; Tue, 14 Jan 2025 03:38:28 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5d99046a17fsm6032580a12.62.2025.01.14.03.38.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 03:38:24 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id B0BDC5F9DA; Tue, 14 Jan 2025 11:38:22 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Weil , Pierrick Bouvier , =?utf-8?q?Alex_Benn=C3=A9e?= , Ilya Leoshkevich , Laurent Vivier , "Dr. David Alan Gilbert" , Paolo Bonzini Subject: [PATCH v2 10/37] system: propagate Error to gdbserver_start (and other device setups) Date: Tue, 14 Jan 2025 11:37:54 +0000 Message-Id: <20250114113821.768750-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250114113821.768750-1-alex.bennee@linaro.org> References: <20250114113821.768750-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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.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. Message-Id: <20250109170619.2271193-11-alex.bennee@linaro.org> Reviewed-by: Pierrick Bouvier Signed-off-by: Alex Bennée Acked-by: Ilya Leoshkevich --- 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 e769132ba3..1eb1af3345 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 Tue Jan 14 11:37:55 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: 13938667 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 843E8E77188 for ; Tue, 14 Jan 2025 11:42:40 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXfG0-0005Fo-0g; Tue, 14 Jan 2025 06:38: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 1tXfFf-00056H-RD for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:31 -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 1tXfFe-0005Pr-7b for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:31 -0500 Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-aab6fa3e20eso974177466b.2 for ; Tue, 14 Jan 2025 03:38:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736854709; x=1737459509; 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=hgLSFJEcqDe01PjKD1GSDO6Rgchp12xoQ++pAm3gY5OzxkQsk3v4oeIshsBRIOnRD9 TaH1ivWzVHNlF7SCqPXDhL8boi4Nj20StqozkUWkUHUXloyqQ7QkeMxtpTW2Ffm7I7KU l9shBoJyoMpw3FqckgwhGP+TQbMay80cNpLpVYlK23xPR2vqBUh3STq2p4VLXzgnsVkK 6CkNY+IS9vQbCM9G/K7yCcosu9PDh13ouK92ViGdrZDoAlluYFKUV9RYx5vbyslsuVaS lxbr7UxvJ5T7Y9D/YZFKRi8NR1zNTgjuJB2x/fIGpzLM+MYkMhj1uFEhRDXLl7WFzh+K xQrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736854709; x=1737459509; 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=MpBTP/Dg335xxs9928yfj1F6faQIfc/Jbcd5Vun0gQNiSbFjCUqHRaJo5LGbglbWZK CJEQ7lZAl8UQ7v0rG4jEX3/Jb2ptNv9R9uebaRqIgskEl55PmxW+otw/+X+N2Kg1lw6O lNsNHAMsMzkbV+MDmpMF8KCMOTgukB4fygoH2zPfKYsH6ay6E5XsXGc2JaWH4qJTOisq 5xo4g6K80RTk57E+gs0nx5od0TpDZ5Jz6YEJ6/LV10tkva3YM1amYgVMSV2+YTi6IuL2 ZRRfH88fifdSJI0d+54Gj4iBgKP7KlK1F0rkjh+moRY+m3LbQ3kI32KR67V7cSoM+9E1 c9WA== X-Gm-Message-State: AOJu0YzQ7Mr8CrlFxBfW3qmWZXNOYxUauV2wLHlsJz+o8RUE6AvwNfz+ /Be6pFSg91UQGJYm8bjKCgMYZKAUcuYR1HhMw7FYp+0m0lfMqY9zM/aY/Q74GmLGaNQv4ozDgwp eKn8= X-Gm-Gg: ASbGnctpITmPDGixL0TiP4h1gbFWrVWkje9vxIWsdHhX85+BackOq4k3neuDAn/sOES ePRMLKHLpDwkqXnWnT/3n6b3Ik3N/3ERYvuI7FK98LC7JMstfi1rhh0vlmR2HoamtgbC1Oi68fG 7+CKmV/wPrnAGW3keE5IEj9OW9ByMOIOY8YpSQVMn8TOKqTTnbREOIh5yLc9LtOBBS7A3Y/bfgU akaYY7KRUwo9u0t/PFxcRjnr7WtfMuXBngAKy3EmsFN79JkPkeqPP0= X-Google-Smtp-Source: AGHT+IFZIEUTIxW4o2JF9gPbX1ZALE1aBODsqHCahnXwtVLak4uxvV+pjMSNdNiAOeKrhG+/lpviqQ== X-Received: by 2002:a17:907:9490:b0:aa6:6885:e2f0 with SMTP id a640c23a62f3a-ab2abc78dd7mr2374565666b.46.1736854708635; Tue, 14 Jan 2025 03:38:28 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab2c9060c00sm619628766b.41.2025.01.14.03.38.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 03:38:26 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id C5AAC5F9DD; Tue, 14 Jan 2025 11:38:22 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Weil , Pierrick Bouvier , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , Alexandre Iooss , Mahmoud Mandour Subject: [PATCH v2 11/37] tests/tcg/plugins/insn: remove unused callback parameter Date: Tue, 14 Jan 2025 11:37:55 +0000 Message-Id: <20250114113821.768750-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250114113821.768750-1-alex.bennee@linaro.org> References: <20250114113821.768750-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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.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 Tue Jan 14 11:37:56 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: 13938660 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4015CE77188 for ; Tue, 14 Jan 2025 11:41:31 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXfFq-0005BF-Qk; Tue, 14 Jan 2025 06:38:42 -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 1tXfFi-00057V-8x for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:35 -0500 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tXfFf-0005QT-Jm for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:33 -0500 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-5d3f28a4fccso7797200a12.2 for ; Tue, 14 Jan 2025 03:38:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736854710; x=1737459510; 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=VqkFhMALgP58Nuydp6Z2aP9VzLtD88mUC4O2U+UmVRIdTNnutRo+szxDgsW0mzO+rb wBOksxD0PkyHEk3aRbziqeuTwGjESpmoJi6UQYfx2CbvXv260j9eCAAccaEyC50WZE3V TGSuix+YIZXuMW6y+DGySdYyjfcoXs7wfaHEm3MWirQ+5BbKvYOTMNcSAliXqeP0LAH4 ytadk0c2xP5yB2YjD9Yj3ZMj3GruUFLz0e8JH1s3oC5S6ROdD4fwGiB35R68PA7DDWrC zIqc1A70g715vRZ66x7MNIc6xRze9v0GpE1gWcQAsTp/QLu1ALoDzMldpHLMxl+bDRKc qxxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736854710; x=1737459510; 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=jpJt8VcA5LrU08m2DkMhdTWQuw+hqm9obrWobGdMW+xOXcADg+IqFj4tQc9vSENTph oOv1WynWRsHPT95s9TJfLdPA9DOsFjA7fMVlct5lSjGhR/7fueIRnG2h2aa59NHoAdKm uhMRZ6hnCNtaZOFWr7THkl2mJfcaqOLwlIA6Y1QDNxE1Jti+aXP8bR7v4gmHxpZSvbn+ EZaBFAcNwr1S6aAMBPcRpGWefGYLymq7rNUGmm8y/Q1E9p1v/DuuWqayDUcJue9IKVbi So03MBiu0NentH/sST6eW17/HqcQwrFeKpsRT+w4A8zkLoo+Qy8nK4WxYAlTEw50BGLF zggw== X-Gm-Message-State: AOJu0Yx0rRjrtYginajGYIL2/zQa/ilTyvRAm0DC/HQV3Hhadbzk1FGR es6ZLZW7K4qJ2HTvJRJtigJZVM4GTauEujOJGVK0eOX+ZdvT/BuoX4NF1/R4WdM= X-Gm-Gg: ASbGnctwDuNwk/gXNyPeUop2vRiVacLmZkRPMpm4caCv5sAYINnO4DaJWbqC1TY8VU5 +aw48U8YyT27WBXb7Mex7sWO2ubZyJ3keaaGHDXPCSfCzfeBZk9gC/ktW7lGGq5jOf0AY6nkXbw cY4UGVev4aW3jXRPA3Cp0oruPtabZ9FvonYF3/FJj6p9vwatSEfY9gwnNvd5Q5cv7nc8ICtvqM5 3t9e+ZJmg4rSOXX7ybS/oHTXVYwrP+G9ixAG+WUMuAdbEMMNVHHOx0= X-Google-Smtp-Source: AGHT+IGJAqpt2tEiJqlAItQL8jfzgMOqCspnBLLLDaDcQrsmhNwbm4CN5hvm5mIT1bfaV9ugoFl/Uw== X-Received: by 2002:a17:907:3d9f:b0:aae:ef24:888d with SMTP id a640c23a62f3a-ab2abc92349mr2514136166b.55.1736854709927; Tue, 14 Jan 2025 03:38:29 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab2c95b09b2sm624652966b.146.2025.01.14.03.38.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 03:38:26 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id DC4B05F9E9; Tue, 14 Jan 2025 11:38:22 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Weil , Pierrick Bouvier , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Alexandre Iooss , Mahmoud Mandour Subject: [PATCH v2 12/37] contrib/plugins/howvec: ensure we don't regress if this plugin is extended Date: Tue, 14 Jan 2025 11:37:56 +0000 Message-Id: <20250114113821.768750-13-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250114113821.768750-1-alex.bennee@linaro.org> References: <20250114113821.768750-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::533; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x533.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.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 Tue Jan 14 11:37:57 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: 13938653 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0FACFE77188 for ; Tue, 14 Jan 2025 11:40:48 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXfFz-0005FX-D8; Tue, 14 Jan 2025 06:38: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 1tXfFj-00057e-D9 for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:35 -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 1tXfFg-0005QZ-Hc for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:35 -0500 Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-aaf60d85238so991654366b.0 for ; Tue, 14 Jan 2025 03:38:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736854711; x=1737459511; 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=jwEE0VIVJpTSr42t4WT0WXaF18KP/d/WVpNGzWwmflVHLo1nds0uxCVMA3hvmM/5gi lBmjXq54MAWun1WDGrwuOT06P+85h2O0aQzHYEqOYbBlpL83hb9TsJclOjz559gfan/O PbvmZv7xHpXQp3nZBpkWrfNmEPjU16h82XvJk7yc9WyUMBGNVnMMgBTTQBtXFdbDqVHx 1V1E+yjMi3zfZEB5CPharlnXDST3PLc9lWzgcHq0VFsCamjTz3N6DKR1m8dGyJGNXKdy uAPDwlbiAqFSJDOGXbQj3eoEwurizH+W4Bjx3eBWjpjQNPNZIg5CK+b4DXjKFvqASHGr vSxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736854711; x=1737459511; 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=QXd1nzHvy3+EbBf+P/H7doT7mjrF2fIfZH9ntTm0NdZss/8FcMe1KGHhh2dZwrHD/w y3eyva6i9cPTRyhVoU1jUyJSSsZmGBdZTniFgkOe2F4PGHZVrioxKUJffa41SbvFO97H d9bmBXg8DQskfBptFOVtTuo0UycJM4rN3Fc6sz337GcSeVVSoVsqkIHBdrUMlq+MMhWm TysZl99Zs0BE0WEWremDfoDVzFi4TFV87N2GD9dEji3C8VXDzH5nPQ2SGo6lA5nqnvjG NV4rO2ysUFoZyBN9VynwGNxaTmr14TY1cqIp6LGlGjZmcs7bo3PpTkvME4+XSW7PRb07 Zg8A== X-Gm-Message-State: AOJu0YzpHf4qGwVRkM4IOtGoh6zW1lsOCc5U606TUmYfXtLNiAJj1AHG 6XWRMMHqKlY2Dgb91w5LnkK/GFJAdKVaLp1kB/TnDXM8KQejbxtc9hlFL31DlBU= X-Gm-Gg: ASbGncsauFbBlp5E/Z3+NbPjWRxBrt1wM9V5+oo7D/gqMG6+cSUvtz65QdPqYKHll9n c8Ik2gV7/DqViICrcTXNvKUvmVwfaem9MnokyrT9jhkDybHMllH1bGpnyf7gVbQsALPWTJpeaUz ZjOuWxZVTLke6ARdgDwmR3F6JbSyXa+br91tJ6sEEPano9lGTZ3gyb55hTxllSXO40NRwnR4Q30 tw6Rys25q9SQOuD3K+GdMEU7yU5aTep6sYRn31rJRcvxrfsoDTXuHc= X-Google-Smtp-Source: AGHT+IFLfZIU2SZ5BzGyrqtX0pYu6xnhkkOEvt/UFwJ/eE2R+VR5Mb1qF6clHgepM8x+nm4RMOMElA== X-Received: by 2002:a17:907:94c2:b0:aa6:824c:4ae5 with SMTP id a640c23a62f3a-ab2abc9f6e0mr2178659766b.56.1736854710675; Tue, 14 Jan 2025 03:38:30 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab2c905ecb7sm618677466b.26.2025.01.14.03.38.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 03:38:28 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 004F35F9EA; Tue, 14 Jan 2025 11:38:23 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Weil , Pierrick Bouvier , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Alexandre Iooss , Mahmoud Mandour Subject: [PATCH v2 13/37] tests/tcg/plugins/syscall: fix 32-bit build Date: Tue, 14 Jan 2025 11:37:57 +0000 Message-Id: <20250114113821.768750-14-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250114113821.768750-1-alex.bennee@linaro.org> References: <20250114113821.768750-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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.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 Tue Jan 14 11:37: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: 13938655 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CD381E77188 for ; Tue, 14 Jan 2025 11:40:56 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXfFv-0005CR-7s; Tue, 14 Jan 2025 06:38: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 1tXfFj-00057d-AB for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:35 -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 1tXfFg-0005Qe-H8 for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:35 -0500 Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-aaeecbb7309so1009896066b.0 for ; Tue, 14 Jan 2025 03:38:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736854711; x=1737459511; 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=IcvYR/FuUi1yW7WCDOOCnfJwliJcQMahBEDhNasxqI0H+aUe3HsA+VxNkY9nbKIKOh FYIpt0SYeVmsjH60sM2AcKud8yq+lDt7/EmsZm7y3dGetQo+jcmIKQAfA43JLgs4Iddx AZS+X0GmDlRJd1FX5+V9Zz5pE9kaD9eJAg9/oM8N8/laQQNZySY3UqKJ8Nv7VTXAUiaC yXPdIMDfGKX393gy8axDkBy/ktdS4Wg9ENTv92NyayXx8iRyli0MpRSZAeweN2yayQyh xAiTJBGQStyJRyzQsY2e71rX1N1QI47NFSfbxQJ7yiPT16CJJU4HOerF/CwDAIszjwYM t2dQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736854711; x=1737459511; 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=gZX2rMsUVeJhHRYeiEYQRxU5iBUfg0PlODcUegtTFzxdhg5i8pMH2nka8iU+b8Y3Ej gsr/uxzjcRPDimmui+Gscz607uAsunAbR3XDI8jaC+qskXtNFUsdRMxDUW1++u+JWNfm 179BDNWVgUraE+uEWEdM6dXUAxSuyn9Z7tlR52MX719sV6Za/O9sLzJRVrsCMJtlBY9O RCm5AbLPRN23NOC/seliEC6F+nUaJaT0cJx6Uq7faYjQjaBfU08ri7kqU3kL4gRxl1Wc brvtJ+ZE2EwWKRbe1+d9IShjHWIAzO39gipgagALAZ2QyhoVjeBhSpviLmyESvtyyVgl il6g== X-Gm-Message-State: AOJu0Yx+t9CXkhdqDqsBmpLOCIt+NVAVDIsG91+AzJo6GrMWqJM6+4Or 7+KOHy0OWmfxIwjE/UoFmqj4S+JYg0X5xAqyBTRU3LMT0IZTmgyGNE+POtzukyY= X-Gm-Gg: ASbGncvw+Nm995xiXOl8zx096kStdVu7AeOtF7oZZGlJmPuksQcPiSm2cLamNBHdicP +CfHOtUG2HOlY5J1DS/tp3ceA6znT6WfDIIUofEuyJs+AxRAGaPGQD12BUTmYhSTAlYfiTYSmsM qTVNoT8L5mkLmg9SGLuAt8M+pijZK6KyuHjHjNc/WfaPVhAi/A2vSXRK7oMf0/omnhUuyZ2zq4N ofcgaLw7WAH9zrwkWRT02ZnMCGasubxINtgbUYTpVOHDE6EHOz8yQ8= X-Google-Smtp-Source: AGHT+IFvcNUZTjmsP8TbGxrBQwGNABXtfS9IckAQTWuz8uKyBtYL/VkIeaXDN4iyYFbsSnb39gPjvg== X-Received: by 2002:a17:906:bf49:b0:ab2:b8c3:be54 with SMTP id a640c23a62f3a-ab2b8c3c3b4mr1832310666b.44.1736854710394; Tue, 14 Jan 2025 03:38:30 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab2c90dc6a8sm615381066b.72.2025.01.14.03.38.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 03:38:28 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 170325F9F8; Tue, 14 Jan 2025 11:38:23 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Weil , Pierrick Bouvier , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Alexandre Iooss , Mahmoud Mandour Subject: [PATCH v2 14/37] tests/tcg/plugins/mem: fix 32-bit build Date: Tue, 14 Jan 2025 11:37:58 +0000 Message-Id: <20250114113821.768750-15-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250114113821.768750-1-alex.bennee@linaro.org> References: <20250114113821.768750-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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.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 Tue Jan 14 11:37: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: 13938669 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E2232E77188 for ; Tue, 14 Jan 2025 11:43:15 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXfFr-0005BR-0K; Tue, 14 Jan 2025 06:38:43 -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 1tXfFk-00057t-R7 for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:39 -0500 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tXfFh-0005Ql-Vu for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:36 -0500 Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-5d0ac27b412so7192202a12.1 for ; Tue, 14 Jan 2025 03:38:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736854711; x=1737459511; 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=caQZd1pfnd8EZ2W3jDsJ0H/AocTRhT4pTJe1AMpBJ9TC1AhKissI86DVBAbozCgIKf uzw0rF1tCQFA+W2rbvZJ0oV94yANJZPH+EOs8aXgaHg3XccM0sgkVquDMFhiRyYul2im Y5QqNDMaSXcpn3VSRbIq6oAPTXf2i7piJujLUEw5k5RAn9GpaTWm8PqE6JKEORePUdO1 yKzOSsrgtZIRAGyjdRGYU6D9w382Nb0H7iO44q0/eis+7r6jDsW9ZopQAYMuFkr2FslD /HogYkQlix/qBDGrFU4UYc2OfW6D2jhGKdupMvj169Rr8HdUDu6re416l0OhVP3qIQq6 OU3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736854711; x=1737459511; 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=X3Q6A1gDPSej+/b418TBiApfJTSyu/PR7iUhIlRLHGPtfj2M28S2+VM0TwfES7BtF8 i3+NHFuzWqGGOv/moEbJT0CpGEPGEIe/8IW6Jjcy0qid8yu+o0SKTBUhWcpVME10tkQW /0WI66HhNTQDU2919V5CfF52HToxlWFogjvZ6bCZMBYK9KFJDGDefuynoXCQkM+xSJ1o CWHom8tjaP0WVp5d0yQSyGKBEeUmwV3uxULU/bwn7gTToDb702dnE0Ukv5MiH0zJ64eJ 6Wa8Q7Y2R3jrPtFkS8bft4B5inPs1QkQSXd44Sq9KFn0Ecu+BxhmO9qHEIi3PdPyeapI T76g== X-Gm-Message-State: AOJu0YzqYJCnFRjW7WxvazWHK6oYMwaJONigXeUTxgy6RtS1iQf7/Roq sj5N4GgAaraTrwEzZ1IG3rvSzxT966HrFEZNqYenJPj2nY2KLBBUqHttViGlBK0= X-Gm-Gg: ASbGncuOe+BdkpV1u11jYKQinZn1YdWQhlseuBFITNfVwe/rseOVrM9YQspQ+vgyYCt AEKo6CGHEzKsJw8/FeR/gCMFhOwcse/+lPRYFlqqvwZL5vIp7nnY2PP57QNOgocQfnNcrxE/Jfo clwdFqcK6x87GYfjODXMMH9TWCXgssv7yYKIam45rep1DjbMTtd/9lvAO5xV3gZlu7zduFP6Ccq ZNZPM37QoyRYZKaN8PFIu3DkCjh965Iy5VK2I6/ptYNI4an3dt/ZY4= X-Google-Smtp-Source: AGHT+IFsSCpX8WFSpwkoKNzm1awGOqpIacxh+XT7KS6OmwEciMGEZiK7jqK86Tw34OWrGG4qeu1+Mg== X-Received: by 2002:a17:906:c155:b0:aa6:b5e0:8c59 with SMTP id a640c23a62f3a-ab2ab74b2admr1811818166b.35.1736854711200; Tue, 14 Jan 2025 03:38:31 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab2c90dc570sm630304666b.51.2025.01.14.03.38.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 03:38:28 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 2C11C5FA05; Tue, 14 Jan 2025 11:38:23 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Weil , Pierrick Bouvier , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Alexandre Iooss , Mahmoud Mandour Subject: [PATCH v2 15/37] contrib/plugins/stoptrigger: fix 32-bit build Date: Tue, 14 Jan 2025 11:37:59 +0000 Message-Id: <20250114113821.768750-16-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250114113821.768750-1-alex.bennee@linaro.org> References: <20250114113821.768750-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52b; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x52b.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.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 Tue Jan 14 11:38: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: 13938663 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D02CEE77188 for ; Tue, 14 Jan 2025 11:42:02 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXfG1-0005GE-8A; Tue, 14 Jan 2025 06:38: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 1tXfFk-00057q-ME for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:39 -0500 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tXfFi-0005RM-DT for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:36 -0500 Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-5d9f0a6adb4so2511305a12.1 for ; Tue, 14 Jan 2025 03:38:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736854713; x=1737459513; 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=EiAKUpZcwOFI06m7urrkvBIoSp4kTL0AH5oviK90IZhpsjJ9o08W0tHqh0d69OWS5F XMVtTAo/5iYhzPjyX+YvV0RRk0pZkECP8omuaylKumeLj0e6N8Xu+6FA7zIahQkET1NQ JCCrEZoLll4VrweqP380wumJt0LVlNc9ZjTKTd7g6AsDUXMI8vF1olS1qE6hD3SHvJFQ /rerE3C7hfOs6soZ364DcXyJ8LiEVi5jflvxvOYxEw3JF/7qj8dB84ShLGzXdCyx9m2T yIlLV61F8abl+ZpgJ6wPQc7s8BwBEmjGyDUBO5tRBq50rWwCakZ8bWDsUV7Re6Mjt9Ab SIjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736854713; x=1737459513; 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=hxv2Q7IZRP4/AMZ6yaWgnr8LimNa4GEaC2n2KFY0pTUaQEx1VrpC9qu5ASSylqZgtN C0j0gk0GS2dXhWITU3RRbhbbF3bLVQ2KsB8Wx64cMSM/Tar1twVEERRLEF3qBLqqdc8c coAqnrepVCm2AEN+R29to+M/tuVOvlXop6+e044iVL2HyBOySnuLZYKhq5JK/3/eCrdm a6E2+RoW++YqNSfnE6oHYv+1Fu4Dgdr/kf/DupoBSJyi/O4NOS1fm6dtKKaFImpjVjL9 GE1dPyo/4rieR3vEn/jxJgitQUvPcaaZAlTgOlNhRTXMghDEOedg8F7agdh3OPLT7nul /FvQ== X-Gm-Message-State: AOJu0Yypz9j0f/QeAp+H68mDijsXzxQPS3xE+i73J7QH5rMd6ibmDXoN vyiqjjNBADZkp45mFdzFOCEGyZUKV96zJBg1swuyeqi8i9qFIEZl7gKSAEYtVgM= X-Gm-Gg: ASbGncueB2GZ/f0NLdBB/I9fPrYS7tT5HxmRcgPIPsbIMoyJgFCiv70ghy8xysbabmx dDM4p/roEgeRJGRs2Ii2pKAyRr5jWEWYYZVl+UilC9hJNz513au56PViavwoMYyI14gml6r1oys CgoWXpz8Un2OlgSlrmesrew4kEJFD8DAK7W1AXTxS6GiWqhMnOc8pp5uF2zg7urs/EVAGTmpfjy ETjAD3VKB11bHI6wEDIsLBgSLxbz/zHX9HGbQ2AJPvNu+mzU3i7gdg= X-Google-Smtp-Source: AGHT+IG/bnZ5cO56fM8HkTlll4LQMmrJ2LrO//U09fldEGFNa/p4/0dQfsmGTPwaZV4P85Kyq/zZWg== X-Received: by 2002:a05:6402:50c6:b0:5d0:b2c8:8d04 with SMTP id 4fb4d7f45d1cf-5d972e147famr26113739a12.18.1736854713029; Tue, 14 Jan 2025 03:38:33 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5d9903c3206sm6331486a12.46.2025.01.14.03.38.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 03:38:28 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 4473D5FA07; Tue, 14 Jan 2025 11:38:23 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Weil , Pierrick Bouvier , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Alexandre Iooss , Mahmoud Mandour Subject: [PATCH v2 16/37] contrib/plugins/cache: fix 32-bit build Date: Tue, 14 Jan 2025 11:38:00 +0000 Message-Id: <20250114113821.768750-17-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250114113821.768750-1-alex.bennee@linaro.org> References: <20250114113821.768750-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::534; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x534.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.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 Tue Jan 14 11:38: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: 13938647 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0B2A5E77188 for ; Tue, 14 Jan 2025 11:39:33 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXfFs-0005Bw-32; Tue, 14 Jan 2025 06:38: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 1tXfFk-00057r-Qh for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:39 -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 1tXfFi-0005RB-1M for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:36 -0500 Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-aaf6b1a5f2bso155155366b.1 for ; Tue, 14 Jan 2025 03:38:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736854712; x=1737459512; 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=AnAWZm3/ZQ0KCgzdufvHJBAb7uSvEPMiKF0VQAYTHgwj/4O1RZCdN60fMItA7HPnkY Z7jIxIwvIKFFwx/uefWOwnGdxtPcnKQKbEDhsjlLvcvcc3N06iiUVKJVLPguEKlv3CHz XJFpFn4YmSVwR43mG/yYQ3wGMqslO1BZiwpwEBNuCcfPTnADv7LMMQryW2oGLsRCmzWs 4bBgwkUgN2Otl9/oR2v3RnSvpCOovQwpov3GOvAGekNJ9AnXBu/D9y/fvWl/kSOhgGJf vpYrp0ygjLULB5cNU7s16VOLhxHLpEBC0AwwsQnzscXO+exrQUrNE1KV8qT8Jtvyy1C5 XWNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736854712; x=1737459512; 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=CT8rjsiwudBdVOuNHI9cRJV0S2NJi/dZQLtjbtbXe69UzRemBoPQrj9P/atFiKt/TF R4A4YL4i9SPK+cwddS7AnC9IyKsqDgKPA9+4XXgJP1wbj00LlS6DoUShbDCXuvaueFsl flFppHHwFmJv3kZ3ooTPAa+95JnIz1O/AlVpBGP13zgk6T/IV0LCD9FtFGFBmqcTqXH6 Y3XIXcysX8gsGO7SdNd1k5tbdKFUFx3qza/WCn1jMLiR7CGG1JrOGcG2XaYjqd2MGXBT SRFP9CioBFRCgsHPwbgbQq48g/sIXkbLYbIMWcriQMosbFJAFSYg3qbBu2zXrceo/TBJ RrUw== X-Gm-Message-State: AOJu0YwBrR4Az1k1FvNBPFnu9Q+qH5XLqTpY4+6+t4i3AZ3iPjl0MacB 1nyrdA00eYeiDAAjl3zpXCqkqDrQZWMlYzF6fKxcH42ip4ydEmWfIZVqT+cMsRc= X-Gm-Gg: ASbGncvnAdxsIux+xaO86RGIRiNGTMNb+GA7YCYxv9fYxt5AaUGXGWLRST+UQ+/xuRc 7j4s0+UxOl8/hv2Zod4PgbS6vOReeFPTpr0V690gdql7gI3s0B01rmBngi75YkahpRO9Bz20atE 7viffvccgV8SzvYMFLRY1iCs/UkVXxjv+EyE2lv/vZTZniyEAv9pUTIDzJmG7xwxilP4OZHHWYe yiY8OxCd+BZGEg4SX85svAemIYsdZc1nPXUU6Gqdl66RxwZKNL21BM= X-Google-Smtp-Source: AGHT+IEE090F+kRO/dX1MM9kx0czTqeWJx6LsrGdEWcGMUI8w1xabnY92ZlPr864YyKDIDnUGHdbGg== X-Received: by 2002:a17:907:7b86:b0:aa6:8dcb:365b with SMTP id a640c23a62f3a-ab2c3c5c979mr1787868166b.5.1736854711979; Tue, 14 Jan 2025 03:38:31 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab2c95647absm615118466b.118.2025.01.14.03.38.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 03:38:28 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 5B34A5F89C; Tue, 14 Jan 2025 11:38:23 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Weil , Pierrick Bouvier , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Alexandre Iooss , Mahmoud Mandour Subject: [PATCH v2 17/37] contrib/plugins/hotblocks: fix 32-bit build Date: Tue, 14 Jan 2025 11:38:01 +0000 Message-Id: <20250114113821.768750-18-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250114113821.768750-1-alex.bennee@linaro.org> References: <20250114113821.768750-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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.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 Tue Jan 14 11:38: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: 13938644 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 57E74C02183 for ; Tue, 14 Jan 2025 11:39:19 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXfG0-0005Fu-Hw; Tue, 14 Jan 2025 06:38: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 1tXfFk-00057s-QY for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38: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 1tXfFi-0005RG-1f for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:36 -0500 Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-5d3d2a30afcso8965857a12.3 for ; Tue, 14 Jan 2025 03:38:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736854712; x=1737459512; 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=bLxZWzE4VnYikUOh4+mFixrEzmJ3y3HvjNYGuY24XYuTKAgNufCDLtmiiPnvBB6DjQ 8fqG89Xtj7koZ9MmryDrn3PzvXr09WNNhTSsIPZis8r76Fg/Gul8hMQYirxPjb5k0TMc MIGc4N8h7lymABzvoGLaIk+msEXiywK/Mz6FpHo4dtaLj3XRyJiPzVtQjPW/DI/duxDP u993zTfthjINTWtYQDqoUiiY9kRM+4SjxsHIss6p54/OhaYX5FFtZyCsLvn6Nxpnd/o+ +k8f1iXhlAgGJ6iK2UpYEiaQttMd8gWZ0WVA+lxk6/Nb2smCIkfjVPNltbXVxEWZV+2l n7fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736854712; x=1737459512; 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=H68Gvw/okiuTFzXXOPZgr4IT4oPOmkqx5mJ6MvsAve1LyOjJnO7OHUdIDvOyCQ9IYT bTQFxRXCAjtsr5c0fNLeNO81SM+VTTLe7jc76z/Zi7qSFIAnTJjwx5I34ES4EbYQqhNW TE0a2TDmwnFLpQg+w44EuKql+8G0WihGu7iWhlGxLlTMjOCPjgNQ1dG0udvZyJ9ybicE fAbhGAK03srXvf55fqpQKsmPwn+wJJISpetAjkZC6jFPbtri/Oa/PqFYo4FuGViMwG+X 620XSEDZ8r1rJVsywIgJ5HFXagSGW0dcwKG4omF33ghcEl8sRMGtmGVdwlnumHrn+VLi CoEA== X-Gm-Message-State: AOJu0Yxdsx1XXTUDV4C7NsKZfSPeezme7BrLunfYn5QbnP7zI37Bhddt GE9BSPitSvlASLgHeHMJngodapwWt0NoqCsSi3DbNT2fJdW9R0/hOFA/7zMwarM= X-Gm-Gg: ASbGncsEpDXxelYMaa8PoyDIsj2PxPz2/ih0oXAOx8l9iJxRJcdB8Kluf9np6qZPlB+ Q+hvLzkkUiq+39weeDjXuhgpmGN2vgfYaovqNTMmfNbDru0Ovz1PiG/v4EGgUN7/pjH6lGe+Ol2 3D3Y2oCtfjOdy1CjkOz2usYDMgLGtx9zmZPtGhmtfRWx7FzGwZmaDdZgDhuo70nRTQTihvYq8Jj bJA/kijTV/8t1rvYRmFjWRdD+s3Eyh0wP6G0eFXc24nf5oKxdqNIwE= X-Google-Smtp-Source: AGHT+IH5l8tyYZzDXjxfReJ7G5JPeLJ/xOhm5FIlHm0HKvPfvl4RjUelb8Uf1wr0l+ZfG8ujHB3SLw== X-Received: by 2002:a17:907:3f95:b0:aae:b259:ef6a with SMTP id a640c23a62f3a-ab2aad3a453mr2389981466b.0.1736854712532; Tue, 14 Jan 2025 03:38:32 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab2c905ecb7sm618679266b.26.2025.01.14.03.38.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 03:38:28 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 739925FA08; Tue, 14 Jan 2025 11:38:23 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Weil , Pierrick Bouvier , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Alexandre Iooss , Mahmoud Mandour Subject: [PATCH v2 18/37] contrib/plugins/cflow: fix 32-bit build Date: Tue, 14 Jan 2025 11:38:02 +0000 Message-Id: <20250114113821.768750-19-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250114113821.768750-1-alex.bennee@linaro.org> References: <20250114113821.768750-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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.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 Tue Jan 14 11:38: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: 13938673 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 23167E77188 for ; Tue, 14 Jan 2025 11:47:52 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXfOC-0004N4-BU; Tue, 14 Jan 2025 06:47:21 -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 1tXfNt-0004LM-FE for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:47:05 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tXfNr-0006f6-Oh for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:47:01 -0500 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-437a92d7b96so6034545e9.2 for ; Tue, 14 Jan 2025 03:46:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736855217; x=1737460017; 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=bp2hQfHNSu9R7aAhZRUQAToOA4QVoltDXT40U6zVb0rfGthcYocLQ4slT4NHQluvkQ PSdUa5bvao3DS3N861oz+YtoLNc7Mfxc4OUFJH4wDtvoJ+iU2sErfl7rPBm1nDBs8GdY amr+p6nbEDEImpU4kYi5RU1xeBz3nUwqd2zZT0n2XkNzFGL5GZBMLJQ9bfX/7xEeaybW VnFKJXoecaI2/Dmu4A6scduCaQ/OtbrwwCcGsdMylq99X6WMSMcAx6R1SiPVl8FIA+kd aett5ww4yHePFpBLngOBUKbPLnTjbMHqFGXaT9YeH9HTZ+PoeBzv2IBhLDb/sBGOcsW0 PHFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736855217; x=1737460017; 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=w8KpHEqwaGrRaAw3wXopmMi5CWN8WIMBc5xB7LPA2NPPJjzrkuHqpbByR8cCvt4tyg +ECxuposhTzWUyg9Rprsb7GBmu5DLRr1yIaxm7V98Z4XEJYW6qzjNhTyVSUpYL8U/NU1 xAffiA6ylYgl4wrS8AwAgqErAvXZkNCgkXqXaWCw+lrdX0jdOyeB4VhgeyHKFxa9T/g9 a8Wk90IWyZMI8kUeMSG06oz3bHS+uaa3yAbYoav16xHo+gVHVyhhXXDUHqfscwBeaN9v q2ibRLONYAtyHL07OyX2hmEltUHF00J/uQNTqOy6BJ62FwELDaU5NX4Di3IWMhr3O2nU QNMQ== X-Gm-Message-State: AOJu0YyR9ALrszz9FHA10azhr3XciNw6u9MzHwJRWeb0vodnG5WNkPmd pttbksfPi33yZDTvw8oRaAEose3slXHY4cGuE+A4myNoMiDJsd8R2oWCXd5XN7s= X-Gm-Gg: ASbGncukFuxa7WTtB+JQY/Htscx9ovuVJlSK9epDYLIGPkIHKecyCNKJdygiNKlMpft wzV7M0dNwLwqMPinsJY8fNSeO2mhCnHUXJJJPhOobhlZfkWVRJCkvPQBk7gHcajm8gY6dfHU4WB m48dED2R715dnr+dD4DZbEGz3lK8l7OasTKM9bR0iSFuHwgMVGDGniNWUctOt9ejbg6oL69U6I6 ppCLCDPrG3bGmB/EZBTZ7KWYWr/9DL0rRdJ3R6xpcsQbpHgPhgLHdw= X-Google-Smtp-Source: AGHT+IHSUNDh+GcBAAqkL4FkfAxGcBR98ti9n55moS+xcyX7hdsWEPj36o81KOF67pT+FGGYiXXm8Q== X-Received: by 2002:a05:600c:46d0:b0:431:58cd:b259 with SMTP id 5b1f17b1804b1-436e26f4d53mr225863455e9.31.1736855216938; Tue, 14 Jan 2025 03:46:56 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e9d8fd03sm177334135e9.6.2025.01.14.03.46.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 03:46:52 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 89ACA5F932; Tue, 14 Jan 2025 11:38:23 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Weil , Pierrick Bouvier , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Alexandre Iooss , Mahmoud Mandour Subject: [PATCH v2 19/37] contrib/plugins/hwprofile: fix 32-bit build Date: Tue, 14 Jan 2025 11:38:03 +0000 Message-Id: <20250114113821.768750-20-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250114113821.768750-1-alex.bennee@linaro.org> References: <20250114113821.768750-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32b.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.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 Tue Jan 14 11:38: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: 13938676 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F189DC02184 for ; Tue, 14 Jan 2025 11:48:35 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXfOL-0004RD-Qt; Tue, 14 Jan 2025 06:47:30 -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 1tXfNu-0004LO-HM for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:47:05 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tXfNr-0006fH-P0 for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:47:02 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-4364a37a1d7so55744465e9.3 for ; Tue, 14 Jan 2025 03:46:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736855217; x=1737460017; 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=vijrYlprhGqX1iu7WH3ORyZsxOOWHG4e9/efInhI+NYED4kmwpYMnDzXzXYLm+9PIE XxW+MQ5tLr0TImb+dkhkB8Lzz8GCZ5wPHmRgI8xrgntEtziJHQYOlcMqgS3XtRoJXdPD GFoOc/a8RWQ39d8b6duNH09vl9r/xprE8fSp/HCT/igOx+4f1zJZxc1EjFdvxCfspT11 q6USTQFHHHxoORCRgqZvrmdY+2h/PSCvxk61wL1SooB/fo3vZYLPr5JeQpTIzp1NYiu4 Wu7pfNeUocE8wCpkH6XcDTud5oCUMWDylSJUiXxpGwrguDp9PRrEtWSFKN/w9liFtQvL 6Awg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736855217; x=1737460017; 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=xQDOBxI+vYROwtkzeRGOE+EjOEnwkpjE20rK8Co1qRPrO+CRjtKGWvw0ZX3lkHAA1I 6CUI+R2f2MvdkkArhgHGmthbjw27RC330khMFobWMYBM74kINsZmjBo4AaLNM5HykUJe CYpDgRwOEtw0w0+x54ZzvvRe6Mz8Fyx6AbsNP+AbhBFyVMcBzzwDV9VU6qEjBz/K2zlJ 9CmfrCbwBO0YXofFaU6pCIla5TAs3S12bvC2SrW6Y9z23yuVI9zl/MgG3zsvWIvEcOZ/ E73fH25mNEv81w8kNrbBKB1xVWO4O8a64wf8a2WfRZOwtRLRbvxIFuGdSdqvefxzWe/K YZ/w== X-Gm-Message-State: AOJu0YxLDgPZoRfJEk+SGH0l6FZfVhhR+HVPQOQNjPPrq1WP1PXcJ5lH lS9FzYEA/Ax1Bi2eJqC98+kE7HxXtkBrfUzGhsBPSytEBr6qwuaZdkpfWuQZ6UQ= X-Gm-Gg: ASbGnctnxG5uUOvUAwaJ7p2oaql1ZLALnZ/AjOX1ZMZaBO7zQvRioc0ZgF8iGvLdSa7 ZdBKBhIc6z2cbBoPStVOfZHnfBZ2W79HangA8TXiEKh1L0XTqAy9K5zUD80Sj6ES9LpKkVV6A7f Z8B1RWf/ylr45zaUMhAwtFiytmeTG2Wyd5L2So1YQPV4A30e1p6f+gYoPbyCyIEOuy3RVJxMTBB oeHdwOK0AWfVmzl+YEhm36RgLD4JQuJ7GKrVzGygwY5nG9CXtBNids= X-Google-Smtp-Source: AGHT+IGHTi7xXl93VR6ukC+VBC/X3BcQpZtFOQ/VRYPyZnWSa/NYhXGyKUbMnAUoiIgpMnblmvmoMw== X-Received: by 2002:a05:600c:1e09:b0:436:e751:e445 with SMTP id 5b1f17b1804b1-436e751e61fmr232295415e9.5.1736855217542; Tue, 14 Jan 2025 03:46:57 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e9d8fc5csm173943915e9.2.2025.01.14.03.46.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 03:46:56 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id A20F45FA1B; Tue, 14 Jan 2025 11:38:23 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Weil , Pierrick Bouvier , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Alexandre Iooss , Mahmoud Mandour Subject: [PATCH v2 20/37] contrib/plugins/hotpages: fix 32-bit build Date: Tue, 14 Jan 2025 11:38:04 +0000 Message-Id: <20250114113821.768750-21-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250114113821.768750-1-alex.bennee@linaro.org> References: <20250114113821.768750-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x336.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.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 Tue Jan 14 11:38: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: 13938680 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 877E4E77188 for ; Tue, 14 Jan 2025 11:48:46 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXfOL-0004Qj-7z; Tue, 14 Jan 2025 06:47:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tXfNq-0004Ka-5n for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:46:59 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tXfNo-0006eF-0u for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:46:57 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-4361dc6322fso37686045e9.3 for ; Tue, 14 Jan 2025 03:46:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736855214; x=1737460014; 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=E97gk1nGa9LcKrOCEE1r0BFla/cVioRBFNdjnXlgrbfnrYCjqNOSAm8ADbCjou7kPC lXMoRRSvVn1km2+zf7zxzPzS1za6y20sWfUEWJjWJyqrnzAveIAb8JOpbOM/XRGJw+q8 yH8DfIyR0cx+xDtqit2iKhUg/y7jAXgyXhIxAsNVW0LCaOIHFVQ+ngH1MJsTuinIqPrY p9vkfvpbdSQk3aj2o1N1bO2crwkO/uXNadF4VBTGLDEqosCRa+8SpuMHN01TPQKUNcaf +U1LOyqV2a4AaY95iPcvDAkNv6oJ8l1NBz6bXaIcddIkYG5/PrXYCyhLZ5ksZKB1KQXn IjHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736855214; x=1737460014; 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=Fq9tGF8kHDwJDG7bSmoVcNYtLCxv8AV5bUWZtwXVk514fJ+Y/Rk0+FYkADYdCMHVCd Um9I5S6BLNr9APx3SZxfDJ8UC2UCrsq+kR2SCZ+ONjDq4jBKRKUgeSQJMUooqgcCEw3T /1gaHAw6cfmsh/bOSxikFE3V/5G54QKza/Zh4eIQFgUeSQOmVMSXenFb2/piiNCRGyII M7Wt/CcRO9pVQoWafOyVHCEV+NgINdkRnSxahxMPcVt2HRoKffs8aSpkNcRzRza7Jr9j 4knG8yTyzIQv6vTib6lSTdJVlqIviVaSFS/1yFJTWYBv44ThIJB+QiOzmfXduf+y+cxe zvEA== X-Gm-Message-State: AOJu0YwcaiDl/SCAfIKStMX/KvuPnN3gIUayDjPuXB8MOKNuYJ9SukxE EdIGBk7RNDexwrJnxe6AuqU3bo1d6FUVejNQazjIWaFC71KaoyYmsqfhOGLd1AQ= X-Gm-Gg: ASbGncuRFUNAPgYZ09gcIEJLoFaIuR2BZowIakUC0b/pF3vEyRcchJDNPc11KNAut8x gjbD1LmgaMN9ayezjVQIQx7SqMAScArYrB5iLgOLSGXNohA4CUu2qDreRDWoXUpNZTtfrXsQbzF AazCsYd0lT+9NXC89jIGGeN5e73aJOtqcAy9fPknOrSx8+U9A1nzrsHp2HX2R0cnMU5PsURmrJt zqxqEXtIKOJQB95p1lyJ9Q/PMljaxKpQSqIPhDdI/wKF64APj1GpyU= X-Google-Smtp-Source: AGHT+IEr7sXXwfqvKZKjC0tZZN3CxOD1EeDoN0Oqi+lF2cs6rGW86LhcAv2UejvoeDQoza8Kc2F85A== X-Received: by 2002:a05:600c:4f06:b0:436:6160:5b81 with SMTP id 5b1f17b1804b1-436e26b98d1mr247137425e9.14.1736855214468; Tue, 14 Jan 2025 03:46:54 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e37d17dsm14347308f8f.21.2025.01.14.03.46.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 03:46:52 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id B7C3C5FA34; Tue, 14 Jan 2025 11:38:23 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Weil , Pierrick Bouvier , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Paolo Bonzini Subject: [PATCH v2 21/37] configure: reenable plugins by default for 32-bit hosts Date: Tue, 14 Jan 2025 11:38:05 +0000 Message-Id: <20250114113821.768750-22-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250114113821.768750-1-alex.bennee@linaro.org> References: <20250114113821.768750-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x334.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.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: 13938681 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 71D40E77188 for ; Tue, 14 Jan 2025 11:48:49 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXfOm-0004yW-RM; Tue, 14 Jan 2025 06:47:58 -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 1tXfNs-0004L3-0V for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:47:00 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tXfNo-0006eO-Ry for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:46:58 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-43623f0c574so38382035e9.2 for ; Tue, 14 Jan 2025 03:46:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736855215; x=1737460015; 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=/xR1sdOln5uQTQB+HehunftAymFm05ADSFOJij2asec=; b=EaQs7UOe2XDLXKsvyOQBTo3sy9Zf8+cZxyi0VEmopAH1giOqeLA24yHQwmzs/WK77w bw2Xk38cUrMg1kAz7j/dSzkuhjNX/DuMwh9xoQGv5+WUG24N3Py3snrrIPEwbWbQk1oi nolRvxepG0Xvylbzhe3NWZJpRzIX3IOU2aYRtcdtc+NKl4Kcds+R/ueQsxzbRMxHVMnl HvpS1Cz+bgI6Kn3EkVhlqxlM6DoGmXxkzL5MtbOwcaqWzulFg0ejPVCRrk15gk4FWytZ qA+Y6GvX9UG+S0BQ9Spl+HjooZWfhaCo1GkIULtFWl7f1B13R3fraeTQ3W5Lh+pcLrUj mvyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736855215; x=1737460015; 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=/xR1sdOln5uQTQB+HehunftAymFm05ADSFOJij2asec=; b=M1zF60UfKdnOefb/I0x01RwKGFpO7lTEUmbtryqgGZXlukD+wqQVu//zJaq0wvstdx k6gLyB0M1qDE4lRX8pvB+PA+ub4RHkB04/F+xSp81D3ZgpI05l7uUr5+f9E8P2ryjzN2 WRQHOqO7L+NOQLBmZsmWwuzNxcxegqHoe/Cf4Yn/Z/xByio8K7a48+CHdHFgM/+n67t9 QIqZYIUgBggDOQiFggXbZ7OQoZ2ORLcashoCjCz5KDhtAqDHwW50SGmOa7aRNkdCOnzp T5P5htXxOkuwlQ+JFe6+bFd02k5ZYm63OK2zv8ajVx81DL3jm5Eec4pdY65Lr8Yks5zT Vg7g== X-Gm-Message-State: AOJu0YwlfGssMjDPC4ukeeYU2Pmv0gq1PHeZoFwjzG4FUVBmb5hAPOpB le2MVpto/aFOAvfMh6AyxZiifhyY0Bumk66mX1QRvi8+wpeK9a3U9PsZrK6WbqI= X-Gm-Gg: ASbGncuxVQaar/uqjb20HWDYtTQdK+ve3qBcvSyWODTuY1vci5rrR6YgVCStfoChUxl ziJe91wucceDwGfhRDCbpMbEhQU11fes3X7bGRd3yeIKVS2hH2bV5H7BcOKkWgPvsS7JarijoAv v2inh+YYk2pXNg2qhtCH4+HXlp9MtrS21F0WXOgpA0zWixdf4BN7cX9ttceNf5mTcu7vER5BdD5 GOhRXGDp08oi/Z6x9LArS5rQE75ITqcW6vCQYDQw4tKCnAK1q9xEWY= X-Google-Smtp-Source: AGHT+IGx2jjAPa5lEa9xVCrGaSvJMlQVVZBdnI1AUpeEKkXkyqGO0eKfU4QfeqPbSLQfJcEKmQTGQw== X-Received: by 2002:a05:600c:1f86:b0:436:51bb:7a43 with SMTP id 5b1f17b1804b1-436ee0f8af6mr184610285e9.5.1736855215052; Tue, 14 Jan 2025 03:46:55 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-437c16c4c12sm7808995e9.3.2025.01.14.03.46.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 03:46:52 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id D07B65FA4B; Tue, 14 Jan 2025 11:38:23 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Weil , Pierrick Bouvier , =?utf-8?q?Alex_Benn=C3=A9e?= , Julian Ganz , Richard Henderson , Paolo Bonzini Subject: [PATCH v2 22/37] accel/tcg: also suppress asynchronous IRQs for cpu_io_recompile Date: Tue, 14 Jan 2025 11:38:06 +0000 Message-Id: <20250114113821.768750-23-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250114113821.768750-1-alex.bennee@linaro.org> References: <20250114113821.768750-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x333.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.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. Message-Id: <20250109170619.2271193-23-alex.bennee@linaro.org> Reviewed-by: Pierrick Bouvier Reviewed-by: Julian Ganz Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Reviewed-by: Julian Ganz --- 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); From patchwork Tue Jan 14 11:38: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: 13938675 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3027CE77188 for ; Tue, 14 Jan 2025 11:48:27 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXfOX-0004e1-4E; Tue, 14 Jan 2025 06:47: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 1tXfNr-0004L2-WD for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:47:00 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tXfNp-0006ee-8C for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:46:58 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-436ce2ab251so38450865e9.1 for ; Tue, 14 Jan 2025 03:46:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736855216; x=1737460016; 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=r8aoZ+4wIpFt1loPUkrjNZIwpI4hyfnz2K8d4L8ae9I=; b=g0+uU6/CsHp+Erbqo2m0MsAPZNeqvyo9Cze+ORQGjSyiywmiYrASK1Jag9HmT4qeAZ 6E00O4dGBcYKUIbptYpKIjYLo7xN9EnVYCDHbFMgye2cyCZz3hC76WcmOFo9A8tb8c67 4Q2eBTBL9b5XiuNkicA9cn5kARblutcHkWU8Ge+KKJFniVD2vT6oPkIAO94vrYPJbHxP KJaj4jm/Mpz9oEhFk7gwN4dfGNOI850DhGnryqT4WwV8ca0Np9O7nhREJiGoQ5JbB+Ys M6rjlHb320hg1fsDX6w4aidmr5LKFlSs/GizYWHr4KX1yVUGX2L6jRdJjHhrN3Qasqdn xuiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736855216; x=1737460016; 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=r8aoZ+4wIpFt1loPUkrjNZIwpI4hyfnz2K8d4L8ae9I=; b=aVe/C8rFYY/qXXYIIFxnlsWESEckYynJxxpcb7z3ueiAZlKqORrAoqT63h+vg4hs32 Jo7XY9DJXNBooavFZ28jKGcCVYzks/dQdifD7LdMu3J4hl9Z60e9/S/VKwfoNivoq2Iu jQ0lkC40ui7mS4K2Iq+I76J9lIv2pqDAGRwjyreEK2x/xkPYFqrgub8rxNNaWZuBkF4d Q2PJpgfWhMjC+Rh9F9jiLO6W1D5w0NWTEtD21KNZS6GeomjwOw8P1JaIU6v5FexMzuEy MDqrkq7kz8fKLHmV+/AhQTgPJJWS3kUjkOP2AG5k9YaFpV60RxUpNOEreO4w0AggF71e aH2A== X-Gm-Message-State: AOJu0YxQBZfJFBXUBDHac5LvG9rRoZbMiAjkDXvHdjg3KjlmY6bhuOzi QmgzrNOyjOozQeQf0E3B4MAUzL25vmS5GOtMTrCxfk0g6SQyiw1SmTBmfx3WxAo= X-Gm-Gg: ASbGncse1GJNrat+lTetKndnN+zGxevvDwqFH0Xr+xEtDt5TXVnknbG0BzlzbQfidN7 6yoIkrNxQDqKY9VFS9H1cj4ut8tazL6ZVB8rZWmex6PQXx14sCCVBktDm3/ci8hj3BalObl7gFO tM7DWGFYk0eF2ULeAFZbKdWqouWHaEodABiv6RAp5LAl9Z+4pwIEW3S9n3/9GyiaB/onDVeOH8f 7DevRnPsN3axOZ/teqMvnYkIfQeaTtHFaX6siLXvo3V0styZveJSy0= X-Google-Smtp-Source: AGHT+IFbMNMHx6ML0JUq4Mx6dDRsIeb1gFC9D84CGU5wYXl19q1NV2WvuPUiVkGT36mg83NWRyFeiQ== X-Received: by 2002:a05:600c:1c98:b0:436:1b7a:c0b4 with SMTP id 5b1f17b1804b1-436e2677c65mr177990345e9.1.1736855215735; Tue, 14 Jan 2025 03:46:55 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e2e92f60sm207387445e9.40.2025.01.14.03.46.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 03:46:52 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id EAD665F935; Tue, 14 Jan 2025 11:38:23 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Weil , Pierrick Bouvier , Richard Henderson , Stefano Garzarella , "Michael S . Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , Paolo Bonzini , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= Subject: [PATCH v2 23/37] win32: remove usage of attribute gcc_struct Date: Tue, 14 Jan 2025 11:38:07 +0000 Message-Id: <20250114113821.768750-24-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250114113821.768750-1-alex.bennee@linaro.org> References: <20250114113821.768750-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32d.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Pierrick Bouvier This attribute is not recognized by clang. An investigation has been performed to ensure this attribute has no effect on layout of structures we use in QEMU [1], so it's safe to remove now. In the future, we'll forbid introducing new bitfields in packed struct, as they are the one potentially impacted by this change. [1] https://lore.kernel.org/qemu-devel/66c346de-7e20-4831-b3eb-1cda83240af9@linaro.org/ Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson Acked-by: Stefano Garzarella Signed-off-by: Pierrick Bouvier Acked-by: Michael S. Tsirkin Tested-by: Stefan Weil Tested-by: Philippe Mathieu-Daudé Message-Id: <20250110203401.178532-2-pierrick.bouvier@linaro.org> Signed-off-by: Alex Bennée --- meson.build | 5 ----- include/qemu/compiler.h | 7 +------ scripts/cocci-macro-file.h | 6 +----- subprojects/libvhost-user/libvhost-user.h | 6 +----- 4 files changed, 3 insertions(+), 21 deletions(-) diff --git a/meson.build b/meson.build index d06f59095c..da279cc112 100644 --- a/meson.build +++ b/meson.build @@ -377,11 +377,6 @@ elif host_os == 'sunos' qemu_common_flags += '-D__EXTENSIONS__' elif host_os == 'haiku' qemu_common_flags += ['-DB_USE_POSITIVE_POSIX_ERRORS', '-D_BSD_SOURCE', '-fPIC'] -elif host_os == 'windows' - if not compiler.compiles('struct x { int y; } __attribute__((gcc_struct));', - args: '-Werror') - error('Your compiler does not support __attribute__((gcc_struct)) - please use GCC instead of Clang') - endif endif # Choose instruction set (currently x86-only) diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h index c06954ccb4..d904408e5e 100644 --- a/include/qemu/compiler.h +++ b/include/qemu/compiler.h @@ -22,12 +22,7 @@ #define QEMU_EXTERN_C extern #endif -#if defined(_WIN32) && (defined(__x86_64__) || defined(__i386__)) -# define QEMU_PACKED __attribute__((gcc_struct, packed)) -#else -# define QEMU_PACKED __attribute__((packed)) -#endif - +#define QEMU_PACKED __attribute__((packed)) #define QEMU_ALIGNED(X) __attribute__((aligned(X))) #ifndef glue diff --git a/scripts/cocci-macro-file.h b/scripts/cocci-macro-file.h index d247a5086e..c64831d540 100644 --- a/scripts/cocci-macro-file.h +++ b/scripts/cocci-macro-file.h @@ -23,11 +23,7 @@ #define G_GNUC_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) #define G_GNUC_NULL_TERMINATED __attribute__((sentinel)) -#if defined(_WIN32) && (defined(__x86_64__) || defined(__i386__)) -# define QEMU_PACKED __attribute__((gcc_struct, packed)) -#else -# define QEMU_PACKED __attribute__((packed)) -#endif +#define QEMU_PACKED __attribute__((packed)) #define cat(x,y) x ## y #define cat2(x,y) cat(x,y) diff --git a/subprojects/libvhost-user/libvhost-user.h b/subprojects/libvhost-user/libvhost-user.h index deb40e77b3..2ffc58c11b 100644 --- a/subprojects/libvhost-user/libvhost-user.h +++ b/subprojects/libvhost-user/libvhost-user.h @@ -186,11 +186,7 @@ typedef struct VhostUserShared { unsigned char uuid[UUID_LEN]; } VhostUserShared; -#if defined(_WIN32) && (defined(__x86_64__) || defined(__i386__)) -# define VU_PACKED __attribute__((gcc_struct, packed)) -#else -# define VU_PACKED __attribute__((packed)) -#endif +#define VU_PACKED __attribute__((packed)) typedef struct VhostUserMsg { int request; From patchwork Tue Jan 14 11:38: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: 13938670 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 75232E77188 for ; Tue, 14 Jan 2025 11:47:29 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXfO0-0004LI-80; Tue, 14 Jan 2025 06:47:09 -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 1tXfNn-0004KG-RS for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:46:56 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tXfNl-0006du-V8 for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:46:55 -0500 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-388cae9eb9fso2862199f8f.3 for ; Tue, 14 Jan 2025 03:46:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736855211; x=1737460011; 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=tO4+dhgDNIyv7ebOS6QWgeVxieJfX0lz0H9vGOgOWgE=; b=dtE19hE/aLE2aoOL1e3pdqxs4NQisp+zsSEVCBzF9wAPdME0xKckLY+Wxwz8SU2Ov7 FmCtenf5++r+duyqxhJKDblmCKBuQfyUASpPyT4Sh2k97hqWO4o532DwFTh1mNjGAnlF bZ0GNNtETGkOxsPvE9CxiFV7eXFIv2a50g9z1pr0/uPRVRnVz6Xc08nefvXYawkVa3Xm m10/meqRhpJLFVHWA7OptaGIte3HLjdCpUDm/QLl5lINW7QXJ3kd9TzvF08Qd3i5UGiY 9jL2Kk5cOk4n+W4YgKPfUdwtQ41cgggmuGEF+Bg6x6YXHeSv/TxmawjFsDP7Nk85vGGj 2YgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736855211; x=1737460011; 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=tO4+dhgDNIyv7ebOS6QWgeVxieJfX0lz0H9vGOgOWgE=; b=Tk2fsPkNhz+kmIEFQPOmNaWBtQLjl5l0n75vXoE9MtbRPC0LwA4ryiDgfqCVt+bozJ s3TgjnwtaJh6/JPKAqYZ9iKxlidGQT0McPJkwBNGGw97Z6cMZ6A56p++S4cZGY+Gq9d9 w561LP4gQg3yzcwH5xpLF0iSe/fjEotFbeUPH5GzpAGIEOOA7gECaPcHvhvOJ1i9DcLB /xQGeCLuWKvCp9RkaF3IXLku8EDYhOkuMDdFeOdvVIKE4Va1TzH5ws7C8xys0ZUSZpVq pNAVt7D14FeRAPFmD450jlEmdDULF8dIsHkBEpDF+44efmDmIvUQ1QDAXq6ucbML9c1t 94sg== X-Gm-Message-State: AOJu0YxO9ko+o3KUbMRYmOdwjVN/MbE669hKVCHFXRU/L5jz1g6wqgSE +f6AbTpz+lZN/DVWJg0SwnZsnfF6MS1naxZCXbhCwa8XSAnf/kTcmuTH2QiTWPU= X-Gm-Gg: ASbGncuOoJznNGh/dUVXG5mPwZ6q5ymAE5fhWAmmr6N39ncjrvAWCmqGnCcjgUCwmal FUtHy8BdmHp7VaASr2AnmISjavASS+XcmwSMU1bPBySG9ZMYFMH+D3GiucbxgXQlzx5xspv/u9j EG5oXHIt5rx/3INEm95cekEFRLpyenvGuaZYRZt4kmkmqaSDc69eJneqVTmjeg/52523jbs/vmq +OKVrFPuJugRlaD4hUmjib18YzftJQJhh5aOFm3KnUK9uVzUn7IEQI= X-Google-Smtp-Source: AGHT+IEB3pBYYIDgnmQX1/g5jnRvq/4ALSpUHAK5J3XBauCB98xPIxZqO0oro9LWzftri9SaNkDF1Q== X-Received: by 2002:a5d:47c5:0:b0:38a:6161:2854 with SMTP id ffacd0b85a97d-38a872c944amr22677658f8f.1.1736855211340; Tue, 14 Jan 2025 03:46:51 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e4b80c9sm14473803f8f.84.2025.01.14.03.46.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 03:46:50 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 0E9035FA6C; Tue, 14 Jan 2025 11:38:24 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Weil , Pierrick Bouvier , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Markus Armbruster Subject: [PATCH v2 24/37] docs/devel/style: add a section about bitfield, and disallow them for packed structures Date: Tue, 14 Jan 2025 11:38:08 +0000 Message-Id: <20250114113821.768750-25-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250114113821.768750-1-alex.bennee@linaro.org> References: <20250114113821.768750-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x436.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Pierrick Bouvier Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier Tested-by: Stefan Weil Tested-by: Philippe Mathieu-Daudé Message-Id: <20250110203401.178532-3-pierrick.bouvier@linaro.org> Signed-off-by: Alex Bennée --- docs/devel/style.rst | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docs/devel/style.rst b/docs/devel/style.rst index 2f68b50079..d025933808 100644 --- a/docs/devel/style.rst +++ b/docs/devel/style.rst @@ -416,6 +416,26 @@ definitions instead of typedefs in headers and function prototypes; this avoids problems with duplicated typedefs and reduces the need to include headers from other headers. +Bitfields +--------- + +C bitfields can be a cause of non-portability issues, especially under windows +where `MSVC has a different way to lay them out than GCC +`_, or where +endianness matters. + +For this reason, we disallow usage of bitfields in packed structures and in any +structures which are supposed to exactly match a specific layout in guest +memory. Some existing code may use it, and we carefully ensured the layout was +the one expected. + +We also suggest avoiding bitfields even in structures where the exact +layout does not matter, unless you can show that they provide a significant +usability benefit. + +We encourage the usage of ``include/hw/registerfields.h`` as a safe replacement +for bitfields. + Reserved namespaces in C and POSIX ---------------------------------- From patchwork Tue Jan 14 11:38: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: 13938658 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 60890E77188 for ; Tue, 14 Jan 2025 11:41:24 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXfFw-0005De-LO; Tue, 14 Jan 2025 06:38:48 -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 1tXfFk-00057u-V0 for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:39 -0500 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tXfFi-0005RI-2F for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:36 -0500 Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-5d414b8af7bso9602522a12.0 for ; Tue, 14 Jan 2025 03:38:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736854713; x=1737459513; 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=castUuYEMS9/+bXLMhhSaPLlf0YHd3GiZGeVC9CY3P4=; b=bwqhtIfttTmB7N5DbHXjHxsx9so4aljvjfvaw8WX+oXfSf0Qliwhl7xTymivnenPms EPjR9PBYMopJM1ZgDuTwwmhams/70cq3IxT/1zpK7Ku1mjWQEITYYKl6xUjIntsIfjwZ ZYR4SFPLE0yQL/wQr3ziNW0cjYisv9WfX+7f8RdaPuwvgfiAvHqIfj3d7uZWT6R+gOqn ZHrnTTFPHdVJohHVYZkRNBhy9j58bDmCyH/IjnHkkBgvBcQK3/n3QXoWzHJzzsNMmFHg i4VnFbC6KsB22lg7Ma73LDdvNiSpRJLr1Ej8xEi5tELpYmxSyzXPZZl28KF993iFb7vB tcgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736854713; x=1737459513; 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=castUuYEMS9/+bXLMhhSaPLlf0YHd3GiZGeVC9CY3P4=; b=jKjtLy85cwkkCWc8tOo0GqRE+HOqiDMzMiPhmrf9pDrFU5JVkbANZcJ8RjUAewEfvF pw1uFUd3PswgKbZSJmfZ7H+U86KQoMt289GaE0CHCA6RNm+G+/i4441Gjkj+DbHYVwAc D3rzuerdU3xu/tCLbx7ts9A6GZtNmbYrz0GUftfZ3o0Y9Hwxxi86AGsDjVw8J6lUTC4u ZwgB+6M1p9MB8NWCI1Cotd7YBgNv82ynpcpJ7Xx0RJe6BDP1XIQThB3O59E8IY3lo/PO a0yhoVrThRY/AmLedxZZSMzUcoOOIUtH7ZWgpsvBWP+7+GCKvN8v1jqzOPy7yhEhNLbE pHqw== X-Gm-Message-State: AOJu0YyvGbcD5QMaa5cjhIWOv4nLWvk+OLTHosxO5YabIx/uyOtxrdPP XTCibvafqRwNmFgO331F32eXXy8J4RfeSPOujApSpyjaV/Fbb41Ma1UrJ1IXlts= X-Gm-Gg: ASbGnct0elBuEOqRzCSGIHnY+Tn8e9f/wg3bs5WqN3IZMAsg+jqTxsxwYBA/U12euz/ nbVe/XhQRMAi6EtwtAtZUNMhF5VhnRdukjURDYB2TEBqIf9fiMaMcB7DkVa5kfoBGZMKdb3GtMl qcNAhARNfv7yjy0IB0Bcjvz3FRcTGZSrFF8wh13PqSOxh/L1CqYC94YTJiiLRPYRjIHjdAUBv46 veMox22xSFi39jQDjLeOJK4pLoPXWWPL83Wq5hxyJAGkIsh0CHPFdc= X-Google-Smtp-Source: AGHT+IFbeRp5YCoHnXj242N/5AUNoNw3XKjWsZq4URpMhYXnqoXgSKEkz4ArfYxT61MSs1EXz203mQ== X-Received: by 2002:a05:6402:2355:b0:5d9:a55:4307 with SMTP id 4fb4d7f45d1cf-5d972e4eeabmr23355229a12.22.1736854712680; Tue, 14 Jan 2025 03:38:32 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5d99046d7d5sm5911756a12.66.2025.01.14.03.38.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 03:38:32 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 2A45B5FA99; Tue, 14 Jan 2025 11:38:24 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Weil , Pierrick Bouvier , =?utf-8?q?Alex_Benn=C3=A9e?= , Alexandre Iooss , Mahmoud Mandour , Paolo Bonzini , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= Subject: [PATCH v2 25/37] plugins: enable linking with clang/lld Date: Tue, 14 Jan 2025 11:38:09 +0000 Message-Id: <20250114113821.768750-26-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250114113821.768750-1-alex.bennee@linaro.org> References: <20250114113821.768750-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::534; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x534.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Pierrick Bouvier Windows uses a special mechanism to enable plugins to work (DLL delay loading). Option for lld is different than ld. MSYS2 clang based environment use lld by default, so restricting to this config on Windows is safe, and will avoid false bug reports. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Pierrick Bouvier Tested-by: Stefan Weil Tested-by: Philippe Mathieu-Daudé Message-Id: <20250110203401.178532-4-pierrick.bouvier@linaro.org> Signed-off-by: Alex Bennée --- meson.build | 5 +++++ contrib/plugins/meson.build | 2 +- plugins/meson.build | 24 ++++++++++++++++++++---- tests/tcg/plugins/meson.build | 3 +-- 4 files changed, 27 insertions(+), 7 deletions(-) diff --git a/meson.build b/meson.build index da279cc112..15a066043b 100644 --- a/meson.build +++ b/meson.build @@ -377,6 +377,11 @@ elif host_os == 'sunos' qemu_common_flags += '-D__EXTENSIONS__' elif host_os == 'haiku' qemu_common_flags += ['-DB_USE_POSITIVE_POSIX_ERRORS', '-D_BSD_SOURCE', '-fPIC'] +elif host_os == 'windows' + # plugins use delaylib, and clang needs to be used with lld to make it work. + if compiler.get_id() == 'clang' and compiler.get_linker_id() != 'ld.lld' + error('On windows, you need to use lld with clang - use msys2 clang64/clangarm64 env') + endif endif # Choose instruction set (currently x86-only) diff --git a/contrib/plugins/meson.build b/contrib/plugins/meson.build index 63a32c2b4f..484b9a808c 100644 --- a/contrib/plugins/meson.build +++ b/contrib/plugins/meson.build @@ -12,7 +12,7 @@ if get_option('plugins') t += shared_module(i, files(i + '.c') + 'win32_linker.c', include_directories: '../../include/qemu', link_depends: [win32_qemu_plugin_api_lib], - link_args: ['-Lplugins', '-lqemu_plugin_api'], + link_args: win32_qemu_plugin_api_link_flags, dependencies: glib) else t += shared_module(i, files(i + '.c'), diff --git a/plugins/meson.build b/plugins/meson.build index 98542e926f..d60be2a4d6 100644 --- a/plugins/meson.build +++ b/plugins/meson.build @@ -17,14 +17,15 @@ if not enable_modules capture: true, command: ['sed', '-ne', 's/^[[:space:]]*\\(qemu_.*\\);/_\\1/p', '@INPUT@']) emulator_link_args += ['-Wl,-exported_symbols_list,plugins/qemu-plugins-ld64.symbols'] + elif host_os == 'windows' and meson.get_compiler('c').get_id() == 'clang' + # LLVM/lld does not support exporting specific symbols. However, it works + # out of the box with dllexport/dllimport attribute we set in the code. else emulator_link_args += ['-Xlinker', '--dynamic-list=' + qemu_plugin_symbols.full_path()] endif endif if host_os == 'windows' - dlltool = find_program('dlltool', required: true) - # Generate a .lib file for plugins to link against. # First, create a .def file listing all the symbols a plugin should expect to have # available in qemu @@ -33,12 +34,27 @@ if host_os == 'windows' output: 'qemu_plugin_api.def', capture: true, command: ['sed', '-e', '0,/^/s//EXPORTS/; s/[{};]//g', '@INPUT@']) + # then use dlltool to assemble a delaylib. + # The delaylib will have an "imaginary" name (qemu.exe), that is used by the + # linker file we add with plugins (win32_linker.c) to identify that we want + # to find missing symbols in current program. + win32_qemu_plugin_api_link_flags = ['-Lplugins', '-lqemu_plugin_api'] + if meson.get_compiler('c').get_id() == 'clang' + # With LLVM/lld, delaylib is specified at link time (-delayload) + dlltool = find_program('llvm-dlltool', required: true) + dlltool_cmd = [dlltool, '-d', '@INPUT@', '-l', '@OUTPUT@', '-D', 'qemu.exe'] + win32_qemu_plugin_api_link_flags += ['-Wl,-delayload=qemu.exe'] + else + # With gcc/ld, delay lib is built with a specific delay parameter. + dlltool = find_program('dlltool', required: true) + dlltool_cmd = [dlltool, '--input-def', '@INPUT@', + '--output-delaylib', '@OUTPUT@', '--dllname', 'qemu.exe'] + endif win32_qemu_plugin_api_lib = configure_file( input: win32_plugin_def, output: 'libqemu_plugin_api.a', - command: [dlltool, '--input-def', '@INPUT@', - '--output-delaylib', '@OUTPUT@', '--dllname', 'qemu.exe'] + command: dlltool_cmd ) endif specific_ss.add(files( diff --git a/tests/tcg/plugins/meson.build b/tests/tcg/plugins/meson.build index f847849b1b..87a17d67bd 100644 --- a/tests/tcg/plugins/meson.build +++ b/tests/tcg/plugins/meson.build @@ -5,9 +5,8 @@ if get_option('plugins') t += shared_module(i, files(i + '.c') + '../../../contrib/plugins/win32_linker.c', include_directories: '../../../include/qemu', link_depends: [win32_qemu_plugin_api_lib], - link_args: ['-Lplugins', '-lqemu_plugin_api'], + link_args: win32_qemu_plugin_api_link_flags, dependencies: glib) - else t += shared_module(i, files(i + '.c'), include_directories: '../../../include/qemu', From patchwork Tue Jan 14 11:38: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: 13938651 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 509F6E77188 for ; Tue, 14 Jan 2025 11:40:32 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXfFw-0005Cp-1Q; Tue, 14 Jan 2025 06:38:48 -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 1tXfFl-000580-PO for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:39 -0500 Received: from mail-ej1-x636.google.com ([2a00:1450:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tXfFj-0005Ra-8x for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:37 -0500 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-ab2c9b8aecaso730238966b.0 for ; Tue, 14 Jan 2025 03:38:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736854714; x=1737459514; 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=xlXD5Sn0rYO8He0H7Rs2R6nW3maRKYRQpAyPaWSU1Fg=; b=DT5XKnNiTbagRvz2AfNXIKDJCesSBIlMVrsJIUF2lksMLXIgE2tBgejhzpUa5zq8pI 3Sz0BNduv0HkL5BJ8kqSAzIklFK0fDxIPeo10d00V/49qnX2XrvIE1eNdn2hgp92Bd6w we69oBBgMMZFnfB86et12+ka5wA3W64b/5xFeGuVixPhbw0DKZZ6cK2r5wmCP3WaXHtl Bdof7pz+lE48w4kC7v8zqhIbNVq5b9e/nHHsuBMNwiFKMSWHbVgefXgPI0i7x5zPk/4i LNP5m2lo4gjKFQskF59w7+8a73keF2Mb8cAs9C5RKY/s8l19EMtSELFrCKdwbFiZvqN0 Solg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736854714; x=1737459514; 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=xlXD5Sn0rYO8He0H7Rs2R6nW3maRKYRQpAyPaWSU1Fg=; b=SHn+uYD+m6xdwG3oSgAUPxBuzDwX+SpJkiqeoCRTHWFPXUdkB9aW+H4VsR95IyHQYO lM9CCX0telKjIzvIh5pWTXOzxXPx49TLZMNvoQlIWKt15RtKWMrXZim2thcIjq3C36nJ L66q25LNEi0IO6UsLLMF15cZOEmppR00CznAKpT5ziq6gE4BAJT5KoHSv/Tc8t+Yx3WE Gvml69AQKlOdgI+pzWuGvMvhB+QDXIUsFQZlAUloLWaIpyEvWf8tu7Mk5Z+uTsGGHNmS R2shtsOXyR+ggqU6Pwv9wlJeeDRHzWiodQVYIG/SCdCnkXTcO/TM+kXqHE3Z2p+ZSIDA TLQw== X-Gm-Message-State: AOJu0Ywy/aFJCwSK54qCJY71fayM8g4DIUYiXNHGou62f+daTinCyFJQ rlClXD4flfMJTTrdiDIEOwRSSwyc1Ow2CLZIVjjtT/ZR1e2CpoBZqLLXwb5b29o= X-Gm-Gg: ASbGnctE71rvaBdaV1JxKG6zPdX5bjy845PsCko7hGPpFDm4Mq5VCOvc81EcSIilLiH aBSgmEvt7gl1pjXV4mfzc7eWcENG9mm6ok7oKCBpxmOt3otxcExdzEUxW3YRcPsXV0BtI4synhR Pr+X0QsUkxv0zcbSQJUoVJcvuItHaTZ8pIwT27DwqMB2Znpdna03psSehYrLGAi4T+jamRCvYB6 GElcwR2lLCZK7b2StiE5as+nBXv2Q6Z6Yd1DU2HxQ/ToXcaczhDbn4= X-Google-Smtp-Source: AGHT+IEBy8bjoh/36I4aHtq06zdHiLSEtZwkJxCXTE9OT2ll5fUc8X1vBuiaeJjMSV7U8VRnujaaHQ== X-Received: by 2002:a17:907:96a5:b0:aa6:834b:d136 with SMTP id a640c23a62f3a-ab2ab5f93c4mr2470534666b.33.1736854713573; Tue, 14 Jan 2025 03:38:33 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab2c9649939sm614159066b.182.2025.01.14.03.38.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 03:38:31 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 42B675FAA0; Tue, 14 Jan 2025 11:38:24 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Weil , Pierrick Bouvier , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v2 26/37] plugins: fix kdoc annotation Date: Tue, 14 Jan 2025 11:38:10 +0000 Message-Id: <20250114113821.768750-27-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250114113821.768750-1-alex.bennee@linaro.org> References: <20250114113821.768750-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::636; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x636.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org The function is qemu_plugin_mem_get_value() Signed-off-by: Alex Bennée Reviewed-by: Pierrick Bouvier --- include/qemu/qemu-plugin.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index 0fba36ae02..3a850aa216 100644 --- a/include/qemu/qemu-plugin.h +++ b/include/qemu/qemu-plugin.h @@ -583,7 +583,7 @@ QEMU_PLUGIN_API bool qemu_plugin_mem_is_store(qemu_plugin_meminfo_t info); /** - * qemu_plugin_mem_get_mem_value() - return last value loaded/stored + * qemu_plugin_mem_get_value() - return last value loaded/stored * @info: opaque memory transaction handle * * Returns: memory value From patchwork Tue Jan 14 11:38: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: 13938674 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 45BF2C02183 for ; Tue, 14 Jan 2025 11:48:02 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXfOM-0004Rg-TM; Tue, 14 Jan 2025 06:47:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tXfNo-0004KV-Rh for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:46:58 -0500 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tXfNl-0006dz-V9 for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:46:56 -0500 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-3862a921123so3111601f8f.3 for ; Tue, 14 Jan 2025 03:46:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736855212; x=1737460012; 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=Pduzs+UmjW63vib6FEKaDURuILe6p6CLJowHwsN6bcg=; b=aIB+xXU372h18WMO1ehatnhVpJWwEdM+Bh5smcISFB9hOJuRo639mz0ZuwIh2zRXV7 MOlbXfMYGWwiJVuqU+MRdax5S4v8LOpVusJ+7+O+KDxpAIiNxursF61WsZM0G2FQ/qrM ImGiYwAPgCKYJXKO+OBE2KaaFkhnUT6U2hkrpb3til1nHSmUP0wZ2OB+4hx/zntMq4Tx MKuAXTXrNJsbmaKs25/vTmcn0TM6Nxocjqo0D4GN+Ftu9ea38D/VudB2Ah3Dcfb/Dfzr A/LNmr/g/qMdhlRbIFAXRSwPkPVAf0isTzar1Nx/0ckgGcBVihI49DSubU57djTj++u4 hS9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736855212; x=1737460012; 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=Pduzs+UmjW63vib6FEKaDURuILe6p6CLJowHwsN6bcg=; b=hNbPjTrIMRQyZbHHtURCA2M+iI8CdbM2H115J7yLpc3BbZg/E3jQq0k7wh+FYjlKMf u8FnQiLaIBnKCUqY9e+7ora9xX+g44N+MR/T4NMuikAjpihSaHQlM67ma+vtXjTA2J/G 95jki+pHcz0KX2/I8c8L7ZwVuYD1qF+gY59tZHc0gFC3SFmMY97dZQ+Av1yWETXcSBH2 HyDYr2hQQgTwmsOcF9KYhePPbIdqDvvXwBarqPe4lXsb45LHEJ6/EUeN1ScUaNLW403R Fn7ymUBqnah4fZO3FiFM4wMu3HLxp2KCDhSpCJ9NWsTll+F2XHBaaHPP+GOFLr/NpvEi iOdA== X-Gm-Message-State: AOJu0Yz/DqexWmbbJav+vYlEQ8mMYWf+qldYmhQjnUolmLXvval05fov 5A7ANnsytmpuHdw5AKR3e/MbEzghp2QNlGVV4TdjMArRlP7mZy5riVMUC5OI9GM= X-Gm-Gg: ASbGncs+8kNpFbBAawsBzBH0eNW8qSQEMgyRVLi0CaUAxHHOfFQ2nOHUsHlcGquYVmW La+sd4SCVTl6KX3NLlYBbsl+rpNkXMmu9HHaqgp656m+lUU+rmIo/2WO5UpmgQjMZDpT2AxFgE/ JE5UvSSMuVffdQKwB0GVjkN1acJv/MHmqayALX2aRtT+y+9XkgNlsvxxjS/FrFkdUSGL9PHhiEM 7ZTruW4gCrQDDf681VgJ6qi68O/pcg79Ck0K1czPHNuGDf9ihOvpsc= X-Google-Smtp-Source: AGHT+IGv5bxYmyhPCryfoF3RUrTR35O1qABD4hyyrYXW8FCfAwguGbE8/ORH10G7DucRMyMLtvY7nw== X-Received: by 2002:a05:6000:1561:b0:38a:9f47:557b with SMTP id ffacd0b85a97d-38a9f47568cmr11438776f8f.40.1736855212054; Tue, 14 Jan 2025 03:46:52 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e4c1b44sm14746104f8f.90.2025.01.14.03.46.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 03:46:50 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 5AEFF5FB4D; Tue, 14 Jan 2025 11:38:24 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Weil , Pierrick Bouvier , =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH v2 27/37] editorconfig: update for perl scripts Date: Tue, 14 Jan 2025 11:38:11 +0000 Message-Id: <20250114113821.768750-28-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250114113821.768750-1-alex.bennee@linaro.org> References: <20250114113821.768750-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x431.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org We have two types of perl scripts in the tree. The ones from the kernel are mostly tab based where as scripts we have written ourselves use 4 space indentation. Attempt to codify that in our .editorconfig Signed-off-by: Alex Bennée Reviewed-by: Pierrick Bouvier --- .editorconfig | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.editorconfig b/.editorconfig index 7303759ed7..a04cb9054c 100644 --- a/.editorconfig +++ b/.editorconfig @@ -47,3 +47,16 @@ emacs_mode = glsl [*.json] indent_style = space emacs_mode = python + +# by default follow QEMU's style +[*.pl] +indent_style = space +indent_size = 4 +emacs_mode = perl + +# but user kernel "style" for imported scripts +[scripts/{kernel-doc,get_maintainer.pl,checkpatch.pl}] +indent_style = tab +indent_size = 8 +emacs_mode = perl + From patchwork Tue Jan 14 11:38: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: 13938672 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 06A4AE77188 for ; Tue, 14 Jan 2025 11:47:44 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXfOJ-0004Oi-2x; Tue, 14 Jan 2025 06:47:28 -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 1tXfNp-0004KX-38 for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:46:58 -0500 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tXfNm-0006e3-FW for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:46:56 -0500 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-385e06af753so2715894f8f.2 for ; Tue, 14 Jan 2025 03:46:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736855212; x=1737460012; 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=wsJrQyXEWZvrTPX4VUVE9uBd8vvjXQHOnXreMlY89ek=; b=dqLrN7x9vIaMFIPTiGPzszoh9Vle0SZIdveecXAADpT7vwlVVrgH/KThwFSWuPzD6j J6cVsywdx5Kkrsd2Kl/7mEt87Dr/oZlky98TMV47sEN+LpxOZ3Rhr1c/SCMLfpIxxCUb FJyAl63bmyiJXJwT8jxvqQkJVaxBbBPUpk3QKhVrAy7P0GDPeKQBm96J3B1mG3hmsL4r IhsAxY9AhRituYjjDvFelimCtOUYoTg2bCRFEhdgfgJ9GzRjQzi0AYPsPWsFi/hw9BPg myc2QDRdfHP5L2j4OEHxicz2gAJSxrF4AgRUI1DtjnmEXteuJoFGrSyW4UhxcRfa9dQf dJZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736855212; x=1737460012; 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=wsJrQyXEWZvrTPX4VUVE9uBd8vvjXQHOnXreMlY89ek=; b=JhERNER6QV75OBV4Xe3kU93FlJuhOIh878G7lJXBdutbDf4afMapFBissEzGvyN7Oz a6gEh65CPdCLHF1dKf6h5lGP/tEzFf+LhYcb2MulUhkSa6hp4BVEpqLJPONSsSBxmyXv 9H3csKW5+IlTm3DfSFXADNTfyq15BNP0hYOVnyob1+H+mh4Tm9Y1/UhF6Vf+Izpk7iHH ogh12GywdbUH6SpKaxYrE1iZ8Da8DQKTbN7J8PjGUcBiJqC/buBTaLbhZFrGJSifsLvw MgBtetHsDy2P4W/x8RkZjsEl4aaGaqrJQHGVOg+sjhEEKyq2WSJaxaR6f8LQn9Uq5Jtk oOyg== X-Gm-Message-State: AOJu0YyG8+2JjmMVxO1RQekSo2/0YTEvvc1zoiovXdiPGltPM8d7dAbg 1d9+fDv4E8JEj61fZj9zzl6/jecR+vHAmPt5fnHlvmmEmvJbp+N0UAWjxoOi0wnqdh456eZdXh+ vGyU= X-Gm-Gg: ASbGncvkOF1hiGSzWuRktKwUhlzYszcdZA6KvOUPhqh50Ts+4gAqP+OCKc4Iu00LUNB JlgckUqwBXdyMgAHuuwruRSwbuprLfVlFDtNT1F/1EP1Lytk0db6JHRuRycfFtjn2M3QH1zuMhv kyKxEwAZ8k3q68w4IETOvUeWmf0fKPqjbknf2/sc4xQ/lDmrlB2F29exdpjG/lSya4h4eFYcaJ6 eUewM6oaoRXTpznkR6AiqW7R6Kyt7OyvFthzy0lOUZwnuh6ZjTIDEw= X-Google-Smtp-Source: AGHT+IE1DFN+OWPDp14+H/YgQki97VWAV3NLnStbT0X6sb+ofZLZxMSsL1CtkbJ3Y8sVU3fScSyTbQ== X-Received: by 2002:a5d:47c4:0:b0:38a:41f8:8abf with SMTP id ffacd0b85a97d-38a87312917mr23365848f8f.31.1736855212602; Tue, 14 Jan 2025 03:46:52 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e4b80c9sm14473802f8f.84.2025.01.14.03.46.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 03:46:50 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 735D15FB53; Tue, 14 Jan 2025 11:38:24 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Weil , Pierrick Bouvier , =?utf-8?q?Alex_Benn=C3=A9e?= , Fabiano Rosas , Laurent Vivier , Paolo Bonzini Subject: [PATCH v2 28/37] tests/qtest: fix some copy and paste errors in kdoc Date: Tue, 14 Jan 2025 11:38:12 +0000 Message-Id: <20250114113821.768750-29-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250114113821.768750-1-alex.bennee@linaro.org> References: <20250114113821.768750-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org A number of copy and paste kdoc comments are referring to the wrong definition. Fix those cases. Signed-off-by: Alex Bennée Reviewed-by: Pierrick Bouvier --- tests/qtest/libqos/qgraph.h | 2 +- tests/qtest/libqtest.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/qtest/libqos/qgraph.h b/tests/qtest/libqos/qgraph.h index 1b5de02e7b..81fbfdd0e2 100644 --- a/tests/qtest/libqos/qgraph.h +++ b/tests/qtest/libqos/qgraph.h @@ -355,7 +355,7 @@ void qos_object_start_hw(QOSGraphObject *obj); QOSGraphObject *qos_machine_new(QOSGraphNode *node, QTestState *qts); /** - * qos_machine_new(): instantiate a new driver node + * qos_driver_new(): instantiate a new driver node * @node: A driver node to be instantiated * @parent: A #QOSGraphObject to be consumed by the new driver node * @alloc: An allocator to be used by the new driver node. diff --git a/tests/qtest/libqtest.h b/tests/qtest/libqtest.h index f23d80e9e5..fa08c7eca5 100644 --- a/tests/qtest/libqtest.h +++ b/tests/qtest/libqtest.h @@ -365,7 +365,7 @@ QDict *qtest_qmp_event_ref(QTestState *s, const char *event); char *qtest_hmp(QTestState *s, const char *fmt, ...) G_GNUC_PRINTF(2, 3); /** - * qtest_hmpv: + * qtest_vhmp: * @s: #QTestState instance to operate on. * @fmt: HMP command to send to QEMU, formats arguments like vsprintf(). * @ap: HMP command arguments @@ -904,7 +904,7 @@ void qtest_qmp_assert_success(QTestState *qts, const char *fmt, ...) #ifndef _WIN32 /** - * qtest_qmp_fd_assert_success_ref: + * qtest_qmp_fds_assert_success_ref: * @qts: QTestState instance to operate on * @fds: the file descriptors to send * @nfds: number of @fds to send @@ -921,7 +921,7 @@ QDict *qtest_qmp_fds_assert_success_ref(QTestState *qts, int *fds, size_t nfds, G_GNUC_PRINTF(4, 5); /** - * qtest_qmp_fd_assert_success: + * qtest_qmp_fds_assert_success: * @qts: QTestState instance to operate on * @fds: the file descriptors to send * @nfds: number of @fds to send From patchwork Tue Jan 14 11:38: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: 13938678 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 85B73C02183 for ; Tue, 14 Jan 2025 11:48:39 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXfOE-0004Nl-71; Tue, 14 Jan 2025 06:47: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 1tXfNn-0004KF-QT for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:46:56 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tXfNl-0006dt-Uj for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:46:55 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-43618283d48so38404075e9.1 for ; Tue, 14 Jan 2025 03:46:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736855211; x=1737460011; 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=CCpqJSBadXyBrjebPIu8ZLRFMr8IBo0L8bVYPsM+QnQ=; b=oifINEBZ+geTQwIf2jXZ4CFiekHj6JtEjBG7NfANRW8h3Rg0/Ay0wVDUgy3v4YKfTO eK5eR5zPK4UkeJlyCUaSv/SCx4qCWFKKWiA4/lA5sIvYrAxLsic7LpQ9pA+lr178S6Nt jt6PiwoniyFDOvqRqe4ab4SPnz2uaqJ1OT7WRsM9ZAKiqMce72VpSCUv5DzB9hqVG5Nz PqH+0wPCVwNOOT7l16H2fl6rXMoo7/sGeoTxDQj/2mmlTefRDxmJUgY4LuAbRwe2wdHW L9ReTpCg5bgtxyw3tm2VB2lh6uNMHfMHbtQBF8NefLa+A/Mjosjk803XwGVXCkY3DYTg XH8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736855211; x=1737460011; 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=CCpqJSBadXyBrjebPIu8ZLRFMr8IBo0L8bVYPsM+QnQ=; b=N1LzzDiCf5TKXhNfQRhZgDt7+T48CMbe0gdiSy1KFWk6kp7385C8/FnSAo/9C1fA1E 56drYhRXsxhN586fkJ6a1rGgdatRKNqtMOjdn5jdkZg/eiMe7Sz6wFAwmGLjUiwQ1cRM PffnSxlWU3nAIzCy1fFLCLB6mXSg39npDXUCAq34DvtTWr0YZYYoYmLJtlDpOEIq8p7p RvvZDJRYFMyS4zF86uI5yp8c8vNQmKdLDeBu+Zj8eKcnax8et8ZWY2uN5nwzWhPRomS7 e34y8olG/igEic0RpXerOMEyIVZmK5DY4R8GKkkL+jKANA+SlqeO0o8hWlPukhyDfWKL NBrQ== X-Gm-Message-State: AOJu0Yy3va0/i6ML2VLv5jzWThvmhdV3jSYZsg/FPWn2btd/YvjBXHpB 4jtorxCBwPht1lFw90RTh3Bo8wbkgplR5jgVb3Jf/2R3ZWFEV9ru9cghtpb5M0g= X-Gm-Gg: ASbGncshz26fhzk+T013nGVsSjJ59TIxITfkQ0kz1UguL5mH9nJfXkjZ7BH5Hg5K6cm 2HH6VyB2r9MyJyuZnpN2WxhDZHSPFiOg+/eLaakQFU1Fis7m3zVNizjRD4fuAhkxUXfiTtTZVVf 4I0l9PltzS0+57uZkp5Keos2oiiu7z4+6E7dkxvtY6yax6MdggGrIFCOEE+TmuTDeiquwuBR339 MVChZVYFtIGLlcYR6eqH/GR7/HE0LxneLzYV82B1Bl6jyTTKy5tXlQ= X-Google-Smtp-Source: AGHT+IGiwCKXCZhfSZ5M9ZJrS7liWZwRELgRdLtLHYzveMatbIefSQo2ssjEhBnAZM7m/2hY9o6TPA== X-Received: by 2002:a5d:64a8:0:b0:38a:8d32:272e with SMTP id ffacd0b85a97d-38a8d322a66mr17360640f8f.46.1736855210969; Tue, 14 Jan 2025 03:46:50 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e37d01dsm14498717f8f.9.2025.01.14.03.46.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 03:46:50 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 8AB855FB63; Tue, 14 Jan 2025 11:38:24 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Weil , Pierrick Bouvier , =?utf-8?q?Alex_Benn=C3=A9e?= , Paolo Bonzini , Peter Xu , David Hildenbrand Subject: [PATCH v2 29/37] include/exec: fix some copy and paste errors in kdoc Date: Tue, 14 Jan 2025 11:38:13 +0000 Message-Id: <20250114113821.768750-30-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250114113821.768750-1-alex.bennee@linaro.org> References: <20250114113821.768750-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x333.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org A number of copy and paste kdoc comments are referring to the wrong definition. Fix those cases. Signed-off-by: Alex Bennée Reviewed-by: Pierrick Bouvier --- include/exec/memory.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index 9458e2801d..605687befa 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -1194,7 +1194,7 @@ static inline bool MemoryRegionSection_eq(MemoryRegionSection *a, MemoryRegionSection *memory_region_section_new_copy(MemoryRegionSection *s); /** - * memory_region_section_new_copy: Free a copied memory region section + * memory_region_section_free_copy: Free a copied memory region section * * Free a copy of a memory section created via memory_region_section_new_copy(). * properly dropping references on all relevant members. @@ -2510,7 +2510,7 @@ MemoryRegionSection memory_region_find(MemoryRegion *mr, void memory_global_dirty_log_sync(bool last_stage); /** - * memory_global_dirty_log_sync: synchronize the dirty log for all memory + * memory_global_after_dirty_log_sync: synchronize the dirty log for all memory * * Synchronizes the vCPUs with a thread that is reading the dirty bitmap. * This function must be called after the dirty log bitmap is cleared, and From patchwork Tue Jan 14 11:38: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: 13938677 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8D7BDC02184 for ; Tue, 14 Jan 2025 11:48:38 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXfOP-0004Zu-8Y; Tue, 14 Jan 2025 06:47:36 -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 1tXfNr-0004L1-Vw for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:47:00 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tXfNp-0006en-Kb for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:46:58 -0500 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-436326dcb1cso37872245e9.0 for ; Tue, 14 Jan 2025 03:46:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736855216; x=1737460016; 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=AlXy29NBIjMy0Rkry+U475eKhew1JRy9bb9HkntANSQ=; b=vcPlaJayrxfpEIR9045x41G47YnosYVkn/th6ipYEfIPReh9r7Z88Z6p9jnPzfyeLK 02rrqJnzIylJSxbk+Eh9H13b0b1zuSoTka5vtw/ge7mUCTQGrxOkANWxAUB3sBnmgFoT RIaFi0bxY2sbUjZS9m7PWkPRJoZgWtkfB0k1bROymj9RipVvoXh36pu5t+lynUCo8ghx pBm7LNPbr9tfixR0AdI/ToacWHaaHZXi596D0a1v943TAevz4NAgNaxT2Zb0P0ReBsHC WG9ChpmrCUliRiao8FrEn6VG61lOYlYOsacyWukdfOdVkle6/YKqrUaFEEGrL8Cxdrdt MiTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736855216; x=1737460016; 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=AlXy29NBIjMy0Rkry+U475eKhew1JRy9bb9HkntANSQ=; b=gnEQSr/E55Kgtr1eKaox0MJqEyGSDDSJeaF6QZWUCq/z3ifRw7U7yFDvMN8N0s6ulN L4hMRWff3BpT7n5Rtljc6Cc9OJPV3gM51xTp9y6IihinGC1ta3dPRJZWSmePPq6ZtFBA hfysaLPKE923s5sa3GnxSLEz3vgIQ3BHi9kCT/MsnTiWrat/d6n6tdQnXVEjlv75cBpr mV2qEjS5l9iyC9Jraqff0PXwT+kgGrjoKlgaqvHxXIL7wew4ceZS46Ov4YpiyfSII1wc oe8WeapKAANxvqPvbz0Y5kHy0FZps6cXDzfOhDfCy69ZRNBcsWOnGSPpbwjKE28hc/2m LNiw== X-Gm-Message-State: AOJu0YwhkG/5tT2ECvJd9PYo/5GrWXBDGbazdJJraUTb4ScI0UVHVZwR TPNMC8/p8Prxdvioh2SBVX36yjznGsvGAF3ZzJJKkZPS71kj9sthGcbVN08BIF0= X-Gm-Gg: ASbGnculVy0po9knjC1itRTd4Ds5jkwXi7RfHFnn0fxnqG5YBJdM2IFBIkZJsF+vmqE xUVtohecLKHlXRfBM9MB3zJvhC91DpAalizG5cuCkmX2JINbt99dQhENrJTfrhf9SGdKZ47E5Dp Vtu/cEJRdaM2iEhzUrHmmCM2ogyTeneHDi0FPe6y2i4sZJff/pLl+qqBc1LCQ8e3//vWNLa7Pp7 qLR/EiqkFYiEh5xEUjMkLnIb1p/btSkh8PAvHXzvvusiMvVaeDqNoA= X-Google-Smtp-Source: AGHT+IHgP+6HBHh6uDwG8QKhTqvCm7FzNbhJggUy3xFbODg6HBJy2dDXCDJ9Cio2bcEfS9RNitwEyQ== X-Received: by 2002:a05:600c:4314:b0:434:a802:e9b2 with SMTP id 5b1f17b1804b1-436eedef4damr146977385e9.4.1736855216226; Tue, 14 Jan 2025 03:46:56 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e2e89df1sm205860075e9.27.2025.01.14.03.46.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 03:46:52 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id A122F5FBC0; Tue, 14 Jan 2025 11:38:24 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Weil , Pierrick Bouvier , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , Peter Xu , Paolo Bonzini , David Hildenbrand Subject: [PATCH v2 30/37] include/exec: remove warning_printed from MemoryRegion Date: Tue, 14 Jan 2025 11:38:14 +0000 Message-Id: <20250114113821.768750-31-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250114113821.768750-1-alex.bennee@linaro.org> References: <20250114113821.768750-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32a.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Since d197063fcf9 (memory: move unassigned_mem_ops to memory.c) this field is unused. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Peter Xu --- include/exec/memory.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index 605687befa..3ee1901b52 100644 --- a/include/exec/memory.h +++ b/include/exec/memory.h @@ -784,7 +784,6 @@ struct MemoryRegion { bool terminates; bool ram_device; bool enabled; - bool warning_printed; /* For reservations */ uint8_t vga_logging_count; MemoryRegion *alias; hwaddr alias_offset; From patchwork Tue Jan 14 11:38: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: 13938679 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F4050C02184 for ; Tue, 14 Jan 2025 11:48:40 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXfON-0004TH-80; Tue, 14 Jan 2025 06:47:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tXfNp-0004KW-2x for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:46:58 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tXfNm-0006e7-LE for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:46:56 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-43622267b2eso56142275e9.0 for ; Tue, 14 Jan 2025 03:46:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736855213; x=1737460013; 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=r3xMvlplv8h0TbuE1B73gGvg3VD8+4dGq7BfJmandFw=; b=A4uu/dfqi8V1ERLh3b1R/rmsSr10AmVYvcVnUOoRdnEh15E1qs6h1s1MqMDErnPUKL VP91DOX2khFJ4jnja+149/85r4TIHXgeKpJ6dani6kvH5chIBUzLFyy81hss16gqqE0h DhXR5qmN2jtgHMGcFXl9tvMLuAMtU46YA56eyA78v6MM2IkZnQA8odZg7y3ylW3pVvHv ru77YmzdxpMzog0vnL7pdSzC4j02mDy4dEAahjS8PblWVBAjU6Tg+0LuV4Oj6v+Jw90O QJVICYk7zVeRj53b4se0WPhj2L6EtDVCgF9kLGVyb9xn3dtOqqzWkM9Iz1yFEwUQsa86 utHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736855213; x=1737460013; 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=r3xMvlplv8h0TbuE1B73gGvg3VD8+4dGq7BfJmandFw=; b=dmNFNRaGxhtu3dnCAuDfdgWMahd7WjVUPBWKY+ODZjaeBY8n3NI4nhO1DBmvRO0dcq duIeBLieIuEHrfZ6loLTN/HQirFCTi/468QBYNkFpQ4bxK4yku+YOJGIvHgWc0AgL/tA ekFLHlaFM29PXsucR0UnC7U7sRJRkOXU8c0RpYT0HDzleX5J2twjwfX2EvT1XZAfP2Dn 54hCB92opZ1a/95tCqoQQWSwn7IxejrIIOLoykuG+Qg7jo2NYWxLjMn/wirKZMsX61gT YFiJ0rkfF2YK+EVZPLezt5MwD4Wyp7HUXwudIdeQVaMRTSkTFBq5Ycu96n6FN52j5JOK hKWA== X-Gm-Message-State: AOJu0Yzeulv+f2ZFsj0p7BPSlkAuuDpVhHWsTnLNverUjI3WYLRO2crb mmknm3v2LWq8+CCfXKn6h+0eORUJ9ePsWMEcGUStUZZUcizpljsguyB7CdgLY1A= X-Gm-Gg: ASbGncsGr1vnZUZblEU41JbYbureMfOHqFqYymTdTEkgcTaGF9wIQ6DU9W9PZAVZ9ih hyiCj6db1gYXCQ3JmTrfWADUu+SwSOv4FzSMhSxIBubU9Ja01B607lCwH1qqzOYR/4BT4MrcWra 1ezFfeTflkcc1g93pMiixrruz59BqZKO3BonL9uFYI+Px7TJU6JlxY58k63aedXovLwSmlBku2O pjD5SRd31baLBzRpPdWcDQNu8Ho+VAI92bmBajUyDWXkfXnI00DUWA= X-Google-Smtp-Source: AGHT+IFUT3M+mz7Xqr2YlxuoBSz2zgfUGCAKLX9oWysfJ5zEtul0hLok4fZKDOSO4VW+UJH2qvn2TA== X-Received: by 2002:a5d:59ab:0:b0:386:37f5:99f6 with SMTP id ffacd0b85a97d-38a8733bf6dmr22328840f8f.53.1736855213325; Tue, 14 Jan 2025 03:46:53 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e38c697sm14902010f8f.52.2025.01.14.03.46.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 03:46:52 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id B60AE5FBCE; Tue, 14 Jan 2025 11:38:24 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Weil , Pierrick Bouvier , =?utf-8?q?Alex_Benn=C3=A9e?= , Peter Maydell Subject: [PATCH v2 31/37] docs/sphinx: include kernel-doc script as a dependency Date: Tue, 14 Jan 2025 11:38:15 +0000 Message-Id: <20250114113821.768750-32-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250114113821.768750-1-alex.bennee@linaro.org> References: <20250114113821.768750-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x333.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org When we update the script we should rebuild the docs. Otherwise breaking changes made to the kdoc script don't become apparent until later. Signed-off-by: Alex Bennée Reviewed-by: Pierrick Bouvier --- docs/sphinx/depfile.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/sphinx/depfile.py b/docs/sphinx/depfile.py index e74be6af98..d3c774d28b 100644 --- a/docs/sphinx/depfile.py +++ b/docs/sphinx/depfile.py @@ -31,6 +31,9 @@ def get_infiles(env): for path in Path(static_path).rglob('*'): yield str(path) + # also include kdoc script + yield str(env.config.kerneldoc_bin[1]) + def write_depfile(app, exception): if exception: From patchwork Tue Jan 14 11:38: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: 13938671 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B31BBC02184 for ; Tue, 14 Jan 2025 11:47:30 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXfO1-0004Ls-Gf; Tue, 14 Jan 2025 06:47:10 -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 1tXfNp-0004KY-Cl for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:46:58 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tXfNn-0006eC-C0 for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:46:57 -0500 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-4361e89b6daso38362725e9.3 for ; Tue, 14 Jan 2025 03:46:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736855214; x=1737460014; 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=E36UvEspsa4mA6pTf+HFiwfFj5ukjbDFpFJX/Z8z6wQ=; b=RXyXKs29vn7XmlNwu70R7mfWR/vdkzTiX9zl9PtrF5xBHnkIBFVW5Bh27qFhmZ9Ive plnCqQO1nmbtCIDnjqyt0+0tuKhzkdVOz/eSt+yF7kwJMjKDSdcJNUNXD4cATpdP9tjl 6vb6BSaUQWiIOE+3SuLyFyCLamKwKsKt/esNHcUQ8EKQQPxbUTLIEyzRBsl33FmHRZUt V9BO6LSHddARvRqFPno0FncYhSx2944Wp0nRAS3v1lz07qJ8pvg6G++acP9w1vPAX2zQ ODJfo4WzsTRkECYdvDac3jtf2YnDWxPq0OO6IbHqS1vvrqrJ27mur+lRyUZqZJHyJC0/ ZIKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736855214; x=1737460014; 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=E36UvEspsa4mA6pTf+HFiwfFj5ukjbDFpFJX/Z8z6wQ=; b=E2q/pyKcFagFuHo6WEz10e7u9nPaCmYTwjsM5tpSR5YKNxbERvffWPAvs0VgMP7HIV EldOIsqdduKaDW4pIUsixG+OoWBpqGD/4O4Ow7B+1mJXglubLy9bpzm8vIR2HRAiurFs 7Qpc4Tk8BrmYNwGS8h5UEwjW/UCIBvzeyGd5KpjayliPQVc/Af+mwRjmIEFAS71FKuqL CZCIEEIQEipWWie0i4OWrDuBBeVGfFEd1wtibdFFt1ZFaSTK7v+U+qAw5msXaUBIZ7dB AU28xxoP96mGmyhOr9HoqkZBTFGtUoRIRIPL+Wo2fo31rkVcUt/SEo/wMZSMB4ia2dvl Zxng== X-Gm-Message-State: AOJu0YxpvFw4qf20Kt9inV3hFzrEA6eVRFnV4NjOPbQdqkEqH/B/vhZT luePDgKFh7QbrbGyTndRC2bNcwZEiVcObfbUXKXXisk9NZChhE5diJ7tH9u/E1c= X-Gm-Gg: ASbGncugB6DGHu9hzn9luXs+sr5NwjDTipgLuZiFdMnlCDMznmm5d1H5HkPdWO/UlMV R5Df6NNmfjyN9hAopwG0oYOGm+T+mvkZmbejlqJvpN0N4aWtDQqBhap4LLxJW9f31cNi3byry/k 6ir7hmRC4GL5DFBt5IsJYiAV3cU9WUG9GjKhA8Xx11z9Jdm53ACfWJocxiIwEuOwC880upG1fmR DEUVQOpegsXvHS5IpTwuzFVvyEn23ZbYwY4EAn6cgFGaY2ZDRwi0YM= X-Google-Smtp-Source: AGHT+IFr7EzaV4CWWFx0LE0WKXeeliasgiUOgkIt/xIxRudTbwaqQ8bgs5LlaUAWPHV9yBNVOCcqiw== X-Received: by 2002:a05:6000:18a8:b0:388:c790:1dff with SMTP id ffacd0b85a97d-38a8733fd71mr20588495f8f.47.1736855213952; Tue, 14 Jan 2025 03:46:53 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a8e37e36asm14303670f8f.5.2025.01.14.03.46.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 03:46:52 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id CBF985FC92; Tue, 14 Jan 2025 11:38:24 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Weil , Pierrick Bouvier , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Markus Armbruster Subject: [PATCH v2 32/37] docs/devel: add git-publish for patch submitting Date: Tue, 14 Jan 2025 11:38:16 +0000 Message-Id: <20250114113821.768750-33-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250114113821.768750-1-alex.bennee@linaro.org> References: <20250114113821.768750-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x332.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Pierrick Bouvier Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier Message-Id: <20241209183104.365796-3-pierrick.bouvier@linaro.org> Signed-off-by: Alex Bennée --- docs/devel/submitting-a-patch.rst | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/docs/devel/submitting-a-patch.rst b/docs/devel/submitting-a-patch.rst index 03b2ac298a..69df7682c5 100644 --- a/docs/devel/submitting-a-patch.rst +++ b/docs/devel/submitting-a-patch.rst @@ -235,6 +235,31 @@ to another list.) ``git send-email`` (`step-by-step setup guide works best for delivering the patch without mangling it, but attachments can be used as a last resort on a first-time submission. +.. _use_git_publish: + +Use git-publish +~~~~~~~~~~~~~~~ + +If you already configured git send-email, you can simply use `git-publish +`__ to send series. + +:: + + $ git checkout master -b my-feature + $ # work on new commits, add your 'Signed-off-by' lines to each + $ git publish + $ ... more work, rebase on master, ... + $ git publish # will send a v2 + +Each time you post a series, git-publish will create a local tag with the format +``-v`` to record the patch series. + +When sending patch emails, 'git publish' will consult the output of +'scripts/get_maintainers.pl' and automatically CC anyone listed as maintainers +of the affected code. Generally you should accept the suggested CC list, but +there may sometimes be scenarios where it is appropriate to cut it down (eg on +certain large tree-wide cleanups), or augment it with other interested people. + .. _if_you_cannot_send_patch_emails: If you cannot send patch emails From patchwork Tue Jan 14 11:38: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: 13938652 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DC9ECE77188 for ; Tue, 14 Jan 2025 11:40:43 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXfFz-0005FY-E1; Tue, 14 Jan 2025 06:38: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 1tXfFm-000586-B8 for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:39 -0500 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tXfFk-0005Rw-6G for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:37 -0500 Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-5d3d0205bd5so8202267a12.3 for ; Tue, 14 Jan 2025 03:38:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736854715; x=1737459515; 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=Rem+PqKJwtTryCp5+P2h89dN9I6AHO+TdjB2QsczI6k=; b=HCwijRHQX4KtBUQ1rV9vfaEQA0knAV31yJpJI9J9JpCyWV4c6oBsWbXpRpXjrX/03N vTWCEttGgS2lt/fDSRqUrXS9dIU95Tufklr84u48zXYLr6xMMVJBiL7txgE/2dYpJs7k Zq/8IqsZJMWvy/umXOIKXH7EsLxUv4ho0mW9fR5nZjrmjSwrK+pSuP9dAX7ukZkfGn6g /xAjaP6INOlCFrrffg3aNXKmwH6r0MLkdVPlC4erHFzIOmWoot4JERSJEsZZM3+dzANu UCiIQ3NgtHRGQg70NO3MU1Ias5orWZqkknjAwk/e4EqctyxUcOAsfde1RB6hEEs2zd/O RE3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736854715; x=1737459515; 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=Rem+PqKJwtTryCp5+P2h89dN9I6AHO+TdjB2QsczI6k=; b=HKNobZCY9ObC2EkJZX+TlNcM1tuMf2/3oMcBPVCyHkQpJcUgiYvn+b7Wv/wHihZO+L XWj0cHUcOwShUcf/gSh8gQ/8VaMbAmOPShfJbixwl7wVyNsz4AtejQVPo2WobFLCLNe/ dD7iJ/IczPnJvltisI0AKhPIJd8W9BCKWrccC6dhdphFls3UYi0/Ayg0kwUWY5qiPVEE cuAbkvvfg5/my14WESqlbdXpyx/Fx3668ypbaeWRjVaMbq5kjCNf0opz8Zn18NT2ii1i A5ywV6nlsxh86S+911/GBVYa7bp/Fit0tpF3Zu1wWr2eAx4wssP7h2PM7UdaEmlHen7k lMWA== X-Gm-Message-State: AOJu0YxYg8qLKX+vjwE/NHXoVvBvkEmnpwBGjBMXCBTqPFRj78vZ32zJ rwCykSklBNYetIuJ7xR48vIauSjWVGEGdmdKPHSbhdM0t2NIpnNuJdKrSgq/sCI= X-Gm-Gg: ASbGncuXfG/0/57IhxD62CHLEN+Xl4JusCzoXOnx0+DHpDlWQg/GTVdaOjlfdihYcp9 npPmvgMjkXB85vhByVRwyulHHHdeN00LPPTPXRvWXHD8lwXjqOGOyph0Zd11cVS2/jz4wZrgVXV FUa1t7BX97xJumDu9Q2GhAChn0GutwKJGvnKFOzaebILzepDApkm8c7hLA4vX4K0MizLU+LMkL6 iZLCFYabU9bFU9lLmb1LPxelI5zsr4K+rB30GYDVdL26t8IyPT2v4k= X-Google-Smtp-Source: AGHT+IFoaWY4h7fBZuQrDxOq4ZsslzzDssSeH/U6q/T0SB/sDE2XlJwrb9gUK/QOasbvjpSlptNKYg== X-Received: by 2002:a17:907:9622:b0:aa6:af66:7c89 with SMTP id a640c23a62f3a-ab2ab670587mr2365693266b.5.1736854714725; Tue, 14 Jan 2025 03:38:34 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab2c90d73a9sm622380666b.58.2025.01.14.03.38.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 03:38:33 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id E39A65F92B; Tue, 14 Jan 2025 11:38:24 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Weil , Pierrick Bouvier , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Markus Armbruster Subject: [PATCH v2 33/37] docs/devel: add b4 for patch retrieval Date: Tue, 14 Jan 2025 11:38:17 +0000 Message-Id: <20250114113821.768750-34-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250114113821.768750-1-alex.bennee@linaro.org> References: <20250114113821.768750-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52b; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x52b.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Pierrick Bouvier Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier Message-Id: <20241209183104.365796-4-pierrick.bouvier@linaro.org> Signed-off-by: Alex Bennée --- docs/devel/submitting-a-patch.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/devel/submitting-a-patch.rst b/docs/devel/submitting-a-patch.rst index 69df7682c5..65c64078cb 100644 --- a/docs/devel/submitting-a-patch.rst +++ b/docs/devel/submitting-a-patch.rst @@ -433,6 +433,20 @@ For more details on how QEMU's stable process works, refer to the .. _participating_in_code_review: +Retrieve an existing series +--------------------------- + +If you want to apply an existing series on top of your tree, you can simply use +`b4 `__. + +:: + + b4 shazam $msg-id + +The message id is related to the patch series that has been sent to the mailing +list. You need to retrieve the "Message-Id:" header from one of the patches. Any +of them can be used and b4 will apply the whole series. + Participating in Code Review ---------------------------- From patchwork Tue Jan 14 11:38: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: 13938659 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0C92CE77188 for ; Tue, 14 Jan 2025 11:41:28 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXfFs-0005Bz-RT; Tue, 14 Jan 2025 06:38: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 1tXfFm-000587-BX for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:39 -0500 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tXfFj-0005Ri-T4 for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:38 -0500 Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-aaf57c2e0beso1100757266b.3 for ; Tue, 14 Jan 2025 03:38:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736854714; x=1737459514; 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=+v1cfKfMBYv6DUpTxzbC+rrsyIR6JwY8WQ4dxVeT55E=; b=e4xNvvd6HHVl/A+QyPhQgtpOMf4+LPG7T5G0/DufTHnG3SxzGAi7QNXPpq4FVMMWH1 ZyVHRBNc+w+tp6E8y4IMkPL+Kcafh80WI+dFCp0af4DnLOg1npuc1Qa+Zmw4Alg5vFpa 5ikOg8XsCkmBjWzOHkmyPiZ7fHMC+RwABorWii+d692DJhdmGXogMF7qW7R94hBYPpQm A9VfkVGjRMDSmEYoS+Uqu5bSmX0m20BYaDRBI5BUPydWk8VjGQKmZjoU0gIN5Oq8TEjC VRHRsQW9Dk+gfyjuP6HyykxhM5FlMGxQrq+b8C0N+GLKJBkFnemmmQx8O+53wg36MYXg 1oSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736854714; x=1737459514; 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=+v1cfKfMBYv6DUpTxzbC+rrsyIR6JwY8WQ4dxVeT55E=; b=tPx1EnsaKrIFr6fPoelAGVLrZOxHMSFYs0a8eV3Ne15Hfg52TRrV9ntFqGWmEN/1z2 FP7jfbnjYfL4p2M5F9rvw7gZr3ED4EZG7h4IuwiWHqHNXuKGy0vYb9edQGwnWuQWdLgQ 7SGFLg2RzjDNTB3UbmuUrX69ACyw+tZ/Ndv9pPSMjg6TC24srzDOieY7Blq0fu1IeAX3 uPBqnIhBhVQRLEhItBFSaSG2OLUlNgiqFjSC0SpywB4EjhWSFgBHYmAuAKYX8kzrSdEU HWm4vWnjy0BOwTsXkIus42x/Cvq98NE/tPdmZlclpfb4gx6ahUYedv3A60ki9pFWrPY9 qADw== X-Gm-Message-State: AOJu0YwhOWAgKnlk+8SzEO1X1QpCsPc+3OZLuL3uBDrUVUfizeDjcCfC 9GpCSArRq3NfFWjpHkPOfa4EKTsgqa9MpfjFXYwW4EHVRXuWecZSC/Uv7ET9cB4= X-Gm-Gg: ASbGnctGgKi0thudB10df5Vbp3igZOPuOmlw7B+zF7aU85upydSqESyve3W/rBXDHPb UE4QjMexQzB/OTcHOMPMmL4sDf6rp93rqwcSC5tpdNvN39dRGvI2cF4F1dOfsCGN8UtJh8Z7wPc lEv73hF8VlxyOPdmVl08l3vGSHgtGDowhE0rvd4nSFrns6LJfcm2pG8Ye/IZib53qVjHOb0qWdD BipEbJUaGMftqa4P5XEJFbeYLW7eivdl+0m7qqquAE4B7TfTs+dlKM= X-Google-Smtp-Source: AGHT+IFhyu5aC/CBWM4VQnIFvHJjTVE3RyDOGdlZ/ddzvT4hfmh9AfxUAC7CvIaHkfu8MNsIno4Hgg== X-Received: by 2002:a17:907:7ea1:b0:ab2:e76a:a51a with SMTP id a640c23a62f3a-ab2e76aaedbmr1593940766b.31.1736854714219; Tue, 14 Jan 2025 03:38:34 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab2c9564848sm612649366b.125.2025.01.14.03.38.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 03:38:33 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 07A855FCB9; Tue, 14 Jan 2025 11:38:25 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Weil , Pierrick Bouvier , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= Subject: [PATCH v2 34/37] docs/devel: add information on how to setup build environments Date: Tue, 14 Jan 2025 11:38:18 +0000 Message-Id: <20250114113821.768750-35-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250114113821.768750-1-alex.bennee@linaro.org> References: <20250114113821.768750-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62a; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62a.google.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 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, URIBL_SBL_A=0.1 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Pierrick Bouvier MacOS and Linux are straightforward, but Windows needs a bit more details. Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier Message-Id: <20241209183104.365796-5-pierrick.bouvier@linaro.org> Signed-off-by: Alex Bennée --- docs/about/build-platforms.rst | 4 +- docs/devel/build-environment.rst | 118 +++++++++++++++++++++++++++++++ docs/devel/index-build.rst | 1 + 3 files changed, 122 insertions(+), 1 deletion(-) create mode 100644 docs/devel/build-environment.rst diff --git a/docs/about/build-platforms.rst b/docs/about/build-platforms.rst index d8b0445157..482b09819c 100644 --- a/docs/about/build-platforms.rst +++ b/docs/about/build-platforms.rst @@ -29,6 +29,9 @@ The `Repology`_ site is a useful resource to identify currently shipped versions of software in various operating systems, though it does not cover all distros listed below. +You can find how to install build dependencies for different systems on the +:ref:`setup-build-env` page. + Supported host architectures ---------------------------- @@ -130,7 +133,6 @@ Optional build dependencies cross compilation using ``docker`` or ``podman``, or to use pre-built binaries distributed with QEMU. - Windows ------- diff --git a/docs/devel/build-environment.rst b/docs/devel/build-environment.rst new file mode 100644 index 0000000000..f133ef2e01 --- /dev/null +++ b/docs/devel/build-environment.rst @@ -0,0 +1,118 @@ + +.. _setup-build-env: + +Setup build environment +======================= + +QEMU uses a lot of dependencies on the host system. glib2 is used everywhere in +the code base, and most of the other dependencies are optional. + +We present here simple instructions to enable native builds on most popular +systems. + +You can find additional instructions on `QEMU wiki `_: + +- `Linux `_ +- `MacOS `_ +- `Windows `_ +- `BSD `_ + +Note: Installing dependencies using your package manager build dependencies may +miss out on deps that have been newly introduced in qemu.git. In more, it misses +deps the distribution has decided to exclude. + +Linux +----- + +Fedora +++++++ + +:: + + sudo dnf update && sudo dnf builddep qemu + +Debian/Ubuntu ++++++++++++++ + +You first need to enable `Sources List `_. +Then, use apt to install dependencies: + +:: + + sudo apt update && sudo apt build-dep qemu + +MacOS +----- + +You first need to install `Homebrew `_. Then, use it to +install dependencies: + +:: + + brew update && brew install $(brew deps --include-build qemu) + +Windows +------- + +You first need to install `MSYS2 `_. +MSYS2 offers `different environments `_. +x86_64 environments are based on GCC, while aarch64 is based on Clang. + +We recommend to use MINGW64 for windows-x86_64 and CLANGARM64 for windows-aarch64 +(only available on windows-aarch64 hosts). + +Then, you can open a windows shell, and enter msys2 env using: + +:: + + c:/msys64/msys2_shell.cmd -defterm -here -no-start -mingw64 + # Replace -ucrt64 by -clangarm64 or -ucrt64 for other environments. + +MSYS2 package manager does not offer a built-in way to install build +dependencies. You can start with this list of packages using pacman: + +Note: Dependencies need to be installed again if you use a different MSYS2 +environment. + +:: + + # update MSYS2 itself, you need to reopen your shell at the end. + pacman -Syu + pacman -S \ + base-devel binutils bison diffutils flex git grep make sed \ + ${MINGW_PACKAGE_PREFIX}-toolchain \ + ${MINGW_PACKAGE_PREFIX}-glib2 \ + ${MINGW_PACKAGE_PREFIX}-gtk3 \ + ${MINGW_PACKAGE_PREFIX}-libnfs \ + ${MINGW_PACKAGE_PREFIX}-libssh \ + ${MINGW_PACKAGE_PREFIX}-ninja \ + ${MINGW_PACKAGE_PREFIX}-pixman \ + ${MINGW_PACKAGE_PREFIX}-pkgconf \ + ${MINGW_PACKAGE_PREFIX}-python \ + ${MINGW_PACKAGE_PREFIX}-SDL2 \ + ${MINGW_PACKAGE_PREFIX}-zstd + +If you want to install all dependencies, it's possible to use recipe used to +build QEMU in MSYS2 itself. + +:: + + pacman -S wget + wget https://raw.githubusercontent.com/msys2/MINGW-packages/refs/heads/master/mingw-w64-qemu/PKGBUILD + # Some packages may be missing for your environment, installation will still + # be done though. + makepkg -s PKGBUILD || true + +Build on windows-aarch64 +++++++++++++++++++++++++ + +When trying to cross compile meson for x86_64 using UCRT64 or MINGW64 env, +configure will run into an error because the cpu detected is not correct. + +Meson detects x86_64 processes emulated, so you need to manually set the cpu, +and force a cross compilation (with empty prefix). + +:: + + ./configure --cpu=x86_64 --cross-prefix= + diff --git a/docs/devel/index-build.rst b/docs/devel/index-build.rst index 0023953be3..0745c81a26 100644 --- a/docs/devel/index-build.rst +++ b/docs/devel/index-build.rst @@ -8,6 +8,7 @@ some of the basics if you are adding new files and targets to the build. :maxdepth: 3 build-system + build-environment kconfig docs qapi-code-gen From patchwork Tue Jan 14 11:38:19 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: 13938656 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8916AC02183 for ; Tue, 14 Jan 2025 11:41:01 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXfFx-0005ES-6R; Tue, 14 Jan 2025 06:38:49 -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 1tXfFp-0005A8-H6 for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:41 -0500 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tXfFl-0005ST-Hs for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:40 -0500 Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-5d3e8f64d5dso10413719a12.3 for ; Tue, 14 Jan 2025 03:38:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736854716; x=1737459516; 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=NT5BETPWFM7sXWDlLEE3rhp1dQa7CeRWLP6f8H1yU0M=; b=eIqM3sMmWJ5aIzwt8z4u7FtarwMJvy4x0/3T++cfsp+aupW3vgUIoCRvycUUf7vDte f7C88tKgNbnQrNje0Oy8RlhqPptaK/vSR77qLXnd86GYynTNcCUphejOr1whaQ860baS 1RJFUB1zBhJb95UZYcRKBZz1XguSV8t6SKm8veaIo2/x2m7WBE2VU2mFdvL1cqJ2OCxf OHnCitnEJj9DbjPzgONwif0rE2691oszMDGrTHcMtH4O49yQV6b1ZKoXYgiR+n4YN58j BiWrYTNsyqmoqS6X4CEceUqfn3jqeF7TWW/l1tlBshv8hcm7aaa5qDlEhH1K6aeLX1hN MZqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736854716; x=1737459516; 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=NT5BETPWFM7sXWDlLEE3rhp1dQa7CeRWLP6f8H1yU0M=; b=mOywR1JO5iE+2FY3ic7p2Z7E6VczpsYBDPhDgQGZ3PTBjllFZdnQY7/XJOtl1oA/f0 DMx6KDDqB0bi1vTJN4YHHC9Tv2UGISYx5wZtauyoENAc9fpOrl0/dR2u2bJ9REDCus6U 8NVIZGcbOVQyISh8+4HRMTBJ1u2mXraJxUDYzPAPQvAjVZKMeykI8FJytZA71+RFo3IW b74dC+ND2S7h7qI6SGhkBXCYk1fAT6ET1U39O9VphH0X8btAkWJ94ujgEPrE3a+Qp0jK nc45L/wqXm2Ntuz8VJVnMi1E8SS3nAbWNVRWMeseDDCtNlD+4Fto7bXs0TtyXrlSwu85 XpOw== X-Gm-Message-State: AOJu0YwgaZgcPpz2FO9Xb3htyqA5RswsPx5yPmloX7c6m/atIYPkEYoA A59Ibb9/aG9Y1R5eJRCpF46SRsyRvqYgHlznFr+41IZu164hFzNMSIWUXnqTSO4= X-Gm-Gg: ASbGncvqCPQSeQGAxawMPtNJcRlGr/iralmS8N7/3Eyur9vqTyBfuqycmdLwV4pz5Ng sZKHD4iQzwTT2tcMmVOYSBASI2SK4uLu76HQcN8aK9/ZCUV9IfAj280oDA02xK/KJXxRvuvFrhY k6cqxBXZz9rY3VagYZwGMkVoLAqFGQegZEPjZEnfk7uiUBEzE1PTohwR4OB4BrOOUVrJBTdUcH6 chdMrct2IqiTEghg1nSAu5tucej/IwQsNVNUWutq+66PCbzIyRF9J8= X-Google-Smtp-Source: AGHT+IFF4nReJIdLFBF3wM5PPnlzPPxWZlRPXRc78LYECq7A6fYv3CnZCNpOt8+yS9rKtWWXVOdeOQ== X-Received: by 2002:a17:907:3687:b0:aa6:7ab4:4597 with SMTP id a640c23a62f3a-ab2abca77a5mr2634443766b.39.1736854715875; Tue, 14 Jan 2025 03:38:35 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab2c95ae536sm618337466b.139.2025.01.14.03.38.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 03:38:33 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 2AE7E5FD17; Tue, 14 Jan 2025 11:38:25 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Weil , Pierrick Bouvier , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Paolo Bonzini , Jason Wang , Andrew Melnychenko , Yuri Benditovich , Peter Xu , Fabiano Rosas , Markus Armbruster , Michael Roth , Konstantin Kostiuk , Kevin Wolf , qemu-block@nongnu.org (open list:Storage daemon) Subject: [PATCH v2 35/37] docs: add a codebase section Date: Tue, 14 Jan 2025 11:38:19 +0000 Message-Id: <20250114113821.768750-36-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250114113821.768750-1-alex.bennee@linaro.org> References: <20250114113821.768750-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::532; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x532.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Pierrick Bouvier Present the various parts of QEMU and organization of codebase. Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier Message-Id: <20241209183104.365796-6-pierrick.bouvier@linaro.org> Signed-off-by: Alex Bennée --- docs/about/emulation.rst | 2 + docs/devel/codebase.rst | 220 +++++++++++++++++++++++++ docs/devel/decodetree.rst | 2 + docs/devel/ebpf_rss.rst | 2 + docs/devel/index-internals.rst | 2 + docs/devel/index.rst | 1 + docs/devel/migration/main.rst | 2 + docs/devel/qapi-code-gen.rst | 1 + docs/devel/testing/main.rst | 9 +- docs/devel/testing/qtest.rst | 2 + docs/index.rst | 2 + docs/interop/qemu-ga.rst | 2 + docs/system/qemu-block-drivers.rst.inc | 2 + docs/tools/qemu-storage-daemon.rst | 2 + docs/user/main.rst | 6 + 15 files changed, 256 insertions(+), 1 deletion(-) create mode 100644 docs/devel/codebase.rst diff --git a/docs/about/emulation.rst b/docs/about/emulation.rst index 3028d5fff7..3bc3579434 100644 --- a/docs/about/emulation.rst +++ b/docs/about/emulation.rst @@ -176,6 +176,8 @@ for that architecture. - System - Tensilica ISS SIMCALL +.. _tcg-plugins: + TCG Plugins ----------- diff --git a/docs/devel/codebase.rst b/docs/devel/codebase.rst new file mode 100644 index 0000000000..4039875ee0 --- /dev/null +++ b/docs/devel/codebase.rst @@ -0,0 +1,220 @@ +======== +Codebase +======== + +This section presents the various parts of QEMU and how the codebase is +organized. + +Beyond giving succint descriptions, the goal is to offer links to various +parts of the documentation/codebase. + +Subsystems +---------- + +An exhaustive list of subsystems and associated files can be found in the +`MAINTAINERS `_ +file. + +Some of the main QEMU subsystems are: + +- `Accelerators` +- Block devices and `disk images` support +- `CI` and `Tests` +- `Devices` & Board models +- `Documentation ` +- `GDB support` +- `Migration` +- `Monitor` +- :ref:`QOM (QEMU Object Model)` +- `System mode` +- :ref:`TCG (Tiny Code Generator)` +- `User mode` (`Linux` & `BSD`) +- User Interfaces + +More documentation on QEMU subsystems can be found on :ref:`internal-subsystem` +page. + +The Grand tour +-------------- + +We present briefly here what every folder in the top directory of the codebase +contains. Hop on! + +The folder name links here will take you to that folder in our gitlab +repository. Other links will take you to more detailed documentation for that +subsystem, where we have it. Unfortunately not every subsystem has documentation +yet, so sometimes the source code is all you have. + +* `accel `_: + Infrastructure and architecture agnostic code related to the various + `accelerators ` supported by QEMU + (TCG, KVM, hvf, whpx, xen, nvmm). + Contains interfaces for operations that will be implemented per + `target `_. +* `audio `_: + Audio (host) support. +* `authz `_: + `QEMU Authorization framework`. +* `backends `_: + Various backends that are used to access resources on the host (e.g. for + random number generation, memory backing or cryptographic functions). +* `block `_: + Block devices and `image formats` implementation. +* `bsd-user `_: + `BSD User mode`. +* build: Where the code built goes by default. You can tell the QEMU build + system to put the built code anywhere else you like. +* `chardev `_: + Various backends used by char devices. +* `common-user `_: + User-mode assembly code for dealing with signals occuring during syscalls. +* `configs `_: + Makefiles defining configurations to build QEMU. +* `contrib `_: + Community contributed devices/plugins/tools. +* `crypto `_: + Cryptographic algorithms used in QEMU. +* `disas `_: + Disassembly functions used by QEMU target code. +* `docs `_: + QEMU Documentation. +* `dump `_: + Code to dump memory of a running VM. +* `ebpf `_: + eBPF program support in QEMU. `virtio-net RSS` uses it. +* `fpu `_: + Floating-point software emulation. +* `fsdev `_: + `VirtFS `_ support. +* `gdbstub `_: + `GDB ` support. +* `gdb-xml `_: + Set of XML files describing architectures and used by `gdbstub `. +* `host `_: + Various architecture specific header files (crypto, atomic, memory + operations). +* `linux-headers `_: + A subset of headers imported from Linux kernel and used for implementing + KVM support and user-mode. +* `linux-user `_: + `User mode ` implementation. Contains one folder per target + architecture. +* `.gitlab-ci.d `_: + `CI ` yaml and scripts. +* `include `_: + All headers associated to different subsystems in QEMU. The hierachy used + mirrors source code organization and naming. +* `hw `_: + `Devices ` and boards emulation. Devices are categorized by + type/protocol/architecture and located in associated subfolder. +* `io `_: + QEMU `I/O channels `_. +* `libdecnumber `_: + Import of gcc library, used to implement decimal number arithmetic. +* `migration `__: + `Migration framework `. +* `monitor `_: + `Monitor ` implementation (HMP & QMP). +* `nbd `_: + QEMU `NBD (Network Block Device) ` server. +* `net `_: + Network (host) support. +* `pc-bios `_: + Contains pre-built firmware binaries and boot images, ready to use in + QEMU without compilation. +* `plugins `_: + :ref:`TCG plugins ` core implementation. Plugins can be found in + `tests `__ + and `contrib `__ + folders. +* `po `_: + Translation files. +* `python `_: + Python part of our build/test system. +* `qapi `_: + `QAPI ` implementation. +* `qobject `_: + QEMU Object implementation. +* `qga `_: + QEMU `Guest agent ` implementation. +* `qom `_: + QEMU :ref:`Object model ` implementation, with monitor associated commands. +* `replay `_: + QEMU :ref:`Record/replay ` implementation. +* `roms `_: + Contains source code for various firmware and ROMs, which can be compiled if + custom or updated versions are needed. +* `rust `_: + Rust integration in QEMU. It contains the new interfaces defined and + associated devices using it. +* `scripts `_: + Collection of scripts used in build and test systems, and various + tools for QEMU codebase and execution traces. +* `scsi `_: + Code related to SCSI support, used by SCSI devices. +* `semihosting `_: + QEMU `Semihosting ` implementation. +* `stats `_: + `Monitor ` stats commands implementation. +* `storage-daemon `_: + QEMU `Storage daemon ` implementation. +* `stubs `_: + Various stubs (empty functions) used to compile QEMU with specific + configurations. +* `subprojects `_: + QEMU submodules used by QEMU build system. +* `system `_: + QEMU `system mode ` implementation (cpu, mmu, boot support). +* `target `_: + Contains code for all target architectures supported (one subfolder + per arch). For every architecture, you can find accelerator specific + implementations. +* `tcg `_: + :ref:`TCG ` related code. + Contains one subfolder per host supported architecture. +* `tests `_: + QEMU `test ` suite + + - `avocado `_: + Functional tests booting full VM using `Avocado framework `. + Those tests will be transformed and moved into + `tests/functional `_ + in the future. + - `data `_: + Data for various tests. + - `decode `_: + Testsuite for :ref:`decodetree ` implementation. + - `docker `_: + Code and scripts to create `containers ` used in `CI `. + - `fp `_: + QEMU testsuite for soft float implementation. + - `functional `_: + `Functional tests ` (full VM boot). + - `lcitool `_: + Generate dockerfiles for CI containers. + - `migration `_: + Test scripts and data for `Migration framework `. + - `multiboot `_: + Test multiboot functionality for x86_64/i386. + - `qapi-schema `_: + Test scripts and data for `QAPI `. + - `qemu-iotests `_: + `Disk image and block tests `. + - `qtest `_: + `Device emulation testing `. + - `tcg `__: + `TCG related tests `. Contains code per architecture + (subfolder) and multiarch tests as well. + - `tsan `_: + `Suppressions ` for thread sanitizer. + - `uefi-test-tools `_: + Test tool for UEFI support. + - `unit `_: + QEMU `Unit tests `. +* `trace `_: + :ref:`Tracing framework `. Used to print information associated to various + events during execution. +* `ui `_: + QEMU User interfaces. +* `util `_: + Utility code used by other parts of QEMU. diff --git a/docs/devel/decodetree.rst b/docs/devel/decodetree.rst index e3392aa705..98ad33a487 100644 --- a/docs/devel/decodetree.rst +++ b/docs/devel/decodetree.rst @@ -1,3 +1,5 @@ +.. _decodetree: + ======================== Decodetree Specification ======================== diff --git a/docs/devel/ebpf_rss.rst b/docs/devel/ebpf_rss.rst index 4a68682b31..ed5d33767b 100644 --- a/docs/devel/ebpf_rss.rst +++ b/docs/devel/ebpf_rss.rst @@ -1,3 +1,5 @@ +.. _ebpf-rss: + =========================== eBPF RSS virtio-net support =========================== diff --git a/docs/devel/index-internals.rst b/docs/devel/index-internals.rst index ab9fbc4482..bca597c658 100644 --- a/docs/devel/index-internals.rst +++ b/docs/devel/index-internals.rst @@ -1,3 +1,5 @@ +.. _internal-subsystem: + Internal Subsystem Information ------------------------------ diff --git a/docs/devel/index.rst b/docs/devel/index.rst index a53f1bfda5..29f032d6a8 100644 --- a/docs/devel/index.rst +++ b/docs/devel/index.rst @@ -35,3 +35,4 @@ the :ref:`tcg_internals`. index-api index-internals index-tcg + codebase diff --git a/docs/devel/migration/main.rst b/docs/devel/migration/main.rst index c2857fc244..cdd4f4a6d7 100644 --- a/docs/devel/migration/main.rst +++ b/docs/devel/migration/main.rst @@ -1,3 +1,5 @@ +.. _migration: + =================== Migration framework =================== diff --git a/docs/devel/qapi-code-gen.rst b/docs/devel/qapi-code-gen.rst index 583207a8ec..3e26d2d104 100644 --- a/docs/devel/qapi-code-gen.rst +++ b/docs/devel/qapi-code-gen.rst @@ -9,6 +9,7 @@ How to use the QAPI code generator This work is licensed under the terms of the GNU GPL, version 2 or later. See the COPYING file in the top-level directory. +.. _qapi: Introduction ============ diff --git a/docs/devel/testing/main.rst b/docs/devel/testing/main.rst index 91f4dc61fb..9869bcf034 100644 --- a/docs/devel/testing/main.rst +++ b/docs/devel/testing/main.rst @@ -39,6 +39,8 @@ Before running tests, it is best to build QEMU programs first. Some tests expect the executables to exist and will fail with obscure messages if they cannot find them. +.. _unit-tests: + Unit tests ~~~~~~~~~~ @@ -126,6 +128,8 @@ successfully on various hosts. The following list shows some best practices: #ifdef in the codes. If the whole test suite cannot run on Windows, disable the build in the meson.build file. +.. _qapi-tests: + QAPI schema tests ~~~~~~~~~~~~~~~~~ @@ -160,6 +164,8 @@ check-block are in the "auto" group). See the "QEMU iotests" section below for more information. +.. _qemu-iotests: + QEMU iotests ------------ @@ -679,6 +685,8 @@ The above exitcode=0 has TSan continue without error if any warnings are found. This allows for running the test and then checking the warnings afterwards. If you want TSan to stop and exit with error on warnings, use exitcode=66. +.. _tsan-suppressions: + TSan Suppressions ~~~~~~~~~~~~~~~~~ Keep in mind that for any data race warning, although there might be a data race @@ -901,7 +909,6 @@ You can run the avocado tests simply by executing: See :ref:`checkavocado-ref` for more details. - .. _checktcg-ref: Testing with "make check-tcg" diff --git a/docs/devel/testing/qtest.rst b/docs/devel/testing/qtest.rst index c5b8546b3e..73ef7702b7 100644 --- a/docs/devel/testing/qtest.rst +++ b/docs/devel/testing/qtest.rst @@ -1,3 +1,5 @@ +.. _qtest: + ======================================== QTest Device Emulation Testing Framework ======================================== diff --git a/docs/index.rst b/docs/index.rst index 0b9ee9901d..78285ebd6a 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -3,6 +3,8 @@ You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. +.. _documentation-root: + ================================ Welcome to QEMU's documentation! ================================ diff --git a/docs/interop/qemu-ga.rst b/docs/interop/qemu-ga.rst index 11f7bae460..d16cc1b9f0 100644 --- a/docs/interop/qemu-ga.rst +++ b/docs/interop/qemu-ga.rst @@ -1,3 +1,5 @@ +.. _qemu-ga: + QEMU Guest Agent ================ diff --git a/docs/system/qemu-block-drivers.rst.inc b/docs/system/qemu-block-drivers.rst.inc index 384e95ba76..cfe1acb78a 100644 --- a/docs/system/qemu-block-drivers.rst.inc +++ b/docs/system/qemu-block-drivers.rst.inc @@ -500,6 +500,8 @@ What you should *never* do: - expect it to work when loadvm'ing - write to the FAT directory on the host system while accessing it with the guest system +.. _nbd: + NBD access ~~~~~~~~~~ diff --git a/docs/tools/qemu-storage-daemon.rst b/docs/tools/qemu-storage-daemon.rst index ea00149a63..35ab2d7807 100644 --- a/docs/tools/qemu-storage-daemon.rst +++ b/docs/tools/qemu-storage-daemon.rst @@ -1,3 +1,5 @@ +.. _storage-daemon: + =================== QEMU Storage Daemon =================== diff --git a/docs/user/main.rst b/docs/user/main.rst index 7a126ee809..80a77f0a0c 100644 --- a/docs/user/main.rst +++ b/docs/user/main.rst @@ -1,3 +1,5 @@ +.. _user-mode: + QEMU User space emulator ======================== @@ -42,6 +44,8 @@ QEMU was conceived so that ultimately it can emulate itself. Although it is not very useful, it is an important test to show the power of the emulator. +.. _linux-user-mode: + Linux User space emulator ------------------------- @@ -175,6 +179,8 @@ Other binaries * ``qemu-sparc64`` can execute some Sparc64 (Sparc64 CPU, 64 bit ABI) and SPARC32PLUS binaries (Sparc64 CPU, 32 bit ABI). +.. _bsd-user-mode: + BSD User space emulator ----------------------- From patchwork Tue Jan 14 11:38:20 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: 13938650 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1FCBDC02183 for ; Tue, 14 Jan 2025 11:40:30 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXfFx-0005FM-Sb; Tue, 14 Jan 2025 06:38:49 -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 1tXfFq-0005BL-TX for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:42 -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 1tXfFm-0005Sg-5z for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:42 -0500 Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-aaf900cc7fbso936060766b.3 for ; Tue, 14 Jan 2025 03:38:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736854716; x=1737459516; 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=UeBtmMJJh3q4D3s+Zk99PbjZE0p3lhgaUGkKHEVlCC8=; b=vZmDTmaXzj9RphVbWHegv8bGwdtsqT9MyF/3V4CQc3ThAF5qFuNQXSCWxE5xqLGsxz QNei72RP1vEae81OQlMDUvIc/35NUEsuRIVeLwS7198/hQ6YohZLQv+gXLH+yZBwyiNX yEUWaOwam5gegBFzyoqdji1eiVMGj3LZW4AZH+Fxan0Nz0dHxRyOF7MvBwoJbNIxbity OE1JNyGBQvx9cYkTsoFpmLuKVrAxV+oPzIKGa+0xiGmw2oMjHrpU3vOxO6U3Y7PM/8zE dY/kw4XsL7ljc5ZEqMy4PaY4PjDojKJrU01/HZlUnJD5Ji/Xpq3R9SlKw9rZhcKy8V+P Unmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736854716; x=1737459516; 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=UeBtmMJJh3q4D3s+Zk99PbjZE0p3lhgaUGkKHEVlCC8=; b=FiQnfhGLl0rAIe5dU+8KcNnsX4m/btXEkKIfJYZJmNuZwD+MqgtMhctLcZg/KER0CA LyTgkfXg57t4qPsSAfUYj2JhB9huC07S+7GYq9OVHIlccxoIiyGksX9N4shFHCkyb1kp CIPtTfrSK9SKMtY0z/X7tVRhLCCb8AvAGUfuPFr30df8bIlr5cUw6/w26GMjcLE1GTA5 NeUlX8JZgUV6eDfCAHnS9LAUcvG88EWxBQ3/OwG5S6QJ4tnRqXy4/6iv6x2i9NCtLehE vH/H1e52uv2eGa5QA3DFOWOFajq932m5LnlLEhOtM42QmhrKTxOuO69BC7+B/HDti/yA DYRg== X-Gm-Message-State: AOJu0YxSwViMTYRcCXlDomcLMD5KRf/e8LGD322VxvqlAFRSR9MDXt+g XTDZ7Jl1KGlv1duVI0xSy/11r2iDBgzjjJiTCiq6PhudibKCei5SIK3yuPPBGcg= X-Gm-Gg: ASbGncvo5DrgI2/D7cwDjD1/HcrX4Nn2xFSrizFe1Fz2Z6LiPMk+2STjrlWq9YbsTUr R7OzlvFDAS2sN7V15UINOxly1n7UE0uTBe2WLNMI5qU9rEyYT7SXrfjfWc7sEASmCfMT/N4p0r7 R1QQlCUwr0fhPfWun5nawfy6W4r+HfVlfzJ1JG3jDRwU5V6XWhJYDGMmCOJsGJR+e5uvZc3jGig Dq9TQYA3kCgOQSUkSbosVzQQg8Vm53csFzhDmolLzmP4YNGUvo+ilE= X-Google-Smtp-Source: AGHT+IG9avi8Injvoi63ekexjT9gWP/Jmgqx4Vr1t0OfePVifFWTqOWFWEeqZlMFHcNAUJ3M4gd5Qw== X-Received: by 2002:a17:907:3e9f:b0:aae:bd4c:22c0 with SMTP id a640c23a62f3a-ab2ab70aeccmr2185881766b.19.1736854716409; Tue, 14 Jan 2025 03:38:36 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab2c9136045sm615585466b.89.2025.01.14.03.38.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 03:38:33 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 4AF685FD18; Tue, 14 Jan 2025 11:38:25 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Weil , Pierrick Bouvier , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Peter Maydell , Eric Blake , Vladimir Sementsov-Ogievskiy , qemu-arm@nongnu.org (open list:Virt), qemu-block@nongnu.org (open list:Network Block Dev...) Subject: [PATCH v2 36/37] docs: add a glossary Date: Tue, 14 Jan 2025 11:38:20 +0000 Message-Id: <20250114113821.768750-37-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250114113821.768750-1-alex.bennee@linaro.org> References: <20250114113821.768750-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: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 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, URIBL_SBL_A=0.1 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Pierrick Bouvier Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier Message-Id: <20241209183104.365796-7-pierrick.bouvier@linaro.org> Signed-off-by: Alex Bennée --- docs/devel/control-flow-integrity.rst | 2 + docs/devel/multi-thread-tcg.rst | 2 + docs/glossary.rst | 280 ++++++++++++++++++++++++++ docs/index.rst | 1 + docs/system/arm/virt.rst | 2 + docs/system/images.rst | 2 + docs/tools/qemu-nbd.rst | 2 + 7 files changed, 291 insertions(+) create mode 100644 docs/glossary.rst diff --git a/docs/devel/control-flow-integrity.rst b/docs/devel/control-flow-integrity.rst index e6b73a4fe1..3d5702fa4c 100644 --- a/docs/devel/control-flow-integrity.rst +++ b/docs/devel/control-flow-integrity.rst @@ -1,3 +1,5 @@ +.. _cfi: + ============================ Control-Flow Integrity (CFI) ============================ diff --git a/docs/devel/multi-thread-tcg.rst b/docs/devel/multi-thread-tcg.rst index d706c27ea7..7fd0a07633 100644 --- a/docs/devel/multi-thread-tcg.rst +++ b/docs/devel/multi-thread-tcg.rst @@ -4,6 +4,8 @@ This work is licensed under the terms of the GNU GPL, version 2 or later. See the COPYING file in the top-level directory. +.. _mttcg: + ================== Multi-threaded TCG ================== diff --git a/docs/glossary.rst b/docs/glossary.rst new file mode 100644 index 0000000000..693d9855dd --- /dev/null +++ b/docs/glossary.rst @@ -0,0 +1,280 @@ +.. _Glossary: + +-------- +Glossary +-------- + +This section of the manual presents brief definitions of acronyms and terms used +by QEMU developers. + +Accelerator +----------- + +A specific API used to accelerate execution of guest instructions. It can be +hardware-based, through a virtualization API provided by the host OS (kvm, hvf, +whpx, ...), or software-based (tcg). See this description of `supported +accelerators`. + +Board +----- + +Another name for :ref:`machine`. + +Block +----- + +Block drivers are the available `disk formats and front-ends +` available, and block devices `(see Block device section on +options page)` are using them to implement disks for a +virtual machine. + +CFI +--- + +Control Flow Integrity is a hardening technique used to prevent exploits +targeting QEMU by detecting unexpected branches during execution. QEMU `actively +supports` being compiled with CFI enabled. + +Device +------ + +In QEMU, a device is a piece of hardware visible to the guest. Examples include +UARTs, PCI controllers, PCI cards, VGA controllers, and many more. + +QEMU is able to emulate a CPU, and all the hardware interacting with it, +including `many devices`. When QEMU runs a virtual machine +using a hardware-based accelerator, it is responsible for emulating, using +software, all devices. + +EDK2 +---- + +EDK2, as known as `TianoCore `_, is an open source +implementation of UEFI standard. QEMU virtual machines that boot a UEFI firmware +usually use EDK2. + +gdbstub +------- + +QEMU implements a `gdb server `, allowing gdb to attach to it and +debug a running virtual machine, or a program in user-mode. This allows +debugging the guest code that is running inside QEMU. + +glib2 +----- + +`GLib2 `_ is one of the most important libraries we +are using through the codebase. It provides many data structures, macros, string +and thread utilities and portable functions across different OS. It's required +to build QEMU. + +Guest agent +----------- + +The `QEMU Guest Agent ` is a daemon intended to be run within virtual +machines. It provides various services to help QEMU to interact with it. + +.. _guest: + +Guest +----- + +Guest is the architecture of the virtual machine, which is emulated. +See also :ref:`host`. + +Sometimes this is called the :ref:`target` architecture, but that term +can be ambiguous. + +.. _host: + +Host +---- + +Host is the architecture on which QEMU is running on, which is native. +See also :ref:`guest`. + +Hypervisor +---------- + +The formal definition of an hypervisor is a program or API than can be used to +manage a virtual machine. QEMU is a virtualizer, that interacts with various +hypervisors. + +In the context of QEMU, an hypervisor is an API, provided by the Host OS, +allowing to execute virtual machines. Linux implementation is KVM (and supports +Xen as well). For MacOS, it's HVF. Windows defines WHPX. And NetBSD provides +NVMM. + +.. _machine: + +Machine +------- + +QEMU's system emulation models many different types of hardware. A machine model +(sometimes called a board model) is the model of a complete virtual system with +RAM, one or more CPUs, and various devices. It can be selected with the option +``-machine`` of qemu-system. Our machine models can be found on this `page +`. + +Migration +--------- + +QEMU can save and restore the execution of a virtual machine between different +host systems. This is provided by the `Migration framework`. + +NBD +--- + +The `QEMU Network Block Device server ` is a tool that can be used to +mount and access QEMU images, providing functionality similar to a loop device. + +Mailing List +------------ + +This is `where `_ all the +development happens! Changes are posted as series, that all developers can +review and share feedback for. + +For reporting issues, our `GitLab +`_ tracker is the best place. + +.. _softmmu: + +MMU / softmmu +------------- + +The Memory Management Unit is responsible for translating virtual addresses to +physical addresses and managing memory protection. QEMU system mode is named +"softmmu" precisely because it implements this in software, including a TLB +(Translation lookaside buffer), for the guest virtual machine. + +QEMU user-mode does not implement a full software MMU, but "simply" translates +virtual addresses by adding a specific offset, and relying on host MMU/OS +instead. + +Monitor / QMP / HMP +------------------- + +The `QEMU Monitor ` is a text interface which can be used to interact +with a running virtual machine. + +QMP stands for QEMU Monitor Protocol and is a json based interface. +HMP stands for Human Monitor Protocol and is a set of text commands available +for users who prefer natural language to json. + +MTTCG +----- + +Multiple CPU support was first implemented using a round-robin algorithm +running on a single thread. Later on, `Multi-threaded TCG ` was developed +to benefit from multiple cores to speed up execution. + +Plugins +------- + +`TCG Plugins ` is an API used to instrument guest code, in system +and user mode. The end goal is to have a similar set of functionality compared +to `DynamoRIO `_ or `valgrind `_. + +One key advantage of QEMU plugins is that they can be used to perform +architecture agnostic instrumentation. + +Patchew +------- + +`Patchew `_ is a website that tracks patches on the +Mailing List. + +PR +-- + +Once a series is reviewed and accepted by a subsystem maintainer, it will be +included in a PR (Pull Request) that the project maintainer will merge into QEMU +main branch, after running tests. + +The QEMU project doesn't currently expect most developers to directly submit +pull requests. + +QCOW2 +----- + +QEMU Copy On Write is a disk format developed by QEMU. It provides transparent +compression, automatic extension, and many other advantages over a raw image. + +qcow2 is the recommended format to use. + +QEMU +---- + +`QEMU (Quick Emulator) `_ is a generic and open source +machine emulator and virtualizer. + +QOM +--- + +`QEMU Object Model ` is an object oriented API used to define various +devices and hardware in the QEMU codebase. + +Record/replay +------------- + +`Record/replay ` is a feature of QEMU allowing to have a deterministic +and reproducible execution of a virtual machine. + +Rust +---- + +`A new programming language `_, memory safe by +default. There is a work in progress to integrate it in QEMU codebase for +various subsystems. + +System mode +----------- + +QEMU System mode provides a virtual model of an entire machine (CPU, memory and +emulated devices) to run a guest OS. In this mode the CPU may be fully emulated, +or it may work with a hypervisor such as KVM, Xen or Hypervisor.Framework to +allow the guest to run directly on the host CPU. + +QEMU System mode is called :ref:`softmmu ` as well. + +.. _target: + +Target +------ + +The term "target" can be ambiguous. In most places in QEMU it is used as a +synonym for :ref:`guest`. For example the code for emulating Arm CPUs is in +``target/arm/``. However in the :ref:`TCG subsystem ` "target" refers to the +architecture which QEMU is running on, i.e. the :ref:`host`. + +TCG +--- + +TCG is the QEMU `Tiny Code Generator `. It is the JIT (just-in-time) +compiler we use to emulate a guest CPU in software. + +It is one of the accelerators supported by QEMU, and supports a lot of +guest/host architectures. + +User mode +--------- + +QEMU User mode can launch processes compiled for one CPU on another CPU. In this +mode the CPU is always emulated. In this mode, QEMU translate system calls from +guest to host kernel. It is available for Linux and BSD. + +VirtIO +------ + +VirtIO is an open standard used to define and implement virtual devices with a +minimal overhead, defining a set of data structures and hypercalls (similar to +system calls, but targeting an hypervisor, which happens to be QEMU in our +case). It's designed to be more efficient than emulating a real device, by +minimizing the amount of interactions between a guest VM and its hypervisor. + +vhost-user +---------- + +`Vhost-user ` is an interface used to implement VirtIO devices +outside of QEMU itself. diff --git a/docs/index.rst b/docs/index.rst index 78285ebd6a..5665de85ca 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -20,3 +20,4 @@ Welcome to QEMU's documentation! interop/index specs/index devel/index + glossary diff --git a/docs/system/arm/virt.rst b/docs/system/arm/virt.rst index 766a7455f0..0c9c2ce035 100644 --- a/docs/system/arm/virt.rst +++ b/docs/system/arm/virt.rst @@ -1,3 +1,5 @@ +.. _arm-virt: + 'virt' generic virtual platform (``virt``) ========================================== diff --git a/docs/system/images.rst b/docs/system/images.rst index d000bd6b6f..a5551173c9 100644 --- a/docs/system/images.rst +++ b/docs/system/images.rst @@ -82,4 +82,6 @@ VM snapshots currently have the following known limitations: - A few device drivers still have incomplete snapshot support so their state is not saved or restored properly (in particular USB). +.. _block-drivers: + .. include:: qemu-block-drivers.rst.inc diff --git a/docs/tools/qemu-nbd.rst b/docs/tools/qemu-nbd.rst index 329f44d989..4f21b7904a 100644 --- a/docs/tools/qemu-nbd.rst +++ b/docs/tools/qemu-nbd.rst @@ -1,3 +1,5 @@ +.. _qemu-nbd: + ===================================== QEMU Disk Network Block Device Server ===================================== From patchwork Tue Jan 14 11:38:21 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: 13938666 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5BF37E77188 for ; Tue, 14 Jan 2025 11:42:31 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tXfG0-0005Fp-4I; Tue, 14 Jan 2025 06:38: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 1tXfFm-000588-D0 for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:39 -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 1tXfFk-0005S0-IN for qemu-devel@nongnu.org; Tue, 14 Jan 2025 06:38:37 -0500 Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-aaeec07b705so853684266b.2 for ; Tue, 14 Jan 2025 03:38:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736854715; x=1737459515; 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=mDXNnBxwJoyhgKzJMRdJdgCJlpb7weenjpk6uMi/xEU=; b=vkTjeihMvfC4FGejwkazgVoEKymzwpqpuWa3w07fd0bgaR6WDu+E6to/KEyd9gzEsl MABI18ivqvfchtdXMjdnMeGlDLP5YrUS8xOXg5WKHgVedMNHjoULAkGdN8nY1Nja4Kt/ Obh3L72pJ/KByXixjHMzxY2+iTC9x6DsGuyn+Fg35A3dUD8NDmWEf/sf4milb8gKMPzF AQXug/vyhaSJbISRCDKs5Ca9V2lCwmCvNROm8n7HxumuYkYfDRfXomc0lQXshq4aPzHA TmGbt+Mo0Ke+9knATJub2MjlMimWr1qjISST/TAM7o+M3RgAuz5IehwwWVDgzuQo7bVA 4+WA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736854715; x=1737459515; 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=mDXNnBxwJoyhgKzJMRdJdgCJlpb7weenjpk6uMi/xEU=; b=b/cRkFd5ly+l7+XU8L6Ch66EeFQKoOtPK2O81i8ONFggVVSU1OoLgSug+Kwrg51q2Z 8YE/GvKIhiJTzcSSheK7vvJ3KraAgF3BWy0LBBt0Rt9ieGEkVJsPZm8gH0QgygHkTvLW kbdRTB0YgqXxGEYYYV0wBJoGfQj/JmNchk3fwqc+jixSR7NhKLHrOsIujaVPhHfF19Np S7jpbCC6pZx9ArQO0ZuD5ajnHoqEJWCkBtX0p32AArTr6jJubYm9Vy9LRkmi9Iwiz0RP HvXkyfgRiBikrm6/f8Bih2oS5DR/DsKQ4YTuFJURIRSMu53oIz/RH0psUvWSfrnVJVvf i46Q== X-Gm-Message-State: AOJu0YzgvSIa4EmKNFA/06IB4VgcgdS2/Pkned+fCV9xxSDYR2j2N8cU adeMKIjqCIy2P4IqRdTMfqolCFn/VESM05kDb4bN4UBdFFwds7g5iD7TvvTDmetTuJE8z1AmHbT LcxQ= X-Gm-Gg: ASbGncu2EsmvLGiTYHfmVCwOVWHCt/0PYeBBq1RVgijl1KpHSbXka6KI06+iXSbALC7 gI23yRprVTu0b8Dybl7v4LDwCMNFb6wqx/Bd3GuuqBAjYdoePybJ84d2yBXI1M66Bbt2lVA0HtR DR/fhNZ5IQ5d6uctyiWfQ0kYM98dCT2BRI4cnYzfEAf54z8dWDKJY6a/Ezz1csNaEnlbYw2ewu1 Ol4VpnH1c25/ggIyxlpGFV4rR/8D971IiuEDcEfOUOMwYEcpmJmCss= X-Google-Smtp-Source: AGHT+IF6AB4hDlV3ZMwbBiLRdFpJ3HRrXBR/Mqiw9QdIMEd/dgQJvlBSQa1OVcSy6eSzrw6MVORGlQ== X-Received: by 2002:a17:907:96a0:b0:aa6:87e8:1d08 with SMTP id a640c23a62f3a-ab2ab6bffc3mr1834463066b.8.1736854715006; Tue, 14 Jan 2025 03:38:35 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab2c9060b9dsm621953966b.4.2025.01.14.03.38.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 03:38:33 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 6397D5F8B5; Tue, 14 Jan 2025 11:38:25 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Weil , Pierrick Bouvier , =?utf-8?q?Alex_Benn=C3=A9e?= , John Snow , Cleber Rosa Subject: [PATCH v2 37/37] scripts/nsis.py: Run dependency check for each DLL file only once Date: Tue, 14 Jan 2025 11:38:21 +0000 Message-Id: <20250114113821.768750-38-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250114113821.768750-1-alex.bennee@linaro.org> References: <20250114113821.768750-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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org From: Stefan Weil via Each DLL should only be checked once for dependencies, but several hundred (781 in my test) unneeded checks were done. Now the script is significantly faster (16 s in my build). Signed-off-by: Stefan Weil Reviewed-by: Pierrick Bouvier Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20250111215244.1680931-1-sw@weilnetz.de> Signed-off-by: Alex Bennée --- scripts/nsis.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/nsis.py b/scripts/nsis.py index 03ed7608a2..af4e064819 100644 --- a/scripts/nsis.py +++ b/scripts/nsis.py @@ -37,10 +37,10 @@ def find_deps(exe_or_dll, search_path, analyzed_deps): analyzed_deps.add(dep) # locate the dll dependencies recursively - rdeps = find_deps(dll, search_path, analyzed_deps) + analyzed_deps, rdeps = find_deps(dll, search_path, analyzed_deps) deps.extend(rdeps) - return deps + return analyzed_deps, deps def main(): parser = argparse.ArgumentParser(description="QEMU NSIS build helper.") @@ -92,18 +92,18 @@ def main(): dlldir = os.path.join(destdir + prefix, "dll") os.mkdir(dlldir) + analyzed_deps = set() for exe in glob.glob(os.path.join(destdir + prefix, "*.exe")): signcode(exe) # find all dll dependencies - deps = set(find_deps(exe, search_path, set())) + analyzed_deps, deps = find_deps(exe, search_path, analyzed_deps) + deps = set(deps) deps.remove(exe) # copy all dlls to the DLLDIR for dep in deps: dllfile = os.path.join(dlldir, os.path.basename(dep)) - if (os.path.exists(dllfile)): - continue print("Copying '%s' to '%s'" % (dep, dllfile)) shutil.copy(dep, dllfile)