From patchwork Fri Jan 17 13:42: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: 13943321 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 63A51C02183 for ; Fri, 17 Jan 2025 13:43:45 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYmd4-00014b-Ha; Fri, 17 Jan 2025 08:43:18 -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 1tYmcu-0000x9-JF for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:08 -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 1tYmcq-0002CP-7w for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:06 -0500 Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-aa67ac42819so328466466b.0 for ; Fri, 17 Jan 2025 05:43:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737121378; x=1737726178; 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=SPhUiahc8AcG/DudZ+NnvJ9oGMqaRHCp9nDZpFVSZuQ=; b=QYRYaxlnaVtvi9VsrJl6JYzdghVQlTuNtC5Rrqe5skykCMHTWbbKQ31mhVgDthvY1b ylzNOv4rxFJbmgtTLQ90NKH88YsiYG/o8iVP604iQRI4kRYy2Vq9Ti72QN2iMwF/iC0U xBZpS5H1hJVK1yxUv3x9auZP3+wV01wkPw82nWB3MqTfhES/LwKAk4X/edJMwVbu87Rg 5AXvS+E1E9OXV69xEH+2jVsJLhJ3crA/3nq3PjZMPF27oGsjhE8JrmctLFdjnnIuDSOx Wu9C9YSTfEfSLs2Qr9B4wHQiuAhC/99vauOqIiqJHyX4Z85LAfLTZ7xJiMNkRwfcGX0m K4qA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737121378; x=1737726178; 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=SPhUiahc8AcG/DudZ+NnvJ9oGMqaRHCp9nDZpFVSZuQ=; b=l1uPKAGEr1tUS0JPE8u4YtYU0d+UhrKo3ARFpKlCQj4S3SgyEqHZ+PcV5Az2LuwNZn 4miFtGdV+z2FtUnJWFfDYJPxVmOPvQ5uzSe1n6bKpsFO20m8HolXfQHvEI99alwRqYjl WZQb39dRVJuIRtqUNBCabCU5/TDbQCynUdMlSMIc90pZps/sjTgGxrQbUbU2HvjNereu PPmzixPpfbz8hnYwRe60jAVBq3Nfz5wxnAQtXCOfSzojGkcXcqRBBKEH6bVTMRLSI/70 J7gS0F8otAAZ42qBtDN5AUkOyeMGR+xpG2jR4YsvawNDA/1YeVIa/CkAi5dgIqffHKMg GsXw== X-Gm-Message-State: AOJu0YwUteDWWV3lijE4HDX7BiJPANmtQJSwuNA9QrzBuTj9ZvlQ9mZ1 JaChwOJPFuci0ikiM3jLc8DX5gpHXAilNxQoyT+VnDO4eJVghE2lgY5eAJTHij7m2bi0pJ9fmFG AnWw= X-Gm-Gg: ASbGncsiTP0blQlFEv0xVf+Dvaelkv4QxBSCrHa0pTX+LfgX9nNKmDtQto94zIW47n+ zyKKM/4N695Imh9BZBJVleFfBsgaFif1AnD+WcH0/2g8xdkHti5StgktgZ946RxVnVeW0E8mYCk xbXaHq3ECqYGJX81KICr5XaF4iFl462deWmkG3FmJfOCMW6bQoK5SH4x6XgwHpKI5asPjjVSyCM z1+hOl+PBIf8jmfdnFQfFR/DIFMBTuJPMAEVfM9mpf1iySuHdldKwc= X-Google-Smtp-Source: AGHT+IHWymvHQFT/Kb8O3h5piJK1U+wH0Hxx/H8XzS4NpgH7ag2xPRorb058tFVpzgn647tGJgdS/g== X-Received: by 2002:a17:906:6a20:b0:aac:23f4:f971 with SMTP id a640c23a62f3a-ab38b1b45e1mr280462566b.33.1737121378166; Fri, 17 Jan 2025 05:42:58 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab384f22fd2sm171481766b.110.2025.01.17.05.42.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 05:42:57 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id F1D386084C; Fri, 17 Jan 2025 13:42:56 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Pierrick Bouvier Subject: [PULL 01/37] semihosting: add guest_error logging for failed opens Date: Fri, 17 Jan 2025 13:42:20 +0000 Message-Id: <20250117134256.2079356-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250117134256.2079356-1-alex.bennee@linaro.org> References: <20250117134256.2079356-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 This usually indicates the semihosting call was expecting to find something but didn't. Reviewed-by: Pierrick Bouvier Signed-off-by: Alex Bennée Message-Id: <20250116160306.1709518-2-alex.bennee@linaro.org> 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 Fri Jan 17 13:42: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: 13943335 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 76EECC02185 for ; Fri, 17 Jan 2025 13:45:19 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYmdA-000189-Bf; Fri, 17 Jan 2025 08:43:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tYmcu-0000x2-Gw for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:08 -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 1tYmcp-0002CR-1g for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:05 -0500 Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-5d0ac27b412so2822743a12.1 for ; Fri, 17 Jan 2025 05:43:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737121379; x=1737726179; 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=HvyvcMT5Ik5FGrm6V5mlorp+UlJN6JEGaToeVYNLLOk=; b=eUqBOWaNpZszfBaqsHYyNC/Zqb9cJv1JtN3sMKDijEeuYGl3O+qgdZuOynEPskL37y WKjwK9xL406c3JAl7EjfapiY2oDFdUGNteUNNT/ZO4Xh0OHMSNmmQbvhP1DyTHUZwGXQ dyw+0RzbCcre/Y7xB7VPPOgpn4TkC+9YEFqW7HDTWHl/ROdxPcto0XHlxkGWHIx8ufzO /VAzwW1iSYE22QhdvRNejcAn9IvGr5DcMFABXOvcCt56xbJ3enGFWjmjapw/WhJcVWWo H+MBwuDjlVTe214Mbm0MNlqoD5h32k8u13IgXYfpdoLGKE3zdpTGwpjFw65xV6hKNbPY rucw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737121379; x=1737726179; 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=HvyvcMT5Ik5FGrm6V5mlorp+UlJN6JEGaToeVYNLLOk=; b=X9FXAv45vIa2LS8eYroHl4UWZTh2mhMcr/jS7IoDaS1ac6ur4Z8fkDsJLEvWunOa/C cMY26HVYho9udfMmUer3L+wR4ikDw4aKwepLU0cuwyf47KeTkmJcyFEWu688KeyJAo1E lA5gE8GESeCB/LdDys+vhYxFHx7Htp+2vXT/zANPvECcvQ/wXxvweyy8VIObqOwEBr2W zOomB548CxuBHNQROl2/ETiDzGEPbS32PI9NPB8CVue0N6iTU+qTSjLIUs+ZRRmk0bTm XHwYII2p8xDDYK3HaWWKcNGo8vkpV2xzTD16PTR0dUmBxEaGqHoVGbkbJcA2uf7yKfH5 iJew== X-Gm-Message-State: AOJu0YxH7V9rpKCBXqoxflC3xXOs/CxBAnYVKcBonf/CCbJfUnU3xVSy jqHx6k5JdieRv9NNecESS2drLlR7AEaNa0JXxea+BYklHRGl30FAbCspLo7qC78= X-Gm-Gg: ASbGncu3k2nE+WVwHUpVrJQxHzkd2ePSsGM3uZQMTlXNookcPxF619yqTpBt9LcpFHH RdIm+Q0CjQOKoWEc2fWeRWITqPKhgZmEAPE/odDSmxh7aBa1iK5MR27WS3I86VHTrowEoZQVfA4 gtLYYMcG2lQr+V/uqS7q1LL5mMqhdVlopEWemB9O6o5mqOVHExzz8RkqAmtLznbwBpklyI3iOFm RWHUYc+Y2y/zuHXy8z+uRGUyaJR+yV5gxQCkO7P7diTx2AgqK0oT0k= X-Google-Smtp-Source: AGHT+IGdIX39FQIwi493U0/Sk1pp8sfPj/O++TejDayneS+J1B2/mRRiqrIGHsqLzGnWtXtqt4nqBg== X-Received: by 2002:a17:907:7e95:b0:ab2:ffcb:edb4 with SMTP id a640c23a62f3a-ab38b162801mr210575466b.25.1737121378573; Fri, 17 Jan 2025 05:42:58 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab384f87d5asm170559766b.124.2025.01.17.05.42.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 05:42:57 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 1300C60853; Fri, 17 Jan 2025 13:42:57 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= Subject: [PULL 02/37] semihosting/uaccess: Briefly document returned values Date: Fri, 17 Jan 2025 13:42:21 +0000 Message-Id: <20250117134256.2079356-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250117134256.2079356-1-alex.bennee@linaro.org> References: <20250117134256.2079356-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: 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 Message-Id: <20250116160306.1709518-3-alex.bennee@linaro.org> 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 Fri Jan 17 13:42:22 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: 13943323 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 5217BC02188 for ; Fri, 17 Jan 2025 13:43:46 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYmdM-0001Hu-Un; Fri, 17 Jan 2025 08:43: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 1tYmcu-0000xH-Jg for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:08 -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 1tYmcq-0002CS-7x for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:07 -0500 Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-ab2c9b8aecaso329038566b.0 for ; Fri, 17 Jan 2025 05:43:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737121379; x=1737726179; 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=iXBLUkL8+yV2RgOy7GvclV3RoZ3IJx6imsmC3PeKgzg=; b=GVokmrSdyT/lwVZRQaZofRkTOLzLgB493e+eKcmLXCkXZ2bUarJBrJqogyNVspnN61 +aEolV7NbFb5/WatLbfZZiK6ImDE9+Loy7c8IjoAd20Qgh2e6dtwsPPCEE59yHSFz+cL 1zdRMfZO3MMZ/804uAZUI4hPuT8TaxM5iiATtfMGvGgu5Jv0N0GykNcDVKF0KjuqMJxl g/zGUWTX5pwJ0C5rvUhP2HZFC/JPryLGoAlPeMaBm/QsNL/1B7ksuWkQjihgVgaZ4VW/ foXhzUnl30GabcsMZrSWLznfHuSxgfe/kDhMXgN4a9Czx/dFdGYFhcNBOA3D9kh4b+uj 5wyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737121379; x=1737726179; 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=iXBLUkL8+yV2RgOy7GvclV3RoZ3IJx6imsmC3PeKgzg=; b=oOVzLuUTDC6BtRAuVwL7zIHUf4oRHHGE7PdSjvyi4trlme7BGaxTRodwEy7tGkWfXP z+ydLVEsWhR3jV2DiNEEbuDl8G1Jwit3uTDF1Vu2O85AgjvICIA7QP8gQf3v/H6FhuOo yaIA3mFn0ceq8ak1x8EH9pVnQ5g17SuQu47Cv4g9UzhvHE/JB2dPLlTT7W9Dmxtrpx6T arpYnbo+eh69h9dnN3djSaiWtcm1bWwDQUKm/WM6FL/C6gbAEtGrxKycuKdRrWxJm5oK c/4bO016F+GrSRSUHV/WVSbIMI2eJ6R9c0f8Y/6niBpPoJ3CVxDQ6mPLmkJHgF6eF3ek CsCw== X-Gm-Message-State: AOJu0YxkGQcd6RFLvpS3pJ1M9afJVIvdG6AQSVfzZflnDjDjsFW39C5s VhIzAyvmkpqlOdgnUv+nQvoQYDtTZAb33b0cfN2ol2P+9T4pXqEJ6VZOVFfRZOI= X-Gm-Gg: ASbGncvf7GNHlVKkohnNU6uMVLHF/3qrYXvChKf3+EBQGWK5YmcdvUfBfLAyrbfaU3X 5M3je9LvNey13wdljIY1M7WNR0KgcU+fYpbJrjP8scA8HS0m/cU3v36We/LIEAeVfyQxaicgUai tLJBnLgEjhViF0Q2IL676/lkZ2Xytt1Jy3tgWSumfTlRZNaFabXBh1i/QofaQYGnd+qSsNLmUxr Oveg+nI4eifILF6zP7vHmStbfKi5nw0cpZdMovtFPxJIBtduiB/yzI= X-Google-Smtp-Source: AGHT+IGrA5oXTZWhIgwpgVfchuwVEnNvwRhAFU9mByMYIEI0vD6r2UZTeA59LAsmKiaoc5w8heKZUg== X-Received: by 2002:a17:907:72d4:b0:ab3:84b2:4247 with SMTP id a640c23a62f3a-ab38b3808fcmr272000666b.40.1737121378861; Fri, 17 Jan 2025 05:42:58 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab384fcd90csm169662666b.181.2025.01.17.05.42.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 05:42:57 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 28B8A60858; Fri, 17 Jan 2025 13:42:57 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= Subject: [PULL 03/37] semihosting/syscalls: Include missing 'exec/cpu-defs.h' header Date: Fri, 17 Jan 2025 13:42:22 +0000 Message-Id: <20250117134256.2079356-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250117134256.2079356-1-alex.bennee@linaro.org> References: <20250117134256.2079356-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é 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 Message-Id: <20250116160306.1709518-4-alex.bennee@linaro.org> 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 Fri Jan 17 13:42:23 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: 13943338 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 E934FC02183 for ; Fri, 17 Jan 2025 13:46:05 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYmdA-00018y-Vv; Fri, 17 Jan 2025 08:43:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tYmcu-0000x5-IN for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:08 -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 1tYmcq-0002D9-8e for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:07 -0500 Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-5d932eac638so4156158a12.1 for ; Fri, 17 Jan 2025 05:43:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737121381; x=1737726181; 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=9VoavrIr417Jut4poNQurXRcCbKSqVL6eDWL02YIVTs=; b=fFM9F6sPiEcKqKuQ1fOk7rSuVGlisfoSviJegPfsbnTiFbcsB5mK5vZv3g3xMS2LEQ pnLORanv8suQ9EmIdmxYigdCuz//+T6VTNjqydoGLiWRDMYJmipxtf6xZeszcxoCQ9np ecWnC9LvnWQl+vrMltbN75fKPdj32aEBkesYf8szDxyV3hbMryuTqCpJ9jwvcIEVZ4KR OMp/AuGeWwUC0kS9st2Kn/w82RfB0z84B8dfhKoT4lG7xoZs74AvHbKiaMYGlPRqAIbQ HDYpfEYLlBw50vNzEYzuV/NqERG3n12MiilQF5OEDlohTpPB7LfH2rqxTQ21s+x6O5Wv OD4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737121381; x=1737726181; 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=9VoavrIr417Jut4poNQurXRcCbKSqVL6eDWL02YIVTs=; b=W4RLN+N6fS3cLCU4r9lPLilBXmjISgiOUqUpH1ynBMuv2edxjlr1zZJPqQJYPGn+1l 3D7MMppfh3o/+LGb/Sj/e23sgACvwV6AEEgqyrYZ+Rqh4CHYz7iS9PozXrlK3TYeyx24 mBD8E7Q+UzYKevEeiOgRyLuonH3zNTVGceTm0opg3bbC6G4ybLQSYwE2ZrdZUxgNJUVI YQgJ+ZgAmh+BvXgazej/MO8DTdPS1+1gZUHAKnqSTM0cK5402TRrT0Owr8zQEuSPm/Vl e7f/iUeOuaNSNmzL/3WtuZJWUV5EoqXRLkH29JnzWHNNlI4JveuD+4SY5+ms3p4PBkxz idTw== X-Gm-Message-State: AOJu0YyygASydgh/2cTqWHZamB/J97+DLXYw4pHrgz37Rxzc9DFh5GLh EQopNGlfxTSaL+oB0i+Az7QjDHDZ+Pii/CbPdFQAk+chAjC+tNsa7nk8gzodxIv8OseJQU5lLKb rW3M= X-Gm-Gg: ASbGncsLVhm+8ds4F1eW7l3iXDZpcstT4HIICyMnO2qOa5qmQE/zaS3fWtTbF0n6Zfw WQIklhvmLUzFj4VdWUr/Vf3PEpguOzWG4p5XlvhzsJU5mpo29Y6aTIeAMWLTpP8EevEM4JNg4UZ wbl7jH1Nl1OvkNKkZzK5WMNxPCHgv+GVORKLFZt8c59aPaz4nGYmx2teEQgQXdBWjUbDZyER0S9 DaCEf/h5JbOyGGn3Hw9mSwy3uogcryneMedalbmC5s6E1ygrAfC6Oc= X-Google-Smtp-Source: AGHT+IGghSK6EBRcnNWRat+qlJI9x6+vfc81c3FyFI6E1VuG9/5l5urI9iP9EofcALk6DD6ZNop2lA== X-Received: by 2002:a05:6402:2803:b0:5d2:723c:a568 with SMTP id 4fb4d7f45d1cf-5db7d2f105fmr2103569a12.10.1737121381278; Fri, 17 Jan 2025 05:43:01 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5db73eb59dcsm1513790a12.61.2025.01.17.05.42.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 05:42:58 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 3DCFA60859; Fri, 17 Jan 2025 13:42:57 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= Subject: [PULL 04/37] semihosting/uaccess: Include missing 'exec/cpu-all.h' header Date: Fri, 17 Jan 2025 13:42:23 +0000 Message-Id: <20250117134256.2079356-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250117134256.2079356-1-alex.bennee@linaro.org> References: <20250117134256.2079356-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é 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 Message-Id: <20250116160306.1709518-5-alex.bennee@linaro.org> 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 Fri Jan 17 13:42:24 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: 13943342 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 891D6C02185 for ; Fri, 17 Jan 2025 13:46:35 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYmcx-0000zh-Jy; Fri, 17 Jan 2025 08:43:11 -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 1tYmcu-0000x4-I3 for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:08 -0500 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYmcq-0002Cy-8c for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:07 -0500 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-aa68b513abcso397510966b.0 for ; Fri, 17 Jan 2025 05:43:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737121381; x=1737726181; 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=SUu6i8T057JPO442k8CSrwOIxRNKi1DJo3XfOqemq7M=; b=gpceqZ25XuXEym/X1EKiqezLap5I0/ZMG58Yg0xM7NTmfT6PPSlEdEYLP+NDxREjYE mvS1786s0D/KnmSTVdvEVw2ZXQDXBhRfIIAAYew82+x23lPC8WQh5HF3eWDofx0I79fU tFt9ETMIK9/y6ikaxIDAuwH1yuxJDQ5Ozt/h78i/43zg2dm4e5aG5VwnUpEFRkfD1Aus nNTPlIAk45bqPW9X0RaBo1g8TgCFO2FSnZW79OesOoP4Pmkt4gOADh/yO4XH2li3uZth POYBDEnjDrA6vn7i4pMEFIKAYjvfpqPO50foZnqPmL8GInGEMWNxsHeskmbTMIm6ochD Bvqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737121381; x=1737726181; 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=SUu6i8T057JPO442k8CSrwOIxRNKi1DJo3XfOqemq7M=; b=lBjuJLui3RTmFb0nT++jmfVDbPNhMRPY/GZrHMaFuo07+O85fCRYplU7+vqoJSA0x1 vVmsEg7r+tGQGp10ocBQLtlaXHA4s0pm+HrxgatcqJ2wzmQnmDYYAGnNHQCB79yGzXyQ 2GxmMC9jX2G5nPY6qvhCF+zjWGz7tZDaC9/MHrtYBxHrRIUeJK5cXGWIC0vu6YWsOVU4 GZTHAC0V00UFEsewb6bWtOMQiQDrft4i71m6AaQglUqmjXgApQ/Tmv8tSi+GLrN/mvGE 92tUPO6Ch/5WY7COBHf287meuPvey5ijp66EUAi3Ik9k7+fFQAzix+LrFKRcmlq4GfF5 Ud8Q== X-Gm-Message-State: AOJu0Yw9YhmOA1QZl76+lXWO2cUtjBdLEqjPc+60t7Q1SRcDayX6vcDx xIqaDTG6MIHj6O1Iyv6lT1NT2iShVL9uFT+Z8UP21Hc5tgObWhxTbdg8/tk1o8Y= X-Gm-Gg: ASbGncvFF2L1I2h4KZidOQrIpiBrfXXd2z3NokvFbYfwexo8zTJe15JfTonIkhWvPHL JxktMnCJEg4VVTDzgJYvGQYQcbXiDKM12r4TOoudlFmAnKztTpHty/oR/US0/QBSJaZzWoA7ioG pAJHwXrG7Xd00lM4xTN1ahs/ff73Us0QZH04ZYdfvO5zi6GH51kIEb1E9o7K4r3CgpEOHF+6O98 qsIOZIcHYYxIOXIicXApkDqWgiqfApStN22ZQsNPdqgPIGm/n0AkMs= X-Google-Smtp-Source: AGHT+IGR4a7Cuptm2vqne97yegTbYKQuTTA5GmdVOe+oNfF8mTmcExAw/t1nTu7Rf0LD0YkhNkaD/g== X-Received: by 2002:a17:907:1b1c:b0:ab2:c0ba:519e with SMTP id a640c23a62f3a-ab38b3701d1mr258354466b.35.1737121380624; Fri, 17 Jan 2025 05:43:00 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab384fc35ffsm170337766b.160.2025.01.17.05.42.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 05:42:58 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 5486960865; Fri, 17 Jan 2025 13:42:57 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= Subject: [PULL 05/37] semihosting/arm-compat: Include missing 'cpu.h' header Date: Fri, 17 Jan 2025 13:42:24 +0000 Message-Id: <20250117134256.2079356-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250117134256.2079356-1-alex.bennee@linaro.org> References: <20250117134256.2079356-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x633.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 Message-Id: <20250116160306.1709518-6-alex.bennee@linaro.org> 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 Fri Jan 17 13:42:25 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: 13943349 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 216A9C02185 for ; Fri, 17 Jan 2025 13:48:37 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYmdt-00020J-OU; Fri, 17 Jan 2025 08:44: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 1tYmcu-0000x3-HD for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:08 -0500 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYmcq-0002Cn-9o for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:08 -0500 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-aaf60d85238so360725066b.0 for ; Fri, 17 Jan 2025 05:43:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737121380; x=1737726180; 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=MTfYyauxFj85w9TzqXO1KGgQnkDy6owgJRE7biN3a3w=; b=xidxAFHWp4qPn3kKJJ9H8zTtzNfaCibSiZDV2Spp6VvynrkAkCVQwHDOGUQfBP04a2 gHhNiw2xVnV+9oTQt269rJkmAaGm3TQEc1370ABcncTKiecV0WD4Z76qwVc/VRvpdPd8 xZpWCsVg309/h9woD+2GYRHkgbwEef5ZtKE7NNYHBzSgiXvDHz/z4ccUBhsgxJ1FNVAb jXrC+9M9V2QQCqpod2LgOtTD/K6NbxOzRJgu5IZ5nOPj2WkVd+DBU4VKUqL/l9SQBK1h px2F0JjgrNOX+6dHb2Mxi1D+ujXM9bUP1Brwk/EfNsJYvXTxuvIh0EBNiSPPiF9O3K09 4oNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737121380; x=1737726180; 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=MTfYyauxFj85w9TzqXO1KGgQnkDy6owgJRE7biN3a3w=; b=jVM2CZ8h/jnYPct/80YyYzuzZ9PGxIa15QZ34KC4r6AGxUYapfSB7LGTleleFAU9Sx 55aRnF1FhjJULnktZpW8nGgmYnZsEB7QZg37a7xMAxVcpD8dPi3njTHZlLGlvGx3DGef SC02o7FSkkuXWCYQo9czMuTd1XFgGSUWuJevKC/kuLhlLNyGv7DylASYxVvV9BysVXn1 WCClVE+6n1x11T5jBo3lX5OzuVY4ulCdNbX5zM7WwJjU6tMmQJ1AKAVBR8I/v+j8b1Or 8E3R3d1Mk31o6yoYm0M0/kHxSd3E7Eb/WWmP3CYTTU43sUQG/uKybxH2cJfMG2j6Yh76 KFug== X-Gm-Message-State: AOJu0YyE0bJny4kxb68dpuxRfQkstxMV8Z1tQRa+XBL4dB56BVcvAv6M mwhQt3QdeCa03V2wM037iFItOB/pBxYCRjLvshXIFz+xxPoY2mbxkOG7YaO6TGblqnNRKzKSxtA /dKY= X-Gm-Gg: ASbGncuozYUhgs4xuvX8aMvQ0xJtFi10LWOVnme9mUkZaukBzXNdztHHhruSsneU3YH ALyNsSbdCrnOx7iOWHLXx18zy9LXhw8pz744H2oMd3j4zC5DNFPKXVMPB73+HQKnwH+flXnpZ9t LiL349+xCijkAnmdawPBObUs21Q0yIlwkIZ8nkmSVSZDsyAhMLw3RSmTRk4gLC/L8qMoPJjw3Rn 1nrNyqoYLJxtnYpc9neJD8WoqlCwQ+v4yz0RbmNOJRyJcK+BYIqCbk= X-Google-Smtp-Source: AGHT+IFz+MtmXeku5YX7QOsECtVBmZlr1xuJGQx1B06fQ0GY2vyHQP8EbjHv/V1DtfVUtQy0vfZQYA== X-Received: by 2002:a17:907:1b15:b0:aae:b259:ef5e with SMTP id a640c23a62f3a-ab38aedb10amr290897166b.0.1737121380098; Fri, 17 Jan 2025 05:43:00 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab384fc35ffsm170338066b.160.2025.01.17.05.42.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 05:42:58 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 6E49260866; Fri, 17 Jan 2025 13:42:57 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= Subject: [PULL 06/37] semihosting/console: Avoid including 'cpu.h' Date: Fri, 17 Jan 2025 13:42:25 +0000 Message-Id: <20250117134256.2079356-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250117134256.2079356-1-alex.bennee@linaro.org> References: <20250117134256.2079356-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x633.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 Message-Id: <20250116160306.1709518-7-alex.bennee@linaro.org> 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 Fri Jan 17 13:42:26 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: 13943331 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 3C2EFC02188 for ; Fri, 17 Jan 2025 13:44:39 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYmdH-0001Bq-5D; Fri, 17 Jan 2025 08:43: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 1tYmcv-0000y3-Bn for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:09 -0500 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYmcq-0002DF-9R for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:09 -0500 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-ab2aea81cd8so358244866b.2 for ; Fri, 17 Jan 2025 05:43:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737121382; x=1737726182; 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=GXvDUDHkugKiilyR3D1H0/yadk87FxFT1Mw8vy1ltsA=; b=TNPyJykwJ6oxeyVdOc0KhqH7b75d7bWLjwdn1fIv/zZ2SyMcXIaWNIgxD9DzGv3eVF cUYUQ2qKj5qpjEl5rkrZIsIk8/LKCJwB+Y1uqtdUW3FSXRgOyJuZRIkqgfOyzSTeDQtB aNDbf5jBVEzAULRoQgHrraO/iEDqvPI/FRWGr/raBuhMF654Jb6D9EF8LC21F0+K5n60 757eO6LCyLHbxCb3HfrrLwtiAs3qUMIagnTYaHWNTENob0md2QtLPcJEy2PNig9TLF+Y keBEzrMurKx5jCsjtbBaSukEfZFXJJaqQCJ4i8MyFFufiCe5VsSBGTyUuPgxYodzyyhu tYfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737121382; x=1737726182; 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=GXvDUDHkugKiilyR3D1H0/yadk87FxFT1Mw8vy1ltsA=; b=kw++KZmIDPZkWpwqF2gsnn9xu8x3QP8An7PhDd4CR+wv5I+uC8WvEgzyYLTKOmxOZZ cRIoPJ6UcTB8Bv5wIidbkBlyKqU/zruF9qOKRt/+J9A9pxmtM1bwB6i3MlmjfaQQamjA TsWerP7ahcoE8IZLsD8r88eD4uwr9f/xuiUojzZQmX/c0PQKC1R/kOnwKlWDeuiXJ1Lq lr/aSfoXDQdMFe+tDt1xHBu9ZvSiutsbEmTG4kMe+J8SdHb320m02MNsKJuZq4d/1ukL QwhHHJEOUxeXtZwEY6IeOqyX/CjJGF6UG3Kxlu3oALF8NuI/zc7xflJ/CJCt0UQw9PIu LpzQ== X-Gm-Message-State: AOJu0Yy17fOm7v3h7oRsGjTgfX/2ChcG8HH0Cb2yOm3KSIXaR36OjGTF TJ6v3/sXB2Fboz0616k2ZsmE1zxI9ZEuJIMtdmTcb2EpxMm93Sg0aQggJh3qk0M= X-Gm-Gg: ASbGncscSbc87BGNI3f86vjjaitPPcYeVDDyBGBqvH5pbvMdwV55SgGN8Izr4O9ZP3d TIIPDVfMlbXzio1iIke2URc9IatyRrY/V5mwoyp3G8DOMwP0s0Zuf/5pHD/HQfGN1M/JvcbuOOk /aiE1aIub9t+XVvV4lnWkZ36PjYMb6SPoM5yKl1Q/bItGhAMs7LJpU+HwiFFmOzyX79+mqQka/l IrQFAg0tgHtX/e2XhYZ8y4nZqXr20w6T7bFiN8us2MI3uudrwRwoCo= X-Google-Smtp-Source: AGHT+IE1zpEXn7HnexZkHIBenMuyo1Y5ptBd8phMZsxQSczT1drUGDh6ua8yULBrQ0oggC2f8/lJPw== X-Received: by 2002:a17:907:980b:b0:ab3:61e1:9b06 with SMTP id a640c23a62f3a-ab38b0a2221mr308042566b.5.1737121381863; Fri, 17 Jan 2025 05:43:01 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab39aa6a7besm38093266b.68.2025.01.17.05.42.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 05:43:00 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 8797F6086B; Fri, 17 Jan 2025 13:42:57 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= Subject: [PULL 07/37] semihosting/meson: Build config.o and console.o once Date: Fri, 17 Jan 2025 13:42:26 +0000 Message-Id: <20250117134256.2079356-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250117134256.2079356-1-alex.bennee@linaro.org> References: <20250117134256.2079356-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::632; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x632.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+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 Message-Id: <20250116160306.1709518-8-alex.bennee@linaro.org> 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 Fri Jan 17 13:42:27 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: 13943325 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 976B2C02183 for ; Fri, 17 Jan 2025 13:44:07 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYmdL-0001EP-Hr; Fri, 17 Jan 2025 08:43:35 -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 1tYmcv-0000yR-Lj for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:10 -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 1tYmcq-0002DL-9m for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:09 -0500 Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-aa67ac42819so328474866b.0 for ; Fri, 17 Jan 2025 05:43:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737121382; x=1737726182; 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=HMQ58Acbctk4+YTi9iqzJht+eWjui8AFJynO1iL5Mfg=; b=l+aJ8gVuW8CAE5GSMBQTjcjALr+Bc3agYqL8WCYxI6HXrLM8sSkrReUEKaAhhj+chd o5AyAkjZyHOfa9ZiWIx4mcuhZbUx+W17F7igYP9819pdjBKKN1KplfMWm5AOXYIKGQnC cQEcDtYGcUBwAyp88zoB2FuhjMgRk4B5fDCrg3vSE8zfyXgB58TnAySyztPCOozdPnS9 e07qYQEyMnqMPDGlNHAcnpBDXn4NKjsckNQp16EUFDYqnxjE2Oi5QDkaTXbIEKhqQTMH co924p7hjdwpAUGXWG6dQkYDNwszHfDsA8MMTPXeNSeJFjicdTFfZUZeEvuiODnYhjC8 lyKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737121382; x=1737726182; 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=HMQ58Acbctk4+YTi9iqzJht+eWjui8AFJynO1iL5Mfg=; b=WlInPNj/x/EoOiZQ76s4AFRRqTj9oybux7GDmz5MsMXTlOC9/rE+XBG7AsxugGlZaQ N7iI7Fc3NYWo2d/tQ7w2yDX+nSJmekEMcQe1pPCudg52B1epClbTQK0Jl4mrZ4sEHOLl FbiVuv3EhA4Fj/qj4H3gjlfBLKLANbAje7FkJNosVWAYE/kI0ANEfEWt4cR5AqtspcXX H1WvguqlVdXCZ9Tn0B4YEgFpqIFwLlMs6Wj32L1cOpeWm7c68EgPT0lny9ZlYZ+H57Dh tE0oyRBlJpr/TfAn0GhQ5BQJEgvjehd4NLWfqg2w8lQ7ABVlP3u5bUH2C+GMjxj7ejSp 3kUw== X-Gm-Message-State: AOJu0YyBQRcs92kWqygl9o3wqykVirBJ8eoQgRch9DMVWuz3yArZDa+3 8yDtIQ0bfriZkRNj21E0VaIEY/X7Wr3qMcXye/bABtdmUnZgohVR767xaEYLkwA= X-Gm-Gg: ASbGnctvl+aTdYidyHCjYpO+bcEkxV83lzWf6Fr+q9j1HitqiH1KlQNQlQSN1+N3TuQ My1XoRRbTsOPlwAFYQUZ5KZ8O+RzN6R9L5XQpGe/KCRKBAUxevt/Q4uaVpw7rT7pvvOUh0C6v52 PVJUTdTYNo2HJMliSYwBjjCMBOWdiKZOTRwzXdqv4gJX9CRPlntqVLq3iTlq2unQUq4K2549WNR l0ALKpzoVY2P9Qe+8qJxv99QSgqf7CvqHa6OkJ5Utw8gmrhOFYGTVE= X-Google-Smtp-Source: AGHT+IGEm1FpSAymfJQwJVLxxPS047LGoXIZhmVZGh9Tm+6w6ppZN6+f0ty5Eyv7IB5iSbAf0EJwQA== X-Received: by 2002:a17:907:8691:b0:aa6:7470:8efe with SMTP id a640c23a62f3a-ab38b10cf47mr233120366b.13.1737121382318; Fri, 17 Jan 2025 05:43:02 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab384c5c47bsm174136766b.16.2025.01.17.05.42.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 05:43:00 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 9F3976086F; Fri, 17 Jan 2025 13:42:57 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Richard Henderson , Paolo Bonzini Subject: [PULL 08/37] system/vl: more error exit into config enumeration code Date: Fri, 17 Jan 2025 13:42:27 +0000 Message-Id: <20250117134256.2079356-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250117134256.2079356-1-alex.bennee@linaro.org> References: <20250117134256.2079356-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 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. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Pierrick Bouvier Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20250116160306.1709518-9-alex.bennee@linaro.org> diff --git a/system/vl.c b/system/vl.c index be029c52ef..22c1444da4 100644 --- a/system/vl.c +++ b/system/vl.c @@ -1307,7 +1307,15 @@ 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 +1327,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 +2052,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 +2672,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 +2719,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 Fri Jan 17 13:42:28 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: 13943333 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 7CFB5C02183 for ; Fri, 17 Jan 2025 13:44:41 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYmdv-00028C-Nq; Fri, 17 Jan 2025 08:44:11 -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 1tYmcw-0000zn-UZ for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:11 -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 1tYmcs-0002Dj-CI for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:10 -0500 Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-5d9f0a6ad83so4301234a12.2 for ; Fri, 17 Jan 2025 05:43:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737121384; x=1737726184; 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=BzeJsOhL7cM2HJmzGNoIr2AKwnH1ajX9mBPNfI6j2oo=; b=oL9dZZ0PPE/H9gxOxUyCSd2PLu5/AXAOXEPzv/m3OyD1m9GGziQ5q02LNco2QXs+Ad 6aaS+fVOmCh3Fmirv7B+VC0SgBMAVqHt+n6m9iEUecyHOZyYbPKQ1cmUV9tFsb9ST5hn oZ3o4mCKDq8icXYkhcwfRq5KHjD6JfmwKLZjdJuy/vf2pexNymSMVK5KjA1bTWB/UBoC 15QPgYeomCOsIfdvVlUnZ9/SeHDPqoTQrSRZ1TBdhqv2YX2Q6KIUJGuxFy2xU04FzBF3 vPWVUNQLrfUvnx7gus0EHYmrLJuwSVSvPXWrb1opKhA2IS24nrBCkR0lt5hJaOq/oaSx SDoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737121384; x=1737726184; 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=BzeJsOhL7cM2HJmzGNoIr2AKwnH1ajX9mBPNfI6j2oo=; b=VqjqYnKQIgwbKUjDA0lEkqfONYy+nKcjY9HepmA86LuuwEirwbJEK0z64zujEVJSo8 6RJCAVOq1+xDCWY3zb9SAPgX6COgFBj+AAhG9frJ7ept3rUjb7svfkZUnWVDrQZnIJQj 9wARWB8whB3lvqtXW117Uh/rhx8c0Ax8f6r2B9yKr348WDfmEgxVYSz3tWT1hrY3a/Ta dCLgSz3xDRNTWGHbYkqXDDU/Vz7L+bEzEn8zKEXXE89n0LazZ3sm5vmFVt1ZA8kVbp5g PAkMggAbNgM4MK7mBSBQgARaE9AxVKANo60v42V8aPUqRcvfzVVIwvP68CpdcGT0i0pP NlLA== X-Gm-Message-State: AOJu0Yz2Q94tV85wzRtVeWcM9iNEAZNAoorFm3nIFzaaydSjmomlsBhb XZN5GI2LwuruFZhXR8vqoOYJiITt4VTAd9U26IRot05wApHVzW7fwhQKTp0OVWlqwjVyDvGZgKS jmHE= X-Gm-Gg: ASbGncuYnMr4z0II4qsJwo051JcEV4VBphE+b/4oKaAyTtgsQbW9icV4K+82jnJxHTl JCITUEFuWQAiNC48jIm3mA7fzFn+C8Z2j4Im2lLKGYvtLH2HAeB0gk4+JuEz9Ryid65L1sa3m/b aI7f0K+4trt2O84L7Y+id8hiz+WHuKrc2TJrowNMDzBx+2h2t2ILh4YADqhR1/otojBQamupt4g G9HNjgMRZg6IiVV9ABEdHlmSK23XNOo27teomelFNh0rSx+6KGyU8I= X-Google-Smtp-Source: AGHT+IGFoyALXDqmeGLZFXoiWjV8jyYIedt6XRZkG2tD0k23aIDPLghbCELiZxSi69k6Cj7FnZJZhw== X-Received: by 2002:a05:6402:34d2:b0:5d2:728f:d5f8 with SMTP id 4fb4d7f45d1cf-5db7db077a0mr2378036a12.27.1737121383878; Fri, 17 Jan 2025 05:43:03 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5db73670fb5sm1557595a12.25.2025.01.17.05.42.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 05:43:00 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id B6E0660872; Fri, 17 Jan 2025 13:42:57 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philipp?= =?utf-8?q?e_Mathieu-Daud=C3=A9?= , Paolo Bonzini Subject: [PULL 09/37] system: squash usb_parse into a single function Date: Fri, 17 Jan 2025 13:42:28 +0000 Message-Id: <20250117134256.2079356-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250117134256.2079356-1-alex.bennee@linaro.org> References: <20250117134256.2079356-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 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. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20250116160306.1709518-10-alex.bennee@linaro.org> diff --git a/system/vl.c b/system/vl.c index 22c1444da4..02795c5135 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 Fri Jan 17 13:42:29 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: 13943340 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 1D1D7C02183 for ; Fri, 17 Jan 2025 13:46:26 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYmdN-0001JU-RQ; Fri, 17 Jan 2025 08:43:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tYmcx-000100-89 for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:11 -0500 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYmcs-0002DS-Bf for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:10 -0500 Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-5da12190e75so4279785a12.1 for ; Fri, 17 Jan 2025 05:43:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737121383; x=1737726183; 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=0lC5KFJs3U8ND64w3w/maXMUrgMg2IESIZ2mhbwm7gU=; b=GWRFGAQ4pJ9KDXE3CPItiHyxIMT0GFbqlhcoMsn/fU/JubAC3jjNZqAfUxpTd6PPA3 56XBFFY9JS7Zi/3YzgJBNad1tenR46haS+An085t5VZbqgmgfKZnzo9X7YQiAK81g468 39d6P85h7ZErzW1SMnSPFBHIg3wu1pQQk4V6Nf8DQhvO9qtrcFsvnsGWV5o41Imb6ZG7 c+l7VrHL3NGn+VmQntKez2fWxjtvcLsLh/oZedtNjEcg6XRMDgo812aSwu94WVqwabau B8tJrewfrgmayzMT5y8QYZadw3Lag5iCvtpojqU5X1yxLsgNijXYcwXGGAe8aVbwskKY 4qVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737121383; x=1737726183; 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=0lC5KFJs3U8ND64w3w/maXMUrgMg2IESIZ2mhbwm7gU=; b=CXyo2RCboQ54/IUzTqrOnQDwOh/btw6nSQ/rZ5rpcxmcW1dRDqU4BKEaaWs2Rg4RB+ 1XE2j1bxdCI2WhF4Vvg3GTfcLo53sZ7Ft8OPN6DDCSF9WCn3yMHMwfXtYsKXHKwxE4no uCBVUb3h4RLjoOsoPqBHS7rQuNUfHwCLQ4EAoJgYyB23d5ZEf1MVZIKafYsresBVLHVZ UXz9uPJB3YMc145P1BfUiNK1Z3AYrh7xWW5qzNzYVPipXTdy1Gx5fxtuGIYfv/UAygJo 6XR55myn+2LoA7DSFokhjcPamu2+U5sF9+3OfTRp7gYLT0ywJY1W/UoiTo95RrtCfwYQ mVoQ== X-Gm-Message-State: AOJu0YwHGCIC+N1q/+dnaP/rv0E0CW5FBfRXLPsvj5xpfHKv9pd9uZ3U Pr2tyxjLtRUgNZGMWyR/6Rt0gm0oqf1qdv4cnirTIFGtsVcqlC071m2LRZBPI1Q= X-Gm-Gg: ASbGncukTGyMShpdMTO0YLUJdAUQbbvqfaXmR0cZ+64KBYkSzp6vW9xfPfKM2Pm99rQ 4MdtPlDAZwCznmydcR5x4PvBw9bjVaU09D9EXHs47XD+M19jR86YajUvJYSTjgrM5r3sc8BLdzl 7VbVOcldU3HRn8P0D9iIiYpReJVS3GhHT5+QV/9kv2QhYG8j5TVWfvtUDNbfy9HRl7dXWd+IoR+ UQW8STwT9/bS5hUKSbGJqh0NflDg2eEEqGCRvddyDZ363rHFxMI828= X-Google-Smtp-Source: AGHT+IGhPpIJZvubcHVhr2Io5rM8cNK1fziLG9qrYuE7mSW7kjFhQ820MbsS8z/VBGYnExcX0s2ygA== X-Received: by 2002:a05:6402:2812:b0:5d0:eb2d:db97 with SMTP id 4fb4d7f45d1cf-5db7db06dccmr2568242a12.25.1737121382697; Fri, 17 Jan 2025 05:43:02 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5db73642332sm1520161a12.9.2025.01.17.05.42.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 05:43:00 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id D73446087C; Fri, 17 Jan 2025 13:42:57 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Pierrick Bouvier , Ilya Leoshkevich , Warner Losh , Kyle Evans , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Laurent Vivier , "Dr. David Alan Gilbert" , Paolo Bonzini Subject: [PULL 10/37] system: propagate Error to gdbserver_start (and other device setups) Date: Fri, 17 Jan 2025 13:42:29 +0000 Message-Id: <20250117134256.2079356-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250117134256.2079356-1-alex.bennee@linaro.org> References: <20250117134256.2079356-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52d; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x52d.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. Reviewed-by: Pierrick Bouvier Acked-by: Ilya Leoshkevich Signed-off-by: Alex Bennée Message-Id: <20250116160306.1709518-11-alex.bennee@linaro.org> 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/bsd-user/main.c b/bsd-user/main.c index 0a5bc57836..b2f6a9be2f 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -628,7 +628,7 @@ int main(int argc, char **argv) target_cpu_init(env, regs); if (gdbstub) { - gdbserver_start(gdbstub); + gdbserver_start(gdbstub, &error_fatal); gdb_handlesig(cpu, 0, NULL, NULL, 0); } cpu_loop(env); 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..c2bdfc3d49 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,14 +373,14 @@ 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"); + error_setg_errno(errp, errno, "Failed to create socket"); return -1; } qemu_set_cloexec(fd); @@ -391,13 +392,13 @@ static int gdbserver_open_port(int port) sockaddr.sin_addr.s_addr = 0; ret = bind(fd, (struct sockaddr *)&sockaddr, sizeof(sockaddr)); if (ret < 0) { - perror("bind"); + error_setg_errno(errp, errno, "Failed to bind socket"); close(fd); return -1; } ret = listen(fd, 1); if (ret < 0) { - perror("listen"); + error_setg_errno(errp, errno, "Failed to listen to socket"); close(fd); return -1; } @@ -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 02795c5135..c567826718 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,24 +1298,21 @@ 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)) + 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); - } } } @@ -1446,7 +1443,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; @@ -1461,13 +1458,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) @@ -1479,44 +1476,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 Fri Jan 17 13:42:30 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: 13943327 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 39DD6C02183 for ; Fri, 17 Jan 2025 13:44:14 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYmd5-00015P-IR; Fri, 17 Jan 2025 08:43:20 -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 1tYmcu-0000x1-Fn for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:08 -0500 Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYmcq-0002DH-98 for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:07 -0500 Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-5d414b8af7bso3968588a12.0 for ; Fri, 17 Jan 2025 05:43:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737121382; x=1737726182; 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=RmjVABPbnCsJ8Mr6h+L49GfrK8//sgmPrYPBbRhvLAY=; b=Ibuq4YfcqznUg/DbVMmsb8+I75Hqd+4yySzd6UyvJnt1dy5msd2bAEJDGIu2gjr77P 7kv4E57YFLAt5TGS4EDm6FO2v1u8m+4a7rQti4CG0kv1gdrXPttuVMMuCt2cNm0s2WsQ gLw3x/+iDI/wPl9il2MLwX12gP4Fwe8C8Pjx1Eaktd5wAUjC3teY8pMDIsxubdGepbHA 7NIj+f83kmSDXzLb21rO75NRe1lwv5MgYsmuPDSARvE75qwjelGlz4eGRnvmWAl0jyzy FES5UrBFi9Z40NnbidD6U45t4oGJCIlZk0NB6RGUT+K09AONywiUOrOwCkD1g7qORTLQ PO+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737121382; x=1737726182; 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=RmjVABPbnCsJ8Mr6h+L49GfrK8//sgmPrYPBbRhvLAY=; b=a0wfKc170NznYUlm6Gqmiqw4ItE5XYjrKZdYpB10yyLH97KLvP/7Zxx+ZkSf5UMixm ZVfUEF6IJfgHhe0CzoeX3ftKT3ZNWq0Zf251/VXTPQwdMxTKOCUkjHL3KcWISpWja6GB Weq406CrPy0SR7iAd9oyXB3borBcALYfHDrW6JZvX2pf7hB6rarLvPMMpodlmR3GrZuF YLjBtb5pCht+X/lFa8cg4nDhVtf2USdIrxSrtmGUXJKISjzEyFdVqbxTo3eiaYjt7Giy GHVcpGgjB/NCsco7mcqxMLBSjSma2h1cjIzYiIT6A+NAMzjiUYlCbpHUEQe7DgT+QFv5 TQPg== X-Gm-Message-State: AOJu0Yzl0J0BDXpYMjRk56YTzhw5WWQBMYi8yn0Nzn3iF/uNqyvlhEav pbmGlJWqRqExQ1DnJhOc+DVTLFY9Q2JAo9xcCtk2sHf58zPHD7IpJv5ioiw0b3g= X-Gm-Gg: ASbGncsRTTBNmkghaR7xN1PxzAgMmUNle/nIA5MWh4HNdPh9Kk32IU6daMeKPKH5wEm B1B9I50aBrzbV8ILuG9e+ygkCT0KuhQWoDpB4HsoDbb94sOyWw4fL7AY0b64inEyZyaI8RuwOoz lPKJz08GEsjI3AiHLurmaI9cOR9iNiG+q2xJRgYsKss523ZKeZLfKLXtBQuKHleQSK3KEWY9dUL w1Xoz3FHmLwwn7gq8BItlFOKYSxZY1UuypAzaErh0VOsMORNB5OvEA= X-Google-Smtp-Source: AGHT+IGrp2uYlWu3xihGxu1xfJOH4DM4k10hWHqLaKkKD0ubckw9XXlY9MDMC+XAadbbDjRL6Y0K6g== X-Received: by 2002:a05:6402:2692:b0:5d0:e73c:b7f2 with SMTP id 4fb4d7f45d1cf-5db7d2d2ffdmr2654110a12.7.1737121382176; Fri, 17 Jan 2025 05:43:02 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5db736428e3sm1486362a12.14.2025.01.17.05.42.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 05:43:01 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id EC3CF60884; Fri, 17 Jan 2025 13:42:57 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , Richard Henderson , Alexandre Iooss , Mahmoud Mandour Subject: [PULL 11/37] tests/tcg/plugins/insn: remove unused callback parameter Date: Fri, 17 Jan 2025 13:42:30 +0000 Message-Id: <20250117134256.2079356-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250117134256.2079356-1-alex.bennee@linaro.org> References: <20250117134256.2079356-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52c; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x52c.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 Signed-off-by: Alex Bennée Message-Id: <20250116160306.1709518-12-alex.bennee@linaro.org> 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 Fri Jan 17 13:42:31 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: 13943339 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 1B10EC02183 for ; Fri, 17 Jan 2025 13:46:14 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYmdh-0001cl-To; Fri, 17 Jan 2025 08:43: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 1tYmcw-0000zp-VH for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:11 -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 1tYmcu-0002Dm-82 for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:10 -0500 Received: by mail-ed1-x536.google.com with SMTP id 4fb4d7f45d1cf-5da135d3162so3483191a12.3 for ; Fri, 17 Jan 2025 05:43:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737121384; x=1737726184; 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=z7WoTOR0MdrCgpCyDuf9KKFcIa92OwQaEc+knkLDVrg=; b=O3IXrqWSOtFiGqaW7arbGmjO2Iik4lXM9SZYuaH4Hx2DBMRCZOfGoMxIYDkao5dGxZ d2ZN8NTYxv3d3JKZcTujsVqKTr6tGvQRkVHbRFgkNhTGWlJrf+aXc+gCZ8dEo36764pO 9yOolJqCfAlNgbQJkWOx6e2p39YIjJ6uU76brIZnfc3Fiodf+e4kKuy546jZPl5hvRHY AzxJYL5juZQ/wyHaFXS5279Ht5Gh9aRNpcjEuAS3Lz7nZz7cQ5wOJHxutfaJJPxo5A4W mwc4QbUB0ZNlt6ZEu2MKnk22qQYLX7h7tpgpDNhwuwl5KrIwlNLduKWckq+2nCgRSc5n 2ggA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737121384; x=1737726184; 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=z7WoTOR0MdrCgpCyDuf9KKFcIa92OwQaEc+knkLDVrg=; b=QpWFjKUNiKQWv5IGhcfKnPDqGx2S87EpdlPz+5bIIQ0elLpXiTe6wdD278H1WIv1Ge GTEPk/GOJ11ehSVWP+CzJgKpZgjHIRIrxJW1l/wU8lgai6np9RG1r9sfYAzEWMslnkqb S43WTBx4HuY4NUDa3MTO1g4KRAKmahrkqVV1g1VsB+oTRxmm9i3lHqRHNVXNLAbym3nW IILIZDsqXBoLZ8GKSM3hEDMuViSPuHJbm/JzOwUCk0Hyq4vNaK1AE3hV/cb7IM63Plyw TQugh/I1gpUuME1ciTTy/f1pUZ5f96lFa0X7DQTgp9qiVw1Py8X7jgUbuFFsNj7N28Vq 5NhQ== X-Gm-Message-State: AOJu0Yz6s/ko32ryNJDDU/TpCmrpuyQr1nzmMiOQ+WcZXhgY8+sCdv/r /UGROkZTZsojOIAkOGiiasU5Q5xhoKLTCGbBZpxnVMMSGqnWb0eVjVkj5naRC5c= X-Gm-Gg: ASbGncsOSk//ka1eY+wZEn1DVQuRF3JMPdQv8+avq9Sye6kIXIuA8wAsXD8GFUFk3sl ALPa6EFAOYPYpauh20HXipHIb5oZUOa8X+07SQNrqNhdm7uIEjSjzXlIDPSIjWYpBpBMl78wlOd 1+Qae9xy3nsaUG9BnGcWPRlUB+hVl5Avb6XKnaOyQf6P6CLukX0acYlT5IrvkDHpXHkFE78MBm9 +Z2lCLiOCZzDF6TD79N8Whn5E6QsRREAJEtqMj5+v+IQ5KRvIj8BP8= X-Google-Smtp-Source: AGHT+IEoLtMQoq5IgYdb4IfLBUY7rRrWjshU6aAPF4O59CNT2YXwin4vNb4tnVS1qMAkA2Og6ZmdaA== X-Received: by 2002:a17:907:7f9f:b0:aab:d8de:217e with SMTP id a640c23a62f3a-ab38b163550mr267921266b.26.1737121384191; Fri, 17 Jan 2025 05:43:04 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab384fcb262sm170003266b.169.2025.01.17.05.42.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 05:43:01 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 0EEF760890; Fri, 17 Jan 2025 13:42:58 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Alexandre Iooss , Mahmoud Mandour Subject: [PULL 12/37] contrib/plugins/howvec: ensure we don't regress if this plugin is extended Date: Fri, 17 Jan 2025 13:42:31 +0000 Message-Id: <20250117134256.2079356-13-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250117134256.2079356-1-alex.bennee@linaro.org> References: <20250117134256.2079356-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-3-pierrick.bouvier@linaro.org> Signed-off-by: Alex Bennée Message-Id: <20250116160306.1709518-13-alex.bennee@linaro.org> 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 Fri Jan 17 13:42:32 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: 13943337 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 1CF54C02185 for ; Fri, 17 Jan 2025 13:45:50 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYmd8-00017O-8o; Fri, 17 Jan 2025 08:43: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 1tYmcw-0000zo-Ul for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:11 -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 1tYmcu-0002E1-8n for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:10 -0500 Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-aaef00ab172so326758766b.3 for ; Fri, 17 Jan 2025 05:43:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737121385; x=1737726185; 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=2PIlRNEhkzbf8X8MOcKyxsekvkuQSHwlU51Y1LPAQWM=; b=p6n8wi+u3o2zxFwENdT39a2/JvLoCcQqEYXncne5DCi3NDODgUJNnoIMQLG8IyHi7W o1T1qtr3b4yTlw/rmyiSti3oPAZ4vYE9pHc5MIqXyln5FBpipqhNpwKCvvHhRE/TvxuA rcxXmZ6qi+/NAiSGkyZq4rmOJK+OEC5sEkFpyFJS18bC225nUcR6CsTTTkez5jAbHM/z 12zge60wDX0e8wv6oigKob3d3zRaGtxkun4OplGxsLRY+kz6fUeS4++voB52kV0v87Ll csTAanh7+Zg46NEuh3dYIFzf1SE272Ts3QCz7Bdk/QlAwM9LqcBnlXSkqXSsj0z0htmj tqjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737121385; x=1737726185; 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=2PIlRNEhkzbf8X8MOcKyxsekvkuQSHwlU51Y1LPAQWM=; b=lf5wRLmJKOkDZ5bDuVa7L75BtvHdAHv13fn9Hc+ym6Z8yI3DBirbkpdGuhhgfmh0y5 HPisduAJT6Y47OFLWIko3wJZWMuukUbHLmVzPUlSE1J/iyGCScqBZX+fam4g9MhloyOP v5po7wAUE4g5HqbzOTkx4PwvYeq0iFE4B6Lurzce63xcd078cZ7+EEUpk0Exzed+ynZi e4cuqYC1UVOCZCo7yI0AN2jTAfcxP2aOozFCdMOqDWKCXzn8U2x0ZtdbLfbmyWLWnz97 liav+Eqquy/YJoeXYQGGetNXHbXVZUy69tn58iIP2JS1olOpcLTCDK5CU+SyFx0d1XVv HASQ== X-Gm-Message-State: AOJu0YxmEhzCiV+StP8prCCuz5VTYnye3SC+Xay54RZqXXv2Mm7J0lbM tqfftmoYunducRzs1V1AqeVRAvvQ6dk5Fqa0+kIF9qzoRxZmEOByBi5TlbbWDSk= X-Gm-Gg: ASbGncsCLOyn8bfvBsRIQSHnwRzVrJ3lJCvRxp3FtxkNgW0NR+uu0jZV2wk71+PQT3G TWNaO6e3kbY7jVhAoE7NewHEi0yMJF1liK5a22cMYua79HWc2GrObHx+zr9+eCplJkGhANTtl5P Ts8SYysKGj/7A1vc4jrkv59uax6dR/Kq1d15unjLspM0wui9fjZgKOk7buGfNv0vLlPMtSL++jz 6BNl/7jZ3sfziwvJC+jV8NdjurU668s5ss2U7gCKHKdB3r0MjXI/vk= X-Google-Smtp-Source: AGHT+IHZnD/jOEmwwp5SVPKf8ImkKKYiNumcE2rorfQwx+6+EyPTku/O1jdPYLDgjEvvz3WOnZ1M1A== X-Received: by 2002:a05:6402:84c:b0:5d0:d818:559d with SMTP id 4fb4d7f45d1cf-5db7d2f5e2amr6655809a12.11.1737121385613; Fri, 17 Jan 2025 05:43:05 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab384f8624fsm171047866b.150.2025.01.17.05.43.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 05:43:02 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 26A9F60898; Fri, 17 Jan 2025 13:42:58 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Alexandre Iooss , Mahmoud Mandour Subject: [PULL 13/37] tests/tcg/plugins/syscall: fix 32-bit build Date: Fri, 17 Jan 2025 13:42:32 +0000 Message-Id: <20250117134256.2079356-14-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250117134256.2079356-1-alex.bennee@linaro.org> References: <20250117134256.2079356-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 Message-Id: <20250116160306.1709518-14-alex.bennee@linaro.org> 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 Fri Jan 17 13:42:33 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: 13943334 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 90995C02183 for ; Fri, 17 Jan 2025 13:45:07 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYmdW-0001Qj-Hn; Fri, 17 Jan 2025 08:43: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 1tYmcx-00010f-Vj for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:12 -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 1tYmcu-0002DZ-8u for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:11 -0500 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-5d3ecae02beso2971924a12.0 for ; Fri, 17 Jan 2025 05:43:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737121383; x=1737726183; 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=rb1csLfisilYlMMpbSH0eapexTVsqPhs+4Rx9cZ9jUA=; b=dnMYejfMVR0ckOSJZ1rNCRwJvRiJL0ojjUEt561/Sj1I6tAg1+JgX93ydWy5Z0Oy7+ NJjAD9XA20duIP3goV0ykr6C5aKksj85jP1LXh9msseboAJXDo3cugohFYwJDUPfRlmI ncA03WZh3n2ACTk+/x2lFSV5xbXYJJP5X7dVZoc2r6l6PoJqS2OMEBPMDnY5dxX+m1tG JMzGZ3vM3JtBcbolvYvsnSPwSNBp4OsRn8VCIGakCp+a5qdO1aDjKIrBn33xVsMUPud5 rWAYtUpy6aHfTn5X1VUSmsAYhzKiYnLyTqa3w3RklykgmWOhJOr4kQqFQOWtI2vGq6Gb ISeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737121383; x=1737726183; 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=rb1csLfisilYlMMpbSH0eapexTVsqPhs+4Rx9cZ9jUA=; b=AZCr5G/kNzW8xJS+HEIOf/una13V3KWn1nz4vlxiujFGQZHUErNtkhVc3RtRh0v6rA RpyFbgzri00Uy7eKPdZdtazfOsYuvHU2utlguEXzoi1T0iulLkscw+BHJ9Lk4JZhsRnS I1l3Vb+G4wgCYJ8ksoJgqKktKa7dgKPRZAggARzaUA8NRtB2VBWtRZoxre3cl4kptdwO 8oKMHil61Xusf0V/WzqGc/N6Rx2WZikFbQj4/c7nbE3ZCdbSeQ3S5Xo4h8rtR5UsvzmI DmuSYPEf1GAH8iya93pyhW/s0mypZFfPFP+EI6vZxTAsFIwGWBoTApu03qS8DeN9km96 uigQ== X-Gm-Message-State: AOJu0Yw7fU8IVMK6nOFZ88uKOLt+5S0XYUCv0hhgJs04ArFh3igVFmsl chRiMWuQfe7rIsP2zOdJMk5jqVhZcOSptFEbQtFmFrwsQnYDapJDlnfZq0YYc40= X-Gm-Gg: ASbGncuIdFuPWG2Hap3MPfRgv46gZ11VZhGN4RAQx9+ZJfmTQ+fbi4DwHZNuYCNMpfQ 0zu5OwA7ozDn9476EiMGfzLYN6fn5eZNZDqkt2E1bw7Fxzuj7MZ56IQWbwpZ+n9iXlWruClOFtM D/ARoPOdwBpmSFTjxcpQzL/MC9/bnrvfMRRIlY29+nOMIdoeRza+HDfRnIhvWKaqfhX759FUBV6 mRE+lf2lgq9Tz83QedkqFivLbSg6WTDVI08J9uUm38LoS20lR/+nKg= X-Google-Smtp-Source: AGHT+IFjic2K6eX6QM7Igrt+uv26WVQ8JvFG4qZLZpvUGAuUMGx5HeFfn9DM9OtfR/IEtLS1WO8Vvw== X-Received: by 2002:a05:6402:50d0:b0:5d0:cfad:f6b with SMTP id 4fb4d7f45d1cf-5db7d2f80c8mr2590100a12.11.1737121383613; Fri, 17 Jan 2025 05:43:03 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5db73edc85fsm1517141a12.74.2025.01.17.05.43.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 05:43:02 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 3F179608A9; Fri, 17 Jan 2025 13:42:58 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Alexandre Iooss , Mahmoud Mandour Subject: [PULL 14/37] tests/tcg/plugins/mem: fix 32-bit build Date: Fri, 17 Jan 2025 13:42:33 +0000 Message-Id: <20250117134256.2079356-15-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250117134256.2079356-1-alex.bennee@linaro.org> References: <20250117134256.2079356-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-5-pierrick.bouvier@linaro.org> Signed-off-by: Alex Bennée Message-Id: <20250116160306.1709518-15-alex.bennee@linaro.org> 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 Fri Jan 17 13:42:34 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: 13943347 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 928CBC02183 for ; Fri, 17 Jan 2025 13:47:51 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYmdP-0001Kq-7W; Fri, 17 Jan 2025 08:43:39 -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 1tYmcy-00010v-8A for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:12 -0500 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYmcu-0002E6-8t for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:12 -0500 Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-5db6921ad3dso3267259a12.2 for ; Fri, 17 Jan 2025 05:43:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737121386; x=1737726186; 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=aBv2PMpv7wLfaY8LQVmtPxp8duzrePMVvgjGXUc6BNI=; b=gLZlRaGJIsFYmAeg5HQCy/jm5netThD/fy4jGsGYl2tnZbl9GvBuvXOtodWVRbotOV X5wausohTMsLTSy3969SrkyvwkSdj27oEIBy1CSp0eqnrH9+JrXfb7MZ0w6x+4xyvuwL 7jGKvn2MAllMaysNcV7LcjFNFoZx3Ru4/0DSPKV3K7DFrI8tCPCW3Fk0uUTIJg35ughi 0SKYlPP71ALpDpruZ8xjbu0gnjwEz8wRHJBOKdzPHw9WbPdTpD6NpVDB4qUcSRfuns50 /76aJcxK8TXsPBeciRDmMyuuahtsmxW5etSn9hfSJoR2g1d+4gY3M48MSeedoXFNQWAw q5/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737121386; x=1737726186; 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=aBv2PMpv7wLfaY8LQVmtPxp8duzrePMVvgjGXUc6BNI=; b=TFBnBo3taG/+jtxeYbDB+cbCVwB6XUehRonOYCWgTAp0uYZr80nDQa//fXM8YVomMc rLXt8zurE7m/q8Ow8Mkl1n26Kb9+DPrHTT9zbEkz2tJs3Nq1+UhGfsAmjzWh0jnQuzh1 aZN5PwKyvXzfxZPwHCh+HFwgMcvKlupmSo/SLtsH9EqYwaRMPD2q2QRHnAMbAsyxSl/P ahHMUnn58W6xYPioY6AU3SR9L/Q3i4MC3nvzr/E3Omg9lnkzig+oEMA0MwdmSfWARXHD KOJcRHtl1Qi1X0vc4QQ1YLNU0tGmhhhMjMI0nd4Dt8B7eTSWh4bidCt3hvta+cxvygH4 I/+Q== X-Gm-Message-State: AOJu0YxMcxRD0pZeMl6F1xAsQ8Nbg9dXJkIIlBTxr304UPaq2WWNdh66 Pyvsuuj0nriGHcRx6SaSbmquLuZ4B+MF9H9nV45zAPAS/5RtDyrQu0t5yZCUIPo= X-Gm-Gg: ASbGncsc7lIant2y4AI6q+ZEmcZNbZeyqluUTQc6ojLoH9TGo/e9ri5Cbd2zAKQ05LH rLQiDR9C7/yY0AI+KQcW7k+j7cHNXdWK+9cqYF2YVsxFR05HAGMxW7bhc8TCzbycpcJdULkl22C CyhWTOlHa6Ilyj2IlgpNivCOlIhpiYf7XkRgQERyi4iBDTK8YA1M6sY06uuYIbtENvOEe4j9pYR Q4xTSAtjC7XUAUx+zoGBGHYMuJ12JpLTD54Oa3htTORUQN3n6JJ4Io= X-Google-Smtp-Source: AGHT+IHT5NlwyUpLnZb80925VL9OQXZm42EUK/Vud/2Gkh+7TcbE3GNWOitgzFVfG6XrMx6TVlywjg== X-Received: by 2002:a17:907:7e92:b0:ab3:3b81:876f with SMTP id a640c23a62f3a-ab38b1b17dfmr274869766b.4.1737121385967; Fri, 17 Jan 2025 05:43:05 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab384c74cd8sm173350166b.3.2025.01.17.05.43.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 05:43:03 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 531DD6084C; Fri, 17 Jan 2025 13:42:58 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Alexandre Iooss , Mahmoud Mandour Subject: [PULL 15/37] contrib/plugins/stoptrigger: fix 32-bit build Date: Fri, 17 Jan 2025 13:42:34 +0000 Message-Id: <20250117134256.2079356-16-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250117134256.2079356-1-alex.bennee@linaro.org> References: <20250117134256.2079356-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52a; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x52a.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 Message-Id: <20250116160306.1709518-16-alex.bennee@linaro.org> 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 Fri Jan 17 13:42:35 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: 13943324 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 42EACC02183 for ; Fri, 17 Jan 2025 13:44:01 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYmdN-0001JR-Rf; Fri, 17 Jan 2025 08:43:37 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tYmcy-00010u-7d for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:12 -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 1tYmcu-0002ES-TC for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:11 -0500 Received: by mail-ej1-x62a.google.com with SMTP id a640c23a62f3a-ab34a170526so292284866b.0 for ; Fri, 17 Jan 2025 05:43:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737121387; x=1737726187; 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=wtbti+nfIC33MIZ1eYW+qTFtToL57v/F5KN9R+uVCLw=; b=vu0SOSet9ldPkOTJU6GXws1FUpz0D37fktPafwMKpnqIxM7xyMtqTqzS8NSm4n/ObW +bQSSmC4+y3IJGYEXMNPNMeq/GKv05zaYv6iS+8IFxz+tdyda4RmpUj+22yyM6XjFa5v x/2qrBNsOSCTRX9hL7XACCoE8+fHvxq+3cs4GQ6o5fbkGxSYkU79JPTGd0I8yDCOrMxp BZhJ5u/tQCVSuXRT7zNrMoinlcCeVQ9/kZGGrMC49/26afoypj5KqiCNI0F1dB4Sig+8 +H86Hrj/oXfc2n54NjMMRAh/UWDbjHpmsGOIBGIFaFT4bzbqwKrpAgEdK1YEZZhFBq1s IwQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737121387; x=1737726187; 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=wtbti+nfIC33MIZ1eYW+qTFtToL57v/F5KN9R+uVCLw=; b=SC2Gw6r4zh2uYMiZkw3cnVHrztQrRRGkI0yeLfzmZepSYcPTEQ7s4W+Jy75acsT3ww 9HVzG2wIENP3/cApwI1EFOJDq4NUZ6RbfCQtTs7JTQu6vrCICAkhhPpTImecLDCuUa/r MszH6IMCpm/4hGiLq8Jp+M7fSjgEh6lfjPCCodjB3F74ue7PK+uiW67AgIfiuzTN9S0M 9KytZMQ0Xts5sBkEL9s2wOMdaIkdvxMdJ22VwGDd5QZefyU/ggXQ3pAsF0997vmA/LYe lHYxOPZM78BtTFnjNpLTulLAVLNs5yv8Qs6jrSQzmCPZA8s1xEWxfiWLDJ477fJj4vOS bHng== X-Gm-Message-State: AOJu0YzjoVeMcYJzQOxrS3ND1vTYNQ9vxkXHtOAkNITbZQsormoF7w3N JUzGw5hfnd2r+7CI5/LRNuVP0UtPKvPnRQ0l+m+bG01EOKzIf+pYcM8Tk9WU0c0= X-Gm-Gg: ASbGncvgI/Hj6kwF0D0RttlI4K4vcGtQpOm23hpwDlAHjfXgZ19vcJn6gQxWlqR4MXK LA3vh2L1CzwQssRF2tja6YeLrvvfv2vyYuxvJaQFkrE5JvCRwfVS8pk4IuNCWmXZrxOT0irabmc k7ghfHOW9Tx8X+RAI0f1goIlvgpa2YlxoBxJZTFCkR/D+qktItbdEwaYA2SpifitiSNk2pnXVft gKjRNvhJpV6fh8A8d+q8uc4LJHSGL70AmkEyxtpmCutdx1tJIqNh1Y= X-Google-Smtp-Source: AGHT+IFwDFvhwSHZSrE/hyV7sM7BvEZbTOwlzT5La5owbhogMfKBcNgDJo/WZWE35T1fm/Q1eai4EA== X-Received: by 2002:a17:907:96a5:b0:ab3:6734:99da with SMTP id a640c23a62f3a-ab38b3841d7mr255257566b.37.1737121387499; Fri, 17 Jan 2025 05:43:07 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab384ce2295sm175622866b.64.2025.01.17.05.43.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 05:43:03 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 69A34608B4; Fri, 17 Jan 2025 13:42:58 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Alexandre Iooss , Mahmoud Mandour Subject: [PULL 16/37] contrib/plugins/cache: fix 32-bit build Date: Fri, 17 Jan 2025 13:42:35 +0000 Message-Id: <20250117134256.2079356-17-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250117134256.2079356-1-alex.bennee@linaro.org> References: <20250117134256.2079356-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: 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 Message-Id: <20250116160306.1709518-17-alex.bennee@linaro.org> 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 Fri Jan 17 13:42:36 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: 13943330 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 E3416C02183 for ; Fri, 17 Jan 2025 13:44:37 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYmdM-0001Gy-Ap; Fri, 17 Jan 2025 08:43: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 1tYmcw-0000zm-Tg for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:11 -0500 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYmcu-0002Dy-81 for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:10 -0500 Received: by mail-ed1-x535.google.com with SMTP id 4fb4d7f45d1cf-5d3dce16a3dso1065104a12.1 for ; Fri, 17 Jan 2025 05:43:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737121385; x=1737726185; 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=zp1WT9YSEVD+JiobR2XNVwHS259ESWVfvYJkMEpr24k=; b=tiMTOEcaNlqmjOTANFWEHUpKWBRw5+j2mIwQmF0WYgH4G4Sat5hI2qQ+E1j8gko/cw FL2c5c5Kt4qudVkPejUSN7VKQmhA7Gm45JejIwIm+qJIdmxxQfM43Z2W/o3lhTwqbmEE TXF8T22zTKoorXiQ9KB8CFSi7n/rzGlMyTAP3zIuqjqmVC5A0ZyMBKu9WQIi/WsBA5bM Dx9IEgN1pFtM95q8zkHcYIvosgVaeZlyJGdB1jarLRLPeidGqdkCPgE2YXKOHVz1yfT0 O4PtubUE6oXNJUzv2wSpz3zR9hLzjyWQxSa7sUbsEArB4itiDyZTcI7ulinkf3jdtgZ/ BdEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737121385; x=1737726185; 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=zp1WT9YSEVD+JiobR2XNVwHS259ESWVfvYJkMEpr24k=; b=Ocxpy5kc7jHVz7lcbsoh4gRqs3eZhoSRXn3SfI/TCnYEBJyEKE6QvQ6UBwDvp4+Rp8 896S4+W7gHf5MltKDKS3T5Bth7+GO+8Fgzq9Cym506tziIH+5b5o1TwWTNl+dGsW+qQM v+uiYhI/sIGN8ngKBllej+rqmB97UFf+7+SLiy2IicUEcG8biuXg8XbYd1lD2RxpVJnV h5tU4eI7c/In5g1azm3dGEAkcMVxaZcxIYVMYl9TW3W3LSf8FL6wGz5iAKjGNn23wZFh uRZbUxFFEgI4GWABYFquIYcdEgPHA5ElpqsQ1u7fwhrhGa3m76TOBb6vhl7RknaciqVu tLsA== X-Gm-Message-State: AOJu0Yz0vwlof1/yCgcm6iTFlSmudlbqpbgbcg6Y/MoAkFtE0zZlL6H0 YcewtwrfoCLGBNLoZ58j9ZnfNKWaJeL0kbr4csf5cU09MZ7vNIXFghranakCgW0= X-Gm-Gg: ASbGncuSTAqjiPkir8Sr/Lx8z8mGnlb3eAL+YgrSC7ndXc+V/eQYYQkg9/2ZgocsoFX eABxiI7V/ZZS7N/BHh1RrXYdc+XQz+n1cOTZ5ptKNUsDh/5Tsgnxn7UUr0hzFgn+Cxn4c539Ai/ BrNXut1S5c3uN+mjtY+Aw0RyXXArvXiO//emutxvLuK3bxeR88NAqcC0Wa/ggqd6VjXCjSs5XU2 49Ve8uJWOYzDn4XWUmHybBcPo5UVT30MTcmOg18xv45U91ZvdL4kWRcNuWoA5lKzw+R X-Google-Smtp-Source: AGHT+IFqcSu33mVpmJKPtAo6h6+TUiVl3S1D8RpBxPkxNOKol8acRgxO0L291zqOrWJsLaGhx4hOHw== X-Received: by 2002:a05:6402:5188:b0:5d0:d06b:cdc4 with SMTP id 4fb4d7f45d1cf-5db7dd0c8f6mr2075132a12.15.1737121385256; Fri, 17 Jan 2025 05:43:05 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5db73642c1asm1487113a12.5.2025.01.17.05.43.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 05:43:04 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 80FD3608B7; Fri, 17 Jan 2025 13:42:58 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Alexandre Iooss , Mahmoud Mandour Subject: [PULL 17/37] contrib/plugins/hotblocks: fix 32-bit build Date: Fri, 17 Jan 2025 13:42:36 +0000 Message-Id: <20250117134256.2079356-18-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250117134256.2079356-1-alex.bennee@linaro.org> References: <20250117134256.2079356-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::535; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x535.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+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 Message-Id: <20250116160306.1709518-18-alex.bennee@linaro.org> 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 Fri Jan 17 13:42:37 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: 13943341 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 658FDC02188 for ; Fri, 17 Jan 2025 13:46:28 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYmdO-0001KC-A1; Fri, 17 Jan 2025 08:43:38 -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 1tYmcy-00010x-Gz for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:13 -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 1tYmcv-0002Ev-NY for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:12 -0500 Received: by mail-ej1-x62f.google.com with SMTP id a640c23a62f3a-ab39f84cbf1so8394666b.3 for ; Fri, 17 Jan 2025 05:43:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737121388; x=1737726188; 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=LiXe8STMjZ/F+kxQHLyLYOsg7/4BbTiTdjsaFjR8pnU=; b=J4+PKZNrBMkMZKJdWqT+lRuU7hKImRtkkAfJ2J4v20tnA2knEYHUWoAUXQB72l42yt v+ilVvRziKNi7A+vh+ke5RDpHzDHxRWLgdLCzzjkxn1L8wfITBidTns/5k645+6UOScd vU/T9jlT3WWqug7k0U33EAxcKmvEKQLXjhRO+NrsUmhV/FomggXcKEzJIgVcfy4UZdEi kPlvqw1+lV+9vjRwdIBPOnHxlmWxZ3p7fljGgnlGPjPKGk5zT0H/A4GtGfjPQ6RxT/jB cVKxobhbCMEuZiVMWJJLWupSXGDBzfueJJsYf4fVrnuOs7FOmxd2tAPOwxj3sJS6uYes C+IA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737121388; x=1737726188; 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=LiXe8STMjZ/F+kxQHLyLYOsg7/4BbTiTdjsaFjR8pnU=; b=ZcFM9yzQ+x4n75HjnU8D0KgAp8XyoBlPn2zaXNvbA80lmydAsQYDzBzKyFrYytgte2 HIfAjYNNITwdUn/O+/qYYdcztJEdRB27nJlvZlqfO3cg+DwUYjEtH5soTZeuHNcKSl2E enBsIzAhFpOmWIiU8hY0eeu5jMHhvlASokp1Djtnlhf25HAOe36Z3An+g9gSmGvWzKLs DyhNSuhuDtKOzwMJ5VBj/7Xs/Mp/JekiTQrBd+Mf4XKMHnD3qi4yxciM2onyqaG3aSuC oMSgfNOUoKNYNCsJNo86fOaVnAEtOxPAVYu1NIUm6yh8J+yAmd14+oncg7aa2SrV3d48 FBFw== X-Gm-Message-State: AOJu0YzakgO4Ay7tSIaNIDOKkBRLbSPmD32AG25RGLwfKmZyoDhSmegb NVUdMhfkA+1d1fWdqP/lJRq7Sh4ElxR5ngz/G3kocZNaUbaAHSBDKLi5DLUcvkQ= X-Gm-Gg: ASbGncuyTR3Elm8jOcmvD+MBS0vTf7fI7jNXnTFo0v0Hb64dOqi9eY9lMSMGLE0AYML BHt3q4hNVgWrq8dSYGb1x+vpwa41haFppfZtILHT9DAxG/SXGeHyPOZ3etWIMD+q9iAatEvU7WO DnnQ8jufg/iBudBaMpCmCvijCiJKPMdXMtMetxuAsQC3twBJArjBRWJ554VGZwZZv8lJtghEGai 7yW85PFHubzlh++Dpy10aCxMLxP8dObSW3xd/FtASLVpZ9XRzCk/9g= X-Google-Smtp-Source: AGHT+IEN5n82hptquB3NRYEd4t3U1UsYOBI1zv/AsqeQsilEI7ArhLP0ncotOkDSpcDDkh2e0LaDbg== X-Received: by 2002:a17:907:c0d:b0:ab2:f5e9:9a39 with SMTP id a640c23a62f3a-ab38b15d2camr244111866b.23.1737121387859; Fri, 17 Jan 2025 05:43:07 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab39aa6a7besm38099866b.68.2025.01.17.05.43.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 05:43:04 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 96939608C2; Fri, 17 Jan 2025 13:42:58 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Alexandre Iooss , Mahmoud Mandour Subject: [PULL 18/37] contrib/plugins/cflow: fix 32-bit build Date: Fri, 17 Jan 2025 13:42:37 +0000 Message-Id: <20250117134256.2079356-19-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250117134256.2079356-1-alex.bennee@linaro.org> References: <20250117134256.2079356-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 Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier Message-Id: <20241217224306.2900490-9-pierrick.bouvier@linaro.org> Signed-off-by: Alex Bennée Message-Id: <20250116160306.1709518-19-alex.bennee@linaro.org> 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 Fri Jan 17 13:42:38 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: 13943353 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 513B8C02183 for ; Fri, 17 Jan 2025 13:53:43 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYmm1-0002Vn-05; Fri, 17 Jan 2025 08:52:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tYmlw-0002Uw-9w for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:52:29 -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 1tYmls-0003lO-Ip for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:52:28 -0500 Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-5d3cf094768so3717321a12.0 for ; Fri, 17 Jan 2025 05:52:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737121942; x=1737726742; 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=JBfBDXCVyBtlkqh3uo0WHdnPDpdgRN/7dgUNkr6m4ig=; b=oYdEr0tLeIXa35+ulMDHAwtOtYBuxz7WiPOoENlZgAARDbkyQ9mhCcLvKVq+D4NNcA /VSFbYKrV20DLqr7pov4e4n8hRcaqnVz9VtnY9fWU7OeFp5hZfot0mNKkKDALFFLAkig 302H4JK6nJMfuETnnJ/IVKVT719SEM/BKxIrkB0FRLV7zJeDLyjPkXlwAxpyH0tJ6o3e HQiFG8oKBJ1gstEHNhPLwyAd5jFzdAV6ZnKbVq0xGM+3Itb/oT/RFAW/Klt5GcBODpq/ SNONLIqebBq2fTz+A74cZmg/lXyKu5Ds+IS1R7yADdulGPpuNR5GrlR9jssx7XH2QmdT 29LQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737121942; x=1737726742; 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=JBfBDXCVyBtlkqh3uo0WHdnPDpdgRN/7dgUNkr6m4ig=; b=Zy6BywZ4dCgdTq9/Xh7qaYYLRlDYOYqFMaBFk57mkQZuDUmxGm0SNL8iBMLKfCj8FQ SwGZPKcyroJr0dVV1aF0RDJoCVaYs6Vt66ucJ5tXyhbJkjstWf54nUMKsQBqjt+B/pYF FcGA4U+NzdLJR3ND2S8cgj1FBB234RQKWk6SbD+RhrC59S7ObSol++FVOVehb05t76r8 FyYuAy79cXcbq8gWe8sUU1UMQ1qEBuLE4tBx0CmRNtwoeNfw808clU9iRA3cPxCPTFX9 QSXrC9QeQcEScqAoSWUhQsB5AuedWtClSVPnPDzFeCFgKCngs5S0pEPT3GMMDlcE3eoE AkFg== X-Gm-Message-State: AOJu0YzC9hUFPW+zEaREaEKmUwc0fh7ibBeHgpFxLgsZCnmqJSOag22v UH2Lw282Aq8rf3+jkFV1amg6oxo4U6hx6ZhEzHhRw0T6MKbaRM5sCFKtfBhOY/E= X-Gm-Gg: ASbGnct9e/IsrzyEOxDM5VSA50cxD4s2gTwz0tI7y59uWGtS2eXUoewMtZJN1b/pAAK Ii3YFH57UxediMVG8FUxesih+GjZlMFHwyyrJTzccCymWE/nhe90RMhkQRzlQ9XOGpvJQ3f3e/g v324tyvk6oDUeQMAkKwM6y0CYJlPv7WCz1Se3RZoDv/km1dFYoLNDZqacAVgQXYsmSwWJUgoyE+ 0ULuvKVkRI2xgdyoxXS7hOkYr+wbUwBz3yArZXa8qOT5SNUDpmhXtA= X-Google-Smtp-Source: AGHT+IE+w31ZcADARboEYhGfhBhF94IenOA5NPWXTkrCLoYjWsiIZWCk01l9C0XQpdim+MeRoJKw6Q== X-Received: by 2002:a05:6402:2695:b0:5da:d16:7378 with SMTP id 4fb4d7f45d1cf-5db7d8271b8mr2176781a12.21.1737121942008; Fri, 17 Jan 2025 05:52:22 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5db7364272esm1484346a12.12.2025.01.17.05.52.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 05:52:19 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id AFCA1608C3; Fri, 17 Jan 2025 13:42:58 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Alexandre Iooss , Mahmoud Mandour Subject: [PULL 19/37] contrib/plugins/hwprofile: fix 32-bit build Date: Fri, 17 Jan 2025 13:42:38 +0000 Message-Id: <20250117134256.2079356-20-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250117134256.2079356-1-alex.bennee@linaro.org> References: <20250117134256.2079356-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: 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 Message-Id: <20250116160306.1709518-20-alex.bennee@linaro.org> 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 Fri Jan 17 13:42:39 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: 13943358 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 DA8AFC02183 for ; Fri, 17 Jan 2025 13:54:07 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYmm7-0002Xp-KA; Fri, 17 Jan 2025 08:52:39 -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 1tYmlu-0002U3-3W for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:52:26 -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 1tYmlr-0003l9-63 for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:52:25 -0500 Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-aafc9d75f8bso358460566b.2 for ; Fri, 17 Jan 2025 05:52:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737121941; x=1737726741; 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=HRiHhaLYBl4Bm0h1nKMlemFfl5RZURyn+9H5B+rbcjY=; b=dR1vsnJksfrQFFEocKj3D7Lge1afFj46fFtF4NaPbRLOuIdghv+a/mMEwOYpeGTGfs +UArTt7EHBNFAPGLOkk7B8joC4b/wsjA89xU5OJZaoKDvEUtqkI+upkbwag35s+TQK6B mSKtv8GDDZH+iQXGV6IG9mPgXoCfjRb5B2BThVtNfpD+j47s32khYa5GTObtz4n1KpGH ULcxyg8cQ+0XR2EXau1SFij5blM/q0Rq6yTEW/8HhTJ0kJdvh9wH9nzTKoZAF14OAoK6 nQyRGUHk39qceknFAPoY8J4FHoWpGEgf+9PBaxtqImaxnuvcinjUF7ne1O7QFqnvvl2X /QCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737121941; x=1737726741; 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=HRiHhaLYBl4Bm0h1nKMlemFfl5RZURyn+9H5B+rbcjY=; b=Or4imgKsp2K8bGgCabnXe5JW5H/9GJOsiP0JS+vmP5Y2jzChS5WUhiHDnIqgtgI/8L LVvNT4gXmhdZHj06FUtfn+FekzKUgV8ptcxUGbFBpujMwAhsCq/dhGjMMyk2Yieq3EzI uPmBzBdlpM7tQl22FeS0IySrHc0Q8k81vhgJJzNljmkp7oV+irbtDcrncR9DCNtMnDVO mjgJRhge1trmTxtUWUM9gdTcnnpH+qPYMWVf72iVWhv0VWd27EWDgI9+7GZMgucDiRl9 PcoFYtL8TvXzqaYYOuEI+712Y3ZsWuau4O8MX7snan2PWYRyHsiejOiVeb2c8dp9ImTM aq+Q== X-Gm-Message-State: AOJu0YxG+eO/Qs1sWVtglK+mHzr6YQ5JJufC6vhx5C+glnY1mrU2R7xy REbMzfQNhYr5iE+KNwDWVS9cOeVmzf9ndCN7oz/mjN97hVrtfcRTYtmIAo8kWcQ= X-Gm-Gg: ASbGncuKWB914mTQh8E3GdRIzHYNtiXNZElvqyGJZu2oY0NCwDer53lv95bNdxUHPdw ewl7NOq359Hy39OhzYNw7W3Du4pNb3ZyagsSWdredxp5S2PUCWH6F8CUgRI+Ru/r2HbP/cgZmul YoLV7brA+ILxXMTH76KOL/UtRxFHEWXVEYmGzwssGl9cFDra+1BHgXZxVOWvWTySDreGrUDNBzs AwyUvxAWwVOepXavWP+xBpjeCdJqXDiP+HU3+T7aL59cHNwsE8WKQ8= X-Google-Smtp-Source: AGHT+IGBU2gZj62OooOyL2LwKKAxLzoLbRxHfdnv1hsAyXd4xpeAGw5ysRTw7wB9KO0geXRYWBNmkw== X-Received: by 2002:a17:907:9408:b0:aa6:a87e:f2e1 with SMTP id a640c23a62f3a-ab38b4b96d0mr265629666b.56.1737121940714; Fri, 17 Jan 2025 05:52:20 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab384f8afddsm172613766b.156.2025.01.17.05.52.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 05:52:19 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id C78AB60853; Fri, 17 Jan 2025 13:42:58 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Alexandre Iooss , Mahmoud Mandour Subject: [PULL 20/37] contrib/plugins/hotpages: fix 32-bit build Date: Fri, 17 Jan 2025 13:42:39 +0000 Message-Id: <20250117134256.2079356-21-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250117134256.2079356-1-alex.bennee@linaro.org> References: <20250117134256.2079356-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: Richard Henderson Signed-off-by: Pierrick Bouvier Message-Id: <20241217224306.2900490-11-pierrick.bouvier@linaro.org> Signed-off-by: Alex Bennée Message-Id: <20250116160306.1709518-21-alex.bennee@linaro.org> 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 Fri Jan 17 13:42:40 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: 13943343 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 2EA8EC02183 for ; Fri, 17 Jan 2025 13:46:38 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYmdI-0001CB-25; Fri, 17 Jan 2025 08:43: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 1tYmcz-00011R-Fq for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:13 -0500 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYmcx-0002G0-9N for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:13 -0500 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-aaee2c5ee6eso372172966b.1 for ; Fri, 17 Jan 2025 05:43:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737121390; x=1737726190; 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=Gjr3Ms2PP/dAfR8/IA8j7EUzgU3XB+6Gxoy5+eUAxmk=; b=K86Q94B8yXzrZsUNrYh0pJfwzEo+56/B1QLiR1c3CIgqtnuplJ8NXHtVp0JZfxczmh q+gYVDtVe6Xj4ak9fLu2gzB2ChR9aKP6pjY6p5cOx0xmnDkJWmUrE2s5mFqeTLWRp5Wb +jumwiUfzot87f9aemM9mcq4Bo8maQQedKRnh2+StBm9BEE38BvTEYuGp31mG6voHfwV ayOcs9EZyHqQlHS7FuOafeqONCNXlfswN+P///d80lCIahqOuCxkK5VY/lp9lph1f1w4 ioYPcKCPtP3slJ0+q3lGQsqyfe8QxYXIEw+FmBD5os+UyGWYcNM0P33iZ77ssTxZrWdo +wIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737121390; x=1737726190; 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=Gjr3Ms2PP/dAfR8/IA8j7EUzgU3XB+6Gxoy5+eUAxmk=; b=sH9nrPyh00y43LxvImlT3nfV+CiJUh3Rr3C7AgAlMfgIXE8X7UL3teWUfrF3bqJpsl ayMoCSbUrhuEyEGrDeb9qiApEXiJu1fNaulq6VGpojyuqRyhrbubGBNgyDao8X2vqA2D h5rNzXtiG+FvQSpWve9iPv2lwACBbKnthal7+FU0LLml3aUXHny3+x6oJaty2hw1XSZB ruerj8m0cMhKvmvpFb3rd9eKblUlp8lldDwqlfWdL2JmA9Mj8H6Xb8f0o3t7Au/BWz9u 2g9gs4q3haU8DLsLGUPcJRKACsJvS8vhsyE5G2RHJW0Wa41CtijVk71R0ZgSYbblG3YG +1gg== X-Gm-Message-State: AOJu0YwAWWghd1sW2ZQUsIlYVqyJYl2Oa2FAnPHVM3V9Zy2hsGuDq8cA zv4o64+oj8QOVHJeqHpBApyNPDSGdCmwo0bBSlQxNQE4nNVOacIhLb+UE2PMMnY= X-Gm-Gg: ASbGncvNRBz+dkBDHStH0D8r9P8b1819f9C0c+7GlrTstkLKUZtjEZoYmhFLXAZYxSh GyIXI4yvI3M0+HcB9CB0FGdz7WegrF+sl4/ZkNAjxaoxP5+Ptij1fjiPG8/ych04oUHXO7HDLdJ ByKv0MdDhIy4hHE+v+kxfbEaczBMXsCKhNPu7tvgkKxfHLBd9QagrGPcw+ED4oScn3HGu4On162 q2xsrY+vn5FIFyw9+QkV2z+Y+fd8/ukGGwspvBkY22gRAYEHOxwmLQ= X-Google-Smtp-Source: AGHT+IE0Z2gv854DsPXL9X88yDyprZKNV9pq2uTQ4ePLvMkhQJwzrLeRkG7LilvDSInqJCYp5/hOfQ== X-Received: by 2002:a17:907:706:b0:aa6:5201:7ae3 with SMTP id a640c23a62f3a-ab38b3b23e1mr291248366b.40.1737121389795; Fri, 17 Jan 2025 05:43:09 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab384ce20fasm174368966b.66.2025.01.17.05.43.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 05:43:07 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id DC2FD608D2; Fri, 17 Jan 2025 13:42:58 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Paolo Bonzini , Thomas Huth Subject: [PULL 21/37] configure: reenable plugins by default for 32-bit hosts Date: Fri, 17 Jan 2025 13:42:40 +0000 Message-Id: <20250117134256.2079356-22-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250117134256.2079356-1-alex.bennee@linaro.org> References: <20250117134256.2079356-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62c; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62c.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 Message-Id: <20250116160306.1709518-22-alex.bennee@linaro.org> 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: 13943332 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 4C1D6C0218A for ; Fri, 17 Jan 2025 13:44:39 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYmdq-0001lV-FM; Fri, 17 Jan 2025 08:44:07 -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 1tYmcz-00011Q-Fv for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:14 -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 1tYmcw-0002Fk-MS for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:13 -0500 Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-aab6fa3e20eso399602966b.2 for ; Fri, 17 Jan 2025 05:43:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737121389; x=1737726189; 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=z0X1Y4uYNu2Kk1P4je8Zch9rD7a4QSWs3eQqhNJ9Els=; b=WSXGy6rKTuQg8jBOZr8u4xFDqX/sr8RI77MdPZAS1jJ+FH0i6SVeWRXAj04fn6CO9o QHCI7JXskUKqmjwQVNfbKIHCAr5KPOZfbtAClIRXaUOJKs7cAOe15lPGgeQ/yfJF0aGy sghKEXHk/i20y2T8kaqiOh7VGC2NRDxAsiui+sZNflLfRZykVny4QRPkydSAgE1FGjXI rpVKjN31MZe58hg7sUt6WnESMcG+CUVEfYnIDP38UuDauvFONZkuufN9FZIGZJM0ES4h LJQzrJ71beoHDze1aBB4jySEHO2DYnbF4FG/5+UsfwIwZjNhkwNNp87yWu/JzTCInFhD oBbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737121389; x=1737726189; 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=z0X1Y4uYNu2Kk1P4je8Zch9rD7a4QSWs3eQqhNJ9Els=; b=IfflOKRSqEncFolydzx54hPG176sik/SX2mCLNV2WEyzpisA7sSwIOynnUYnVnQxzM b1yLJucMLICZr06Tmxrfd45P3PJd39m2j4tK7tD+/ar3ScY5Ft5J1mQgxo8W2NcrB0Aa yAGu7euSLJ2AndPVwep41UiXgA9pDpbghbBkAVSVoHkeW3tCxjHQUZyG3msxlK05Dv2N SsK4lpdZdW3u0WKZ/j1lgUJwy3fJmRTda6oc7aUNzwcz6DeRO5WqGiLIOWQApcgyphgm DYFFmTG6k3A5vPhT/9akt+UFi32bNMSrXIkIEWp00fICo0ECp4RaLWfp9kRobMZrjiwC LTAA== X-Gm-Message-State: AOJu0YyC+udU8hliViC0EM6oNv0JLxqIeEJlDUvChr+uq4YKEnCqSQjx x1HT0mV+Esrv9a8S5OsYSRhel70tvoYK94Y/aWm8wAFX+ojllZPxb/TV/GACfoI= X-Gm-Gg: ASbGncsBFKlJk9Z6JqSCvTTyyCPzvsDkHmHrrcjGAI8YMMDJ7YZwDV9bdJMR+ZQRaAF xuRd8kQcpeCZ+2o0C7Oc733BrqrC4DtaOUmCeAw8m0H/+CzSzanRg7Z6Sd7n7gzsnsA536fsMp0 i/11wQeZ5soCdcoFXGcC5hQaOS5BGsJQKfas+fLGIgYe0IRbnMRgcDK9ZBVcXPdeg0h5J/JsYJa Ku5Q5vcQy7SFolF9l/aXeMeOEsxAPo7IF7+ONnK2B7kN+3tECYgoJk= X-Google-Smtp-Source: AGHT+IG8sy+wJlhBjrnXX1CZ6NQTsDMJtl2oBKNY49ZZJlbGCk0pFKvlNmvGvueZQYCYOiD4WUkToA== X-Received: by 2002:a17:907:86a3:b0:ab2:db7b:5db3 with SMTP id a640c23a62f3a-ab38b4c8520mr323435866b.54.1737121389093; Fri, 17 Jan 2025 05:43:09 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab384c75283sm173209666b.8.2025.01.17.05.43.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 05:43:07 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id F114660858; Fri, 17 Jan 2025 13:42:58 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Pierrick Bouvier , Julian Ganz , Richard Henderson , Paolo Bonzini Subject: [PULL 22/37] accel/tcg: also suppress asynchronous IRQs for cpu_io_recompile Date: Fri, 17 Jan 2025 13:42:41 +0000 Message-Id: <20250117134256.2079356-23-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250117134256.2079356-1-alex.bennee@linaro.org> References: <20250117134256.2079356-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 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. Reviewed-by: Pierrick Bouvier Reviewed-by: Julian Ganz Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20250116160306.1709518-23-alex.bennee@linaro.org> 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 Fri Jan 17 13:42:42 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: 13943329 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 DC615C02183 for ; Fri, 17 Jan 2025 13:44:23 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYmdU-0001Mi-69; Fri, 17 Jan 2025 08:43: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 1tYmd1-00012Y-33 for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:15 -0500 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYmcz-0002Gz-2d for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:14 -0500 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-aa6a92f863cso398624366b.1 for ; Fri, 17 Jan 2025 05:43:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737121391; x=1737726191; 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=O5nQGY+sbeCS5yMC9j5SrutOVhuXnWOJMgjZQS915h0=; b=QZajQNUQ+DnTg/Zp/11okea2Mjcx9WgWrEzyzWRxZEeyGdiCMwlmUhC5wV7s0ki8Qp WL965c8BERXupc0t5LCjxcVeHg8EISZgJ/vOizAgcOPvdjZeI6RoD/ZXXGCeCA3Qn1OZ tEIoyjs1aGUZ7iWjWwKNRrryi/xkvn4sg6VWqHI0Oex8fHBh/574Dk32ppX9ZSVZqeGV oKfcQJB9QZ3omNO4ZUVLav4Zs6EANogc4VN5p8CDlbdTpyvyGYeMmHsiVzxh4WbUZVDr 9Liq6TOvIK/6rjxuy76bquqQbY46iiLWIArRZdoQM25OaIM4hm7BEY1qbqwryzw0WU3R PUAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737121391; x=1737726191; 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=O5nQGY+sbeCS5yMC9j5SrutOVhuXnWOJMgjZQS915h0=; b=o9oVH7IpCjWgbEDSVX/UOtiMyWbHpRTPvLYyCDjvUt5UT3JAXN31wsbGIeaa/umso/ NzvxP/WSGEMTzWhIuEVvXgaX5WdveUOln3WZFZGmCziGSaCfxaHQK9PzJyKOo/2V5Ut8 FV1iNO5+ddbV6Rwc5X9GYgZKdukZIv/UkZ/kmycsqsmTfwvorhIOU2Sjb9qDljC1hD4L 4d/XIWgIw5PtvZuAy2KFhnyJRDvhqgb93F/XrpM9nbIyDTxZqywYXO/EacK04cGiH2Zq kT1Ihri03BLJE0jX0xlGjtY92oOPWxsEU/9h4Ha35BFQY9dWbh3YdyFibFnVwJ8Zzp97 Yv6A== X-Gm-Message-State: AOJu0YxEIwWUMVp8IaIU+kE1Yn9iU6utEAbJsM8xDMw70ecIge9R2CyH Kpi8hFNNE5lk9bci63WK3FocxvcU6EZgdcCTvo/Hki1pV3iF2Eeyzq4LqqjPHiM= X-Gm-Gg: ASbGncv6m9CMUwEKGzIkexYha50OBuUg52lPE8zRpkYiGbwtXrEU4C6DSsfM6nWApMw kSsF4IrtIbN+MdX9PkSff/sfQoAsD9JReLrpewjpsjocsmdQtb4UnXciWHjN7le1gdMO7mhiNIi MVLkQAYko+LFM6nzBBtkV4H1ENR25n82BhLpaij4Xp3uWadhHQbA8IX5yP4toODS4cy3kekLuyL avhuPj0ItWffoGiTj5+WazfsvcXGonZs5APLA/9X7Bbgb2VUhc7eHk= X-Google-Smtp-Source: AGHT+IGCdPNfpgDJtPz/ahOLKkFUK4XEW7GUwdcjHc+3mT0LTTg6LP29PDcA4vjcCjgP/+YXedQbJQ== X-Received: by 2002:a17:907:969f:b0:ab2:d721:ed8e with SMTP id a640c23a62f3a-ab38b42e688mr319241966b.39.1737121391459; Fri, 17 Jan 2025 05:43:11 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab384c743e9sm174955466b.10.2025.01.17.05.43.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 05:43:07 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 18222608D4; Fri, 17 Jan 2025 13:42:59 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Thomas Huth , Richard Henderson , Stefano Garzarella , "Michael S . Tsirkin" , Stefan Weil , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Alex?= =?utf-8?q?_Benn=C3=A9e?= , Paolo Bonzini , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= Subject: [PULL 23/37] win32: remove usage of attribute gcc_struct Date: Fri, 17 Jan 2025 13:42:42 +0000 Message-Id: <20250117134256.2079356-24-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250117134256.2079356-1-alex.bennee@linaro.org> References: <20250117134256.2079356-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::632; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x632.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+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 Message-Id: <20250116160306.1709518-24-alex.bennee@linaro.org> 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 Fri Jan 17 13:42:43 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: 13943359 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 C4273C02188 for ; Fri, 17 Jan 2025 13:54:09 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYmm8-0002Yi-TH; Fri, 17 Jan 2025 08:52:40 -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 1tYmls-0002Tk-Os for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:52:25 -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 1tYmlp-0003ki-Vl for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:52:24 -0500 Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-aaee0b309adso345331466b.3 for ; Fri, 17 Jan 2025 05:52:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737121937; x=1737726737; 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=0BAoeWKkDj1LhcqXrH6NGonyyn5Hcg/wwizoEUTfNUY=; b=tpD7VoG4mWWiqyc9zLH8mNOMQ9t+q4HD0cdPwbqdcYlTXD87noAP6kNUHB3wn1CyT7 M484bwGJWEC4+6n8Txt/mzEvZWaNhO9cUjofbdFmg/Id9eKoG1h5AyWVnkd0pusmAcN5 hPrVT5in7uN4dsLoPlmZA6lKFLN4V3Lkq8CheiQICqWQN1T9EeMYRQH6UKpRmOtlDf8A Tg/GZb8//sQrVxLBdfYavcvx8LLSQWLGz9lRgZpE3rB60L9PzmQs49PD/9HcyjzaQSo8 ZKYmF5ZjA2nPrN/WxayurK5y7elHDJdc7pslCaHxpYkNJPtpP4WRvfYuWpOA54+Ujfte er2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737121937; x=1737726737; 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=0BAoeWKkDj1LhcqXrH6NGonyyn5Hcg/wwizoEUTfNUY=; b=ktUlHrCuJAa/AT3yUUH8lWmcZ6fecUlfvDky+24WJbdFmRQEJHahd7Qd5H5TjR7+FK oVq8uQueyOPhBCMAwgusr/FaWJoDYp9LL9GrUYik86HZRhbb0Y/hbz8g/dJB16BTSR+2 7ndtS9hrPrvtlKQFQ+YMUrRhp7sjS+sZOM+0HsqVXbimNu7JfAyY21aPdZRaisLqICcj zDW7GqpY69B3puU3RmBkrSz/aC2bLM5dsE2WQgc196XCVW/PjJeBAMJXyZK71MtG3hlL XiZeu8JrqQUOJSRueJB5ZZRc87vmqb2Ufp9qJP1a9kH0L/PHooTKt6DdA78xYlklzKrA VmZg== X-Gm-Message-State: AOJu0YxP8OoHG51uRfJpoeL1Qk4Hw/jx6bsanF67j4qGol+40L93nip3 zV2TIDH5HfOjhGbXxnNxI9ioahkbczuQf8k60gMstWC8jDuTV8CRVQG7SkrI1Ao= X-Gm-Gg: ASbGncvGiYdb1t3GNDKQAcH9lDyBc+7ZTjhF671fj8N2AS/M5QntITZj9lEA7x14Bho wpc4TR+4rU0JF/O+HKzfCisxi0sQqy+zOw3EPquKts4dQWXbG5xaha5w0coNMnYdIyCFdZdkmSR xllXVmpRwuFwKOOFGIQEZgWDV44MzVfaQ0bAR7ApKLLzSw0Gz/n+8MlG89guf14pnxlcVJ2CTrN P/Pg5nyI2im2kq7PlZN6yqoI12Np6GGFK6TfyHII2fCXX4UIMEdElA= X-Google-Smtp-Source: AGHT+IHpGaDIKVx7bZ+yk4k0+Nst3fsbzUMnoIRYMtuZssslTimVo7FSEPfkTmQNjeKYPmVE8eSMEw== X-Received: by 2002:a17:906:4783:b0:aa6:7662:c56d with SMTP id a640c23a62f3a-ab38b167b33mr273208066b.30.1737121937391; Fri, 17 Jan 2025 05:52:17 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab3999638f8sm44617666b.9.2025.01.17.05.52.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 05:52:16 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 2F965608D6; Fri, 17 Jan 2025 13:42:59 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , Richard Henderson , Stefan Weil , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Daniel_P?= =?utf-8?q?=2E_Berrang=C3=A9?= , Thomas Huth , Markus Armbruster Subject: [PULL 24/37] docs/devel/style: add a section about bitfield, and disallow them for packed structures Date: Fri, 17 Jan 2025 13:42:43 +0000 Message-Id: <20250117134256.2079356-25-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250117134256.2079356-1-alex.bennee@linaro.org> References: <20250117134256.2079356-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: 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 Message-Id: <20250116160306.1709518-25-alex.bennee@linaro.org> 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 Fri Jan 17 13:42:44 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: 13943352 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 F3CEBC02183 for ; Fri, 17 Jan 2025 13:53:25 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYmm3-0002WK-Re; Fri, 17 Jan 2025 08:52:35 -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 1tYmlv-0002UV-B6 for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:52:27 -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 1tYmlr-0003kz-2z for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:52:27 -0500 Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-ab2c9b8aecaso330535066b.0 for ; Fri, 17 Jan 2025 05:52:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737121939; x=1737726739; 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=+DsD0KNZtCjKGcEGcvgtBm3TE+kh+pIdctH3xrF6qRk=; b=fy662R/vjX5rwXPgvCPjKyCvfYby9SmriIUm/DHPb4c9/8tVxa3wUWwLJ6aSFUnNhz aPKl1CIrIvpSBTpoobRBHmadEFhq2eX/r47R7JU6KoClHS3lbFomlFXYZXgGUpNE7Qhu ualMixRx4FUbV80bOOqu9Vfnp3EJnQYBcgNRTMair4NITrQlyyr8rKHI92VhktNX0bpW /EPngm6zhvCoTAdpyiqbk4k3KZNDizwT8T/Vg3d54kYdruuWjA+iECO4j9ERnpQkYSKf gphjpPqHB9qZRBHtjqtYi6rO4S+0K26URpqzMW6uDzrKNLfKokcXSczdj9S9vDdFJ6y5 px1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737121939; x=1737726739; 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=+DsD0KNZtCjKGcEGcvgtBm3TE+kh+pIdctH3xrF6qRk=; b=VHKA/OqawLRtZy438kW+BrCN96DtJEgSyqwpHVOUPcH5ofciyiu79ahXLWXt3RFa2+ Ju8e9iIjOFBwRhskGSaQOHhYuRgxHQfJhGRUGGodEfQT9Hlid6Hc+Xd6xBjkV/6XYpMg ZmVq7Fasqqmt03XWPC1PT1vXVdF4pUCVqDkdJ22NqzYSS2mmSEjpefpSsmZH/fLDqMFb y4KgvPbhaZNZinJz1uVgjxIzOFWvtIgYgilLjAd9AVRrYRXdsBXSoFoAY92QmajSZdn6 FWLXSn7BXFj9bAvEHgjRyfL1N2Y85bbzo1iNGP6lo89ZZOq6vaMt+Va1bAZSqOVTOZ2n 967A== X-Gm-Message-State: AOJu0YyZM/ttI/LdQIbv2cwVpsrGHoR4egwF9uNX80s6bgleBKCprI/i gS0PMlDmbD4oTd0gaV8MJJgjlrgp91JqS0U7pjLSASuCYqmq6gDGRJvVgpZCU4k= X-Gm-Gg: ASbGnctRQMr+y7z9DvTRsNwwQ///mDMbpI+vwgij2r/VmK44neRHlN7DIYh22zIqfdi B5UHfEq6bs7vbUDW7XnOoTkOM54KiM0gve2xZvN2qXNBBuTlQJR+Gsx6I4rbI55P/Gsuba+gdwx z2hqWcPRTgqpohrD13E9xYqwER6jBB8X90Y0dkl7Vm7Gt9cHhwGRV4p1IGfRYDGtrhE5afP7DcC /NMG2Lt969Euy7nkFQTH6Aamfgltkqmcyk/jIRvzBq1NvYRkuVXYMY= X-Google-Smtp-Source: AGHT+IGj8DyFJ+DNPzjQ0BI2My3osml72k4v+m89Ojwq+r/dL1UZJOmlcpnD5GshcjDtFe2BwjRf5g== X-Received: by 2002:a17:907:72c1:b0:ab3:61e8:aa16 with SMTP id a640c23a62f3a-ab38b38134amr322541466b.43.1737121939347; Fri, 17 Jan 2025 05:52:19 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5db73eb59c6sm1482637a12.62.2025.01.17.05.52.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 05:52:16 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 4C1FF608D9; Fri, 17 Jan 2025 13:42:59 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , =?utf-8?q?Philippe_Mathi?= =?utf-8?q?eu-Daud=C3=A9?= , Stefan Weil , =?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: [PULL 25/37] plugins: enable linking with clang/lld Date: Fri, 17 Jan 2025 13:42:44 +0000 Message-Id: <20250117134256.2079356-26-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250117134256.2079356-1-alex.bennee@linaro.org> References: <20250117134256.2079356-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 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 Message-Id: <20250116160306.1709518-26-alex.bennee@linaro.org> 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 Fri Jan 17 13:42: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: 13943357 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 8EE10C02183 for ; Fri, 17 Jan 2025 13:54:04 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYmm0-0002Vf-BR; Fri, 17 Jan 2025 08:52: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 1tYmlu-0002U5-Bn for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:52:26 -0500 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYmlr-0003l6-6c for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:52:26 -0500 Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-aab6fa3e20eso401427666b.2 for ; Fri, 17 Jan 2025 05:52:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737121940; x=1737726740; 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=HtCDv3d7Fj7JdhWS0o/IEH/Zvi/ajW/ZDQ9T4eeCRh8=; b=ijbLpktOx3ZPF0CEinUFtewiSich2KRhHN3ayksE7Gm05I3ZvR+wkX3sZ9eL/2a+pp A8UIfuABoyLqnWag8sC69SNwPjEBAF8x37uiVKRqQ8CBSPnp4ORs3RbnJ5VBwaoT33qF 8RdnZGtvt7Bgs/9GALivxL5sT45Epo1nEmdEWSfCNIId4wcAPtWreLQcjGd7W3V2Rm8K BN1OwC8cPRQJFTbnXe6tjYvWZXp/KBKciFu12zKmsRHdO3FEua546TSRDTlIUGc9NzB6 J13gpy3c5hphRM9vLWdHkhOb+XpqFzAivPo9dC7RswSWxeP6L3jZIaHN9QhM0Ph+XvQU iXKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737121940; x=1737726740; 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=HtCDv3d7Fj7JdhWS0o/IEH/Zvi/ajW/ZDQ9T4eeCRh8=; b=VhmicbRf98enW1OqU3S/vRl5mGse5fGCB3Z9TLrbX6UjxaSiV6Wk2+ZgCHo4EJh+/R lq4LmYzBOtFFy3Z+FVhJmwb+sqqAYr8IAlWUzrMVWH3YyXKkssnKmqTTWAmrmdpHzX7w uBp4OBTTWDZBvBBuIvak5gTNOYKMNAOPhWAq+FOr5FW6hKKQToH8nHkzH1+cYAY1fhZo 8U91QNr6sZnNIYH2wyOnEq9Y4UI6SCtDeFD38/kq8NFn8xULY/BYv7wM8+0N/V6pqrus jsXe2+drvYNC2ErddpbP79o5p/uLpRpjj2wodJxcMw2VZeSzRIL6+BdKItwPyNmXQ0ZX nWIQ== X-Gm-Message-State: AOJu0YxrYdv9ipw6EYh3cIX/dwwrGc+EG1mhKSqPs/9CbOp8UtvI0tmy 4SPxEtZVFDWWmY/zBzGKKIsEjs/M30KUv8wKHE0OqMDKh14vRBILNNHSDcj+ojI= X-Gm-Gg: ASbGncvGnscNBBHl5UAs58zZNfIcJDJ4PJ4gdLjqmLXcfOrACA2JwPKSeb5zF+Dj0wy sKlrfN5j44W2M/tK7xlXZv3p0S89Q3I/aje6VAxggn2GHyXjbmtd6rcib8MdBoAxzA4ATSyitSj MIXiZaEuNoBML9ay9Rp4G61L91HywLmiIsiJsx8oSEfAw1YS6XHvmGWBwjIGlQxW4iRjhxc3Wn7 2mQ1h/JkGrsmfb+Fc0DxDtTt2UjxNPYNDXVk4RYDycUu5QZRRcVEDE= X-Google-Smtp-Source: AGHT+IEot0OJi02dAtKnC0F2Jjse2aekavj1JmXqkk9hpxKnQkkCGBlBw4Mww+b1TQWuBZGQhwGUMQ== X-Received: by 2002:a17:907:60d2:b0:aac:43e:ffa5 with SMTP id a640c23a62f3a-ab38b1ff088mr231210666b.15.1737121940138; Fri, 17 Jan 2025 05:52:20 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab384f86fa4sm174040666b.143.2025.01.17.05.52.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 05:52:19 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 66A1E608DD; Fri, 17 Jan 2025 13:42:59 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Pierrick Bouvier Subject: [PULL 26/37] plugins: fix kdoc annotation Date: Fri, 17 Jan 2025 13:42:45 +0000 Message-Id: <20250117134256.2079356-27-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250117134256.2079356-1-alex.bennee@linaro.org> References: <20250117134256.2079356-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62d; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+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() Reviewed-by: Pierrick Bouvier Signed-off-by: Alex Bennée Message-Id: <20250116160306.1709518-27-alex.bennee@linaro.org> 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 Fri Jan 17 13:42: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: 13943345 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 AC388C02188 for ; Fri, 17 Jan 2025 13:47:13 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYmdy-0002GX-EB; Fri, 17 Jan 2025 08:44:14 -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 1tYmd1-00012Z-3i for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:15 -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 1tYmcz-0002HD-H3 for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:14 -0500 Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-5d3cf094768so3703051a12.0 for ; Fri, 17 Jan 2025 05:43:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737121392; x=1737726192; 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=4xuiCI7PA8RfyoMtUNzdFe3eSRNq2phrVz5fhVl8TLw=; b=d7qzB0Dg+c5stXWn2L321nKNY0XRVaQwlEJj7bHChaS6YvvIV2dh/bGRBM0AtsPi1n VVMyonDB20skRHdrwTeKvniHjGV9VQ082ZFJr0WHnSYhRiFBY7IPku/7ka7Q+MNh/BiG EakPDG7WsxbWW/fH2Hk+wokLTMEd8d7ODhlwijPJ5CAn4VW2vGdcKfh8nDZTugVV3eDs cHALDCdgJ8EfGjDTNHp3hkIec5fAiH+UlAZ/YnumfuRINxpNjLTBiW44/xsqNL2XCHm8 1v0ojXQ5SvNP7Ckl2UdJGLK5HgP7NZJMnaH8hH4xJzKauh5bstafW4W5MR/+3n2tgA7+ UOsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737121392; x=1737726192; 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=4xuiCI7PA8RfyoMtUNzdFe3eSRNq2phrVz5fhVl8TLw=; b=athHIcwTjT4tbChum8oqEHlmQSlb8rJaSPDRtYuBufRqZb+l5zQZhuP9pV8dsHkbrP FBK4h/llPCvMgsDwF3/OGpDB33lvzUWT/TlNJyRxsbij3ihRcgiFfevNktZH9qgs6986 mBmE3w9T6dwY2Qmcb0WTXIfiz3CxcOlFKc5XcsHeQr00rtmZfAmDZvUwbQe/H8O2PhwU 5UY5JvNVyrP+tbuXPkLr6xLdLfrHYjfWoCNovR+i24zk8aTi4P/DsCgAUaPYLMKw1wHb MdROzHqPCe6ELXdi5xwpXRR09F+mGDRsymhf3gSN/sC1RG1GNAXfHop/+XtU36z2ZN5a bbDw== X-Gm-Message-State: AOJu0Yya0m8MVw7TSFphfbLyOwvaT9OE1v/0vQiNZeQjnCcUBlCnJABS lTFhAs8oaXQIypo+SSYMZi9Zbe9GhJxxBV8cWeMW6t6jnkPwsS9XEDUJW9YCBgw= X-Gm-Gg: ASbGncvqErAAD/uhj04SeEBjtUpLlH1b4z2idFV/Ze40xGw8ta1udTjZ+Ap2QRUmCZ3 oaFy2RBjCRcICCIWZk5I0lz81LrqQM736HZIK0lv8FSJPL+Djk5KeuqSLH+1OlEmOBZwQLq0G/B Fsico2itVtjSv9KZ9b6Tgd1exoOkBQG6DRxvAZHHKrJdGNKsI1sqUjCSvNfjW27aix/eH04d3xc U4gzaM6NFjEfZii5VSQEoKN5HWcPYwovr82zElFKH3ZGPDhEFRnOHA= X-Google-Smtp-Source: AGHT+IGF+Gm/f1PNYFKM83X+vDlXCClrRtie2cNqA1eMIbmFB+odbv9zJX0hBJFbVVvLFQgugzrmqg== X-Received: by 2002:a17:907:3e1d:b0:ab3:974:3d45 with SMTP id a640c23a62f3a-ab38b0a186cmr298609666b.1.1737121392001; Fri, 17 Jan 2025 05:43:12 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab384ce0f58sm172496766b.48.2025.01.17.05.43.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 05:43:07 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 7E7E26083E; Fri, 17 Jan 2025 13:42:59 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Pierrick Bouvier Subject: [PULL 27/37] editorconfig: update for perl scripts Date: Fri, 17 Jan 2025 13:42:46 +0000 Message-Id: <20250117134256.2079356-28-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250117134256.2079356-1-alex.bennee@linaro.org> References: <20250117134256.2079356-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 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 Reviewed-by: Pierrick Bouvier Signed-off-by: Alex Bennée Message-Id: <20250116160306.1709518-28-alex.bennee@linaro.org> 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 Fri Jan 17 13:42: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: 13943326 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 BD15CC02185 for ; Fri, 17 Jan 2025 13:44:10 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYmdq-0001lB-6R; Fri, 17 Jan 2025 08:44:06 -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 1tYmd0-00012G-8g for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:14 -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 1tYmcw-0002FN-31 for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:14 -0500 Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-5d3e9a88793so3563345a12.1 for ; Fri, 17 Jan 2025 05:43:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737121389; x=1737726189; 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=BweiGGrjQIGk1dVGD1ZKLAbH1Kswi6PYCPMuHmp0Q1k=; b=DDqAtGK7KP4hQCqPwlp85M/5Y+UYFxyz1aXhlkvYOks30v0xGzFOXt+4T9WxMltBAs OW0qNr9dsfwvl/mw2xfzW1M8QyJygLY1KFUaJ7aAWZtjTsa7JnsvxnL3ckM4VKN1Q1/J 4hyDgfJx/ElkwuzVhIhhKGVpEsl1t0I7lzsDIYEnwQCLuxD1j0UOiTKZfIdI/+jMWo6G /Mk4CA2w8jqfTCdQFDBCB2tMS8TAWvrqoj04fd0ss/tpbwzrxZQ/vCSf78i81H83YB5c PIej6c23Di/I7HCScjm/8YNY4Fz0m80OYSmOzKn3/H9/R2g5Q9cFV6bextrmZxcnoyyP 7dIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737121389; x=1737726189; 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=BweiGGrjQIGk1dVGD1ZKLAbH1Kswi6PYCPMuHmp0Q1k=; b=tV38+GA+XOWc3cu2fUJPX4a67VrAs/Gczed76jHhbUgHa5YZ0/hk/FJsOS8vHuqsAy DZMhsPTYehem5KBH4ulbaerrDZ5+fcRZUTwinobLlz0JPJ2n/vEPJKr0x++jVz6gaAEu 1KvUHc+PXKOcTtz43KrsxkK/j4LyUY9KoX3+hW7+jiSWQWnwV1GsShlRz5LFUy7fcVNF ma0J/udXvuM54OT0AkpCepSa3P2NLmdVwKvXgyzIBvrObQipjEY3IPp/vRtXIp+NQlN8 +e71MPFvKxsq+wJemgLcblMWy7D6A5rpGv4FACJuwepQaAmlWfcvM/m00Xb6xG73ZVoY dRoA== X-Gm-Message-State: AOJu0YzmB+HxZQhdGKdNH8S1LtBMpV8APhN6nt+mHamiaO3RY+QwQheH 8Q6nS7H/SK7op1x6UC5pwdXoucL0lF5M5na/NUyw6Kw5ibzrg4TWxmNtc00YVU8= X-Gm-Gg: ASbGncvADERGFklDzaPQv/dzyYCv9vTrwTVTl/8WXvzJWMB9QNgcNMiJBWD6ry5TUgh sjHD2uC7Vz6fNsnX598QaCwnSTYD86twJD8sBFsWSxcfg/MfBAROHPe0/dZDCSv8hkb0QPvNlt2 iAhQhDSh21+vA4H6I4uBOficVnalZYrqNFNo+Ftdi2OV8rqZg0r3pPVmBs7pMo7e1Fuv1yQsoQ4 eKe5MLEa5nRvdTYqsLWwd5IM1RANc7bhI2o+UyeSs4oCu3npwzus3A= X-Google-Smtp-Source: AGHT+IFk1+Oy1TOXGZ8g4I9xM1xsQPsj89hmeV58GbW3/ataKNaxDE91kPt5XlcrcA/iTVSlcKfpNQ== X-Received: by 2002:a17:907:9450:b0:aa6:9198:75a2 with SMTP id a640c23a62f3a-ab38b3787ecmr244697766b.44.1737121388587; Fri, 17 Jan 2025 05:43:08 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab384fcc926sm170193766b.164.2025.01.17.05.43.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 05:43:07 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 982D5608DF; Fri, 17 Jan 2025 13:42:59 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Pierrick Bouvier , Fabiano Rosas , Laurent Vivier , Paolo Bonzini Subject: [PULL 28/37] tests/qtest: fix some copy and paste errors in kdoc Date: Fri, 17 Jan 2025 13:42:47 +0000 Message-Id: <20250117134256.2079356-29-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250117134256.2079356-1-alex.bennee@linaro.org> References: <20250117134256.2079356-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 A number of copy and paste kdoc comments are referring to the wrong definition. Fix those cases. Reviewed-by: Pierrick Bouvier Signed-off-by: Alex Bennée Message-Id: <20250116160306.1709518-29-alex.bennee@linaro.org> 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 Fri Jan 17 13:42: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: 13943344 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 62FDCC02183 for ; Fri, 17 Jan 2025 13:47:13 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYmdz-0002Nv-Si; Fri, 17 Jan 2025 08:44:16 -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 1tYmd1-00012b-6J for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:15 -0500 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYmcz-0002Gd-Jn for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:14 -0500 Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-aafc9d75f8bso357074966b.2 for ; Fri, 17 Jan 2025 05:43:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737121391; x=1737726191; 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=jqP9s6i1XKCADbEJhUROhCpIYtt+5Tsr7aRO+xN3Yg4=; b=bykIVamnXCh7A2va4nJ1jzc00WssVmFkPAa1WM5pNFZ0+AwT8ikXp3lKf1NxIRERuU 4Ikmbx1l7kNDi4SiSilx0DTuhV8DifKwnLbK29hO4HZgDvNRChGaZkCiHhArweRQoXxL kONvV8EB62ju1ZHurCJ65W2t267fGca0OpSVsnEH9QCJ/xHqgq4z53aiYP9d4SS4jbc/ Cwlp4BIGmGQxGRROhx9flfLznfqXFDtYGC0eF6fGCG08wopYZbmZ9ayY4rTfnApzaQ/B QYhu+1c8uVCAJ7n0obcHeIvDuS32/zKzRK2/dRyXyvtqE3Q38QfasyETuj+9HChmPWSa 7zwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737121391; x=1737726191; 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=jqP9s6i1XKCADbEJhUROhCpIYtt+5Tsr7aRO+xN3Yg4=; b=GVw2Gvrj/m00cHa/uEXSZjNHVwUCjELDXNvkQPc8vxeJCT/TixgCPQKEZbHpxNL63h JMiT9lmf1tH8BJHJEsbNqhotivm+3fsbsqMBVPexZ4XBAdtdd30yg+TKZ+S6D7OvOwQQ yW5yvyp1oGJ9YT/qP8gJ9MIYnTUwxsQKH30oIZtGqqjbYxBQ54P/o1ArO6pNENwj+pjd 7T31x/kMcWZrFfZ2ISXI/kwIbXws6V5T2v8FGQZTbwpJ1MAGqmqVM+XUbgNkLRGo+CCp Haq5PUrftNZLZLT9J7NtVfmVI4tVc4lSqlvVS/oEQ7PZ6cM+0GhrcFlFpNsUelNpXwG/ m90g== X-Gm-Message-State: AOJu0YyHMZ6sEyeCvCQWJMSlbfoGT4sHOCP3Y42l5xSrEUC0b0jKH4ZH zsCoM4a/n78Jf54RNNoFqQES4C1HLjqaWdcC53COrvIJ6ZTl3xEdL8QP4oxbpSo= X-Gm-Gg: ASbGncsrFvfEeVhP+6FJrHxGciB9El1QdoFbwgzPiXrnUEw3TL4qOq7IRT1p+nOE9gM hzpSgoH9sSKvfvVX2nDblbxl36vJbP5Xh95KGsRlk+aj3ExkENsQ2KMNU6951fbdYkGO6qGxar5 aWugXpyj/0M5CCkSKM5hfJJoEhmJSEOjR+H5IW4ZQJdI+sfH68mK8KgCbvBfOTDpJ/zu+y7lYis 4EkY5s7AKFguMnFC4muGnqewvktmou5YqBHf7OzG4FQFI8TBkxMMTc= X-Google-Smtp-Source: AGHT+IF3kqH2/xNhwlDEsbXKNOLpAnEYoMvkTt9biQNWE8OkTIsEv3LFSKlZakxouIvn6vmLlOaYQw== X-Received: by 2002:a17:906:c107:b0:aac:29a:2817 with SMTP id a640c23a62f3a-ab38b2e4528mr224538566b.26.1737121390831; Fri, 17 Jan 2025 05:43:10 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab384c639easm171521166b.22.2025.01.17.05.43.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 05:43:07 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id AB960608E1; Fri, 17 Jan 2025 13:42:59 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Pierrick Bouvier , Paolo Bonzini , Peter Xu , David Hildenbrand , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 29/37] include/exec: fix some copy and paste errors in kdoc Date: Fri, 17 Jan 2025 13:42:48 +0000 Message-Id: <20250117134256.2079356-30-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250117134256.2079356-1-alex.bennee@linaro.org> References: <20250117134256.2079356-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62d; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+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. Reviewed-by: Pierrick Bouvier Signed-off-by: Alex Bennée Message-Id: <20250116160306.1709518-30-alex.bennee@linaro.org> 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 Fri Jan 17 13:42: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: 13943336 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 3460FC02183 for ; Fri, 17 Jan 2025 13:45:45 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYmdi-0001da-7g; Fri, 17 Jan 2025 08:43:59 -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 1tYmcz-00011m-Lc for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:14 -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 1tYmcx-0002GN-OF for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:13 -0500 Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-5d3e6f6cf69so3390692a12.1 for ; Fri, 17 Jan 2025 05:43:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737121390; x=1737726190; 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=Id2YhFWnCyQzMpp3/7mwnf47rokh9cmGN9I+7TPRgK8=; b=DmjWh9nUkk4nwTWoB1GyfB3jY9O9pAGmtm9f7hUsNcc5KRrfIxuN9SE0TK8m53E3gz PWFZjAag5/60sRKESENJbpquA0NJ7byVsc062bCfDjRibzQmyJqD97xAFgwzenO/QJEh ffd9tWe7zJyhVxpTY72JCpuvKlVAfzfevRCRT0Uyf9WJ00SUxokUligGk/yxoLRBwbqR VNs/LbxmDm5mN8PksXY8UJONacOyO+NGRe21w+WrfrHWcVocAdm4HbZRqtgARLBkKpKw vtkkM/DyLr01g24tG4+dOJ7/D/RSoq/PCBfbdeGyswIm3M1h06wmcekLzDXGa3Ao5rRK 698A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737121390; x=1737726190; 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=Id2YhFWnCyQzMpp3/7mwnf47rokh9cmGN9I+7TPRgK8=; b=vQii0KeTKDu/tYsjOYBh2cP7vEfgEOJ5mZ2lybk4GvP6dNaF8WX3J9pAcB3IjYv1Je OF8ayDqqjyKaAu6EGgLbhMPcZXY1LV4tjw9lXzch+DeYhkpQuSy7IDYIaw6CHSYkv96G 9vYkZsjQXvqSB1ajtc2KUFn/tzSKfVc4Fixu4j66ZKsTgHygfH4Xop5tNHXJntDAyEvn 4TymNQaTB8Ni+ffRFrzzUsa915POyR0aZ3qc8yrbUqIbr8zi+YBdIBLdD0W+csxaDUnR 8IQ3afsjKt4tVDe9i1cgQ1PAgL4mDW+mOTyjA73sbjIKDNCwxUKE7w1X4ijZPBpRwJv6 /xLg== X-Gm-Message-State: AOJu0YwFkDPz41dxdA+bWD+D7X/9zu1l+OGof1ASrhZ0oescVPDwFWQk 7Cxwbn7vydv44cZHPtsJou5tDOtblCWzS7sPftkkMBggwlv/P36bGVEZJhj3Hoo= X-Gm-Gg: ASbGncveZVwdn6ZWnfkcM9Bq1H0ti12091YWG7XLY4yQvzgIeWjxiJXR4b0kzDDqr7U yqLyuLz6zDW/NaoLNlIWwXeoyZ0wuLfOlfApPNnqIaPW5U/RJJNdHwgbuktnJg7t9P7q7EeIFMs gCuw/er1Jir97Z/oYGRaK6TDSg0SO4+oSOCpyaOI9C/VubKAQ1pZER3PSv34tamnRw7A9SW9ceI 9AmRmPnBIcybKjkaKAYwyxeu+flI5+zHmLxuJyvk7NCXLqCIPAcH8E= X-Google-Smtp-Source: AGHT+IEPd+S7xaBMlDOhOLhpY3UdXL6s9Iuj1XG3lbVuG0u9x0Ee+78PiRQbvNfwEx+QXIX/c0nlhg== X-Received: by 2002:a05:6402:35d3:b0:5d0:feec:e15d with SMTP id 4fb4d7f45d1cf-5db7d2f9af6mr2005904a12.8.1737121390315; Fri, 17 Jan 2025 05:43:10 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5db73edcd89sm1504127a12.79.2025.01.17.05.43.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 05:43:07 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id C31F3608E2; Fri, 17 Jan 2025 13:42:59 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , =?utf-8?q?Philippe_Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Peter Xu , Paolo Bonzini , David Hildenbrand Subject: [PULL 30/37] include/exec: remove warning_printed from MemoryRegion Date: Fri, 17 Jan 2025 13:42:49 +0000 Message-Id: <20250117134256.2079356-31-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250117134256.2079356-1-alex.bennee@linaro.org> References: <20250117134256.2079356-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 Since d197063fcf9 (memory: move unassigned_mem_ops to memory.c) this field is unused. Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Peter Xu Signed-off-by: Alex Bennée Message-Id: <20250116160306.1709518-31-alex.bennee@linaro.org> 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 Fri Jan 17 13:42: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: 13943354 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 BE102C02185 for ; Fri, 17 Jan 2025 13:53:57 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYmm3-0002WW-Ti; Fri, 17 Jan 2025 08:52: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 1tYmlv-0002UP-8H for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:52:27 -0500 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYmlr-0003lD-BH for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:52:27 -0500 Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-aaec61d0f65so457112566b.1 for ; Fri, 17 Jan 2025 05:52:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737121941; x=1737726741; 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=zi1VkFTI50wNhaF65yTFWx7N5fJKMyRmjD/Fawk5sw0=; b=pxKpUO38wSVTrkw45sZyasy0WEVfSYAV+hkw+7UlYmyrjdii4E6SH59dnDOP1r80Uq bhD58vis1G0PzRfiIjfl4xdyaM6HAVgh9iJZT+V797s9qOgtVmBg+Omp8GFPwkVpXfOD tqlvjEucKgdllnksOXABeGof5INmAlyK3Wu5ACKNo2utWL5V/iiR7UrHxKNmzNLB4GAI yC+wMCWOEgvNcoVdOU4hIPHw5+Nik+hEzkD4jMuIspqMrRN/ETzVN30bCDjb2lzDSE6S HKtpOHelwbAXabwsIAeLxFUB8oX19bDHzjL5YP0sj6RA/p3MqUgbYCM1TT9Ezqd0Da4V QtLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737121941; x=1737726741; 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=zi1VkFTI50wNhaF65yTFWx7N5fJKMyRmjD/Fawk5sw0=; b=EaJ415YIf4ucrqFc8V5iWBa8Z9oHvHU1aJmRbvjAr2h+rQasS5sXi1y6Avjg1wrcJP j06WRvhEAO1d10ZL5lJdW+ZC6JzHTYRtcRt2CQCAMANGScghVKGg/ie9mvfpeRlLOhZv 7HDFKNjL5z28KkyxsZGdcXvKbQU5voL3epl5LfJk0+isvrR4wmXXw8fBVh1KW36934lM Z8pzmM/NbV6/WDHh90jcBpOg1VsUWqO1QNsHTjTAjLCsu1ilPZWf6ro1+WbYRuntSUVH 3BonZuBTV2OtG4u6hmLrYZo8pH29Gp/eqAoY7gGI9Nrbdd2wnIiNKh3d6bHxPRusZMLp HoeA== X-Gm-Message-State: AOJu0YwY2ttu05EgWTd+XwLSjcpv4ZamM8B0rD5bX28yoMI8ksKcDzyq 9aNM9TEVig8wbPi+2iJQCN9sRjKIu7bU8IOWftj/8dVGpUuxLaEse0ZcBsS7DEg= X-Gm-Gg: ASbGncvLwTXg32b57lGcISx2+QxpHesJcFoPwA7BIZp55c9Yx/Y9MQ0dNIZiHQUvXfl bGhcmsGzRdI1fBPiOGVpL3w5M3fa6MP/saX9XDUm4nu68kJOnfYPJlSxY9G6/bZKlt2YAtJgz7B 7ypK3jdCqy01ONuXOtaNeufpeFpMBOJkbXPPIwJdOt4F9Ru/hkKk147jtIP3QdDpFbB6dfR/jyr r+xcqCRtod/ZJwW8ve6PEMzRZIUV6UCDC1MMe6DQld/E3ZIpLrhsyA= X-Google-Smtp-Source: AGHT+IEy+X6vol4Daf2Pux81XnSa3lU4b9g0yDu2kHvB0hWhcTaQVph6ZJBAyAtQHxRO69EVY7Xv+A== X-Received: by 2002:a17:906:478f:b0:aa6:acbb:3653 with SMTP id a640c23a62f3a-ab38b0a6059mr256769966b.12.1737121941383; Fri, 17 Jan 2025 05:52:21 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab384f29031sm173241866b.97.2025.01.17.05.52.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 05:52:19 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id DA0A4608E4; Fri, 17 Jan 2025 13:42:59 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Pierrick Bouvier , Peter Maydell Subject: [PULL 31/37] docs/sphinx: include kernel-doc script as a dependency Date: Fri, 17 Jan 2025 13:42:50 +0000 Message-Id: <20250117134256.2079356-32-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250117134256.2079356-1-alex.bennee@linaro.org> References: <20250117134256.2079356-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62d; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+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. Reviewed-by: Pierrick Bouvier Signed-off-by: Alex Bennée Message-Id: <20250116160306.1709518-32-alex.bennee@linaro.org> 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 Fri Jan 17 13:42: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: 13943355 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 E1C0EC02185 for ; Fri, 17 Jan 2025 13:53:59 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYmm7-0002Xg-AM; Fri, 17 Jan 2025 08:52:39 -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 1tYmlv-0002Uq-Lr for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:52:29 -0500 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYmlr-0003kf-Bp for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:52:27 -0500 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-aaf57c2e0beso433348266b.3 for ; Fri, 17 Jan 2025 05:52:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737121937; x=1737726737; 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=ryjDq6SVbM3rFJynOdzdzyOyu6l/v62KzXYJQB4a/Jc=; b=nOipSmuNGruHMzjrAW3L1DjxFQRGZpLDnZG1XX4h6xmPErNfcihZz+JzuZB2Dy8U44 bX2aNgMBaJ4iGaVSOiMxS16PnL8JlWmA7BsvqzF0ttwwvWKA9A7iG7M1y6ofpaQQd0qk 9PolqW7f8X4hESvhjouhidD3CUJEHkK+btXW6zvi6Sx4UgBVd21tj+lzzIZELdSV+lNh Oi3iiID0rGg/IiFJXOsuLqeF3C0qXa3EUaeG0QCUA3LSU6Yi6WK3fDC4siFAxUodBM3E pjWm8FdNAmnalDKE9xLNrb47JCiKiOBchrGdXUmraUQ8EcFP+vTcVLr7UR3rL1l2QLIx Lm9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737121937; x=1737726737; 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=ryjDq6SVbM3rFJynOdzdzyOyu6l/v62KzXYJQB4a/Jc=; b=n6nTD0ZPhRavHxGCVFVkX0rQ3hq0KUWN1i2uaJG88D1GhdP8pU9YPdLYMwvOaP8rv8 nKrrMeR6EJq6cKzII9QARGopth40jnoF4ThkQrttDJtvK9UwR7VcgIlqoYHQUzCUOCp+ 16a+1HHyAOIvoaT/JM/2K0STiwA5RxvJMXhmGgdN1PMYfrzusMFQkFakL3s0g15CX9kk mXO8pGd74G1AzDqHG7icWvBI90LW5ht+YtexSRvUGjW4HyyE1HaNVFAIKnRYCO4Nhn0M KVKExZ4F108JMX2DSwi6/e732FWYoe5ZPQIV4U0v5Ramg7D40s4/u/LB2pFHBT4/8mj4 sO4w== X-Gm-Message-State: AOJu0YxIpzuZjDwrrdfCuKKmSbV3svXsJhVU57Ynom+4+MQk4HMKDQ9/ i+PIU4Qm/OR+chyuVHjBQepeCxmHeyZTAam+Bh7I/KXDGECfuqIfSmBopYTkwU0= X-Gm-Gg: ASbGncv3vnzxOYSHGoOhZgMmukaskklVddbFwwVo47nMqz4lQ1JXu4FbfQx84j7l23u ObHzWfXQzIbT0tDA/naf5SH7fpTmwqxwlQJ4i7ByF+lc8o6EsBjmK6WlbXADUPcsG0PlF4AgCdX uEUl8Hkf3GmUYb1D44biQ4+/zm8SU8zQnyhDZQppNxEGyYDSuVKG7DEjNYW8uqc85ZJ++w/fGiL vjebQRXFgk/c4z7o/Jgs6qlO5wE0OVG8LdjKs3SsRoeRA22dUvhDoc= X-Google-Smtp-Source: AGHT+IHsd+PcqI9MeXCO5b5vAfss7QvLlIiAUHz+LDZYrsB+pFJYLV32MqWLnVwLr8Upss5cWL059Q== X-Received: by 2002:a17:907:2cc2:b0:aab:e07c:78b7 with SMTP id a640c23a62f3a-ab38b27a5dcmr267547566b.23.1737121937122; Fri, 17 Jan 2025 05:52:17 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab384fcec76sm170997366b.184.2025.01.17.05.52.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 05:52:16 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id F0FCD608E6; Fri, 17 Jan 2025 13:42:59 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Thomas Huth , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 32/37] docs/devel: add git-publish for patch submitting Date: Fri, 17 Jan 2025 13:42:51 +0000 Message-Id: <20250117134256.2079356-33-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250117134256.2079356-1-alex.bennee@linaro.org> References: <20250117134256.2079356-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::632; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x632.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+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 Message-Id: <20250116160306.1709518-33-alex.bennee@linaro.org> 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 Fri Jan 17 13:42: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: 13943350 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 37299C02188 for ; Fri, 17 Jan 2025 13: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 1tYmdt-00021T-SZ; Fri, 17 Jan 2025 08:44: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 1tYmd2-000142-AH for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:16 -0500 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYmd0-0002HZ-DM for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:16 -0500 Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-aaf57c2e0beso431614766b.3 for ; Fri, 17 Jan 2025 05:43:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737121393; x=1737726193; 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=V25rdshuWsL/Iwjc7wONea+6ItK7iYQ49yGh8fic0Lw=; b=LYjr1+Kb4Pj++4sILjbE2aZzGOT4VZQ8doWxoQS4Jhi9HaEXFlsYf+NRtW2FX1qKyP B3k2melCiR8lBRlzCfdzR/xdVTLZ8EuHq3osr9VK1rgY8e5R2/2YSQxxyHcubTXbLJSF LuLsVn+10csz4MarnPWkRGPJYq+QhW30/CCPruyYBb+EemiaM5eSFyggGY+6yMIBFTkE SdW2qpKWXPUbUdeKEOicmfjEFFwLfEIkyZShpi/45fObFMQaX8tHKqZEUee+R5K0zzh9 JXN7+0E94/pDUV/KgQtlYshdi85L56HQTncI8E/fGDjnrjKxmRNNuMYjhtQz01BoZVx3 0pXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737121393; x=1737726193; 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=V25rdshuWsL/Iwjc7wONea+6ItK7iYQ49yGh8fic0Lw=; b=bJAD26sGQxHDs5NufPuegY5WaOfLRD27zNziBaQCXRb6CIeBPGYQJH968UXxDl70mH SqX2x1Eu1uYtIys/+ZzUNhwAwfN9GP5zWbfHwoavhp4zn7gOdZZdfT+bRF/Mxal2Jl/P DlVYHMzA7arQcX41LiEWOQHcQnWHkIfPEmxQF22shUP4meFhEpazqZdsUsyqEFdgc6BM 7OjflLWU4E7enmDhosCM0h+EO5GJkCGmFjABEWhF3C0XUnhQlMtzoBGlYsHqPsXa21TU edKRUnYPAJPz9ItU4MmjDhhlVEDXDscg9dGIkTXMdJHg6lO68aWNSwwgzM7QaTOMXFtR B0Fw== X-Gm-Message-State: AOJu0YzGzlXE1O1hBLscpgPkrBzz77ZTCDP6g1aF8H7QFSMBoOUvv2Iv MZnJR2dmSfjgJm9P4E+QFXOp813j+RCC7oL/xJL6IXnvYEUMnfNVN57j+gOXkus= X-Gm-Gg: ASbGnct1FV7ig5b9ZVbX/yXjU3UCldyghEHIfFz7qB9PhvZB7ol0RfwPZMeNhsIl6+s F0r0URttLqI/jwUyA4iLa0dZ4q9J6HuvfYPI1dUqV3aZspUzkyXALOadt8iti7KRo5x26tG9HU7 7ocIWb2R/aKn1bgT/jaDbnYScMonXnl902m//KzsOD65mTTLzli/buwLG9OHJkAFVrwQ1gUYjfP W5cVIjT9AJUhlSmSnlkhM7XU31bMnzsyCr2SSiDq8O0Ae08/gtL0gA= X-Google-Smtp-Source: AGHT+IFtnfSdunR5M6gm4uB2EhZNqAW3bEeL9NB/Jb/BnMVUN3qY5OY9ZTy/FMFghU9ht9Hi71YPhA== X-Received: by 2002:a17:907:1c19:b0:aa6:acd6:b30d with SMTP id a640c23a62f3a-ab38b4c63f2mr249497966b.48.1737121392679; Fri, 17 Jan 2025 05:43:12 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab384ce20fasm174375166b.66.2025.01.17.05.43.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 05:43:11 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 1005A608EF; Fri, 17 Jan 2025 13:43:00 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Thomas Huth , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 33/37] docs/devel: add b4 for patch retrieval Date: Fri, 17 Jan 2025 13:42:52 +0000 Message-Id: <20250117134256.2079356-34-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250117134256.2079356-1-alex.bennee@linaro.org> References: <20250117134256.2079356-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::629; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x629.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+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 Message-Id: <20250116160306.1709518-34-alex.bennee@linaro.org> 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 Fri Jan 17 13:42: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: 13943351 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 D4E31C02188 for ; Fri, 17 Jan 2025 13:53:18 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYmlz-0002Ur-7E; Fri, 17 Jan 2025 08:52: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 1tYmlt-0002Tl-6f for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:52:25 -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 1tYmlp-0003kk-Vh for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:52:24 -0500 Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-ab2bb0822a4so408956566b.3 for ; Fri, 17 Jan 2025 05:52:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737121938; x=1737726738; 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=xom9M1/hHRIoa6wXqP36+GbithL64UKHkweB7SQXlLs=; b=ArOEyUJc6/fw0QJJOPLSb0Hg05+rfE8APGA+igs6N9O7SCI3/gGpcoE+NU3nV1jV7w swgleVhsgBg1E73eTH2p3iFjLOqrnmw/wnV8CFC8brbhIChuOrx/cdjiSJZ79QWvFxyV zAN9S2U9DGCO/piXUl5OHcmXf69n63J/aN07S/K46/cIwj9PhfrGBGjaN4aifwGC1vlz hD1pCk4I8izV2cHnTah974iMxilnHlB3dHCOvEfmQx6gn38eKBJ9H9oRYnuGzVlF0spk cBSzMndD9Uvl4InswKbFU8zIpw8g/Zli47XOcgYB8PRel1eIZ097DBe5Qj8/fBV2HAM5 uvoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737121938; x=1737726738; 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=xom9M1/hHRIoa6wXqP36+GbithL64UKHkweB7SQXlLs=; b=KsqBZ+1ATHma42fP1MtgLhnsJO1KtJfy/8njByLA9Wn7BsDWk1RQzaEi5LZ0g0UXFd dNGm30z3bKtFmG4l9lwBURUEj2y3ci1RPABscJg7zq2LSe61Cib4OiBxTHtbElSNsRMQ xbxmVygtMOtz0/p4zbbKEQl84tU7HbSeF3wM5CiVDBBqnyrf99+1Tgf7h8pMLXHohph5 +WROlDy6Y3AjzjeBnv7yyUavJ+tcJtTAAA0W+k1/WzI9eu5/QMo/s1sPdPfZV51J+8jj GIFmpM5JE8zHZx5syB5O7gnVgFTT7OQ46QgtNBF01FA5bnCbG4ZJi6O4wegJ7QiqUG8n vBQA== X-Gm-Message-State: AOJu0YyR5mMMm+JvFZxhN8HdQ1SmTG1NUkXzh6iOZ42FpxGuMR7KilDL mTkawsTkyJS2C7DnxPqSmJz9xmEXhy6iBt9AgxtHGknCF/Tt6vuYcE9Qa0XEDrs= X-Gm-Gg: ASbGnct5ZUiXnlyk4n+tgMLfvK+UsDmxx5C98kVUWOzJS7eZym96TCybfLu2hdnWYLk 9O4uyTxRHXwFfEXZ7CgQAQv5ofuZZj1u7x1AbfGi66gTku3FB2+gonMWl8GMzBhtB6qg/ThDYvY UmDwwVwYYgibdfGy9px8K4OwRPYk1bbH9gchPbOC+WhfqjB6xzE3Kjv9DLRALPUvlxsYq4G/wh8 LLbOTtVdT38R82dq+8OWsA4tav1155CN8SPIszOrIK/cdUW8QWH2T4= X-Google-Smtp-Source: AGHT+IEAnZJBlkkXp6B1clDgibBfsmspoijK0Dj1grD+QcgLcQWy8z54iFGKCl9ACAFHD8hToV4h4w== X-Received: by 2002:a17:907:7ba2:b0:aa6:b63a:4521 with SMTP id a640c23a62f3a-ab38b1100cemr255520966b.15.1737121937716; Fri, 17 Jan 2025 05:52:17 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab384fcd5e2sm174983766b.170.2025.01.17.05.52.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 05:52:16 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 2D4AD608F4; Fri, 17 Jan 2025 13:43:00 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Thomas Huth , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 34/37] docs/devel: add information on how to setup build environments Date: Fri, 17 Jan 2025 13:42:53 +0000 Message-Id: <20250117134256.2079356-35-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250117134256.2079356-1-alex.bennee@linaro.org> References: <20250117134256.2079356-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: -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 Message-Id: <20250116160306.1709518-35-alex.bennee@linaro.org> diff --git a/MAINTAINERS b/MAINTAINERS index a928ce3e41..f744896f89 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -72,9 +72,10 @@ R: Markus Armbruster R: Philippe Mathieu-Daudé W: https://www.qemu.org/docs/master/devel/index.html S: Odd Fixes -F: docs/devel/style.rst +F: docs/devel/build-environment.rst F: docs/devel/code-of-conduct.rst F: docs/devel/conflict-resolution.rst +F: docs/devel/style.rst F: docs/devel/submitting-a-patch.rst F: docs/devel/submitting-a-pull-request.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 Fri Jan 17 13:42: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: 13943348 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 4B63AC02185 for ; Fri, 17 Jan 2025 13:48:05 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYmdz-0002K4-AP; Fri, 17 Jan 2025 08:44:15 -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 1tYmd6-00016U-7h for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:20 -0500 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYmd3-0002IR-13 for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:20 -0500 Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-5d9f06f8cf2so4008645a12.3 for ; Fri, 17 Jan 2025 05:43:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737121395; x=1737726195; 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=LZVXQImgyXuNo9dYY7O4wSXJ8MQi5BChBt6FVzYz5Oo=; b=MejmGd8GHyRF+rgGJzVVRMMc+qaNYj7/4RihyRuX4lIk4/TL8fqVn42vwpmQV70bC0 eH+KXV80xOBGW4UWDOXIB6g02H0sw4P0MtxmSq3kEYxt0V8/aVgZE4PVbMPQayFDBXa3 o7CrkUh8fZZtSTRlxw1kncKXTQNj1w2z1lmqN5frpl2Qrin+PZpJc8RqxBFwS3aWhrta 1MmaaBabALCl5e9267q5jiE7Uhma72+Sb7k8FBT3f6rjrH4fsUkfQei5cdIf3LAn+OTS 21D+xejJoZYgSL3WD0gCM3EEv7wCeiDyGH/NBgAUqHPnOeWjtGIIqF0hf3NfJDAiez9x lPhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737121395; x=1737726195; 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=LZVXQImgyXuNo9dYY7O4wSXJ8MQi5BChBt6FVzYz5Oo=; b=f/Ma0zH+AAB1iTANmKktsk/OhT5Ky3FoM1U3sLLuYIn/JokEg54ep59VAsnkqF31XB M4w/4BYS5P0l7flBKMPHrBt1deXQ9Q/BHjey7UYQlw5/ZDPxR/8Nqq/TlWbPiyUjiHHz ctFGxt0Rkl5YH0TSyZMwF0QPpLtY5kQf6ISlrzWAv/+gak4MYH9Ck446uZvk7YnQG4fu 26XnK8J9jln/5ctZL6ZHF5BLPsn8q3BXyULMnyrYLHMy+BtET8f76V7aNWIuQazpwkhL 1rfOIDA9IcRAMKZ+/LCaKrqs90cjPUOU1Hnf7RmSoIGIhdGFvNJKU60xPaPqlNzwxk0U kKwA== X-Gm-Message-State: AOJu0YzddvwcjMa/oz7B2lsmpVgdqwk9pBT+c6bhuh+oGbGSWgv/ayYx Z4upbUlCI/ZHLT0Vn7zgW/G/bOznhwFplSpX+ClQok5bUSIM4qlDrkpRMUDost0= X-Gm-Gg: ASbGnct4Pn0Efyrx9hjjr2vR8HtT/y+2VzEThYak45aOXZHQMjDz+dBTz8o9X/TZKm8 sURsqoQdLjknKHLoc+d/h+a4KPBFZYlDNj68kHEhbZE68nGZ3HpzEIo1cUKjuJiBmsGslMBWawm J3Rs6lDprhdT0nKd/JalBBBmwcEVoH0OZ2tnzucSp9lmRh13YlyB+E4bxV+/4AFLL6xxJ5uek5x rBR+J2UNkGb5cpkj2j+wnlCyVhcZJ/3BqZvqv7lnZcffP4sHooHLVQ= X-Google-Smtp-Source: AGHT+IHDWbSyKwkeO4AwAZ82MhRXZhEGSBMa0w/jHcstLdrYQkXpM7KgSn3sZ/AI9BCQQ86NxPadpg== X-Received: by 2002:a05:6402:13d2:b0:5da:d76:7b3f with SMTP id 4fb4d7f45d1cf-5db7d0f8663mr2430050a12.0.1737121393671; Fri, 17 Jan 2025 05:43:13 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5db73eb5b64sm1474330a12.57.2025.01.17.05.43.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 05:43:12 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 57F4060866; Fri, 17 Jan 2025 13:43:00 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Thomas Huth , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paolo Bonzini , Jason Wang , Andrew Melnychenko , Yuri Benditovich , Peter Xu , Fabiano Rosas , Michael Roth , Konstantin Kostiuk , Kevin Wolf , qemu-block@nongnu.org (open list:Storage daemon) Subject: [PULL 35/37] docs/devel: add a codebase section Date: Fri, 17 Jan 2025 13:42:54 +0000 Message-Id: <20250117134256.2079356-36-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250117134256.2079356-1-alex.bennee@linaro.org> References: <20250117134256.2079356-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52a; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x52a.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> [AJB: tweak commit summary, update MAINTAINERS] Signed-off-by: Alex Bennée Message-Id: <20250116160306.1709518-36-alex.bennee@linaro.org> diff --git a/MAINTAINERS b/MAINTAINERS index f744896f89..4c86c81f08 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -74,6 +74,7 @@ W: https://www.qemu.org/docs/master/devel/index.html S: Odd Fixes F: docs/devel/build-environment.rst F: docs/devel/code-of-conduct.rst +F: docs/devel/codebase.rst F: docs/devel/conflict-resolution.rst F: docs/devel/style.rst F: docs/devel/submitting-a-patch.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 Fri Jan 17 13:42: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: 13943346 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 9B037C02183 for ; Fri, 17 Jan 2025 13:47:28 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYmdo-0001js-NP; Fri, 17 Jan 2025 08:44:05 -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 1tYmd3-00014g-LW for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:18 -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 1tYmd0-0002Hk-R7 for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:43:17 -0500 Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-5db6890b64eso3415253a12.3 for ; Fri, 17 Jan 2025 05:43:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737121393; x=1737726193; 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=+YCgy9C2hNrU+KGc5S0g5k7dDwcxdEEI9FnlcD1Fi8Y=; b=Ia/Qu6ADkmtp3fFLNDC++Esln/72DrBTnErq8+fkV7xRdKnDI5H8Jv73NpZfnzlSe7 wIZVvpe8AZ7ByzWO0kbdNtIktYFHozzxgLdtKksvX89VJPUYacmqIOfFJrxmvDQ4KHYV gnOxVwHJEbe3uqydp9dsAk+yM5D5vCf9n5yLil7dpYPScotdKsj+EmBYvyYFCnBnklRg ICqmvkAKEr94O9cDY3nokQ7Z0SSdhel1Rj8YZv4lfW00ozN7aMKy1d6U0VssHp2yq0x8 xzgMuCSNeO8v+YC+A5IWNH+pJSu0AtS2eyYnI3jhmdBWkTf7utUPrfyGA2BH4s4YABmO 6rcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737121393; x=1737726193; 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=+YCgy9C2hNrU+KGc5S0g5k7dDwcxdEEI9FnlcD1Fi8Y=; b=MlrQE9bwgf1iS1Jhpp7GxgX6sKQas14HOneO2UU+/4sNCWZzcepxtzX2dx1g0n2d9K tbQnc25wEQjMsGmvkRSr6QFaxPHm2+MIrvImkXKSXpGIQjUj7Sj6K0Stl2hSWfl3NZ0n YgY0Qdpnt/hDnUrtBrPQKVSQBK92HZ7iRcPa0Og62amkqMcjjGboz3bsBqdzXtQJs+Qq 8KAvJjdIOGOlTnfG4iUNFn5aj5QLvmy2wv4gpRsmeFrTrZhuw96lyGrTPYcxMW7pa0mC 1lOg098C6FxGtW95RNFzGnOCRpt++cPPH4YL2T5hWcM3M7/ur9lwSDe5TWTisHFqpeKI mbGg== X-Gm-Message-State: AOJu0Yx482wCKKvncv2eG8fDG3XkiW85RfDIoGfpCJiaCHVzA2cl4Vgw 5R4iG/gJon9SB7NyKJW/A2RUo9L0Ugwi0RDMw3Gi931RV+9EQVHf2YrLjg2tTuI= X-Gm-Gg: ASbGncufjYH7VjnXS9bFoTFhixiuAphSWcgY4Axv52gSo7B6Zd4k7ZRmWxLLbt8h1r2 6Xa4h5zl3qdW0gu9Cp3uH7EuAhf9txjm8EPMtri+R2WoTzHCSQUWsdURBZOxiQ/lwJ5vypaZ519 qnh/r+KBcUDJoIPdLwgCSglMUlAyA09Wml6m9QqHG2S+dLM7T3drcV3MN7kJ/uWWlm9Tbeum/Mw 9R0F+gqF2HOPCeYOZK6cz3alRNlNgK8B/WEX3x986Qgd8GLUjXOfcc= X-Google-Smtp-Source: AGHT+IHj9RmjKo+BRvORZ9XY8lg779XQNJZAI4v5hceg74VYQLWvcdnsxesGcpRuhmdjKGX7axUEuA== X-Received: by 2002:a05:6402:3489:b0:5d0:e826:f0dc with SMTP id 4fb4d7f45d1cf-5db7d2f9c54mr2301349a12.12.1737121393228; Fri, 17 Jan 2025 05:43:13 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5db73eb5976sm1511563a12.53.2025.01.17.05.43.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 05:43:12 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 7B3F5608F5; Fri, 17 Jan 2025 13:43:00 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Pierrick Bouvier , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Thomas Huth , Markus Armbruster , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Maydell , Eric Blake , Vladimir Sementsov-Ogievskiy , qemu-arm@nongnu.org (open list:Virt), qemu-block@nongnu.org (open list:Network Block Dev...) Subject: [PULL 36/37] docs: add a glossary Date: Fri, 17 Jan 2025 13:42:55 +0000 Message-Id: <20250117134256.2079356-37-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250117134256.2079356-1-alex.bennee@linaro.org> References: <20250117134256.2079356-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: -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> [AJB: update MAINTAINERS] Signed-off-by: Alex Bennée Message-Id: <20250116160306.1709518-37-alex.bennee@linaro.org> diff --git a/MAINTAINERS b/MAINTAINERS index 4c86c81f08..846b81e3ec 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -79,6 +79,7 @@ F: docs/devel/conflict-resolution.rst F: docs/devel/style.rst F: docs/devel/submitting-a-patch.rst F: docs/devel/submitting-a-pull-request.rst +F: docs/glossary.rst Responsible Disclosure, Reporting Security Issues ------------------------------------------------- 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 Fri Jan 17 13:42: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: 13943356 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 14D72C02185 for ; Fri, 17 Jan 2025 13:54:04 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tYmm2-0002WH-Fu; Fri, 17 Jan 2025 08:52:34 -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 1tYmlu-0002U4-8y for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:52:26 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYmlr-0003kv-6M for qemu-devel@nongnu.org; Fri, 17 Jan 2025 08:52:26 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-436341f575fso22323415e9.1 for ; Fri, 17 Jan 2025 05:52:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737121939; x=1737726739; 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=O9E60eH4NFvltUAEYDSdM5V//h4nzKoVHstzvrxeFhY=; b=eEpiqNoqza0cU6LkqIbyfHOsBNyFUu6u+6vma9YecLDLmT0GVoG2okc1xivodJbnx5 EoHJfln8xRYAtP2JLwO2c12Znt2jzehMm2+/FtPbzKumbhDqPX6aolsmfqN2f+T7JJSY 2Mrc0Y6wCamXD1XnNXMRy59bjJXbBds2gKg4pmf8KDyrDIk8bR79WmSK+5LW5Hld1R8u 1+9RUBHpnxgCt0woEO0PwXaCZLHuLjPnar0C04yNm3S5nIuGLo+alF7e+NeKDmNXqdXw 032VrRqDh639pl2pQpF+25O8InTijGDpTNdtdR9DKBIxfg4OyKx4esjLy97/+ihWKkH2 ByyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737121939; x=1737726739; 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=O9E60eH4NFvltUAEYDSdM5V//h4nzKoVHstzvrxeFhY=; b=pAm9KHee8Y/fFKmW3QrdICanyf7Ri22rgtHyGBe3G+1fcU4BpngdttSWz8g+K+TBHO dnaV0NI7H0siWzIZq7b4K+vGf17suf2vDeugRbUiX6TZVu/4CNWPFS7ojSZNr1sU0Tin CHQZqbrHYMBscSsHlm+jdAFZw5ILXVzXmDH19/U4t3DDmD018Dz9h9QzL5uvTk1Fsx2o cSd2FK5m9DVEIhb9UZGClpZ1tMZdCd2PVtsmX3+B2FNc438Qhf3JWoslHUwdXTIQwEOz UiPQDGemEHKGiwMo4nGtd282XKB8s1nqyLvjF/y+PkAzvt15lxysqKdwqcJpKwBKIIRm 107Q== X-Gm-Message-State: AOJu0YwNqTpw285sEMDMBQ/eJ39Qoo/vCR7aRHWVa5MdbSy/zbUT9qFl VeeIMIWtbT6hJB/a8AAVWorgZikevgpRcF83u94RA6EI6RYmvfuuQo9aU9UEQv8= X-Gm-Gg: ASbGncvevLJKegkcA2m74jdeCq1BglGhHaFpknYQJEmaNPlay12kzHayXZwRpjzwbde LBm6nPKyayp6oCK+wogztNE+0wXFVFs7J9Nsgfh/brXilsLufUUxISyFlTJ4T9Ov1DJDnT4QBJs ceKmsbjjur3eGSvwd5Q0afljX16rfj8A7vIExJBTRsRUW7GLK58Lc81eKgVL70REI165TDlNW8H W1YNNZtGbVnC4gsod+fmAdmccXUE769+QplRJj+g/vj0lf87aBWEYg= X-Google-Smtp-Source: AGHT+IG5mcO1rxRyOUbTNuwhLXWjAL/+7wGngHsS4rZECwG9QK7TrsUE2tUSBjPSOA9n7LnzLzLYbA== X-Received: by 2002:a5d:6d86:0:b0:385:fc00:f5e1 with SMTP id ffacd0b85a97d-38bf5649261mr2859093f8f.9.1737121939007; Fri, 17 Jan 2025 05:52:19 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ab384cea151sm173570766b.74.2025.01.17.05.52.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2025 05:52:16 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 960BD608F7; Fri, 17 Jan 2025 13:43:00 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Stefan Weil , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , John Snow , Cleber Rosa Subject: [PULL 37/37] scripts/nsis.py: Run dependency check for each DLL file only once Date: Fri, 17 Jan 2025 13:42:56 +0000 Message-Id: <20250117134256.2079356-38-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250117134256.2079356-1-alex.bennee@linaro.org> References: <20250117134256.2079356-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32c.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 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 Message-Id: <20250116160306.1709518-38-alex.bennee@linaro.org> 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)