From patchwork Tue Jun 4 09:55:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13684959 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 9E45AC27C50 for ; Tue, 4 Jun 2024 09:57:39 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEQtz-0005Ih-A4; Tue, 04 Jun 2024 05:56:23 -0400 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 1sEQtx-0005Hg-IR for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:56:21 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sEQtv-00021f-Lm for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:56:21 -0400 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-354f3f6c3b1so826889f8f.2 for ; Tue, 04 Jun 2024 02:56:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717494977; x=1718099777; 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=gcCJYiy8N4VBhdUv3burvHdpVxEgBVi2moNCcKrRfBA=; b=M2bQH9bQJK9K0Vh96uMX6+442VmSDtJlIWdQINKQaLs7NLmiMiOlmV1GMeNxH8KMdU j65LxeZXWu1Ogj0FXlZZ1fpQCBGSZjBullaV18DbKa+BBZUbXnM/61vCYJmehbXg7vUu liHzbIl64FwOE0Ss39QpTI9zEP3ECx7xqxt3OrnzuLOv29SJCrmbWQQFhDxbhKTq9Mt1 ilEF4mKfZTezKZDQgyEDzBdCiNSKv9CxD3HzIvi5TSG82ww6KKJYMKzgB8OiKZE92QFH zkHVF7TqptM+etHGUkZBTv53Sdkjq9MXFd28dJrI02XAWuPuJXzPW0KxDqooWRGsmOax 1M+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717494977; x=1718099777; 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=gcCJYiy8N4VBhdUv3burvHdpVxEgBVi2moNCcKrRfBA=; b=uf22uOwKbBQO47cnRZUfVVvWoHs473AAmPpWBhFdCURVDY9Nkz+m+ul79Yg+U3rx4o ryJrv6vfyDwrWNcaikRwcvMpjhAR8rF6zuAKSYM/vsqJE94enkefVhOPrmfdwgNnplip ByiELXQQ69HzmbnSxy2Pmz5IOPAs7sERgl0BGf7v68hpim4DCzO7rqVLPak6d9LOrdl1 kNE+ZGie54RTdQ8pnVIbP76i8Gvsve4vCFgRD5FqzmwPii/CJMochd+/vIP4dslN/D5L Neaw+yW5/aYTaCYqVSEBYyp9R9qCCnOrbbfVJ0F1VbxTTctpCkSMj71mB2fmyCqow4NZ cxNA== X-Gm-Message-State: AOJu0Yw2ckDfNDUy070+nK3VMWMj9l9zqe4vqAeYu3yRNTfO5rTTyplq RxtIcJZhfFGUc/1QypA1us4U6fiCsJVXVtAuEV1MU5JfhEhBFDLld39B/SrnioiR9u0B1+8riYQ G X-Google-Smtp-Source: AGHT+IHfK7kEuDLuzAHU50rjklAg5lDDfmOLGhsNMlUmjILR0rMNJIDvN3xdz7d53ta26FZo3M+YFg== X-Received: by 2002:adf:f58e:0:b0:35b:5a14:984a with SMTP id ffacd0b85a97d-35e0f30c7d4mr8709071f8f.56.1717494976953; Tue, 04 Jun 2024 02:56:16 -0700 (PDT) Received: from m1x-phil.lan ([176.176.159.34]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35dd064b684sm11187323f8f.100.2024.06.04.02.56.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Jun 2024 02:56:16 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Daniel Henrique Barboza , Alistair Francis Subject: [PULL 01/32] target/riscv: Remove unused 'instmap.h' header in translate.c Date: Tue, 4 Jun 2024 11:55:37 +0200 Message-ID: <20240604095609.12285-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240604095609.12285-1-philmd@linaro.org> References: <20240604095609.12285-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Daniel Henrique Barboza Acked-by: Alistair Francis Message-Id: <20230626232007.8933-2-philmd@linaro.org> --- target/riscv/translate.c | 1 - 1 file changed, 1 deletion(-) diff --git a/target/riscv/translate.c b/target/riscv/translate.c index 2c27fd4ce1..32a453f686 100644 --- a/target/riscv/translate.c +++ b/target/riscv/translate.c @@ -28,7 +28,6 @@ #include "exec/log.h" #include "semihosting/semihost.h" -#include "instmap.h" #include "internals.h" #define HELPER_H "helper.h" From patchwork Tue Jun 4 09:55:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13684956 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 7F0D8C25B78 for ; Tue, 4 Jun 2024 09:57:10 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEQu2-0005Jc-VE; Tue, 04 Jun 2024 05:56:27 -0400 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 1sEQu1-0005J7-Rk for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:56:26 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sEQu0-00022D-7O for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:56:25 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-42137366995so34379345e9.3 for ; Tue, 04 Jun 2024 02:56:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717494982; x=1718099782; 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=2Ay+Vb25Ah58Dvvnz7p7zDrtYiMbYdEQ6V3ef1gToK4=; b=NAOqbAZ9rXscGu3Fo7xbmPVgkeZ9s/+ZuBzZJ5F7mW3ba9mMw8NOxkLNZlQmHV2F47 meV0OOq0IvtlNV8o+61z4+HhD5amDZsdVCwv4z0/8hDt864ahNwNlW+27VyG44lNPZWk 7Av4VmzUxZMgS9YPzI2gV8db+reyrO1Fv12y+CScxO2sonfOSiC41V8XwgViWZ9dvGOP luWNFRBcyh+ma52HYL3BiWjpuPpXkCZH/Kgna3WvgM0QtA95JIixfWEeLZzpL6AbQoP9 BTyNr1Ouwhsw+dEG7CCuXwMY8U7sroRkn3rD5qKCgPm4hxWs/hlk3RTCo9NFOQBkc6H1 NynQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717494982; x=1718099782; 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=2Ay+Vb25Ah58Dvvnz7p7zDrtYiMbYdEQ6V3ef1gToK4=; b=NMz15+YlDtZFxrkZLcyzVWVw3BLObXncExJqqAwPGb5LtiBp57/WzQtMqWZABoxEas Uk0CB4uxAxl246z7RMTEVStZh9yVl94PFjDOKHw4fPzg3xKGF3gkIWoTz7+iAw1ZGSag 2jaYBi65Vt1x+bAJlpzM95DEco5UlF+DFUt+QGRfoC/n3KIMNpULCBeukzngFoeAODs/ oEGhVcqYuw87lN2TIqx2Zd0aD7Thy6LrWMC/JUZq6xcL7B4ikiAl1bmz669Ngp3ocH+J CEaAaEHDwC/L8YHe5trUoxe8r+8nHRpOoLsb+1mEbi+nuMuclH7fRQFfBjgQmnwKAcCU 4ADw== X-Gm-Message-State: AOJu0Yxeo8EvlyoBEh1VPim7096yhSNpIqEuVnUuwCPbv8AtNkmioabO lBDbuv15512wb8qtAOj77f2ATrUhMYwkRUJeRDa374XNR3qhhibvZvWRm2U4tfnl6kEPE3EWpXr E X-Google-Smtp-Source: AGHT+IEB8RT1GC6X383o/hp+NDc23LnbLGFkWuJ/5Rrx9E8cXvl7ht1QjD66JW21WJEss1u3LKXVGw== X-Received: by 2002:a05:600c:5248:b0:421:4ecb:bd68 with SMTP id 5b1f17b1804b1-4214ecbbf7amr14446145e9.31.1717494982345; Tue, 04 Jun 2024 02:56:22 -0700 (PDT) Received: from m1x-phil.lan ([176.176.159.34]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35dd062edbcsm11070738f8f.84.2024.06.04.02.56.21 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Jun 2024 02:56:21 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Daniel Henrique Barboza , Alistair Francis Subject: [PULL 02/32] target/riscv: Restrict 'rv128' machine to TCG accelerator Date: Tue, 4 Jun 2024 11:55:38 +0200 Message-ID: <20240604095609.12285-3-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240604095609.12285-1-philmd@linaro.org> References: <20240604095609.12285-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 only build for 32/64-bit hosts, so TCG is required for 128-bit targets. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Daniel Henrique Barboza Acked-by: Alistair Francis Message-Id: <20230626232007.8933-5-philmd@linaro.org> --- target/riscv/cpu.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index eb1a2e7d6d..0dad66ec96 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -591,6 +591,7 @@ static void rv64_veyron_v1_cpu_init(Object *obj) #endif } +#ifdef CONFIG_TCG static void rv128_base_cpu_init(Object *obj) { RISCVCPU *cpu = RISCV_CPU(obj); @@ -612,6 +613,7 @@ static void rv128_base_cpu_init(Object *obj) set_satp_mode_max_supported(RISCV_CPU(obj), VM_1_10_SV57); #endif } +#endif /* CONFIG_TCG */ static void rv64i_bare_cpu_init(Object *obj) { @@ -624,7 +626,9 @@ static void rv64e_bare_cpu_init(Object *obj) CPURISCVState *env = &RISCV_CPU(obj)->env; riscv_cpu_set_misa_ext(env, RVE); } -#else + +#else /* !TARGET_RISCV64 */ + static void rv32_base_cpu_init(Object *obj) { RISCVCPU *cpu = RISCV_CPU(obj); @@ -2550,12 +2554,14 @@ static const TypeInfo riscv_cpu_type_infos[] = { DEFINE_VENDOR_CPU(TYPE_RISCV_CPU_SHAKTI_C, MXL_RV64, rv64_sifive_u_cpu_init), DEFINE_VENDOR_CPU(TYPE_RISCV_CPU_THEAD_C906, MXL_RV64, rv64_thead_c906_cpu_init), DEFINE_VENDOR_CPU(TYPE_RISCV_CPU_VEYRON_V1, MXL_RV64, rv64_veyron_v1_cpu_init), +#ifdef CONFIG_TCG DEFINE_DYNAMIC_CPU(TYPE_RISCV_CPU_BASE128, MXL_RV128, rv128_base_cpu_init), +#endif /* CONFIG_TCG */ DEFINE_BARE_CPU(TYPE_RISCV_CPU_RV64I, MXL_RV64, rv64i_bare_cpu_init), DEFINE_BARE_CPU(TYPE_RISCV_CPU_RV64E, MXL_RV64, rv64e_bare_cpu_init), DEFINE_PROFILE_CPU(TYPE_RISCV_CPU_RVA22U64, MXL_RV64, rva22u64_profile_cpu_init), DEFINE_PROFILE_CPU(TYPE_RISCV_CPU_RVA22S64, MXL_RV64, rva22s64_profile_cpu_init), -#endif +#endif /* TARGET_RISCV64 */ }; DEFINE_TYPES(riscv_cpu_type_infos) From patchwork Tue Jun 4 09:55:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13684961 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 A0B54C25B78 for ; Tue, 4 Jun 2024 09:57:45 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEQu8-0005MG-OS; Tue, 04 Jun 2024 05:56:32 -0400 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 1sEQu7-0005Kh-4w for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:56:31 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sEQu5-00022m-HN for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:56:30 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-42148c0cb1aso7985225e9.3 for ; Tue, 04 Jun 2024 02:56:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717494988; x=1718099788; 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=zrlTj9cDcahH+eORLITQpITIeYXXxYxxz/PmNCcuvu0=; b=wYmf98EERJwEuRcOhDZNCyTq8jvFQMPkD5oQoJI0POrmp8anBRy6I9RzEneDZs3bmk kFpOWnZp9gEKxMN7Aw3kr2dFaJdE5HU+QS7MVwrIBeWQZUhbbNoAHIdqpv3rv2RQ6rRV 52bip7zC0WGHXGpOJQ5KAYJ8qavFnQr9P+aPwSD9s5xPxP96F+SbsEI98J6cRprx0itZ eFbvVMD6AGARdf4Vd2ahsJAtxuzvVtguThAUBx2IILgEuzVP+3BDIlw6Eci0+FJyrX2u 2t/6MOfbBEwNO9ugx6+FexFvi4CELiw8Kp457B3aRFPGbLMpUXF3qAaMkwDm43/PKhI6 QPeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717494988; x=1718099788; 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=zrlTj9cDcahH+eORLITQpITIeYXXxYxxz/PmNCcuvu0=; b=b2nB1M4S7U/VKMcpPQu3e8mokd1Qi4HrmRl3yMPqajaq/KAzaHZLKS4vo7fKDSP3ay aeil9jzDFGgU6DigS3E/pRtlyWDCt4ZULxWBys05Mrz4rgdxMdujZUW6RPqBqr4GuaPH C6+YUxI3NTY+rA9m+jTRiQDQqPfudF6ptGQVH5oMZMRwi5UGz/wCiIj7WXJlQSSZ22vC /QEe3UbuNXAMjiw3evH5PPpj8EonNBjDJmSl3DDkh/gubPc61emn3ztzGgc4deB1U5F8 3x2ur7eBsJGYvaKt5bGXXFsZGDYh6AM045EYuXQQQB8vQmyv+PQ7Kbk46FATsZZsBuGi jnBg== X-Gm-Message-State: AOJu0YyVcMtg+NtdoKpdTQhwdOXg4a8eyR1hLe64+UhNFKYB9xo/s25w kOhdGpsGrHWKF8ldrCZTh51xJLzY73BgzJ4azW6xoyDGg4yURsVym497nqFwqSA2D4/fOQNoBGX E X-Google-Smtp-Source: AGHT+IHWs7uPb0NyGUgObjklZI4NgfIFdJpJaHQTqQZCerlzgx2FSVXyMqfc5U3eHBi6nNpdTqRVaA== X-Received: by 2002:a05:600c:1550:b0:421:2ac2:d7c8 with SMTP id 5b1f17b1804b1-4212e0622afmr103510855e9.18.1717494987865; Tue, 04 Jun 2024 02:56:27 -0700 (PDT) Received: from m1x-phil.lan ([176.176.159.34]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35dd064b030sm11067292f8f.105.2024.06.04.02.56.26 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Jun 2024 02:56:27 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Daniel Henrique Barboza , Alistair Francis Subject: [PULL 03/32] target/riscv: Restrict riscv_cpu_do_interrupt() to sysemu Date: Tue, 4 Jun 2024 11:55:39 +0200 Message-ID: <20240604095609.12285-4-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240604095609.12285-1-philmd@linaro.org> References: <20240604095609.12285-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 riscv_cpu_do_interrupt() is not reachable on user emulation. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Daniel Henrique Barboza Reviewed-by: Alistair Francis Message-Id: <20230626232007.8933-7-philmd@linaro.org> --- target/riscv/cpu.h | 5 +++-- target/riscv/cpu_helper.c | 7 ++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index 2d0c02c35b..648e640f22 100644 --- a/target/riscv/cpu.h +++ b/target/riscv/cpu.h @@ -484,7 +484,6 @@ extern const char * const riscv_int_regnamesh[]; extern const char * const riscv_fpr_regnames[]; const char *riscv_cpu_get_trap_name(target_ulong cause, bool async); -void riscv_cpu_do_interrupt(CPUState *cpu); int riscv_cpu_write_elf64_note(WriteCoreDumpFunction f, CPUState *cs, int cpuid, DumpState *s); int riscv_cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cs, @@ -514,6 +513,7 @@ int riscv_cpu_max_xlen(RISCVCPUClass *mcc); bool riscv_cpu_option_set(const char *optname); #ifndef CONFIG_USER_ONLY +void riscv_cpu_do_interrupt(CPUState *cpu); void riscv_isa_write_fdt(RISCVCPU *cpu, void *fdt, char *nodename); void riscv_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr, vaddr addr, unsigned size, @@ -539,7 +539,8 @@ void riscv_cpu_set_aia_ireg_rmw_fn(CPURISCVState *env, uint32_t priv, void *rmw_fn_arg); RISCVException smstateen_acc_ok(CPURISCVState *env, int index, uint64_t bit); -#endif +#endif /* !CONFIG_USER_ONLY */ + void riscv_cpu_set_mode(CPURISCVState *env, target_ulong newpriv); void riscv_translate_init(void); diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c index 8ad546a45a..0868357f1c 100644 --- a/target/riscv/cpu_helper.c +++ b/target/riscv/cpu_helper.c @@ -1635,7 +1635,6 @@ static target_ulong riscv_transformed_insn(CPURISCVState *env, return xinsn; } -#endif /* !CONFIG_USER_ONLY */ /* * Handle Traps @@ -1645,8 +1644,6 @@ static target_ulong riscv_transformed_insn(CPURISCVState *env, */ void riscv_cpu_do_interrupt(CPUState *cs) { -#if !defined(CONFIG_USER_ONLY) - RISCVCPU *cpu = RISCV_CPU(cs); CPURISCVState *env = &cpu->env; bool write_gva = false; @@ -1842,6 +1839,6 @@ void riscv_cpu_do_interrupt(CPUState *cs) env->two_stage_lookup = false; env->two_stage_indirect_lookup = false; -#endif - cs->exception_index = RISCV_EXCP_NONE; /* mark handled to qemu */ } + +#endif /* !CONFIG_USER_ONLY */ From patchwork Tue Jun 4 09:55:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13684962 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 452C5C27C50 for ; Tue, 4 Jun 2024 09:57:47 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEQuD-0005OQ-Sp; Tue, 04 Jun 2024 05:56:37 -0400 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 1sEQuC-0005Nm-OU for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:56:36 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sEQuB-00023E-8j for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:56:36 -0400 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-35e0eb3efd0so772108f8f.0 for ; Tue, 04 Jun 2024 02:56:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717494993; x=1718099793; 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=9Ft5fiyMmdVHsVWcIS5vXcjPxaNkK/GEvLAcOaQ7yGI=; b=Mqe/tJPyL8EKxoRQIqyCbZFppiMfOFrLC1gNneeJ5tABTk/5YGKCr2TkezHVllAM9u ZWPdZBo+dpk+1YRMchwEd3PXyYmD/zMG8P8jOnraLzS5Hv7lpsZN9MtHPjXyAWgsXL7I ePprktmhE+pkEHI2sUn5GY44Sv291g4epRMNOkYSHTQapaoPbq1/be5pqlL61uwQBMS0 H89DZCbdMj63KJUaW0CQiunhanEx4DtOR/5Z6zlGzDcRfWyf13oHesSKefXJXJR+atcH bmYdMPgSgRhmuTGXDBSQQlJOUJf8DUZ7pXIy/HAPTx4EM1Ln0q8H9WceOoF2zaVztVny M52w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717494993; x=1718099793; 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=9Ft5fiyMmdVHsVWcIS5vXcjPxaNkK/GEvLAcOaQ7yGI=; b=w/BThb8dqv9J5w32p0lq/hWTgirwsbd3X0g6fIZdM07fw4zwusEH6D6ko/teDdH8zX WzMDSrf29pR/j5iIz2lITmqkRhpFZB4wHHE4fNJMYygOu0+eAYV+cBRCLk9nPeonc74O CRZBzO7yLfnXdYgYbiyHwS14rTcfifJGLNNFU6ce9IdbAsXzEpdA7al6yLY6Bi66rjwa 9+KaOihBtKqfzDYtzey5TT6c1Ezf4dPs/jKtEdD85CTfewgVbRkfi/lOYKyMsRw5cF4o lgc+c7pAHx8vcQDbboa2dGb52Zj2TDcZNDpw+aSPmAqTt2r4duHAfUJGp/HgzH4+w7YK 7bNA== X-Gm-Message-State: AOJu0YzYWiTmupciicBGLwrnT7tzKrA24MjXLtlVqNWrBFCHCsNXmhSE 8SUv9zF83WiletMmtRbEWrJPLkgbSko0NyHdlF6tKacLcrWvR8Ae84GqpTiWgWdKKmnzTfEp4Nr d X-Google-Smtp-Source: AGHT+IFOUfeIDokwxi3zlwKF8+obQ6Jnb9GzXIStMD9239fgD4ZM/mEnb7wHl1g+Zrr7HhyvARaWpA== X-Received: by 2002:adf:b319:0:b0:354:f9f0:a7ed with SMTP id ffacd0b85a97d-35e0f30bd3amr7374057f8f.47.1717494993264; Tue, 04 Jun 2024 02:56:33 -0700 (PDT) Received: from m1x-phil.lan ([176.176.159.34]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35dd064afd8sm10968444f8f.95.2024.06.04.02.56.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Jun 2024 02:56:32 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Jiaxun Yang Subject: [PULL 04/32] target/mips: Remove unused 'hw/misc/mips_itu.h' header Date: Tue, 4 Jun 2024 11:55:40 +0200 Message-ID: <20240604095609.12285-5-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240604095609.12285-1-philmd@linaro.org> References: <20240604095609.12285-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=philmd@linaro.org; helo=mail-wr1-x435.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 commit e1152f8166 ("target/mips: Remove helpers accessing SAAR registers") this header is not needed. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Jiaxun Yang Message-Id: <20240529155216.5574-1-philmd@linaro.org> --- target/mips/tcg/sysemu/cp0_helper.c | 1 - 1 file changed, 1 deletion(-) diff --git a/target/mips/tcg/sysemu/cp0_helper.c b/target/mips/tcg/sysemu/cp0_helper.c index ded6c78e9a..79a5c833ce 100644 --- a/target/mips/tcg/sysemu/cp0_helper.c +++ b/target/mips/tcg/sysemu/cp0_helper.c @@ -28,7 +28,6 @@ #include "qemu/host-utils.h" #include "exec/helper-proto.h" #include "exec/exec-all.h" -#include "hw/misc/mips_itu.h" /* SMP helpers. */ From patchwork Tue Jun 4 09:55:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13684980 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 4A7F0C27C50 for ; Tue, 4 Jun 2024 09:59:56 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEQuK-0005SE-D5; Tue, 04 Jun 2024 05:56:44 -0400 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 1sEQuI-0005RJ-Jf for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:56:42 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sEQuH-00023Y-0L for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:56:42 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-4214aa43a66so6415555e9.1 for ; Tue, 04 Jun 2024 02:56:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717494999; x=1718099799; 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=DIOW1O9+X9Zn3nRI+K8vVtjj1gMTn5Z9TMOA7fC7V5E=; b=TWdj9g5FinwiyYHMKRkUXc9R2VgTXTVUZ54qGpr1sRmbASXQUUdQ20fkGJ/dDSzaxU F0gL49nyPulyQSDlUIkRf0PVjB0+kr7kV/IQIFVdbugwVxJAvvDkyzfObY/8xqQ4xdXw CbEEbpH2mDRJiEcUNudDtLlNt0bSgHAtxjocIzafUWvjk0dkxZ1bffJLvgk5Y1BY43Jz 7Iqp0cBx5YsAjEUFB5VUz0d3L5FBf34/yP7NAPS/k7HIBsyYJPB4gGkxD+OZ8xE1Or+7 JWMdnfSywzBB47Fy2sq3IEHThPSj9EnO6VCIFQ24pb85fUcJsSIm56TdQAOUZkPR1LTv qzBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717494999; x=1718099799; 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=DIOW1O9+X9Zn3nRI+K8vVtjj1gMTn5Z9TMOA7fC7V5E=; b=sz1lh7IwC+9pl8dM/jFDtBliWbq8ZnUvJKoxPM/ZSYMo2o5aZ0l30hyuBJDys7msXh 5ERCCULIpdkvDUosHOifWy5LNf/AoVVitK4Kc1NfVW9PXopKymb47TYkJEAmgkZ0uDEg VLHKNN0Dy9b4UPrbGA9ggTg5ZulTvBYHhrGJA6d6GphpembjYSpytyJ+7/qu698+L5QW vC44CtPD1UanJupDRqcBlRMxfQLHVLBBBwEcQRHGuwULpwhdveDrZLrEGqWzwsLqbWLm oFkNbQiUCtjZsg1RAgDl3K2aRRsztkUQRRKWdpcum6NTHrLeKlSQnRkvxIvL4RcG9Ds0 kWjA== X-Gm-Message-State: AOJu0YyPTXV0fRP+jfN3mZXdzsOAMtJHW77CKNuCDAdDdMNRJUjmLM5F HzBeIJ5yQBj/WbPsMKv5/CNkHRNR2/7mVzO0ci6U/iUM0dwKTT17X8ydXjOoCyY0DH5R3rgUTia U X-Google-Smtp-Source: AGHT+IHYIfssMgJyQViH/PG6SUuqwghodOPEqtXUG+smjvs7TA/ME23+Z4ueQBHBUjHOhSPJBe1V9Q== X-Received: by 2002:a05:600c:45cb:b0:41a:c92:d323 with SMTP id 5b1f17b1804b1-4212e04a1famr109906945e9.10.1717494998765; Tue, 04 Jun 2024 02:56:38 -0700 (PDT) Received: from m1x-phil.lan ([176.176.159.34]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42138c41becsm95838805e9.30.2024.06.04.02.56.37 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Jun 2024 02:56:38 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Peter Maydell Subject: [PULL 05/32] target/arm: Replace sprintf() by snprintf() Date: Tue, 4 Jun 2024 11:55:41 +0200 Message-ID: <20240604095609.12285-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240604095609.12285-1-philmd@linaro.org> References: <20240604095609.12285-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.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, T_SCC_BODY_TEXT_LINE=-0.01 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 sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, resulting in painful developper experience. Use snprintf() instead. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Peter Maydell Message-Id: <20240411104340.6617-9-philmd@linaro.org> Signed-off-by: Richard Henderson --- target/arm/cpu64.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c index 862d2b92fa..262a1d6c0b 100644 --- a/target/arm/cpu64.c +++ b/target/arm/cpu64.c @@ -437,7 +437,7 @@ void aarch64_add_sve_properties(Object *obj) for (vq = 1; vq <= ARM_MAX_VQ; ++vq) { char name[8]; - sprintf(name, "sve%d", vq * 128); + snprintf(name, sizeof(name), "sve%d", vq * 128); object_property_add(obj, name, "bool", cpu_arm_get_vq, cpu_arm_set_vq, NULL, &cpu->sve_vq); } @@ -462,7 +462,7 @@ void aarch64_add_sme_properties(Object *obj) for (vq = 1; vq <= ARM_MAX_VQ; vq <<= 1) { char name[8]; - sprintf(name, "sme%d", vq * 128); + snprintf(name, sizeof(name), "sme%d", vq * 128); object_property_add(obj, name, "bool", cpu_arm_get_vq, cpu_arm_set_vq, NULL, &cpu->sme_vq); } From patchwork Tue Jun 4 09:55:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13684958 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 D609FC25B78 for ; Tue, 4 Jun 2024 09:57:16 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEQuO-0005Va-Tl; Tue, 04 Jun 2024 05:56:48 -0400 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 1sEQuN-0005UF-GV for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:56:47 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sEQuL-00025K-UI for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:56:47 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-4214053918aso8458395e9.2 for ; Tue, 04 Jun 2024 02:56:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717495004; x=1718099804; 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=jgoZWUZoZ64J/jsUK/BO8m7HZCfTE8MphpmeDDotPMw=; b=bZjgJBI5284J1SjHUkyo71g4FxGv0FKXFQ7qbmdsp7foBi+PD22NmzUeVL3rR2LvDo 5UZ6+HxGxofMuFiSmmMPZjHrc458b6FK3dXYJVR6yczeoSX2EvqQf376ICBbF6o3E9Q8 /mLdZixbEB+m0waUJW0WuI7Nz2mfd59MkvLgGpIWEBcIWYZojBPmD4A0H+XW94/hWcah +91LuGeooOnuRPyoKjLEQjCS3OWCfQ/W82urb9dCDOg6cgH6Ngy/zjhKJ7Pn4sr3uLFz NwkX/cYm2NAMjiiXqxz7t0Lvlq/bjMbnitDihIsvAghryjd8N4QM7zkAGvJmSVnoD1Rt AVQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717495004; x=1718099804; 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=jgoZWUZoZ64J/jsUK/BO8m7HZCfTE8MphpmeDDotPMw=; b=RQeXTS5CdvESx9F1rgT1vM5OlJTE9yWL+v418Dv6GMi1xcAvtpTz+5nn/awM+D98yz A3n9xpA40dqkowMVS2OeGPTRXoiftAe+h2kobKl/ISRLNeko/y9VSCVpuFEn0uNB9MhJ aas87yRtjeEJ13rLCSOQ5hQkFjaS2i/GALHkHQ5q0ywh+XI7xN0wKuYkSMwu0SGU30ds /jGNveoJYsYiN7G/ZwCoZv7rsRmd1Mqd4pOlLbk7pExuWZnXsWdrMUsPLC29HWLN+936 7nHCgrtIAAcdOnE6Rk10jvJT3AjwHtvFzcCSeRvaJlwx04rGaqgWWOfJTZh1tSBlEnZP zxyA== X-Gm-Message-State: AOJu0YzzZ1vMcnm+6JOvgLobGQ8yrFLCsWKFYum8ZVaiUWRRZIdKOvuq pys8jIplVag6cgr7lRylbsILi0j4nnHL3nYR2kHQD6Bo8xFCOhu0/ikmfXf+WXu6rJTIPMk6UM/ L X-Google-Smtp-Source: AGHT+IFjz5uT6H7AV9C1AonhIUawUqa9v/TOZ27fTuoOI1efggQKW6efBbW3dYEmVNCqidttAZD92Q== X-Received: by 2002:a05:600c:4454:b0:420:18e9:86d5 with SMTP id 5b1f17b1804b1-4212e047556mr110629845e9.10.1717495004276; Tue, 04 Jun 2024 02:56:44 -0700 (PDT) Received: from m1x-phil.lan ([176.176.159.34]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4212b83d469sm147315445e9.9.2024.06.04.02.56.43 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Jun 2024 02:56:43 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , Zhao Liu Subject: [PULL 06/32] target/i386/kvm: Improve KVM_EXIT_NOTIFY warnings Date: Tue, 4 Jun 2024 11:55:42 +0200 Message-ID: <20240604095609.12285-7-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240604095609.12285-1-philmd@linaro.org> References: <20240604095609.12285-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.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, T_SCC_BODY_TEXT_LINE=-0.01 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: Richard Henderson Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Zhao Liu Message-ID: <20240412073346.458116-28-richard.henderson@linaro.org> [PMD: Fixed typo reported by Peter Maydell] Signed-off-by: Philippe Mathieu-Daudé --- target/i386/kvm/kvm.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c index 6c864e4611..82ebddada1 100644 --- a/target/i386/kvm/kvm.c +++ b/target/i386/kvm/kvm.c @@ -5329,7 +5329,6 @@ int kvm_arch_handle_exit(CPUState *cs, struct kvm_run *run) uint64_t code; int ret; bool ctx_invalid; - char str[256]; KVMState *state; switch (run->exit_reason) { @@ -5389,15 +5388,15 @@ int kvm_arch_handle_exit(CPUState *cs, struct kvm_run *run) case KVM_EXIT_NOTIFY: ctx_invalid = !!(run->notify.flags & KVM_NOTIFY_CONTEXT_INVALID); state = KVM_STATE(current_accel()); - sprintf(str, "Encounter a notify exit with %svalid context in" - " guest. There can be possible misbehaves in guest." - " Please have a look.", ctx_invalid ? "in" : ""); if (ctx_invalid || state->notify_vmexit == NOTIFY_VMEXIT_OPTION_INTERNAL_ERROR) { - warn_report("KVM internal error: %s", str); + warn_report("KVM internal error: Encountered a notify exit " + "with invalid context in guest."); ret = -1; } else { - warn_report_once("KVM: %s", str); + warn_report_once("KVM: Encountered a notify exit with valid " + "context in guest. " + "The guest could be misbehaving."); ret = 0; } break; From patchwork Tue Jun 4 09:55:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13684957 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 24982C25B78 for ; Tue, 4 Jun 2024 09:57:14 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEQuU-0005Y4-VH; Tue, 04 Jun 2024 05:56:54 -0400 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 1sEQuT-0005XQ-7Y for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:56:53 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sEQuR-00025q-Nv for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:56:52 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-4214f52b810so5715635e9.1 for ; Tue, 04 Jun 2024 02:56:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717495010; x=1718099810; 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=Hob+P2Sg+ihzbfNnyrqDcUFLAYWTTSYARygSNcUTJO4=; b=j9tCm+Wm51aG9HL1/qRQTo31h1jQ53Nux/3nFAMQu71FfcrEd6GpIraFRpazo7rgOu 9qpBVnLeIezJX20H3kiHyPgWh6rEh3Vohh0p7EKJvKVlhH89XkDot3RTj77thqM9cxsW ukmLH3dmDEd9AW4VRgT/9hmSJir9FAmx1j1KkyM2+xeP/R3Q6d65/TXehu0+U68LQ/Gk YNNiKWYGt0KIYK/6rJFkGK8JQGvJz/cnfPP8Er0qk043a7/gTSRAxfAtELWiTCb5gSx0 zNdGwGplzSMiZAAAcgw9m5+sPAOo3ZTcPhAisDmwhVttjPGdCGZoz27jSrhciBrA6Eu1 hBPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717495010; x=1718099810; 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=Hob+P2Sg+ihzbfNnyrqDcUFLAYWTTSYARygSNcUTJO4=; b=sqbFQFTOdr/ycHd54V8WSoHasFeR1IUGTn7G0tyF+n0+DIE4dz3CMRBxfP8ObR9FxD rNmT3bfayveB1rHy8ab3ozl3mPrhDwS95eUXMop5mkF6S4dTAT2p9KfTHw7pEXO6/iKG FVLJB+LYZe26QWkHlLwz0i9XKVAaoyR+e7yvwkFStoFU6djxAmOvRIO3NgG5EdxCBbCO l3tAAGHCn1hQ9O1CLLVC/OsOwTIF+kb7iP6zJZJerfOX7nWJ3n1neLeThDCQEjxfyL0q r0NAwViSZejQG7JX3rMf/WQcO4oxmOs0pGWnPsvELflt50omUTrpa+jmSnBss861qHpP iTug== X-Gm-Message-State: AOJu0YyEkxhzq/HY3CDVFis5IiePyMjznOzDZF5mmcV3yYF194nLiDgD q/o9e5VWpMoFv469onGI0k4WkUf9akMBbfZPYGhLgRwgz79ee7oVqQ7xAW1wcxF6b6DyW1gv2JJ O X-Google-Smtp-Source: AGHT+IFk7VVvgi/EwuzktBTb/DDMNLfi9oY40NMURF6XYYaKnXP/ZL4PBlcB6PrOt12Vrf5S6PznQg== X-Received: by 2002:a05:600c:a03:b0:421:499c:7039 with SMTP id 5b1f17b1804b1-421499c71acmr20096295e9.29.1717495009779; Tue, 04 Jun 2024 02:56:49 -0700 (PDT) Received: from m1x-phil.lan ([176.176.159.34]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4212c0fb7c2sm145029725e9.26.2024.06.04.02.56.48 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Jun 2024 02:56:49 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Peter Maydell Subject: [PULL 07/32] disas/m68k: Replace sprintf() by snprintf() Date: Tue, 4 Jun 2024 11:55:43 +0200 Message-ID: <20240604095609.12285-8-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240604095609.12285-1-philmd@linaro.org> References: <20240604095609.12285-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.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, T_SCC_BODY_TEXT_LINE=-0.01 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 sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, resulting in painful developper experience. Use snprintf() instead. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Peter Maydell Message-Id: <20240411104340.6617-2-philmd@linaro.org> Signed-off-by: Richard Henderson --- disas/m68k.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/disas/m68k.c b/disas/m68k.c index 1f16e295ab..800b4145ac 100644 --- a/disas/m68k.c +++ b/disas/m68k.c @@ -1000,7 +1000,7 @@ print_indexed (int basereg, /* Generate the text for the index register. Where this will be output is not yet determined. */ - sprintf (buf, "%s:%c%s", + snprintf(buf, sizeof(buf), "%s:%c%s", reg_names[(word >> 12) & 0xf], (word & 0x800) ? 'l' : 'w', scales[(word >> 9) & 3]); From patchwork Tue Jun 4 09:55:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13684966 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 63593C25B78 for ; Tue, 4 Jun 2024 09:57:52 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEQua-0005ZY-8D; Tue, 04 Jun 2024 05:57:00 -0400 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 1sEQuY-0005Z3-SO for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:56:58 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sEQuW-000261-TH for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:56:58 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-35dcd5377c4so4442046f8f.2 for ; Tue, 04 Jun 2024 02:56:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717495015; x=1718099815; 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=vkD3w3/QnVGpH+/ZIlaZduOawYbzu0aNROx1qgMgywQ=; b=Bil//0OEsxsi3lJxCzD/CQy/kMLOEWmdTK4Sb56Hh4jH1rfKudFg8dPYwK6c49ggXN k4WAVSyy8+1SxT2vVIhYG0upm2007afc1BMBUwcALs3mX4ZdRcLzzTz4pcQDnE0ALT6s 7VBCr3xcm2A3FgE6y4eNFevxebPLC0CCu7XKqeuYyOCDXvsRAgx7oHNt0ZyJUTYiIotN J3p6LQ+N+rn6AvuQs4JuG04jvd06ia/SA0KJ0hn47p8Xpej+qB0BB8EcG2cHQMOuDyur vH/mDex5DZ4Z9WG5a+KFCXFvWL0FjizuCUIlA4DoPPm1MFCMv/KHJkT0zQFFQbcPz5Z1 xkwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717495015; x=1718099815; 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=vkD3w3/QnVGpH+/ZIlaZduOawYbzu0aNROx1qgMgywQ=; b=r26JDxFYeOYCvEvVdm+d1XIAonN5h14WW8gzvPxmFX16eKPpbFptbZ2wLpRgKlxGM9 QdoqrMyp/D615SMQXaQDRa1Ie4yzJISdRh5iVMCSmx1y22SlyBqnXKRfRNWq7PQZKfk3 T6cRf1cji/Qs+a2yy5bX4NEve8dVMK9F0aLN1eNdNbaV2SP2EQunR2zpFtkSGl5HKcQe 2I3qIn0KhZSX9/HFxDiTurHVha2IkBQLnQTyPSVB8e2AHszWDPHL2Bb1tHa+cjx3QPFK f4pQ4iEt6P8W5qtcvoZlnAohhUAMsnpGazZ85yA3Wfz3Zgvn8lHydq5zghhBXg2ISlDh aAlg== X-Gm-Message-State: AOJu0Ywc00+NC0cAy+tZyRjEQwmN++NF3biASGzC8QQrB0vKeo9rwMCD autmz33Vg3LmMQD+wiQuTGajOsgSHM0hRTWYEdQwpnB+m0nUml60bXsflU+6wfc5XLKSpvd2RHM Q X-Google-Smtp-Source: AGHT+IF3905Eq57FpvlfP0N2hoGm5y4O+6V7XarkSYN030TNRFD4wsfMnD/RZfWk85H4PmmHa8DqsA== X-Received: by 2002:a5d:484f:0:b0:354:e22d:c7da with SMTP id ffacd0b85a97d-35e0f2a9ab0mr8195900f8f.39.1717495015110; Tue, 04 Jun 2024 02:56:55 -0700 (PDT) Received: from m1x-phil.lan ([176.176.159.34]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35dd066b47asm10972385f8f.112.2024.06.04.02.56.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Jun 2024 02:56:54 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Edgar E . Iglesias" , Richard Henderson Subject: [PULL 08/32] disas/microblaze: Replace sprintf() by snprintf() Date: Tue, 4 Jun 2024 11:55:44 +0200 Message-ID: <20240604095609.12285-9-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240604095609.12285-1-philmd@linaro.org> References: <20240604095609.12285-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=philmd@linaro.org; helo=mail-wr1-x42e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 sprintf() is deprecated on Darwin since macOS 13.0 / XCode 14.1, resulting in painful developper experience. Use snprintf() instead. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Edgar E. Iglesias Message-Id: <20240411104340.6617-3-philmd@linaro.org> Signed-off-by: Richard Henderson --- disas/microblaze.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/disas/microblaze.c b/disas/microblaze.c index 0b89b9c4fa..49a4c0fd40 100644 --- a/disas/microblaze.c +++ b/disas/microblaze.c @@ -600,7 +600,8 @@ static char * get_field (long instr, long mask, unsigned short low) { char tmpstr[25]; - sprintf(tmpstr, "%s%d", register_prefix, (int)((instr & mask) >> low)); + snprintf(tmpstr, sizeof(tmpstr), "%s%d", register_prefix, + (int)((instr & mask) >> low)); return(strdup(tmpstr)); } @@ -608,7 +609,8 @@ static char * get_field_imm (long instr) { char tmpstr[25]; - sprintf(tmpstr, "%d", (short)((instr & IMM_MASK) >> IMM_LOW)); + snprintf(tmpstr, sizeof(tmpstr), "%d", + (short)((instr & IMM_MASK) >> IMM_LOW)); return(strdup(tmpstr)); } @@ -616,7 +618,8 @@ static char * get_field_imm5 (long instr) { char tmpstr[25]; - sprintf(tmpstr, "%d", (short)((instr & IMM5_MASK) >> IMM_LOW)); + snprintf(tmpstr, sizeof(tmpstr), "%d", + (short)((instr & IMM5_MASK) >> IMM_LOW)); return(strdup(tmpstr)); } @@ -624,7 +627,8 @@ static char * get_field_rfsl (long instr) { char tmpstr[25]; - sprintf(tmpstr, "%s%d", fsl_register_prefix, (short)((instr & RFSL_MASK) >> IMM_LOW)); + snprintf(tmpstr, sizeof(tmpstr), "%s%d", fsl_register_prefix, + (short)((instr & RFSL_MASK) >> IMM_LOW)); return(strdup(tmpstr)); } @@ -632,7 +636,8 @@ static char * get_field_imm15 (long instr) { char tmpstr[25]; - sprintf(tmpstr, "%d", (short)((instr & IMM15_MASK) >> IMM_LOW)); + snprintf(tmpstr, sizeof(tmpstr), "%d", + (short)((instr & IMM15_MASK) >> IMM_LOW)); return(strdup(tmpstr)); } @@ -641,7 +646,8 @@ static char * get_field_unsigned_imm (long instr) { char tmpstr[25]; - sprintf(tmpstr, "%d", (int)((instr & IMM_MASK) >> IMM_LOW)); + snprintf(tmpstr, sizeof(tmpstr), "%d", + (int)((instr & IMM_MASK) >> IMM_LOW)); return(strdup(tmpstr)); } #endif @@ -653,7 +659,8 @@ get_field_unsigned_imm (long instr) { char tmpstr[25]; - sprintf(tmpstr, "%s%s", register_prefix, (((instr & IMM_MASK) >> IMM_LOW) & REG_MSR_MASK) == 0 ? "pc" : "msr"); + snprintf(tmpstr, sizeof(tmpstr), "%s%s", register_prefix, + (((instr & IMM_MASK) >> IMM_LOW) & REG_MSR_MASK) == 0 ? "pc" : "msr"); return(strdup(tmpstr)); } @@ -709,7 +716,7 @@ get_field_special(long instr, const struct op_code_struct *op) default : { if ( ((((instr & IMM_MASK) >> IMM_LOW) ^ op->immval_mask) & 0xE000) == REG_PVR_MASK) { - sprintf(tmpstr, "%s%u", pvr_register_prefix, + snprintf(tmpstr, sizeof(tmpstr), "%s%u", pvr_register_prefix, (unsigned short)(((instr & IMM_MASK) >> IMM_LOW) ^ op->immval_mask) ^ REG_PVR_MASK); return(strdup(tmpstr)); @@ -720,7 +727,7 @@ get_field_special(long instr, const struct op_code_struct *op) break; } - sprintf(tmpstr, "%s%s", register_prefix, spr); + snprintf(tmpstr, sizeof(tmpstr), "%s%s", register_prefix, spr); return(strdup(tmpstr)); } From patchwork Tue Jun 4 09:55:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13684969 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 9CBD5C27C54 for ; Tue, 4 Jun 2024 09:58:15 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEQug-0005bg-Iy; Tue, 04 Jun 2024 05:57:06 -0400 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 1sEQue-0005aK-GO for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:57:04 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sEQuc-00026T-Iv for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:57:04 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-42147970772so5079005e9.0 for ; Tue, 04 Jun 2024 02:57:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717495020; x=1718099820; 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=HhkkGO7UM5NempyNbZSpgeksE20VfiEa/+ho7bDGL5s=; b=x2FybTSz7/tPL2v1URKH5MUvy983gyExCh1IZcY6EQV2l2ldcvR762jzOnhEFcov+a z/yjS1D8yF9off+Q3gtf7wwl4fEW0S0Lr9AISMzC3KldscJDAf45pay9+32CDImWlKeH g1XDZrP+i/kDmNWFNfDiW55MoF2IxITsy9EkOH1NDnn+wBiiwjpgIbFvjIHHyn3g2qhO X+j8rrqptCR2LBWpHPYztrEXWwiV1Efp57RUTLzrpuqz0zkzQTzJcwvn9k8ggAntxmVj x9zM1PTYFt9KmO2gn2dLKXeSSJA+l4fCzA9sQz+72eq+xMndc53l/nYEUyZbxIE4qtB1 FnSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717495020; x=1718099820; 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=HhkkGO7UM5NempyNbZSpgeksE20VfiEa/+ho7bDGL5s=; b=OPLELOgugaRifvThC2QgC/t7z9XZcJE5+NoUO35we3yoASBgvhv9HfrwyfAFmXm6tL bKxNy1nALl4c3N0219oSC35IQLtEE2Z6o/2edOgGGqhLQkzOm2nJCLURFFPMGpU7RK08 ImkQcgGGAGXP53y4Se+8J3aZQNr+Qjn2+mDE/ZKOjE8Uym4uBnAmdU2MDDvudN94wLQx v7RimYG4nQZb/ksecDkgTRSuaeCu1Fb0bCpD9USo0kuETgz7KJsZFGMUojyOIFsDge4X DW7nD7qT2r/4TjWBADPEO6qefoGVnvPf3kmH7I7007vLEnc63LfmJg0sKmhUvM0JHqB3 nMgw== X-Gm-Message-State: AOJu0YzRObZo0bwX2bxaMcGuZ0nKy12AI1ADVbQCnTEYCW8x6sZw5LHf swosGQU3GLtniWvcJI4wmlvYHBK+66H9QMYN525ultlXbwRbA4ASAbU321RuWuI0adY3bQ5x91v H X-Google-Smtp-Source: AGHT+IFZPX2h1ZqZMR4lee0UczZUEIRW+G+dZMUD4sX24NA2MkCPTPmOyItxhBCpXPLoRlezz0WykA== X-Received: by 2002:a05:600c:4705:b0:421:2918:3d97 with SMTP id 5b1f17b1804b1-4212e0add57mr103467795e9.30.1717495020665; Tue, 04 Jun 2024 02:57:00 -0700 (PDT) Received: from m1x-phil.lan ([176.176.159.34]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4212705692csm178091885e9.10.2024.06.04.02.56.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Jun 2024 02:57:00 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= Subject: [PULL 09/32] util/hexdump: Remove b parameter from qemu_hexdump_line Date: Tue, 4 Jun 2024 11:55:45 +0200 Message-ID: <20240604095609.12285-10-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240604095609.12285-1-philmd@linaro.org> References: <20240604095609.12285-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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, T_SCC_BODY_TEXT_LINE=-0.01 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: Richard Henderson Require that the caller output the offset and increment bufptr. Use QEMU_HEXDUMP_LINE_BYTES in vhost_vdpa_dump_config instead of raw integer. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240412073346.458116-2-richard.henderson@linaro.org> Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/cutils.h | 2 +- hw/virtio/vhost-vdpa.c | 4 ++-- util/hexdump.c | 13 ++++++------- hw/virtio/trace-events | 2 +- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/include/qemu/cutils.h b/include/qemu/cutils.h index 741dade7cf..d7715f7a33 100644 --- a/include/qemu/cutils.h +++ b/include/qemu/cutils.h @@ -287,7 +287,7 @@ int parse_debug_env(const char *name, int max, int initial); */ #define QEMU_HEXDUMP_LINE_BYTES 16 /* Number of bytes to dump */ #define QEMU_HEXDUMP_LINE_LEN 75 /* Number of characters in line */ -void qemu_hexdump_line(char *line, unsigned int b, const void *bufptr, +void qemu_hexdump_line(char *line, const void *bufptr, unsigned int len, bool ascii); /* diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c index ed99ab8745..f3a86c1a8c 100644 --- a/hw/virtio/vhost-vdpa.c +++ b/hw/virtio/vhost-vdpa.c @@ -949,8 +949,8 @@ static void vhost_vdpa_dump_config(struct vhost_dev *dev, const uint8_t *config, for (b = 0; b < config_len; b += 16) { len = config_len - b; - qemu_hexdump_line(line, b, config, len, false); - trace_vhost_vdpa_dump_config(dev, line); + qemu_hexdump_line(line, config + b, len, false); + trace_vhost_vdpa_dump_config(dev, b, line); } } diff --git a/util/hexdump.c b/util/hexdump.c index 9921114b3c..7324e7b126 100644 --- a/util/hexdump.c +++ b/util/hexdump.c @@ -16,7 +16,7 @@ #include "qemu/osdep.h" #include "qemu/cutils.h" -void qemu_hexdump_line(char *line, unsigned int b, const void *bufptr, +void qemu_hexdump_line(char *line, const void *bufptr, unsigned int len, bool ascii) { const char *buf = bufptr; @@ -26,13 +26,12 @@ void qemu_hexdump_line(char *line, unsigned int b, const void *bufptr, len = QEMU_HEXDUMP_LINE_BYTES; } - line += snprintf(line, 6, "%04x:", b); for (i = 0; i < QEMU_HEXDUMP_LINE_BYTES; i++) { - if ((i % 4) == 0) { + if (i != 0 && (i % 4) == 0) { *line++ = ' '; } if (i < len) { - line += sprintf(line, " %02x", (unsigned char)buf[b + i]); + line += sprintf(line, " %02x", (unsigned char)buf[i]); } else { line += sprintf(line, " "); } @@ -40,7 +39,7 @@ void qemu_hexdump_line(char *line, unsigned int b, const void *bufptr, if (ascii) { *line++ = ' '; for (i = 0; i < len; i++) { - c = buf[b + i]; + c = buf[i]; if (c < ' ' || c > '~') { c = '.'; } @@ -58,8 +57,8 @@ void qemu_hexdump(FILE *fp, const char *prefix, for (b = 0; b < size; b += QEMU_HEXDUMP_LINE_BYTES) { len = size - b; - qemu_hexdump_line(line, b, bufptr, len, true); - fprintf(fp, "%s: %s\n", prefix, line); + qemu_hexdump_line(line, bufptr + b, len, true); + fprintf(fp, "%s: %04x: %s\n", prefix, b, line); } } diff --git a/hw/virtio/trace-events b/hw/virtio/trace-events index 96632fd026..3cf84e04a7 100644 --- a/hw/virtio/trace-events +++ b/hw/virtio/trace-events @@ -50,7 +50,7 @@ vhost_vdpa_get_device_id(void *dev, uint32_t device_id) "dev: %p device_id %"PRI vhost_vdpa_reset_device(void *dev) "dev: %p" vhost_vdpa_get_vq_index(void *dev, int idx, int vq_idx) "dev: %p idx: %d vq idx: %d" vhost_vdpa_set_vring_enable_one(void *dev, unsigned i, int enable, int r) "dev: %p, idx: %u, enable: %u, r: %d" -vhost_vdpa_dump_config(void *dev, const char *line) "dev: %p %s" +vhost_vdpa_dump_config(void *dev, unsigned ofs, const char *line) "dev: %p 0x%04x: %s" vhost_vdpa_set_config(void *dev, uint32_t offset, uint32_t size, uint32_t flags) "dev: %p offset: %"PRIu32" size: %"PRIu32" flags: 0x%"PRIx32 vhost_vdpa_get_config(void *dev, void *config, uint32_t config_len) "dev: %p config: %p config_len: %"PRIu32 vhost_vdpa_suspend(void *dev) "dev: %p" From patchwork Tue Jun 4 09:55:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13684967 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 D1BD6C25B78 for ; Tue, 4 Jun 2024 09:58:14 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEQul-0005mW-GT; Tue, 04 Jun 2024 05:57:11 -0400 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 1sEQuj-0005c6-EG for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:57:09 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sEQuh-00026j-RZ for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:57:09 -0400 Received: by mail-wr1-x435.google.com with SMTP id ffacd0b85a97d-35dcff36522so775208f8f.1 for ; Tue, 04 Jun 2024 02:57:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717495026; x=1718099826; 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=IKCb8LNXYSVbebdxNMftRVpPNmizlFVEcNh6n2gVUMA=; b=uVEsyXqtdFcCLy4mFlnKWY05yOTrMAbICi8yS5Syorty92KbKJjPj21R6Y9t7Z4gAr L+LQi4VgORgQ+VEHF3LfnwFZQdH4GmJkC3IfycVTHrDYJLfDsOWvSVVocwATVqvlftSJ 4NCLciTEV91BHI+QZXJcfbsTrAHHfVZ1oi9QW3i7p3hkFvUZ/4PHkVBDEDfFwhBm2hFx kts5BWk9fFlengmvPzujjSnJusdSjSzb9HLNnkVxpgzF+yTJAjJ4rHvEwXq/l2z2fte0 RvjlJUFiPkrYdgfTlWkCUIW5IlU/yuELqy28yLk1ofW9Li4Q8mXB4k3nDENdfXL4jdGV PKNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717495026; x=1718099826; 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=IKCb8LNXYSVbebdxNMftRVpPNmizlFVEcNh6n2gVUMA=; b=b3wXLGMtPLCXPlqwNQyQfMzmVUnep/x2Rw+SsylSS/jG4RUvPteJl7zdPtzliZJ54Y uOKyjrgNJaIvQy2lfdUx8tO9Ze34DAx4sYn2WZBbMhU9JVn31qAHytnGTk7Wij+2yKXe Tijs0RgL9v6iTShiibtzrywHwGDr3UxvPJXVRK5c/MAriMPciM5Lio5SP0XnktKmSpju QZSc9EnbRbFqJGJr2rLpy+i0ob//mMB4G5X52ckgS91weGl7NbhlRnqd56+lfajBDASZ vV9tl2gMteks64qPFh8joJoXsnbkM5IjCrU9eR9OFWn5ziNMbyEFz+w5b+GEQkIuaFot klxw== X-Gm-Message-State: AOJu0YxcsC0p40rPR4blyzlAHBJxWwuPjvtTTeLgcfZ+ilt+4ZxV++dh +fDH6SGSbQBNApjtgm1lEqZdp46Kp7MlxkEBjDobUoj4An09TUaC79CmoRsOWdzWR00+2Jmgj69 S X-Google-Smtp-Source: AGHT+IE8KrpvqisRgdrcfUDOzvij0a2+1NWoxiD2NITeksUXozUz8Emny9VeMDiqSFyqgyrcql9gBg== X-Received: by 2002:a5d:5f8b:0:b0:356:c47a:87d2 with SMTP id ffacd0b85a97d-35e0f25a5d9mr9190500f8f.6.1717495026208; Tue, 04 Jun 2024 02:57:06 -0700 (PDT) Received: from m1x-phil.lan ([176.176.159.34]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35dd04d96f6sm11103296f8f.61.2024.06.04.02.57.05 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Jun 2024 02:57:05 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= Subject: [PULL 10/32] util/hexdump: Remove ascii parameter from qemu_hexdump_line Date: Tue, 4 Jun 2024 11:55:46 +0200 Message-ID: <20240604095609.12285-11-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240604095609.12285-1-philmd@linaro.org> References: <20240604095609.12285-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=philmd@linaro.org; helo=mail-wr1-x435.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: Richard Henderson Split out asciidump_line as a separate function, local to hexdump.c, for use by qemu_hexdump. Use "%-*s" to generate the alignment between the hex and the ascii, rather than explicit spaces. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240412073346.458116-3-richard.henderson@linaro.org> Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/cutils.h | 3 +-- hw/virtio/vhost-vdpa.c | 2 +- util/hexdump.c | 56 ++++++++++++++++++++++++------------------ 3 files changed, 34 insertions(+), 27 deletions(-) diff --git a/include/qemu/cutils.h b/include/qemu/cutils.h index d7715f7a33..c5dea63742 100644 --- a/include/qemu/cutils.h +++ b/include/qemu/cutils.h @@ -287,8 +287,7 @@ int parse_debug_env(const char *name, int max, int initial); */ #define QEMU_HEXDUMP_LINE_BYTES 16 /* Number of bytes to dump */ #define QEMU_HEXDUMP_LINE_LEN 75 /* Number of characters in line */ -void qemu_hexdump_line(char *line, const void *bufptr, - unsigned int len, bool ascii); +void qemu_hexdump_line(char *line, const void *bufptr, size_t len); /* * Hexdump a buffer to a file. An optional string prefix is added to every line diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c index f3a86c1a8c..7368b71902 100644 --- a/hw/virtio/vhost-vdpa.c +++ b/hw/virtio/vhost-vdpa.c @@ -949,7 +949,7 @@ static void vhost_vdpa_dump_config(struct vhost_dev *dev, const uint8_t *config, for (b = 0; b < config_len; b += 16) { len = config_len - b; - qemu_hexdump_line(line, config + b, len, false); + qemu_hexdump_line(line, config + b, len); trace_vhost_vdpa_dump_config(dev, b, line); } } diff --git a/util/hexdump.c b/util/hexdump.c index 7324e7b126..0f943e31e5 100644 --- a/util/hexdump.c +++ b/util/hexdump.c @@ -16,49 +16,57 @@ #include "qemu/osdep.h" #include "qemu/cutils.h" -void qemu_hexdump_line(char *line, const void *bufptr, - unsigned int len, bool ascii) +void qemu_hexdump_line(char *line, const void *bufptr, size_t len) { const char *buf = bufptr; - int i, c; + int i; if (len > QEMU_HEXDUMP_LINE_BYTES) { len = QEMU_HEXDUMP_LINE_BYTES; } - for (i = 0; i < QEMU_HEXDUMP_LINE_BYTES; i++) { + for (i = 0; i < len; i++) { if (i != 0 && (i % 4) == 0) { *line++ = ' '; } - if (i < len) { - line += sprintf(line, " %02x", (unsigned char)buf[i]); - } else { - line += sprintf(line, " "); - } - } - if (ascii) { - *line++ = ' '; - for (i = 0; i < len; i++) { - c = buf[i]; - if (c < ' ' || c > '~') { - c = '.'; - } - *line++ = c; - } + line += sprintf(line, " %02x", (unsigned char)buf[i]); } *line = '\0'; } +static void asciidump_line(char *line, const void *bufptr, size_t len) +{ + const char *buf = bufptr; + + for (size_t i = 0; i < len; i++) { + char c = buf[i]; + + if (c < ' ' || c > '~') { + c = '.'; + } + *line++ = c; + } + *line = '\0'; +} + +#define QEMU_HEXDUMP_LINE_WIDTH \ + (QEMU_HEXDUMP_LINE_BYTES * 2 + QEMU_HEXDUMP_LINE_BYTES / 4) + void qemu_hexdump(FILE *fp, const char *prefix, const void *bufptr, size_t size) { - unsigned int b, len; char line[QEMU_HEXDUMP_LINE_LEN]; + char ascii[QEMU_HEXDUMP_LINE_BYTES + 1]; + size_t b, len; - for (b = 0; b < size; b += QEMU_HEXDUMP_LINE_BYTES) { - len = size - b; - qemu_hexdump_line(line, bufptr + b, len, true); - fprintf(fp, "%s: %04x: %s\n", prefix, b, line); + for (b = 0; b < size; b += len) { + len = MIN(size - b, QEMU_HEXDUMP_LINE_BYTES); + + qemu_hexdump_line(line, bufptr + b, len); + asciidump_line(ascii, bufptr + b, len); + + fprintf(fp, "%s: %04zx: %-*s %s\n", + prefix, b, QEMU_HEXDUMP_LINE_WIDTH, line, ascii); } } From patchwork Tue Jun 4 09:55:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13684970 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 73A84C25B78 for ; Tue, 4 Jun 2024 09:58:19 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEQur-0006MT-3T; Tue, 04 Jun 2024 05:57:17 -0400 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 1sEQup-00069a-BG for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:57:15 -0400 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sEQun-000272-Mb for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:57:15 -0400 Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-5295eb47b48so917137e87.1 for ; Tue, 04 Jun 2024 02:57:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717495032; x=1718099832; 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=ImVmefo1MlwAmY4FNzose8vP9/wMtnxVjazWG/n/+Lw=; b=Iips2Im6vBwTDCb3WLOsaVMwPyunx4KfWRy+1oLXKorwGVn213VOO9u9oluQ2I+MfY Rw4+0cp2pJ2P6gvnlMXxn3cSpy6HB220pKPUglwiU1EPqN3NjM1wFyx7IujrD1G5J1Os 3htD8d1ktaDGm4Gen4jFqm/MkZSuMFfpmMsBA3o8Sx7VCKuueaGXgJVENAs7HF+WoKhC 35lS+0sG9GhzBS3zAzSQqK310k2qT12LKo9MjUePSkvrBc22WxJ1PYbd+Bxf19RTgydX jl200G4uJF9fkF4keDXjTYGB51v2sumtmEKx6X8wbYWlbHx76EBpeiXt5wUNmOzBdI1c RTDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717495032; x=1718099832; 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=ImVmefo1MlwAmY4FNzose8vP9/wMtnxVjazWG/n/+Lw=; b=JG0tA+dQFfrjmrDzqqfddra1d841qx8wKAQ0qrB1JPQPsAht7lEPQ9Gg5IaZYR2tIT /aKQ3k5tAwOpfcIxT6djskzYprqdz+tmtXviv1wUViVuKdcMbmgPu7DyOGO71rk1vtyj zpUq6plaIFGdfwIqT76/memVrG2F+AjN+0R7/XZRWMsvfBRcQqcDmOTKrRLPRsgDjJrx TjPoTjOo9C9oGdDlajuD+/q1wmqpGQBRTI07wleJn+J8CEEqwApk1rSc+Tca+dP2DI8X PDEZWvYNOLSAE+9YHdX9Y/Zw4UYWeYvo4F0VwhPhqaf/8xVeRdS7QeyTyIqlmKfBLUov YucQ== X-Gm-Message-State: AOJu0YxbD6y9k1I5qQkci6DDSMlTINu4vr+nzVtWxoMf7PSjh23w8jh5 jhQKgPYbmW+f0bTaLD4f8r0ZusIbN6BNelvhIA0Jvy/VlG+dcy4BLMpeaebdMFZfSSL5yhBoQC6 Y X-Google-Smtp-Source: AGHT+IEnB+OfoGZGHL7izD1AQ0ApPkEpicQlRTfCoLwEG1OAbzt/sn1ZXy9I33G2SdxSt0XWdH62nQ== X-Received: by 2002:ac2:5b5d:0:b0:51d:68fb:5d73 with SMTP id 2adb3069b0e04-52b8956932dmr7798641e87.8.1717495031553; Tue, 04 Jun 2024 02:57:11 -0700 (PDT) Received: from m1x-phil.lan ([176.176.159.34]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35dd04c0de3sm11095383f8f.9.2024.06.04.02.57.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Jun 2024 02:57:11 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Manos Pitsidianakis , =?utf-8?q?Philippe_Ma?= =?utf-8?q?thieu-Daud=C3=A9?= Subject: [PULL 11/32] MAINTAINERS: drop usb maintainership Date: Tue, 4 Jun 2024 11:55:47 +0200 Message-ID: <20240604095609.12285-12-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240604095609.12285-1-philmd@linaro.org> References: <20240604095609.12285-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::133; envelope-from=philmd@linaro.org; helo=mail-lf1-x133.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, T_SCC_BODY_TEXT_LINE=-0.01 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: Gerd Hoffmann Remove myself from usb entries. Flip status to "Orphan" for entries which have nobody else listed. Signed-off-by: Gerd Hoffmann Reviewed-by: Manos Pitsidianakis Message-ID: <20240528083858.836262-3-kraxel@redhat.com> Signed-off-by: Philippe Mathieu-Daudé --- MAINTAINERS | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 448dc951c5..5bc478f7ff 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2141,8 +2141,7 @@ F: tests/qtest/fuzz-sdcard-test.c F: tests/qtest/sdhci-test.c USB -M: Gerd Hoffmann -S: Odd Fixes +S: Orphan F: hw/usb/* F: stubs/usb-dev-stub.c F: tests/qtest/usb-*-test.c @@ -2151,7 +2150,6 @@ F: include/hw/usb.h F: include/hw/usb/ USB (serial adapter) -R: Gerd Hoffmann M: Samuel Thibault S: Maintained F: hw/usb/dev-serial.c From patchwork Tue Jun 4 09:55:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13684965 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 CEF8AC25B78 for ; Tue, 4 Jun 2024 09:57:48 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEQuw-0006rK-J0; Tue, 04 Jun 2024 05:57:22 -0400 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 1sEQuu-0006kj-A0 for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:57:20 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sEQus-00027e-KE for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:57:20 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-42122ac2f38so30823735e9.1 for ; Tue, 04 Jun 2024 02:57:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717495037; x=1718099837; 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=tvJdNys5P3aGDE+znvt43SgumkIO7uwCiPZ5aglr7XY=; b=GvjEQP+39a5hwwtJmtBiLMiZP14RfklSQfl21WaBG4pplUlMR1VvFDouv03GTHxd+7 6DUDjqGaTRZjWcPqgCtOC/M/jx2PmTpKZVBFrwIVVokhgKlt6O/4ObPV4bBPZRQkbIrE 6tUY1JazWFQdFYIZxS3klPIfh2g3tB52ilu9hwb5NbFvgBUoKnZgqsPIh1j8NlGOzwj7 WQ47Ou+/y4PpXqeCY7DVNIQleiQPOFYHngXvGygBjvJPCrtNJ1x0MbPcXgdWpeiEarws srWfCqC20BWaqZQyg2/xmLOPemtZeToqcShrG6v9jsgeV3AfYEPSEgqEosg9V8q2Bpx+ vvbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717495037; x=1718099837; 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=tvJdNys5P3aGDE+znvt43SgumkIO7uwCiPZ5aglr7XY=; b=YjHnY/FsI50dRz2mGSKvhAtNqRNGuH3TfJUXMDzVeapZagf09ZfFqJyEBDu1PkDtXU dMpYYFZ/RpuKb/NqGg8Q5Y5VGX/xCDvy5WN+0WiagUjHNlT7CioPtxVftwyvQWHNDTiX NGFw6PzdbbYuJjkICWFJLuXOBlrFRBswpsa8vcDyJEMWJnu3Toh3rnxC1rqM2wdpPJum VtvFHXQ7Beeuo9A2XoP8iejtU+imTkiDNtP8I7nGvUFUQd+rWe+ZAx8YfISGPgBDu2QP FIMY2brxvmBRKp/vmmikWVQ70NgHuEjZfc8PvDbWFXfesSboU9sN4GmI8pgA2bAUEx8Z BUnQ== X-Gm-Message-State: AOJu0Yz/yGguOfKrwd53rHpkAEF6QsfUNDZEtD+CNc0MfqUKeEK/qOLP GP1sQCHu9jHIEvTRW5ZxNZ9LgjPAIxsZGSvIDLhsfljBgvqqnfM15ZZDvfIXumk5hwLLHv6jGuN T X-Google-Smtp-Source: AGHT+IGT46fGClMEY5U6P6yl+uSC3kFL1mSdK1VIjAovNqHqRI11lnx+H1Qw8IhACxZhhcH0rH1Ffg== X-Received: by 2002:a05:600c:3ba9:b0:421:2a54:2f22 with SMTP id 5b1f17b1804b1-4214511b763mr19160985e9.9.1717495036962; Tue, 04 Jun 2024 02:57:16 -0700 (PDT) Received: from m1x-phil.lan ([176.176.159.34]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35dd04cada4sm11006871f8f.40.2024.06.04.02.57.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Jun 2024 02:57:16 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Pierrick Bouvier Subject: [PULL 12/32] system/runstate: Remove unused 'qemu/plugin.h' header Date: Tue, 4 Jun 2024 11:55:48 +0200 Message-ID: <20240604095609.12285-13-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240604095609.12285-1-philmd@linaro.org> References: <20240604095609.12285-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.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, TVD_SPACE_RATIO=0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 system/runstate.c never required "qemu/plugin.h". Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Pierrick Bouvier Message-Id: <20240528145953.65398-2-philmd@linaro.org> --- system/runstate.c | 1 - 1 file changed, 1 deletion(-) diff --git a/system/runstate.c b/system/runstate.c index cb4905a40f..ec32e270cb 100644 --- a/system/runstate.c +++ b/system/runstate.c @@ -45,7 +45,6 @@ #include "qemu/job.h" #include "qemu/log.h" #include "qemu/module.h" -#include "qemu/plugin.h" #include "qemu/sockets.h" #include "qemu/timer.h" #include "qemu/thread.h" From patchwork Tue Jun 4 09:55:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13684964 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 E8F1BC41513 for ; Tue, 4 Jun 2024 09:57:45 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEQv3-0007iK-7w; Tue, 04 Jun 2024 05:57:29 -0400 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 1sEQv1-0007Sq-HH for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:57:27 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sEQuz-000282-1C for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:57:27 -0400 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-35e573c0334so1245505f8f.1 for ; Tue, 04 Jun 2024 02:57:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717495043; x=1718099843; 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=Cmg1ayuApwmH79kPzx40QOBelO6dVSgqwUpaSLnFGiQ=; b=YHiAQmUrSvdPbTySjrFpb2kMvhNiLXAd9lpVFSjnBQinrhDJ1mjfPoPU6ccvKe8nV6 /aO+UnKUr+JfRzIoqRUUUox+mXe4XuIUBdO4qOnEK1RGfgjafI7rwX6U3nJvGv9AoHD2 URCt/1/nCqUVUKscFCnw9cawRDeYcCe5ZDzaILYoegSYwHwozyTXP200wfbJCI7fmn27 iBVlKQW10bcG4VbPY+IyyJ+jN/oQ63awjBw4p3k36qdagbu6guWLjx8uEQnru/juNozO zudkoXnDx9BTkY8iouMx00xmiJ8OMXCfOpYyDF4uz2n4n517iKXLGQ0HQqdPv/btnCQt sT5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717495043; x=1718099843; 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=Cmg1ayuApwmH79kPzx40QOBelO6dVSgqwUpaSLnFGiQ=; b=fOejli+M/+6OrPPsHzkeBpZXfC6yKMlwv734aOHBv0oGkpOtXxD0hl5WIwd2KDp6WR GmRIH/hZ6LLLwBwtV2JOPobiSpmKEc6jwMA4k4+cy78SbALQ4fMA2xBtX5gj8Lonxs96 HNc26g6anyUgl70FPuhGdVrdecrQuXyKAejBojfCHmjN3a0xvGB726oQzKUEN95NdVHw p36MOSZ9GeYlgxKdCV6X82NV9lB8DgZTkFz/p49KB0YDK4aMguAeA9/HFvxDdGayJAot +39q20plA/jtapDroX+q0oFcjEmloBLMc3sTWsgIq+8fZv5q5GpFyei3AjjZ8DdnfULi 5S8A== X-Gm-Message-State: AOJu0Yzaj9Sn4u9KMXjpzcYI1DpZy4a0U4if1GMBbqPpXbVMR3r+yHM5 13FKH0tslQzz6T0KveAmU0Ez+ucrKCPIq5w53JM5qRTOP47+qAS7Eo5z1zVAdswwH2XqqjzkvJI Z X-Google-Smtp-Source: AGHT+IGE5AOIrfCmNaVABCZwujJ4Jv/skudobAVX++pyZBQDmCuC7KkxIGxPbJdpbWoDP1LLu/TQqQ== X-Received: by 2002:adf:eb4a:0:b0:354:ece6:d9b9 with SMTP id ffacd0b85a97d-35e7c54b2b9mr1879055f8f.15.1717495042682; Tue, 04 Jun 2024 02:57:22 -0700 (PDT) Received: from m1x-phil.lan ([176.176.159.34]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35e4f0fd15esm8443084f8f.68.2024.06.04.02.57.21 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Jun 2024 02:57:22 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Pierrick Bouvier Subject: [PULL 13/32] accel/tcg: Move common declarations to 'internal-common.h' Date: Tue, 4 Jun 2024 11:55:49 +0200 Message-ID: <20240604095609.12285-14-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240604095609.12285-1-philmd@linaro.org> References: <20240604095609.12285-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=philmd@linaro.org; helo=mail-wr1-x42f.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, T_SCC_BODY_TEXT_LINE=-0.01 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 'internal-target.h' is meant for target-specific declarations, while 'internal-common.h' for common ones. Move common declarations to it. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Reviewed-by: Pierrick Bouvier Message-Id: <20240528145953.65398-3-philmd@linaro.org> --- accel/tcg/internal-common.h | 15 +++++++++++++++ accel/tcg/internal-target.h | 14 -------------- accel/tcg/tcg-all.c | 2 +- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/accel/tcg/internal-common.h b/accel/tcg/internal-common.h index cff43d221b..a8fc3db774 100644 --- a/accel/tcg/internal-common.h +++ b/accel/tcg/internal-common.h @@ -15,6 +15,8 @@ extern int64_t max_delay; extern int64_t max_advance; +extern bool one_insn_per_tb; + /* * Return true if CS is not running in parallel with other cpus, either * because there are no other cpus or we are within an exclusive context. @@ -41,4 +43,17 @@ static inline bool cpu_plugin_mem_cbs_enabled(const CPUState *cpu) #endif } +TranslationBlock *tb_gen_code(CPUState *cpu, vaddr pc, + uint64_t cs_base, uint32_t flags, + int cflags); +void page_init(void); +void tb_htable_init(void); +void tb_reset_jump(TranslationBlock *tb, int n); +TranslationBlock *tb_link_page(TranslationBlock *tb); +void cpu_restore_state_from_tb(CPUState *cpu, TranslationBlock *tb, + uintptr_t host_pc); + +bool tcg_exec_realizefn(CPUState *cpu, Error **errp); +void tcg_exec_unrealizefn(CPUState *cpu); + #endif diff --git a/accel/tcg/internal-target.h b/accel/tcg/internal-target.h index 4e36cf858e..fe109724c6 100644 --- a/accel/tcg/internal-target.h +++ b/accel/tcg/internal-target.h @@ -69,19 +69,7 @@ void tb_invalidate_phys_range_fast(ram_addr_t ram_addr, G_NORETURN void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr); #endif /* CONFIG_SOFTMMU */ -TranslationBlock *tb_gen_code(CPUState *cpu, vaddr pc, - uint64_t cs_base, uint32_t flags, - int cflags); -void page_init(void); -void tb_htable_init(void); -void tb_reset_jump(TranslationBlock *tb, int n); -TranslationBlock *tb_link_page(TranslationBlock *tb); bool tb_invalidate_phys_page_unwind(tb_page_addr_t addr, uintptr_t pc); -void cpu_restore_state_from_tb(CPUState *cpu, TranslationBlock *tb, - uintptr_t host_pc); - -bool tcg_exec_realizefn(CPUState *cpu, Error **errp); -void tcg_exec_unrealizefn(CPUState *cpu); /* Return the current PC from CPU, which may be cached in TB. */ static inline vaddr log_pc(CPUState *cpu, const TranslationBlock *tb) @@ -93,8 +81,6 @@ static inline vaddr log_pc(CPUState *cpu, const TranslationBlock *tb) } } -extern bool one_insn_per_tb; - /** * tcg_req_mo: * @type: TCGBar diff --git a/accel/tcg/tcg-all.c b/accel/tcg/tcg-all.c index c6619f5b98..2090907dba 100644 --- a/accel/tcg/tcg-all.c +++ b/accel/tcg/tcg-all.c @@ -38,7 +38,7 @@ #if !defined(CONFIG_USER_ONLY) #include "hw/boards.h" #endif -#include "internal-target.h" +#include "internal-common.h" struct TCGState { AccelState parent_obj; From patchwork Tue Jun 4 09:55:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13684960 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 2D8CBC25B7E for ; Tue, 4 Jun 2024 09:57:45 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEQv9-0007yR-Ob; Tue, 04 Jun 2024 05:57:35 -0400 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 1sEQv5-0007uV-Tj for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:57:32 -0400 Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sEQv4-00028r-B2 for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:57:31 -0400 Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-52b87e8ba1eso5503464e87.3 for ; Tue, 04 Jun 2024 02:57:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717495048; x=1718099848; 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=pSBLM04d3DAbKCspvBjFgiIMn9c2P954kLTi2eYOo9c=; b=whjKlISRZm2GG4dGvOyT55289SeEHgC33ztpy60ELy46mx6CmA/pZ42aEXAZXZhC4t e0wpb9pSku6GWKMo3CLtES95Lscs1DrIxTiXznQMoASnuKAL+MsMn6w2L8sqQKBD7xpX dTuxax3Xoly289P/KK3yReko0xwZH8SdTJHsPjHmZfvWxqp8gtVffLYIa0qLa2SGkOsv cIbUW9TpVpExcgOv5oNDarXGYlr3VciHfmzZoWJlW1iIog6hzTwMMO5ZYKTAy32bwTWq yC0H39fvbOA8PpBSDi2RvIgO32dKQnQKkrWV1sBi9wX7KaZYJCjhRhac9f11cFpoY+ds sPvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717495048; x=1718099848; 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=pSBLM04d3DAbKCspvBjFgiIMn9c2P954kLTi2eYOo9c=; b=Kw4qq5h4+ufuqDd6Y2B6ynDPUOglw4i7tupyq3q6WzL7/Jh9d1nBPmLTJe5+u8On7x gEBa1sfqkSXbJ63Gj/k3KLxgSD66eEMA1ECkPeHpTWK+rMto2AFJ6tN/YyLWkpekOHaA peFsGPbySePp8RPdX/fkJ9gAZpe5AAN8zzqpbBMY69v3I/gLAIRcFRtSYePRxBqSQN3A f6EOF1QZf2DRxtFFJMnSarM8exltQDh4RTqA1rblBfAnDbq0TZR4thmLYvEx1y3A8b1o 29E6DIYcuUOWJAVRzYXVDMewsTGY+BOZhwCI78r6pvpM2jKtPQdbtOOSnaQr4gLBsBZ+ P5Rg== X-Gm-Message-State: AOJu0YxEIGe3h3BXiFiTOXsfALcDhtBN7EaEWwxv4qFG91WjmenPQB1u IqWIBfB90lqGlSCti2Ftup8JO7jjNCxNaL83JP9P9pa4ufpsZlteEXc5+mm25l/6DXNXDqc2B24 r X-Google-Smtp-Source: AGHT+IGV42mO2QBgoA/NiPQiATIP+vXmcJDIo/PhKYV1G+1U4VC/MaC96g5jPKuFp5AwdHxUMEOxNA== X-Received: by 2002:a05:6512:785:b0:52b:8612:edd3 with SMTP id 2adb3069b0e04-52b8958aeaemr8764573e87.30.1717495048129; Tue, 04 Jun 2024 02:57:28 -0700 (PDT) Received: from m1x-phil.lan ([176.176.159.34]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4212b838acdsm149376765e9.4.2024.06.04.02.57.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Jun 2024 02:57:27 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , Zhao Liu , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 14/32] accel/kvm: Fix two lines with hard-coded tabs Date: Tue, 4 Jun 2024 11:55:50 +0200 Message-ID: <20240604095609.12285-15-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240604095609.12285-1-philmd@linaro.org> References: <20240604095609.12285-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::132; envelope-from=philmd@linaro.org; helo=mail-lf1-x132.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, T_SCC_BODY_TEXT_LINE=-0.01 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: Peter Maydell In kvm-all.c, two lines have been accidentally indented with hard-coded tabs rather than spaces. Normalise to match the rest of the file. Signed-off-by: Peter Maydell Reviewed-by: Zhao Liu Message-ID: <20240531170952.505323-1-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daudé --- accel/kvm/kvm-all.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index c0be9f5eed..009b49de44 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -2893,7 +2893,7 @@ int kvm_convert_memory(hwaddr start, hwaddr size, bool to_private) !memory_region_is_ram_device(mr) && !memory_region_is_rom(mr) && !memory_region_is_romd(mr)) { - ret = 0; + ret = 0; } else { error_report("Convert non guest_memfd backed memory region " "(0x%"HWADDR_PRIx" ,+ 0x%"HWADDR_PRIx") to %s", @@ -2964,7 +2964,7 @@ int kvm_cpu_exec(CPUState *cpu) kvm_arch_pre_run(cpu, run); if (qatomic_read(&cpu->exit_request)) { - trace_kvm_interrupt_exit_request(); + trace_kvm_interrupt_exit_request(); /* * KVM requires us to reenter the kernel after IO exits to complete * instruction emulation. This self-signal will ensure that we From patchwork Tue Jun 4 09:55:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13684971 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 D2B5AC25B78 for ; Tue, 4 Jun 2024 09:58:33 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEQvE-0008IN-Ti; Tue, 04 Jun 2024 05:57:40 -0400 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 1sEQvB-00088O-GA for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:57:37 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sEQv9-00029I-HA for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:57:37 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-42134bb9735so29701175e9.1 for ; Tue, 04 Jun 2024 02:57:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717495053; x=1718099853; 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=obtEpkiAsJdiWpm7zcpgW5liQ303qrBraj3NKulpnrg=; b=GFdAoyoylMNQ+DPpBG7JKcNmY3lHNdn28Djst9t6qFiZvtlDq31TMKz84dv9aFqDq6 EkTHHe7N0V5xddDaXzbgGhi0tyAwuQZ8gYBpyRv8WainUeecqXVHjVF6Vn3HUP9qLYdn MsiIzhNs4Ne7LU5ELTKVD1Hu0Ku0zA6frSEnheHXUpbFLecd/EqUrUJLrmZkqdsljJ5l YMgZSEYiQqhWFYyvWXCeGvT9qatJR99xiILgtFai8tmdHPMVFb+Gh1Zt7K7zNTrYWXEq 3paZgbVMp5Ue7O6VnUo7SCAC7CKbcGQMAn1jmjOr2k/vuMflCSgOif4oCqNSbtBUPA5Q zXXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717495053; x=1718099853; 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=obtEpkiAsJdiWpm7zcpgW5liQ303qrBraj3NKulpnrg=; b=du6/2Yjre1hPNqDpiTPTjmAMHObpxj5wERncHAll42XxdCAPcAXePjTJqAgRRbgMo5 ICQqc4NZg1fXx5Q/dSqoui276GzNYx31ABdqX+PV3Ae50t2ONSt+wkhmyrGTuNolFuwj bmTS+90FbOGgRGev4Gni/YGQFoJETqaGrI9AVy5lxxSf0a7tWlqMOSfbgvnrby1uQs7R hd0PII4EW1241qdlMlSPTw1fAtqGc0GWr7h0+uaNIVbIS88Lvy419+eQG38FyL6+P0pk 6EjvGmHybxaf7g9j5yohqJ1r2Q9jIh6jziIox9BiISxp8qbfAygvQ6dmx1aCcTqHiFB3 byeQ== X-Gm-Message-State: AOJu0YzcuosbtAe1CuyZ14j/NXJahjS2aAL0R/ekqhPg+J9IvDarmBBP WZP7JR4Z1Ee/7GObJQUAf6YjUNAXX8ysIWyHfFjcOmZC+Q1hQdwq+ZyEPZANn0Gmc242+BnQnW7 + X-Google-Smtp-Source: AGHT+IEktRku/zcyjNjox8mle+MVL2eSRUmZfkMxGn7inNrwYrFDVMmbgJ88UHcLC5Jj+skWlhrSOA== X-Received: by 2002:a05:600c:4e8b:b0:421:3a41:5428 with SMTP id 5b1f17b1804b1-4213a4157bcmr44589875e9.41.1717495053637; Tue, 04 Jun 2024 02:57:33 -0700 (PDT) Received: from m1x-phil.lan ([176.176.159.34]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4215447035bsm7234385e9.13.2024.06.04.02.57.32 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Jun 2024 02:57:33 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= Subject: [PULL 15/32] hw/core: expand on the alignment of CPUState Date: Tue, 4 Jun 2024 11:55:51 +0200 Message-ID: <20240604095609.12285-16-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240604095609.12285-1-philmd@linaro.org> References: <20240604095609.12285-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: Alex Bennée Make the relationship between CPUState, ArchCPU and cpu_env a bit clearer in the kdoc comments. Signed-off-by: Alex Bennée Reviewed-by: Pierrick Bouvier Message-ID: <20240530194250.1801701-2-alex.bennee@linaro.org> Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index bb398e8237..be44746d24 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -391,7 +391,8 @@ struct qemu_work_item; #define CPU_UNSET_NUMA_NODE_ID -1 /** - * CPUState: + * struct CPUState - common state of one CPU core or thread. + * * @cpu_index: CPU index (informative). * @cluster_index: Identifies which cluster this CPU is in. * For boards which don't define clusters or for "loose" CPUs not assigned @@ -439,10 +440,15 @@ struct qemu_work_item; * @kvm_fetch_index: Keeps the index that we last fetched from the per-vCPU * dirty ring structure. * - * State of one CPU core or thread. + * @neg_align: The CPUState is the common part of a concrete ArchCPU + * which is allocated when an individual CPU instance is created. As + * such care is taken is ensure there is no gap between between + * CPUState and CPUArchState within ArchCPU. * - * Align, in order to match possible alignment required by CPUArchState, - * and eliminate a hole between CPUState and CPUArchState within ArchCPU. + * @neg: The architectural register state ("cpu_env") immediately follows + * CPUState in ArchCPU and is passed to TCG code. The @neg structure holds + * some common TCG CPU variables which are accessed with a negative offset + * from cpu_env. */ struct CPUState { /*< private >*/ From patchwork Tue Jun 4 09:55:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13684972 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 0B9AAC27C50 for ; Tue, 4 Jun 2024 09:58:34 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEQvJ-0000Hn-6R; Tue, 04 Jun 2024 05:57:45 -0400 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 1sEQvH-0008Uw-1H for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:57:43 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sEQvE-0002Bt-Vw for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:57:42 -0400 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-354f14bd80cso664790f8f.1 for ; Tue, 04 Jun 2024 02:57:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717495059; x=1718099859; 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=4b/mmQIhvhV7OjyWLu/roxTepS1wlgLdQck8dHERJM8=; b=IKWP3YLAoGrG4UI1EE4h5oK4QxtI4sKI/cmB6RYVZayElu0fkmc8hsXRka2hdnQFKY +IKx6Si3S6dt36KPr5We+b5bdqO8wIOPSe8xuybZYl8akxnW9vxN73PPysyjGNelwpW4 WkB8yEbrJyaQMLjpn5XhDSG+4nxsQ4rQQcW3v0MTA3gGxLiDKLPSVpoJUO8JKKJvksmF GQuE/tK02XEFk0Pf+zRGN8nZwUU2+BljvRrSp0Z0+qYR29yIr6ER6EujXtMUEai/iDpN IrhWTEjX7RfyWx+fAs4PnRgM3kypFsBGTFz9dcMms705ACbWwUhzScnDU/3ThvdMaPi6 7z+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717495059; x=1718099859; 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=4b/mmQIhvhV7OjyWLu/roxTepS1wlgLdQck8dHERJM8=; b=frSUFtX5eeNt105rvWCi04slqwPA3LnFC4XXpdQj+d2yzG5Lte7meQBX0npdwPNBNx uMVib5Q7AIv5m+D61YaVcgWriffH1YNSx8Yk1ebwMo1asMMCVX64CnKhvrrvybkKkpRC Q3iG+KZJVaiiW3lH49oU3DfTkYISpp6n3tsnnBDLZ2cu+lkEz1UIEZ6WC9WHwGKZGLPk Ted2QsXrBmETzU5E+P21SvArqNHmar02mKkfFERzRWjWAp0EDEJicq/g4dpbsDDQxazw fkPsWIIWk/LEKhdr3BRCmNXkuPOpTpkv/4jB8YicGdZc/WxxcdG5oZMoC7GO+fT1/os7 EWyQ== X-Gm-Message-State: AOJu0YzEgdRH+xlI0q4dAbd/vCeZPMfhIHRPx7uY0ZnvXqWSNGgTISZW 0QtQZCBHeaKcKfvJxsJ933/pCzKxTrVMQIVT52SDsHaXFTLMPbYwsgtuVhaPxIlyQqLPBQSDHK5 S X-Google-Smtp-Source: AGHT+IEq1weK1263FRX84P+UvjTwIOfTS68wvdj7q6X/0nrfeBq8SrMAuF2Bx+d7ydu4/k4gq8lr2A== X-Received: by 2002:a5d:5231:0:b0:35d:cb8b:bd2e with SMTP id ffacd0b85a97d-35e0f330f2cmr7994202f8f.67.1717495058986; Tue, 04 Jun 2024 02:57:38 -0700 (PDT) Received: from m1x-phil.lan ([176.176.159.34]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35dd04c0de3sm11096895f8f.9.2024.06.04.02.57.37 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Jun 2024 02:57:38 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= Subject: [PULL 16/32] cpu: move Qemu[Thread|Cond] setup into common code Date: Tue, 4 Jun 2024 11:55:52 +0200 Message-ID: <20240604095609.12285-17-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240604095609.12285-1-philmd@linaro.org> References: <20240604095609.12285-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=philmd@linaro.org; helo=mail-wr1-x433.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, T_SCC_BODY_TEXT_LINE=-0.01 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: Alex Bennée Aside from the round robin threads this is all common code. By moving the halt_cond setup we also no longer need hacks to work around the race between QOM object creation and thread creation. It is a little ugly to free stuff up for the round robin thread but better it deal with its own specialises than making the other accelerators jump through hoops. Signed-off-by: Alex Bennée Reviewed-by: Pierrick Bouvier Message-ID: <20240530194250.1801701-3-alex.bennee@linaro.org> Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 4 ++++ accel/dummy-cpus.c | 3 --- accel/hvf/hvf-accel-ops.c | 4 ---- accel/kvm/kvm-accel-ops.c | 3 --- accel/tcg/tcg-accel-ops-mttcg.c | 4 ---- accel/tcg/tcg-accel-ops-rr.c | 14 +++++++------- hw/core/cpu-common.c | 5 +++++ target/i386/nvmm/nvmm-accel-ops.c | 3 --- target/i386/whpx/whpx-accel-ops.c | 3 --- 9 files changed, 16 insertions(+), 27 deletions(-) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index be44746d24..a2c8536943 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -404,10 +404,14 @@ struct qemu_work_item; * @tcg_cflags: Pre-computed cflags for this cpu. * @nr_cores: Number of cores within this CPU package. * @nr_threads: Number of threads within this CPU core. + * @thread: Host thread details, only live once @created is #true + * @sem: WIN32 only semaphore used only for qtest + * @thread_id: native thread id of vCPU, only live once @created is #true * @running: #true if CPU is currently running (lockless). * @has_waiter: #true if a CPU is currently waiting for the cpu_exec_end; * valid under cpu_list_lock. * @created: Indicates whether the CPU thread has been successfully created. + * @halt_cond: condition variable sleeping threads can wait on. * @interrupt_request: Indicates a pending interrupt request. * @halted: Nonzero if the CPU is in suspended state. * @stop: Indicates a pending stop request. diff --git a/accel/dummy-cpus.c b/accel/dummy-cpus.c index 20519f1ea4..f32d8c8dc3 100644 --- a/accel/dummy-cpus.c +++ b/accel/dummy-cpus.c @@ -68,9 +68,6 @@ void dummy_start_vcpu_thread(CPUState *cpu) { char thread_name[VCPU_THREAD_NAME_SIZE]; - cpu->thread = g_malloc0(sizeof(QemuThread)); - cpu->halt_cond = g_malloc0(sizeof(QemuCond)); - qemu_cond_init(cpu->halt_cond); snprintf(thread_name, VCPU_THREAD_NAME_SIZE, "CPU %d/DUMMY", cpu->cpu_index); qemu_thread_create(cpu->thread, thread_name, dummy_cpu_thread_fn, cpu, diff --git a/accel/hvf/hvf-accel-ops.c b/accel/hvf/hvf-accel-ops.c index 40d4187d9d..6f1e27ef46 100644 --- a/accel/hvf/hvf-accel-ops.c +++ b/accel/hvf/hvf-accel-ops.c @@ -463,10 +463,6 @@ static void hvf_start_vcpu_thread(CPUState *cpu) */ assert(hvf_enabled()); - cpu->thread = g_malloc0(sizeof(QemuThread)); - cpu->halt_cond = g_malloc0(sizeof(QemuCond)); - qemu_cond_init(cpu->halt_cond); - snprintf(thread_name, VCPU_THREAD_NAME_SIZE, "CPU %d/HVF", cpu->cpu_index); qemu_thread_create(cpu->thread, thread_name, hvf_cpu_thread_fn, diff --git a/accel/kvm/kvm-accel-ops.c b/accel/kvm/kvm-accel-ops.c index 94c828ac8d..c239dfc87a 100644 --- a/accel/kvm/kvm-accel-ops.c +++ b/accel/kvm/kvm-accel-ops.c @@ -66,9 +66,6 @@ static void kvm_start_vcpu_thread(CPUState *cpu) { char thread_name[VCPU_THREAD_NAME_SIZE]; - cpu->thread = g_malloc0(sizeof(QemuThread)); - cpu->halt_cond = g_malloc0(sizeof(QemuCond)); - qemu_cond_init(cpu->halt_cond); snprintf(thread_name, VCPU_THREAD_NAME_SIZE, "CPU %d/KVM", cpu->cpu_index); qemu_thread_create(cpu->thread, thread_name, kvm_vcpu_thread_fn, diff --git a/accel/tcg/tcg-accel-ops-mttcg.c b/accel/tcg/tcg-accel-ops-mttcg.c index c552b45b8e..49814ec4af 100644 --- a/accel/tcg/tcg-accel-ops-mttcg.c +++ b/accel/tcg/tcg-accel-ops-mttcg.c @@ -137,10 +137,6 @@ void mttcg_start_vcpu_thread(CPUState *cpu) g_assert(tcg_enabled()); tcg_cpu_init_cflags(cpu, current_machine->smp.max_cpus > 1); - cpu->thread = g_new0(QemuThread, 1); - cpu->halt_cond = g_malloc0(sizeof(QemuCond)); - qemu_cond_init(cpu->halt_cond); - /* create a thread per vCPU with TCG (MTTCG) */ snprintf(thread_name, VCPU_THREAD_NAME_SIZE, "CPU %d/TCG", cpu->cpu_index); diff --git a/accel/tcg/tcg-accel-ops-rr.c b/accel/tcg/tcg-accel-ops-rr.c index 894e73e52c..84c36c1450 100644 --- a/accel/tcg/tcg-accel-ops-rr.c +++ b/accel/tcg/tcg-accel-ops-rr.c @@ -317,22 +317,22 @@ void rr_start_vcpu_thread(CPUState *cpu) tcg_cpu_init_cflags(cpu, false); if (!single_tcg_cpu_thread) { - cpu->thread = g_new0(QemuThread, 1); - cpu->halt_cond = g_new0(QemuCond, 1); - qemu_cond_init(cpu->halt_cond); + single_tcg_halt_cond = cpu->halt_cond; + single_tcg_cpu_thread = cpu->thread; /* share a single thread for all cpus with TCG */ snprintf(thread_name, VCPU_THREAD_NAME_SIZE, "ALL CPUs/TCG"); qemu_thread_create(cpu->thread, thread_name, rr_cpu_thread_fn, cpu, QEMU_THREAD_JOINABLE); - - single_tcg_halt_cond = cpu->halt_cond; - single_tcg_cpu_thread = cpu->thread; } else { - /* we share the thread */ + /* we share the thread, dump spare data */ + g_free(cpu->thread); + qemu_cond_destroy(cpu->halt_cond); cpu->thread = single_tcg_cpu_thread; cpu->halt_cond = single_tcg_halt_cond; + + /* copy the stuff done at start of rr_cpu_thread_fn */ cpu->thread_id = first_cpu->thread_id; cpu->neg.can_do_io = 1; cpu->created = true; diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index 0f0a247f56..6cfc01593a 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -261,6 +261,11 @@ static void cpu_common_initfn(Object *obj) cpu->nr_threads = 1; cpu->cflags_next_tb = -1; + /* allocate storage for thread info, initialise condition variables */ + cpu->thread = g_new0(QemuThread, 1); + cpu->halt_cond = g_new0(QemuCond, 1); + qemu_cond_init(cpu->halt_cond); + qemu_mutex_init(&cpu->work_mutex); qemu_lockcnt_init(&cpu->in_ioctl_lock); QSIMPLEQ_INIT(&cpu->work_list); diff --git a/target/i386/nvmm/nvmm-accel-ops.c b/target/i386/nvmm/nvmm-accel-ops.c index 6b2bfd9b9c..0ba31201e2 100644 --- a/target/i386/nvmm/nvmm-accel-ops.c +++ b/target/i386/nvmm/nvmm-accel-ops.c @@ -64,9 +64,6 @@ static void nvmm_start_vcpu_thread(CPUState *cpu) { char thread_name[VCPU_THREAD_NAME_SIZE]; - cpu->thread = g_new0(QemuThread, 1); - cpu->halt_cond = g_new0(QemuCond, 1); - qemu_cond_init(cpu->halt_cond); snprintf(thread_name, VCPU_THREAD_NAME_SIZE, "CPU %d/NVMM", cpu->cpu_index); qemu_thread_create(cpu->thread, thread_name, qemu_nvmm_cpu_thread_fn, diff --git a/target/i386/whpx/whpx-accel-ops.c b/target/i386/whpx/whpx-accel-ops.c index 189ae0f140..1a2b4e1c43 100644 --- a/target/i386/whpx/whpx-accel-ops.c +++ b/target/i386/whpx/whpx-accel-ops.c @@ -64,9 +64,6 @@ static void whpx_start_vcpu_thread(CPUState *cpu) { char thread_name[VCPU_THREAD_NAME_SIZE]; - cpu->thread = g_new0(QemuThread, 1); - cpu->halt_cond = g_new0(QemuCond, 1); - qemu_cond_init(cpu->halt_cond); snprintf(thread_name, VCPU_THREAD_NAME_SIZE, "CPU %d/WHPX", cpu->cpu_index); qemu_thread_create(cpu->thread, thread_name, whpx_cpu_thread_fn, From patchwork Tue Jun 4 09:55:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13684978 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 E5685C25B78 for ; Tue, 4 Jun 2024 09:59:33 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEQvN-0000if-5L; Tue, 04 Jun 2024 05:57:49 -0400 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 1sEQvM-0000aq-62 for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:57:48 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sEQvK-0002GC-Id for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:57:47 -0400 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-354f14bd80cso664836f8f.1 for ; Tue, 04 Jun 2024 02:57:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717495064; x=1718099864; 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=Maqg614wB6IQJrQoZvf0lrAnLMpTuuWUZ3NE8tvuj7U=; b=SuOeEavAjG+sdjApvbmzVNN+BA1o6s+ZqildnXCUUgGwJA5UGE3sNbskVLIbMXaNcz BfEXHv8Far743LZ/viGzDGiLdju6QIaLBFYcecBZxFSTiN+qgFYAl0cz+BgPX4AbQZ/0 MrzLqwhihHHUo3elpHfYDzueMycsI4S84yOvfMU15Bt6uZw68erdgVeH/5N0/YbrRNTi //r2uoE3p0C6SlP6ZCcOv25/5F41JxBw0oinEN0I++aXZB+sQzn2gZFgd8KXzdBcZXjw 6XQbqRNqNmzpkV8BnplgsrPEoRG69tInLGUprYG8fzrgmjgEk1T//MJ+wnN//wzncSZb XT9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717495064; x=1718099864; 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=Maqg614wB6IQJrQoZvf0lrAnLMpTuuWUZ3NE8tvuj7U=; b=a9foHtwAT+xAoGp8J/cYCZo/IFkHiImvbxgBMpiAm/Zv2Sj63O710wblTbg0d2XqvQ i3tf0H1+hIQYm570W8Ni2ODmXMcl8kwpyx3yCUwo7XATVAbnfAVWGzygjE3SVVQLbe4Z fO7XieR6dRY0xCDVaWyruJ3YkrcinaVBG3ESWgjwkozz0qqoJfyDhYSCKWLburIRXvHs D+gAlZr+ncMndHNYJT1fLVB8nnPbBbvtv8AWRygCaKFG2VF9BzoxDBQMWsiFKVDUFFI0 tLhwb4RBkSDgMrFhW/yn77FFUWxVZh8DuG8GsmSjxKEBWlNLhyOopJyNqp7J5GiAlwEA snag== X-Gm-Message-State: AOJu0YzfGjPosnQbjHzCdxw4/e/CksER0wmX8EfDViW4Yz/2hyEaAHFK pOqpb3C1y7R0FmmgQjNQI8UaFYQMdafgZ6JYpvs6eFVqfxjugy8SEFwnQupauTnQo2+YhE4ocBz Q X-Google-Smtp-Source: AGHT+IFzseSKmBMsrErO0w7gvhlDM7DV7/ZOnmum0sFQowJRB5MOtgh6TIfpudOka8cP2kJpPxhm8Q== X-Received: by 2002:adf:e2c2:0:b0:357:ff92:ab06 with SMTP id ffacd0b85a97d-35e0f25b2e3mr8934642f8f.2.1717495064467; Tue, 04 Jun 2024 02:57:44 -0700 (PDT) Received: from m1x-phil.lan ([176.176.159.34]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35dd04c0f57sm11125532f8f.12.2024.06.04.02.57.43 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Jun 2024 02:57:44 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= Subject: [PULL 17/32] cpu-target: don't set cpu->thread_id to bogus value Date: Tue, 4 Jun 2024 11:55:53 +0200 Message-ID: <20240604095609.12285-18-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240604095609.12285-1-philmd@linaro.org> References: <20240604095609.12285-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=philmd@linaro.org; helo=mail-wr1-x434.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, T_SCC_BODY_TEXT_LINE=-0.01 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: Alex Bennée The thread_id isn't valid until the threads are created. There is no point setting it here. The only thing that cares about the thread_id is qmp_query_cpus_fast. Signed-off-by: Alex Bennée Reviewed-by: Pierrick Bouvier Message-ID: <20240530194250.1801701-4-alex.bennee@linaro.org> Signed-off-by: Philippe Mathieu-Daudé --- cpu-target.c | 1 - 1 file changed, 1 deletion(-) diff --git a/cpu-target.c b/cpu-target.c index 5af120e8aa..499facf774 100644 --- a/cpu-target.c +++ b/cpu-target.c @@ -241,7 +241,6 @@ void cpu_exec_initfn(CPUState *cpu) cpu->num_ases = 0; #ifndef CONFIG_USER_ONLY - cpu->thread_id = qemu_get_thread_id(); cpu->memory = get_system_memory(); object_ref(OBJECT(cpu->memory)); #endif From patchwork Tue Jun 4 09:55:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13684968 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 20272C27C50 for ; Tue, 4 Jun 2024 09:58:15 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEQvT-0001Dd-GR; Tue, 04 Jun 2024 05:57:55 -0400 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 1sEQvQ-00018G-TI for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:57:52 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sEQvP-0002Gu-AX for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:57:52 -0400 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-35e4d6f7c5cso2923564f8f.2 for ; Tue, 04 Jun 2024 02:57:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717495069; x=1718099869; 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=xZ3BsgSsDpVAMiUE0ZHS//M9sgcI8U2Pt7eSzUE/3vA=; b=gwZLW4ZYcfY0bgwBnD2xOM09lHUAw93F9FnFgr6LEsV7kze+sX/B0ZL4EpwgXD03Ad UMzB0y7GFTzKeZO53HeNudYyGSfMUMj3ATb2QjAmIHE1H+LTlR6vtD1pGrRwUW6s4afC PHdhuqmwq5R/GRq0xuw+20f+fAVj3n/VhSJG8sfMFZdNUV9+pA3h1K04nM5ezYmG+3FZ KZ+KO4KmujOzdSrK+wXQnDb0sMIAm9aCyuaPllc6OBL9VPYe7IHJLyyBzDZAtd8Wh2+p j5Vsti7W5kFVq+ALi5vDJCTDUom6/EyeCj+pjRso9zWkSHWSXvibg80YEVJcUvzCCXmm zb8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717495069; x=1718099869; 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=xZ3BsgSsDpVAMiUE0ZHS//M9sgcI8U2Pt7eSzUE/3vA=; b=YaBGt84qPOfZ1/sUCeVLkPZ2sMry069SAuQtD5rpSeY83YTEJU+pHB3ODycZX0wWD4 D4AlMZues84UGwsWqxcHUcJUnA24pcBdJvg7FpLlb1eVTNPGHAMMb4D571Lnki6HE0og HTfpvfPGUhK7AK9MnevVJ36cjtxlmqTghKtmLm26e6JTXQ0j75JKiO4kZxyQbsq9f7Aj zaxHaHcNxWwMopc5rKKuroWZ/YRqjJdJxlfK/2z7a0GeffTnHjjrW4cyKRPlxr4NFcNe Za1Vi9X1+ss6DwXI5Kqhyn0sS7A9lZBis0msvLL6VOogm/zzbnFDKItV8uRrvRkFHG3i wycA== X-Gm-Message-State: AOJu0Yx1SGwi9Qly9xoxdXfococv9gqMHmAk7zJWiUYZAvRqxzYRWPLo GDkEG1NlaKKeFzNgtaMWCqVA2YH/KltVdow40o2sgY7cDt07x906UBDa+O2+9Bz80kKHjAz80NK c X-Google-Smtp-Source: AGHT+IGjzaumT/kpOGRm5EuVd3DXmuuCEwaPu7dIKF+VdsyNyTkig7dkZAqwGLIGbVEm5FgqE6Jh3Q== X-Received: by 2002:a5d:4647:0:b0:359:b737:68d9 with SMTP id ffacd0b85a97d-35e0f25a5c3mr8371812f8f.12.1717495069692; Tue, 04 Jun 2024 02:57:49 -0700 (PDT) Received: from m1x-phil.lan ([176.176.159.34]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35dd04da182sm10991675f8f.54.2024.06.04.02.57.48 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Jun 2024 02:57:49 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= Subject: [PULL 18/32] plugins: remove special casing for cpu->realized Date: Tue, 4 Jun 2024 11:55:54 +0200 Message-ID: <20240604095609.12285-19-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240604095609.12285-1-philmd@linaro.org> References: <20240604095609.12285-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=philmd@linaro.org; helo=mail-wr1-x42f.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, T_SCC_BODY_TEXT_LINE=-0.01 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: Alex Bennée Now the condition variable is initialised early on we don't need to go through hoops to avoid calling async_run_on_cpu. Signed-off-by: Alex Bennée Reviewed-by: Pierrick Bouvier Message-ID: <20240530194250.1801701-5-alex.bennee@linaro.org> Signed-off-by: Philippe Mathieu-Daudé --- plugins/core.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/plugins/core.c b/plugins/core.c index 0726bc7f25..badede28cf 100644 --- a/plugins/core.c +++ b/plugins/core.c @@ -65,11 +65,7 @@ static void plugin_cpu_update__locked(gpointer k, gpointer v, gpointer udata) CPUState *cpu = container_of(k, CPUState, cpu_index); run_on_cpu_data mask = RUN_ON_CPU_HOST_ULONG(*plugin.mask); - if (DEVICE(cpu)->realized) { - async_run_on_cpu(cpu, plugin_cpu_update__async, mask); - } else { - plugin_cpu_update__async(cpu, mask); - } + async_run_on_cpu(cpu, plugin_cpu_update__async, mask); } void plugin_unregister_cb__locked(struct qemu_plugin_ctx *ctx, From patchwork Tue Jun 4 09:55:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13684973 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 A8168C25B7E for ; Tue, 4 Jun 2024 09:58:40 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEQvh-0001wo-0O; Tue, 04 Jun 2024 05:58:09 -0400 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 1sEQvW-0001Sx-8y for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:57:59 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sEQvU-0002H4-La for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:57:58 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-42134bb9735so29704055e9.1 for ; Tue, 04 Jun 2024 02:57:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717495075; x=1718099875; 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=aye1K/Rd4o81X/8PhiFbSTR8xpOCjIohLrumKVTvmK4=; b=Nzb4Zdns0rmVXzwrbPLG2/nJmXMbfxA+mYgr0GvxlzqBdY9c7kOm6/tA9/oQH+0a34 CP1uCPOq5iaSz42n3JagGZBQ8s4HnojaqV/kRSzbHdo5E4iw7DXSC8FTkJuEaJIozP6O oZPRT1rpaXFdaM/FEfulCPwLijPcDqskU8Zybb9smRJwUW4zuT7TUzaSLK2wM2Wzffon YjupyKrZJnoPMj+gms+wcil3hUULi/fXOotOnZDTIFpFlNTSoBJgHU0z89Dfn0fzeUOa rHHha1uZ4zqs8vxFMZV5Qt6KPW53sGNfGPzXiHzvyjQTMRH5CIH18sOBuEDNEGEJhYAU 5JPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717495075; x=1718099875; 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=aye1K/Rd4o81X/8PhiFbSTR8xpOCjIohLrumKVTvmK4=; b=M4wYdWg+EN8cp0kKVRYBgHbp0DvabMSIew3RX+a4yN8zggQ7nS6C05lciby9AwmasC 7AG08Sth79OF1ZGRQhckQEbkzn3LLSRjF3DjbtilxtzoevthlPu76h4JD5f2UrdNx344 Qi3PmOd7/fgBwJCWd6+KD3LsRVNPQslY6ta1vQ6M8QemMbi2vm2Zz3lmaVuvWrT2XLfQ /Cwwi0I/i+BM5Qn+aH1RQCbFWyaSk2NQQJtAmIgaEeAUUrsKuroZAZzgd/bNPCWicikc FZg6Z/WPRrVcGKsNRxEEfpB7e+FNADd6h3EdvxSwJ6m1+tKa66v5A/lyf+zmmekuaWUe Hf4g== X-Gm-Message-State: AOJu0YzS2ul7KREjOEnO/h3SRePMkQV9UTv2X7E+6gLC/i+AKjLBseAq /NYQGpWhrlJw0F1Ke/6jzZPiVC9DXoaxlgTElofFP/iwGMjVIIpFGXBigtWmKbrIKAWCESI3XkL 8 X-Google-Smtp-Source: AGHT+IH820FPTAz8jhvDdJDxTB8ZEN2lFP7D9uhU+IKV7jKFduNrJ2Uvl4Ln9Dhh1pFrnhLo8ktBqg== X-Received: by 2002:a05:600c:1d1a:b0:41a:1b3f:b465 with SMTP id 5b1f17b1804b1-4212e0ae724mr95394855e9.26.1717495074888; Tue, 04 Jun 2024 02:57:54 -0700 (PDT) Received: from m1x-phil.lan ([176.176.159.34]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-421535bc543sm8948085e9.43.2024.06.04.02.57.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Jun 2024 02:57:54 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= Subject: [PULL 19/32] core/cpu-common: initialise plugin state before thread creation Date: Tue, 4 Jun 2024 11:55:55 +0200 Message-ID: <20240604095609.12285-20-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240604095609.12285-1-philmd@linaro.org> References: <20240604095609.12285-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.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, T_SCC_BODY_TEXT_LINE=-0.01 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: Alex Bennée Originally I tried to move where vCPU thread initialisation to later in realize. However pulling that thread (sic) got gnarly really quickly. It turns out some steps of CPU realization need values that can only be determined from the running vCPU thread. However having moved enough out of the thread creation we can now queue work before the thread starts (at least for TCG guests) and avoid the race between vcpu_init and other vcpu states a plugin might subscribe to. Signed-off-by: Alex Bennée Reviewed-by: Pierrick Bouvier Message-ID: <20240530194250.1801701-6-alex.bennee@linaro.org> Signed-off-by: Philippe Mathieu-Daudé --- hw/core/cpu-common.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index 6cfc01593a..bf1a7b8892 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -222,14 +222,6 @@ static void cpu_common_realizefn(DeviceState *dev, Error **errp) cpu_resume(cpu); } - /* Plugin initialization must wait until the cpu start executing code */ -#ifdef CONFIG_PLUGIN - if (tcg_enabled()) { - cpu->plugin_state = qemu_plugin_create_vcpu_state(); - async_run_on_cpu(cpu, qemu_plugin_vcpu_init__async, RUN_ON_CPU_NULL); - } -#endif - /* NOTE: latest generic point where the cpu is fully realized */ } @@ -273,6 +265,18 @@ static void cpu_common_initfn(Object *obj) QTAILQ_INIT(&cpu->watchpoints); cpu_exec_initfn(cpu); + + /* + * Plugin initialization must wait until the cpu start executing + * code, but we must queue this work before the threads are + * created to ensure we don't race. + */ +#ifdef CONFIG_PLUGIN + if (tcg_enabled()) { + cpu->plugin_state = qemu_plugin_create_vcpu_state(); + async_run_on_cpu(cpu, qemu_plugin_vcpu_init__async, RUN_ON_CPU_NULL); + } +#endif } static void cpu_common_finalize(Object *obj) From patchwork Tue Jun 4 09:55:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13684976 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 5E15BC25B78 for ; Tue, 4 Jun 2024 09:59:21 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEQvk-0002SO-WC; Tue, 04 Jun 2024 05:58:13 -0400 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 1sEQvc-0001sq-Kx for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:58:06 -0400 Received: from mail-lj1-x232.google.com ([2a00:1450:4864:20::232]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sEQva-0002Hh-UZ for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:58:04 -0400 Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2eabd22d3f4so8443741fa.1 for ; Tue, 04 Jun 2024 02:58:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717495080; x=1718099880; 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=KhtO+b8xKpbz5dyKFVe313y98g7MQZe0qAfemmQJG2o=; b=Ny/YqwUT/L2YSs78/vGsJKV1vSBtQ5AmMqhJu9gQsaScoWSV8s3+ru2LQtsiaVqCMJ NuiC1xsisspQj/irZv94ZfcVo2v5/IcaSXmJEVkWHmMA7CHVLJu0pH2IWWcoL6mqLYLb LTWRvKnNNDW4Jx0VKxG+H46ZcDPTKv4RskdU+wEtZpipAeZSf3dUbM/0QDUfxrlQZtLa VkZaQLT3HAKHxq/sdqwEJZYTKW+pmg8KJ3KFTmU0OuwStQypY1yj1NpYOjOMW5tHgvrI qnNEguq3Q1INFBqRVDYpmDTolaQvQf7YdyeMnd+AByGv5NW1scWmAFf6V+cgjzZEw5H/ k4Iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717495080; x=1718099880; 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=KhtO+b8xKpbz5dyKFVe313y98g7MQZe0qAfemmQJG2o=; b=wPer/ULnyxr3yGF+8CHX/jm/k1zjsdYHtzqOBZJ+0BiIx7bTo1M8Z4T72CEDJD5FQx xjvATgnzf6VWk539b8TcfpI7FdL+HJ/32nTqxFSfqd/nn1RnD4FtH25wvwrOTyNdwmBH slPZ6fq3cM0VsLhPnvIwoffhW9qLwRusvdPvWrheJbCfjlPnRikqU1XL6gKoJOGmv+Zq HtTiVX3Vf2XUfZ3HZYiuCdy4aRp1fXr2XXxKAJ/gl1hq5IotWXZfrpoLPW62Xuk3Twr+ 0Ic/s7GE5hKFtt20VuQN7SZ9i5pdaZmoWqritg0VJzq4rXqtrxao1Hh5oN++nDos6OPw 8H+g== X-Gm-Message-State: AOJu0YztetSL4GfdncSHKMLMNzpJLCldI0ATD8bM1blvTrgBeLIKFYJT REKemd2XQZygNnFNK4jyOxevIjPMeoOHVSQzh4OR9wKEtBAN0coOKz1zKAIeNqPY1y84nTnLkVG 9 X-Google-Smtp-Source: AGHT+IErAEByG+blH4ldyvqDww6GNUxSaTcykxJ/kVYXoj55TqH4GjOyWKIh80aTT64WwxIhvkFeKg== X-Received: by 2002:a2e:994b:0:b0:2ea:7e5b:98db with SMTP id 38308e7fff4ca-2ea951f9657mr71594191fa.51.1717495080415; Tue, 04 Jun 2024 02:58:00 -0700 (PDT) Received: from m1x-phil.lan ([176.176.159.34]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35dd062ec39sm11105957f8f.89.2024.06.04.02.57.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Jun 2024 02:58:00 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Edgar E. Iglesias" , Stefano Stabellini , David Hildenbrand , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 20/32] xen: Add xen_mr_is_memory() Date: Tue, 4 Jun 2024 11:55:56 +0200 Message-ID: <20240604095609.12285-21-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240604095609.12285-1-philmd@linaro.org> References: <20240604095609.12285-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::232; envelope-from=philmd@linaro.org; helo=mail-lj1-x232.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, T_SCC_BODY_TEXT_LINE=-0.01 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: "Edgar E. Iglesias" Add xen_mr_is_memory() to abstract away tests for the xen_memory MR. No functional changes. Signed-off-by: Edgar E. Iglesias Reviewed-by: Stefano Stabellini Acked-by: David Hildenbrand Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240529140739.1387692-4-edgar.iglesias@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- include/sysemu/xen.h | 1 + hw/xen/xen-hvm-common.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/include/sysemu/xen.h b/include/sysemu/xen.h index 754ec2e6cb..3445888e39 100644 --- a/include/sysemu/xen.h +++ b/include/sysemu/xen.h @@ -49,4 +49,5 @@ static inline void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, #endif /* CONFIG_XEN_IS_POSSIBLE */ +bool xen_mr_is_memory(MemoryRegion *mr); #endif diff --git a/hw/xen/xen-hvm-common.c b/hw/xen/xen-hvm-common.c index 2d1b032121..a0a0252da0 100644 --- a/hw/xen/xen-hvm-common.c +++ b/hw/xen/xen-hvm-common.c @@ -12,6 +12,12 @@ MemoryRegion xen_memory; +/* Check for xen memory. */ +bool xen_mr_is_memory(MemoryRegion *mr) +{ + return mr == &xen_memory; +} + void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, MemoryRegion *mr, Error **errp) { @@ -28,7 +34,7 @@ void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size, MemoryRegion *mr, return; } - if (mr == &xen_memory) { + if (xen_mr_is_memory(mr)) { return; } @@ -55,7 +61,7 @@ static void xen_set_memory(struct MemoryListener *listener, { XenIOState *state = container_of(listener, XenIOState, memory_listener); - if (section->mr == &xen_memory) { + if (xen_mr_is_memory(section->mr)) { return; } else { if (add) { From patchwork Tue Jun 4 09:55:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13684977 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 2EF4EC25B78 for ; Tue, 4 Jun 2024 09:59:26 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEQvk-0002Ae-EC; Tue, 04 Jun 2024 05:58:12 -0400 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 1sEQvh-0001yA-5R for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:58:09 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sEQvf-0002IA-IJ for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:58:08 -0400 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-35dc1d8867eso4586640f8f.0 for ; Tue, 04 Jun 2024 02:58:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717495086; x=1718099886; 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=EzcgxKBZLi25ReeoipJxRQhlgzmQ34yT5acRrJVoGcE=; b=t+ZvpSx6qgJu3ED/DV2fWT0biIqpcOuJhlQgafd6ojqnMkClXtMmVvRkta4mqKjMk9 f3Pemt9qzscPdMJNIlAVJ6oi1xY0yaxoOrZfldjT1mp3BIX4z7S02ggpi0ngzX8pQAHK oYvpYxYa673LPP9uudfQrLJ8Qp9yJqWKPoMqs1bc9N8E+1zshwR86cVVuqH8PnPO+Qrr IiMzNMVaQYMqBzbs6NpQIVe9LoBNCE8iKd9GJynXdFisQbf+lCzf0jFqRg/XXBH/PE9g HmpTRbbOYoFAlQ47D1IdYhRo+HVszDP+sVPCj+OPF6LtyELJmOfR3hFHJyLZ1OlW1rzx MRDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717495086; x=1718099886; 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=EzcgxKBZLi25ReeoipJxRQhlgzmQ34yT5acRrJVoGcE=; b=gpMXivvgCEeOhbCxxfM745R6o9AwXpgB3v7ZSn7znuXJpJjlbmXt1hoR7tqoNBecot qwfGTpUAy1pTClIJESJhFKHwgz91HLHX+eexdkwrWXJQHvb21rct+tvHsiB6YSYT1mAN 0iW81xEiDO79BW3wMElo4lWcgj5ijR1gVB4LqwmolZLXCS7Te+2IiGspqGaukaKN5msx yg6aAjWyGgmdLCynfuz3qC9VwVmKqZ2cjLTL8wifXY9j4REghAmMa8Tz2hKHmj/L5b45 C771KUhHBcNN++74xhtoLngzktr8gvXePfC746YfqCveFlHtvJWB9BmOHDay8ZPrW9x7 KQ1Q== X-Gm-Message-State: AOJu0YzQfSJdJnszK1zdjjwK6Trx+E+jgy/9VqO1K8aVbihjdW1H7j7s hftEBgbN9P8T9n6QMT8bMpIvCpXFTPJCc//xC2G4oZZ4WUlO5lHCRip8RTTJcXsJEba9RkmXOOB t X-Google-Smtp-Source: AGHT+IEUm9fBDg4Kslt2mW3Mzccqzt+Wmlaj0QsdjnC/1eN1V8dDWzeponpQmbJdsTb+vPMYrEY9vA== X-Received: by 2002:a5d:5186:0:b0:354:f467:c149 with SMTP id ffacd0b85a97d-35e0f36dca9mr7275991f8f.59.1717495085822; Tue, 04 Jun 2024 02:58:05 -0700 (PDT) Received: from m1x-phil.lan ([176.176.159.34]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35dd066d317sm10999710f8f.113.2024.06.04.02.58.04 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Jun 2024 02:58:05 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Edgar E. Iglesias" , Stefano Stabellini , David Hildenbrand , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 21/32] physmem: Always pass offset + addr to xen_map_cache Date: Tue, 4 Jun 2024 11:55:57 +0200 Message-ID: <20240604095609.12285-22-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240604095609.12285-1-philmd@linaro.org> References: <20240604095609.12285-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.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, T_SCC_BODY_TEXT_LINE=-0.01 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: "Edgar E. Iglesias" Always pass address with offset to xen_map_cache(). This is in preparation for support for grant mappings. Since this is within a block that checks for offset == 0, this has no functional changes. Signed-off-by: Edgar E. Iglesias Reviewed-by: Stefano Stabellini Reviewed-by: David Hildenbrand Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240529140739.1387692-5-edgar.iglesias@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- system/physmem.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/system/physmem.c b/system/physmem.c index 342b7a8fd4..5e6257ef65 100644 --- a/system/physmem.c +++ b/system/physmem.c @@ -2230,7 +2230,8 @@ static void *qemu_ram_ptr_length(RAMBlock *block, ram_addr_t addr, * In that case just map the requested area. */ if (block->offset == 0) { - return xen_map_cache(block->mr, addr, len, lock, lock, + return xen_map_cache(block->mr, block->offset + addr, + len, lock, lock, is_write); } From patchwork Tue Jun 4 09:55:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13684975 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 8EBA9C25B7E for ; Tue, 4 Jun 2024 09:59:18 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEQvo-0002yo-O1; Tue, 04 Jun 2024 05:58:16 -0400 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 1sEQvm-0002kB-Qm for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:58:14 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sEQvl-0002J2-0m for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:58:14 -0400 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-42121d27861so8664055e9.0 for ; Tue, 04 Jun 2024 02:58:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717495091; x=1718099891; 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=SNllFIjXNz5GjqDOBbChwyL7SF1oO9qoS6VeKoJgVQQ=; b=LBkGYM+JHguc/GC/OWjs783zYXQr4eU9T4Y5XiSqleBFQ4RF6tvcB5oLiFLeblmK7b IO6IDTIyou6e1zgnE2TWOFX36SNmBT2C8UX4wJ4UzvF34Zgg5p2zF22LE9mPmQiLUoUn Nvt5T6EJ5a3myhYEhwP004Hq0iz8ubsiNT6OkbUVzzH8sLwGGhPkhQ9THnKkP0xL6LU3 znb1UNi7Nco/3RjOhfQmxdoUrNhVTzBU4BlPJIM5oe5kEXvH0AqrNxct9t60bGdpI6// g1KoxYIgFC+VV/azRNlcMCY77rgvMXhOvTpnjMS0MBTtYPU3dk5+EfODDIFYn/Kk+9ER N4uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717495091; x=1718099891; 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=SNllFIjXNz5GjqDOBbChwyL7SF1oO9qoS6VeKoJgVQQ=; b=r/aDWcf0+ZlLigFkGEC6gG075pfgXujvWkNX+Jf2va+44SiZcOUwDhkh4eKSsfUan+ rF9Bqk21U2LWjpW6Fma+GUjXFq+2pC/28Bm0RH45a+EpXEaBT1NCmTYR4EwEunLfcI+g l2MoegZH87w93sx89pNqG3TNgNuenPUFXkwzSDLeDY8zaWE1fC6BzJsNIV2auNH4/reP NwpciR0MzBb25gSsTp8QW7TAgSazPezhGajk1A8BVoXu0AMxupy8mEclcnCjmXSDXjha 50OA4YEx4cXxugGFMXVybEK3D4WH/5XndWm/75tvu1T80UrI5zGCeSGY2c3ZW23cycz6 ZarQ== X-Gm-Message-State: AOJu0YyWy7pu/O7ed+4DoqM+vahHQBQAC+XXqzUxT4rZ4uaGvhU7sn1E KiKTCSevTokoAGQlt7RudiQv2HanFERjpVY/jygVCmryP3UtrPdcW9lG5zx6TG49habRVGd+x4E / X-Google-Smtp-Source: AGHT+IGK7i4mnCY4rcZ0K8m+AzlE92Y1UXIKQleM6PeYArTfWB721sahRuFDriX+HnsfYqX5nP1qfA== X-Received: by 2002:a05:600c:4f13:b0:421:418d:8f7 with SMTP id 5b1f17b1804b1-421418d0be6mr28047945e9.12.1717495090999; Tue, 04 Jun 2024 02:58:10 -0700 (PDT) Received: from m1x-phil.lan ([176.176.159.34]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4212b8a5598sm147525575e9.38.2024.06.04.02.58.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Jun 2024 02:58:10 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: "Edgar E. Iglesias" , Stefano Stabellini , David Hildenbrand , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 22/32] physmem: Replace check for RAMBlock offset 0 with xen_mr_is_memory Date: Tue, 4 Jun 2024 11:55:58 +0200 Message-ID: <20240604095609.12285-23-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240604095609.12285-1-philmd@linaro.org> References: <20240604095609.12285-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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, T_SCC_BODY_TEXT_LINE=-0.01 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: "Edgar E. Iglesias" For xen, when checking for the first RAM (xen_memory), use xen_mr_is_memory() rather than checking for a RAMBlock with offset 0. All Xen machines create xen_memory first so this has no functional change for existing machines. Signed-off-by: Edgar E. Iglesias Reviewed-by: Stefano Stabellini Reviewed-by: David Hildenbrand Message-ID: <20240529140739.1387692-6-edgar.iglesias@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- system/physmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/physmem.c b/system/physmem.c index 5e6257ef65..b7847db1a2 100644 --- a/system/physmem.c +++ b/system/physmem.c @@ -2229,7 +2229,7 @@ static void *qemu_ram_ptr_length(RAMBlock *block, ram_addr_t addr, * because we don't want to map the entire memory in QEMU. * In that case just map the requested area. */ - if (block->offset == 0) { + if (xen_mr_is_memory(block->mr)) { return xen_map_cache(block->mr, block->offset + addr, len, lock, lock, is_write); From patchwork Tue Jun 4 09:55:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13684983 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 7C4DFC25B78 for ; Tue, 4 Jun 2024 10:00:14 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEQvt-0003j1-Id; Tue, 04 Jun 2024 05:58:21 -0400 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 1sEQvr-0003U6-Qo for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:58:19 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sEQvp-0002JR-Vd for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:58:19 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-421338c4c3bso8559625e9.1 for ; Tue, 04 Jun 2024 02:58:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717495096; x=1718099896; 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=UMNBQrBvKQfv4Dl+hKP/TPgBc1DhyAHhW2w6Yei3CGk=; b=qGm3eQ+frIAk25ighZiIiPxdPwjGeOO55nOBu8D/Imyhe5V5uH7XQU0XtAojxRFvGj FBNQ+WzE4nlIwLR2TnLm9Ec0FzhMINvwESuGi1U5a3cS4GjSjG6P/Sovl8UD4s8BLx4u jOadOL2nLHHlPxCgwqsgz+bhpUAVO1aATwSYqpx9CW4T/080oIEDtw9bSKTXS9U5/cYX TEJXHWKbAiTZKhPIWHvewbZFf6Fi4N7NeW6Hq6GUD65MpvU/4Gg8IXbnQ4F2gjRydBb3 F89UUMKIEuB1N5yJiaDOS3p4VWJESqFIwc3/fsaab+8qCYXfKiT75/OUedlwKoz8K8oT iWOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717495096; x=1718099896; 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=UMNBQrBvKQfv4Dl+hKP/TPgBc1DhyAHhW2w6Yei3CGk=; b=oDjxC4BdvwuZ1l7O+kQ+lyozAyO6KdZvh8/fkEppte4O/JBKiaZfFea2GuoN9i+/c/ IgDwxgBybmmzuakzxZW0OVc6s5ON0goupVMxM8ZtTtaECUoqUcZOVPGU04slj1/DKpkZ /LeaSl9k6A5A6RcDGLmkinG65R6EKhpNOSp0bZpK4cWzrXePnXQGtZw39Of2fpUHeQz6 K617eaDwJlzd2eOVK8F9YJFeEAeRx+IfJKkKovEekFubULw1HyTpTGZxcRyPGP7kN6AJ /0z9m7+5fYDDs/5K5jseX0CcleKBvVW5iNjR41vGal4pNYmic/Z07rM2eU2EnjB+hKZ8 H2GQ== X-Gm-Message-State: AOJu0YynXb7De9qTTbxHDEgftWTzOxCwPLxkI2EVW1QQGPAGO4CvymFM X61a6hfZEZ2wU0IuOWDFpatg0g1qZRWuKMajEGkMPOk7OGQdjZvY/DTMx4qiXZq7RDkflnf2WD6 r X-Google-Smtp-Source: AGHT+IHGdggg5ewx0/2n3Lu8hrxRYSTHdGkSS5iyyrnz+QbRSHoncf7/+uzqUAg7gR3BPYSgZQK9OA== X-Received: by 2002:a05:600c:35d5:b0:419:f3f9:8ed6 with SMTP id 5b1f17b1804b1-4212e044bffmr110122735e9.4.1717495096202; Tue, 04 Jun 2024 02:58:16 -0700 (PDT) Received: from m1x-phil.lan ([176.176.159.34]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42135c9dc18sm112972305e9.1.2024.06.04.02.58.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Jun 2024 02:58:15 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paul Durrant Subject: [PULL 23/32] hw/xen: Constify XenLegacyDevice::XenDevOps Date: Tue, 4 Jun 2024 11:55:59 +0200 Message-ID: <20240604095609.12285-24-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240604095609.12285-1-philmd@linaro.org> References: <20240604095609.12285-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.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, T_SCC_BODY_TEXT_LINE=-0.01 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 XenDevOps @ops is not updated, mark it const. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Paul Durrant Message-Id: <20240510104908.76908-3-philmd@linaro.org> --- include/hw/xen/xen_pvdev.h | 2 +- hw/xen/xen-legacy-backend.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/hw/xen/xen_pvdev.h b/include/hw/xen/xen_pvdev.h index fdf84f47af..0c98444047 100644 --- a/include/hw/xen/xen_pvdev.h +++ b/include/hw/xen/xen_pvdev.h @@ -52,7 +52,7 @@ struct XenLegacyDevice { xenevtchn_handle *evtchndev; xengnttab_handle *gnttabdev; - struct XenDevOps *ops; + const struct XenDevOps *ops; QTAILQ_ENTRY(XenLegacyDevice) next; }; diff --git a/hw/xen/xen-legacy-backend.c b/hw/xen/xen-legacy-backend.c index 6f0b300a42..33620fe42e 100644 --- a/hw/xen/xen-legacy-backend.c +++ b/hw/xen/xen-legacy-backend.c @@ -170,7 +170,7 @@ int xen_be_copy_grant_refs(struct XenLegacyDevice *xendev, */ static struct XenLegacyDevice *xen_be_get_xendev(const char *type, int dom, int dev, - struct XenDevOps *ops) + const struct XenDevOps *ops) { struct XenLegacyDevice *xendev; From patchwork Tue Jun 4 09:56:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13684984 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 2CF86C25B78 for ; Tue, 4 Jun 2024 10:00:20 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEQvy-0004nK-Sc; Tue, 04 Jun 2024 05:58:26 -0400 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 1sEQvx-0004aC-9o for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:58:25 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sEQvv-0002Jk-G5 for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:58:24 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-421392b8156so8492835e9.3 for ; Tue, 04 Jun 2024 02:58:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717495101; x=1718099901; 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=KWEiLSLjPrxtWwEuDW5HmfeuH1N7C8mHb/ZvIjGfjz4=; b=Lzrg3/QZ7NNp6WK00x5y/n2tK8OOCalAoxhHZGkVV5p0bkXwKx2DORImveSx2h4z2I 3MAvFKogOfA9AHNBUT3VV63t9A1D54RYTGe9emSHM3xInHIhpo+xpcbUZEkCZVDy4UOe WqGSm+HeGvTJGkSgkRrfPrUD55i2jmZFj0MACwsjpteNFniLj1/15dNGhzTrlvfOzEhx /hWCQ1wM4vtTEmixxpCRNnDYR5yymI24omoe7z09zyL/uuES4qcTiJ/ByeHbZZ4QUiXg SW2mXAiIX9u/wBBd6hODw2pv2f5YjuwghdvK9NPe+4jcQpqZwRl97t5KSleYb75XIB6C Enaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717495101; x=1718099901; 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=KWEiLSLjPrxtWwEuDW5HmfeuH1N7C8mHb/ZvIjGfjz4=; b=cOlsV36jdqr++7ift2uypVD7RqHcCP3aBiIDDVkcx57+W6vhhMTa36LdohqrTpG4U4 qdNhiP3ZOzwIJukLY1VEJgLjWs6GAjizbue3LN7E9BqSnGIjU+oCk7WJPEbKLzOJC8Lu pSjm27ylcyMG1Fg861DSOkaPaYbADOZhICgMIXvJNSlGXZ4jlbjf70p0J/gKGXejf2K6 keu4Eu6mnaf0I0mLXM+PT2Wlk1iDToAptWYaOOhDgGcVkFzePjB7sgmvTTFTA/upN9CD uhbY5Mhy18gMLUa12s1+FzWv5bDpjMxXIJ0bI4LEOdcNA0+7x4sj4ywhBM1WmJyqtzQd DCLA== X-Gm-Message-State: AOJu0YxNPwzDkMnBYNe/4TQMiDauombdzv5Xc42L13SwvKkwRFl8woD2 7alOFyKaupbrHC4P0zdcTxoFR/bSUwmvNZtFi6s75DDDjbtyp17tQ0bZXRXK5Z7PBInjWjdOmFo T X-Google-Smtp-Source: AGHT+IF4t3Ptbt+sQoQi7/KPrImQE6KI2L2BTH13Sordg4RJXSyTY5Whek96aSR7UiPNBQn/BhIXcg== X-Received: by 2002:a05:600c:3b0d:b0:41b:fc3a:f1ef with SMTP id 5b1f17b1804b1-4212e0b08f7mr98344425e9.33.1717495101344; Tue, 04 Jun 2024 02:58:21 -0700 (PDT) Received: from m1x-phil.lan ([176.176.159.34]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4212b83d469sm147380125e9.9.2024.06.04.02.58.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Jun 2024 02:58:20 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paul Durrant Subject: [PULL 24/32] hw/xen: Constify xenstore_be::XenDevOps Date: Tue, 4 Jun 2024 11:56:00 +0200 Message-ID: <20240604095609.12285-25-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240604095609.12285-1-philmd@linaro.org> References: <20240604095609.12285-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.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, T_SCC_BODY_TEXT_LINE=-0.01 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 XenDevOps @ops is not updated, mark it const. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Paul Durrant Message-Id: <20240510104908.76908-4-philmd@linaro.org> --- include/hw/xen/xen-legacy-backend.h | 2 +- hw/xen/xen-legacy-backend.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/hw/xen/xen-legacy-backend.h b/include/hw/xen/xen-legacy-backend.h index 979c4ea04c..62623ecb30 100644 --- a/include/hw/xen/xen-legacy-backend.h +++ b/include/hw/xen/xen-legacy-backend.h @@ -40,7 +40,7 @@ void xen_be_check_state(struct XenLegacyDevice *xendev); /* xen backend driver bits */ void xen_be_init(void); -int xen_be_register(const char *type, struct XenDevOps *ops); +int xen_be_register(const char *type, const struct XenDevOps *ops); int xen_be_set_state(struct XenLegacyDevice *xendev, enum xenbus_state state); int xen_be_bind_evtchn(struct XenLegacyDevice *xendev); void xen_be_set_max_grant_refs(struct XenLegacyDevice *xendev, diff --git a/hw/xen/xen-legacy-backend.c b/hw/xen/xen-legacy-backend.c index 33620fe42e..5514184f9c 100644 --- a/hw/xen/xen-legacy-backend.c +++ b/hw/xen/xen-legacy-backend.c @@ -520,7 +520,7 @@ void xen_be_check_state(struct XenLegacyDevice *xendev) struct xenstore_be { const char *type; int dom; - struct XenDevOps *ops; + const struct XenDevOps *ops; }; static void xenstore_update_be(void *opaque, const char *watch) @@ -557,7 +557,7 @@ static void xenstore_update_be(void *opaque, const char *watch) } } -static int xenstore_scan(const char *type, int dom, struct XenDevOps *ops) +static int xenstore_scan(const char *type, int dom, const struct XenDevOps *ops) { struct XenLegacyDevice *xendev; char path[XEN_BUFSIZE]; @@ -624,7 +624,7 @@ void xen_be_init(void) xen_set_dynamic_sysbus(); } -int xen_be_register(const char *type, struct XenDevOps *ops) +int xen_be_register(const char *type, const struct XenDevOps *ops) { char path[50]; From patchwork Tue Jun 4 09:56:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13684985 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 35E4CC25B7E for ; Tue, 4 Jun 2024 10:00:20 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEQw3-0005OC-Au; Tue, 04 Jun 2024 05:58:31 -0400 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 1sEQw2-0005J4-36 for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:58:30 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sEQw0-0002KI-9q for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:58:29 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-42134bb9735so29708695e9.1 for ; Tue, 04 Jun 2024 02:58:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717495106; x=1718099906; 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=OVq5FRQEdCU02hRbXIlYUuqMspOJT3T18nLYpVAudrA=; b=hqwKUPueMb8RT7UtzGdF315S9iukKo1NivEwR6tUrL5OgwRJSMi1dKsd7c4zUBn7P5 ulxzxJfdwdgB5d94TnPu/HlGecNrJ2Xa9DIpbHcHp+9v7yYQgqgV0XtlUMkHtZfsIdJR 2d9K8oZBb9tInDHXclfA5iV3169oqRSlWdVEZFFjsEZPQSXW/KAVZMFtiW9732Ajt3Nj 7S+/I2wFq0S7UPkyMLTwSdqgIjPjZBwo3HDVvjQDxZm0vkaEVsk7WcHMhGu3N09qtKS7 xp7v5XLtJLecHF6tiCXnUrEJF7W31Zgp4Ahc2yWS/MOlvfTpdoiZBv6ybPO68E5mauUG 0AKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717495106; x=1718099906; 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=OVq5FRQEdCU02hRbXIlYUuqMspOJT3T18nLYpVAudrA=; b=fdzkGVDDfUNkaxF8st3KBe9iLQmJiTI4tkWQHmiVZ8JejPnhUmo/zvD8pL9H2Amhsd 4+gp5ki9+S4ktpx80mM7gllmT1F/9mzyYVdT5PqgnIZY4wEZQv35623DJeTSP/amEHej xL3K/lz5jjkgQK8uKmHP7kvzUeuZ3RikM+eSO1+8fnOkpzokeHxD0Yxu+LBFeJ8mD3aK b0829X+/0YEUMe7KBz+czbpAQw/aHkReMmcF6pmthy7QB3a70dKoT64I98gK5YTMdbsK GLpBqlfyACBx/K1Qx7O7MKCFYJcvIUDObBEiwM7XNQwtSGCMqrnoXy4lxwtUfcschvya BRbg== X-Gm-Message-State: AOJu0Yy0+VBx2oEKrocVYI49C/fZlezI9jG/zV9tpq02IgluiRRzpApe bOwo1DFCJz7chc84vYNiTibA168wdtL72orfYqSmDjwF6RD9Kkn3aUGNsaDAz/PwRWlLzZUIGrq P X-Google-Smtp-Source: AGHT+IFzhuuGdPzB1aEOkyQhJbsR5qjtHRj1gAg9egiFde3NkinnbmI7sptJs1w/JF3/+3ssBa6MJw== X-Received: by 2002:a05:600c:4f46:b0:416:536b:683a with SMTP id 5b1f17b1804b1-4212e0ae76fmr97568835e9.32.1717495106567; Tue, 04 Jun 2024 02:58:26 -0700 (PDT) Received: from m1x-phil.lan ([176.176.159.34]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4212f0f9660sm138041625e9.39.2024.06.04.02.58.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Jun 2024 02:58:26 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paul Durrant Subject: [PULL 25/32] hw/xen: Make XenDevOps structures const Date: Tue, 4 Jun 2024 11:56:01 +0200 Message-ID: <20240604095609.12285-26-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240604095609.12285-1-philmd@linaro.org> References: <20240604095609.12285-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.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, T_SCC_BODY_TEXT_LINE=-0.01 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 Keep XenDevOps structures in .rodata. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Paul Durrant Message-Id: <20240510104908.76908-5-philmd@linaro.org> --- include/hw/xen/xen-legacy-backend.h | 2 +- hw/9pfs/xen-9p-backend.c | 2 +- hw/display/xenfb.c | 4 ++-- hw/usb/xen-usb.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/hw/xen/xen-legacy-backend.h b/include/hw/xen/xen-legacy-backend.h index 62623ecb30..e55a14057f 100644 --- a/include/hw/xen/xen-legacy-backend.h +++ b/include/hw/xen/xen-legacy-backend.h @@ -67,7 +67,7 @@ static inline void xen_be_unmap_grant_ref(struct XenLegacyDevice *xendev, } /* backend drivers not included in all machines */ -extern struct XenDevOps xen_framebuffer_ops; /* xenfb.c */ +extern const struct XenDevOps xen_framebuffer_ops; /* xenfb.c */ /* configuration (aka xenbus setup) */ void xen_config_cleanup(void); diff --git a/hw/9pfs/xen-9p-backend.c b/hw/9pfs/xen-9p-backend.c index a3ac53f989..79359d911a 100644 --- a/hw/9pfs/xen-9p-backend.c +++ b/hw/9pfs/xen-9p-backend.c @@ -513,7 +513,7 @@ static void xen_9pfs_alloc(struct XenLegacyDevice *xendev) xenstore_write_be_int(xendev, "max-ring-page-order", MAX_RING_ORDER); } -static struct XenDevOps xen_9pfs_ops = { +static const struct XenDevOps xen_9pfs_ops = { .size = sizeof(Xen9pfsDev), .flags = DEVOPS_FLAG_NEED_GNTDEV, .alloc = xen_9pfs_alloc, diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c index 27536bfce0..b6d370bdf6 100644 --- a/hw/display/xenfb.c +++ b/hw/display/xenfb.c @@ -972,7 +972,7 @@ static void fb_event(struct XenLegacyDevice *xendev) /* -------------------------------------------------------------------- */ -static struct XenDevOps xen_kbdmouse_ops = { +static const struct XenDevOps xen_kbdmouse_ops = { .size = sizeof(struct XenInput), .init = input_init, .initialise = input_initialise, @@ -981,7 +981,7 @@ static struct XenDevOps xen_kbdmouse_ops = { .event = input_event, }; -struct XenDevOps xen_framebuffer_ops = { +const struct XenDevOps xen_framebuffer_ops = { .size = sizeof(struct XenFB), .init = fb_init, .initialise = fb_initialise, diff --git a/hw/usb/xen-usb.c b/hw/usb/xen-usb.c index 416623f956..13901625c0 100644 --- a/hw/usb/xen-usb.c +++ b/hw/usb/xen-usb.c @@ -1083,7 +1083,7 @@ static void usbback_event(struct XenLegacyDevice *xendev) qemu_bh_schedule(usbif->bh); } -static struct XenDevOps xen_usb_ops = { +static const struct XenDevOps xen_usb_ops = { .size = sizeof(struct usbback_info), .flags = DEVOPS_FLAG_NEED_GNTDEV, .init = usbback_init, From patchwork Tue Jun 4 09:56:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13684986 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 CFE4BC25B78 for ; Tue, 4 Jun 2024 10:00:33 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEQwD-00063G-N9; Tue, 04 Jun 2024 05:58:41 -0400 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 1sEQw8-0005qZ-ES for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:58:36 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sEQw5-0002KT-GI for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:58:36 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-4214fe0067fso3750185e9.1 for ; Tue, 04 Jun 2024 02:58:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717495111; x=1718099911; 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=JSS7Auq4rjMzsXWfz5GZCQIt8zRmJ+DnGC7DTwkUw/o=; b=gt9SidZVNko3upKcRpipSjF5pYz7twkzxZhDl2BhJ+xZ5usTBIp91e5cKQJu2Ntd3s ylKi07E9O5MkCu/dNNhdp6wI27ALTXvLtLsAxnD3rXy39tDsVEq9rLBsBjPTQ2NjJNFc 96EHK5/NyQUUbCYIpM/DqqF3uj+4BMWl9j3WIaa+51KkoIa18bcIVZJDpb8TLYprfD6d 5Y9BdjpH5SEtZlbs45Rq2y+z06OfSUtFmpjJzxlpltKVRetfE1VelvZiygR4H1aVLqmK Ha63BdIwOKwxlmNZzsvvGY6yMJRrfMnYO5JXP2QhFpy4N3MCXpb8H8JHkk6nIczsxhEY mLCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717495111; x=1718099911; 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=JSS7Auq4rjMzsXWfz5GZCQIt8zRmJ+DnGC7DTwkUw/o=; b=ZuAW6sHaoppCTKXyHyOc89ffR8UexJLKODs6dYkbPYVVIeYTgMqN68yrMWkhbPwaUC MRjBY2LKyPiW61RaPcyRUHvU0x4iUPF8+UQBrWlyrQ4VgH23GBR2VDbWS4bCSj7hE7Pz 93gHG7v1uP3v7hYDL4xNVnC3SeI7ZoTn6LvOS0/WYEKW6QHgcFvrWNSIApbYQUif9v+0 or1RUUmie+jdCUf97CXdlU7UWWVqiKD/rpg2Z/Z9iZf6PoSPM5H1Cs0iuiY0j2Cr/ejR +YMtRILFqrDURyNmjsrzqGtRP/fPLq6Jt0ybBVWNnd4KBWTthwgEElaM2ezOuk7zdcWd X11A== X-Gm-Message-State: AOJu0YxAtNrDvoq94+kZ1YVzkhQcCluj3lNw9sK1z2RqQHoqUlAZ73zr KfHmGLDgG4B5+vAP0HvVnaszqVPV8RU3ofvvL0lE6M/z36iPHi+PYA7ib04xFb1Lubh8pLspXRK h X-Google-Smtp-Source: AGHT+IEqZw8J1TvbFkkIzX9qRVJETCTGRQ2hTRyRRgoRWNi9EdONdKrG6MB2qGUfMV36SucEB1WWkA== X-Received: by 2002:a5d:58c3:0:b0:35e:81b0:e28f with SMTP id ffacd0b85a97d-35e81b0e4efmr299450f8f.40.1717495111682; Tue, 04 Jun 2024 02:58:31 -0700 (PDT) Received: from m1x-phil.lan ([176.176.159.34]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35dd04c0d6csm11105972f8f.1.2024.06.04.02.58.30 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Jun 2024 02:58:31 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Paul Durrant Subject: [PULL 26/32] hw/xen: Register framebuffer backend via xen_backend_init() Date: Tue, 4 Jun 2024 11:56:02 +0200 Message-ID: <20240604095609.12285-27-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240604095609.12285-1-philmd@linaro.org> References: <20240604095609.12285-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 Align the framebuffer backend with the other legacy ones, register it via xen_backend_init() when '-vga xenfb' is used. It is safe because MODULE_INIT_XEN_BACKEND is called in xen_bus_realize(), long after CLI processing initialized the vga_interface_type variable. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Paul Durrant Message-Id: <20240510104908.76908-8-philmd@linaro.org> --- include/hw/xen/xen-legacy-backend.h | 3 --- hw/display/xenfb.c | 9 +++++++-- hw/xenpv/xen_machine_pv.c | 2 -- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/hw/xen/xen-legacy-backend.h b/include/hw/xen/xen-legacy-backend.h index e55a14057f..943732b8d1 100644 --- a/include/hw/xen/xen-legacy-backend.h +++ b/include/hw/xen/xen-legacy-backend.h @@ -66,9 +66,6 @@ static inline void xen_be_unmap_grant_ref(struct XenLegacyDevice *xendev, return xen_be_unmap_grant_refs(xendev, ptr, &ref, 1); } -/* backend drivers not included in all machines */ -extern const struct XenDevOps xen_framebuffer_ops; /* xenfb.c */ - /* configuration (aka xenbus setup) */ void xen_config_cleanup(void); int xen_config_dev_vfb(int vdev, const char *type); diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c index b6d370bdf6..ff442ced1a 100644 --- a/hw/display/xenfb.c +++ b/hw/display/xenfb.c @@ -29,6 +29,7 @@ #include "ui/input.h" #include "ui/console.h" +#include "sysemu/sysemu.h" #include "hw/xen/xen-legacy-backend.h" #include "hw/xen/interface/io/fbif.h" @@ -996,8 +997,12 @@ static const GraphicHwOps xenfb_ops = { .ui_info = xenfb_ui_info, }; -static void xen_vkbd_register_backend(void) +static void xen_ui_register_backend(void) { xen_be_register("vkbd", &xen_kbdmouse_ops); + + if (vga_interface_type == VGA_XENFB) { + xen_be_register("vfb", &xen_framebuffer_ops); + } } -xen_backend_init(xen_vkbd_register_backend); +xen_backend_init(xen_ui_register_backend); diff --git a/hw/xenpv/xen_machine_pv.c b/hw/xenpv/xen_machine_pv.c index b500ce0989..24395f42cb 100644 --- a/hw/xenpv/xen_machine_pv.c +++ b/hw/xenpv/xen_machine_pv.c @@ -50,8 +50,6 @@ static void xen_init_pv(MachineState *machine) break; } - xen_be_register("vfb", &xen_framebuffer_ops); - /* configure framebuffer */ if (vga_interface_type == VGA_XENFB) { xen_config_dev_vfb(0, "vnc"); From patchwork Tue Jun 4 09:56:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13684974 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 5A476C25B7E for ; Tue, 4 Jun 2024 09:59:00 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEQwF-0006eA-0Q; Tue, 04 Jun 2024 05:58:43 -0400 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 1sEQwC-0006Qq-RU for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:58:41 -0400 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sEQwB-0002L1-3A for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:58:40 -0400 Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-52b9dda4906so1978410e87.2 for ; Tue, 04 Jun 2024 02:58:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717495117; x=1718099917; 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=fenTnqVRpu5N0h4sB+9IKfbou1R637umnDD1Q49OsQo=; b=HLZOaw8atNr7louzNmdzCxjob+fdDDKJi4X5U52xVT6wRWoAm6fvcVNmoh7v/UhV2J rOEqKSS/kRgfRMMB25XmgQ2wgQlod3sZz1TK1TPmksl7Mpb2A+qZswq4VUOK1AB9MPJG h4hmteVLNKqsQkZN6GhaZO++EGZB5oxzG/Lq/TC6Zba/7+sEPDqbGxKEM+n1/MUwokLq kXvyt5HBfdLcb/i3FKhKsq/+UorZT7KtB1usmVKWv+1X9Gxiu6WTpGevTAegmx9A/eAX Zeqkk5hQbpgBXQm/0gm2DLFBiYCDfk3gY7w+twUGSvigrZ8z4w9bjOrxXaUPLuJHsruG Wqfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717495117; x=1718099917; 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=fenTnqVRpu5N0h4sB+9IKfbou1R637umnDD1Q49OsQo=; b=TfJgApEmCs904UI6AWPkS6uUZCS51QJ5bjc7qi0VrTnz/wPwRTnkYEBYJCqbkr8zSS LDOYVKqDLEAtgSwsVUSQM8klj2vuYSMVouwqzaw0C5i+0beeLcQRoVWWqVVeXvZg4uI5 r5NJrGdjDq+6wgnPHNFbXA+sZbduZalPyhttYkKyG+t5U5iacWRsbZJRWnshOZ2eCsbq BF05MaTvkZE6XOcZgpcj5b7lXT4USLIEze41ZLzTf4+9pzfhVdlz79Wv3OzEj6oLKasO z08sdlyZL6NdN1vVMlX/5V1jMJSruvfZUq3n0Cj63KGcxYkw0heyJpL3P+YbJHOzBaTl 31Pg== X-Gm-Message-State: AOJu0YxrqgbpSQwJs6Ob90URP7OyBVGcYQHpD9YPonwq2Ly7JGpG2aED Ll1NhjEy5G/RvO0aTWHnWbwH7LzVqIeEs038j81tLKz/4pn8rBrcgEjogPIT2svgtQ1MKnprq6P T X-Google-Smtp-Source: AGHT+IHUA11IW1AKvmEzUAac9DNZ0j6nmv78yeSZMEg64da3ya/uY+STP5HLyUYf8awk6HuH2Lf7Pw== X-Received: by 2002:a05:6512:3e24:b0:52b:8455:fb1f with SMTP id 2adb3069b0e04-52b895609e6mr12046025e87.10.1717495116852; Tue, 04 Jun 2024 02:58:36 -0700 (PDT) Received: from m1x-phil.lan ([176.176.159.34]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35dd062fe96sm11004277f8f.67.2024.06.04.02.58.35 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Jun 2024 02:58:36 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= , =?utf-8?q?Philippe_?= =?utf-8?q?Mathieu-Daud=C3=A9?= Subject: [PULL 27/32] hw/misc/debugexit: use runstate API instead of plain exit() Date: Tue, 4 Jun 2024 11:56:03 +0200 Message-ID: <20240604095609.12285-28-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240604095609.12285-1-philmd@linaro.org> References: <20240604095609.12285-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12f; envelope-from=philmd@linaro.org; helo=mail-lf1-x12f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: Thomas Weißschuh Directly calling exit() prevents any kind of management or handling. Instead use the corresponding runstate API. The default behavior of the runstate API is the same as exit(). Signed-off-by: Thomas Weißschuh Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240523-debugexit-v1-1-d52fcaf7bf8b@t-8ch.de> Signed-off-by: Philippe Mathieu-Daudé --- hw/misc/debugexit.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/misc/debugexit.c b/hw/misc/debugexit.c index ab6de69ce7..c5c562fd93 100644 --- a/hw/misc/debugexit.c +++ b/hw/misc/debugexit.c @@ -12,6 +12,7 @@ #include "hw/qdev-properties.h" #include "qemu/module.h" #include "qom/object.h" +#include "sysemu/runstate.h" #define TYPE_ISA_DEBUG_EXIT_DEVICE "isa-debug-exit" OBJECT_DECLARE_SIMPLE_TYPE(ISADebugExitState, ISA_DEBUG_EXIT_DEVICE) @@ -32,7 +33,8 @@ static uint64_t debug_exit_read(void *opaque, hwaddr addr, unsigned size) static void debug_exit_write(void *opaque, hwaddr addr, uint64_t val, unsigned width) { - exit((val << 1) | 1); + qemu_system_shutdown_request_with_code(SHUTDOWN_CAUSE_GUEST_SHUTDOWN, + (val << 1) | 1); } static const MemoryRegionOps debug_exit_ops = { From patchwork Tue Jun 4 09:56:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13684979 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 9B551C25B7E for ; Tue, 4 Jun 2024 09:59:37 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEQwJ-0007QF-OI; Tue, 04 Jun 2024 05:58:47 -0400 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 1sEQwI-0007Ez-Cb for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:58:46 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sEQwG-0002LO-90 for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:58:45 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-42134bb9735so29710245e9.1 for ; Tue, 04 Jun 2024 02:58:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717495122; x=1718099922; 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=2xJYxwlPHFAuhiLDRZkfUXQ6zjFldlOAPPa4Gg5JdMk=; b=Kg4SYeE+81ZHVI/OjjQdnyDC1cEVEl7ZOYYhoyx2G5ugbA1zYEHp6MvCtiH9Yp7pWH CiUCG8agC02dx+wx0C/gMa7lEPp5cSAzOeuyJwO/q5ip0MamoaUUCCkaGyYb6UcHeFbn yFFk4Uj6h8RoshSfMNZ95SJndc6Og1yWSWPMd/5btbFyWQ+ITpIkKjxy9JjzQ8LfPSMJ 8HFPuzttcJqaV7bgAyPFL1veDurCsKCkKH5KkWNRmXwvvNOkHGJk/UX/lEmc3KgMgMKo NR1rhnMaAMNEMVBrvu6eXbLKVXGk/m6vj1Kk95WKLBWkZSoXJaMfmufwjpRcJN1GkwhD D1MA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717495122; x=1718099922; 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=2xJYxwlPHFAuhiLDRZkfUXQ6zjFldlOAPPa4Gg5JdMk=; b=Wssf/MjEkXdvsWzpfe58qN/bWX62OY9yGIUVWEk98rfU4dMYC55NDSakV3lGUG0ka5 jIdIzboq94+bOkzreAAhhXl11xnk/87q48VSJgMGh1/mlGrdKt50KxQ0eojYlYJzijaT UMdhi6hnAmHRiaeWN4dQNU9Tf+GCG3yYqLH8tUdNUmF5HbxxGZ9RXlBYc9oMKOAx/NuI uGCMhFBDCqfBX95Hv0zv0oBgEF60QEdoZ79UpJykFRbkhVTtv7J/DThwOZ/b1mMRr/J9 LGUFvw0T5t+GKr7bKoaWhc+uCDC/STs4xKhSa9pxyPLKvPoaBlNGZO9eT40V9KJi+yGn 0BsQ== X-Gm-Message-State: AOJu0Yyhtg2cPNvnwdhOnvVSmiUMsMGPGoFn4XU0M87c1HD7UEyish89 xqgTJQkaA5/UOnms29YMYEx/MCZ9SE15qLNvG2VsLRZ0wgXUvM3tV+7gZ/gnuyN1QWmNqk8wdDv 1 X-Google-Smtp-Source: AGHT+IGXYO5WgcV76r2okXv1SIz5QZc9EfEaCRwCvct+pMZdg0fDNclY/39UOOdYBXmVYxeJySJV+g== X-Received: by 2002:a05:600c:4f8d:b0:41b:85bf:f3a8 with SMTP id 5b1f17b1804b1-42138622459mr60251755e9.35.1717495122078; Tue, 04 Jun 2024 02:58:42 -0700 (PDT) Received: from m1x-phil.lan ([176.176.159.34]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42133d745aasm128622335e9.38.2024.06.04.02.58.41 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Jun 2024 02:58:41 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , "Edgar E . Iglesias" , =?utf-8?q?Philippe_Mathieu-D?= =?utf-8?q?aud=C3=A9?= Subject: [PULL 28/32] hw/dma/xlnx_dpdma: Read descriptor into buffer, not into pointer-to-buffer Date: Tue, 4 Jun 2024 11:56:04 +0200 Message-ID: <20240604095609.12285-29-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240604095609.12285-1-philmd@linaro.org> References: <20240604095609.12285-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: Peter Maydell In fdf029762f501 we factored out the handling of reading and writing DMA descriptors from guest memory. Unfortunately we accidentally made the descriptor-read read the descriptor into the address of the buffer rather than into the buffer, because we didn't notice we needed to update the arguments to the dma_memory_read() call. Before the refactoring, "&desc" is the address of a local struct DPDMADescriptor variable in xlnx_dpdma_start_operation(), which is the correct target for the guest-memory-read. But after the refactoring 'desc' is the "DPDMADescriptor *desc" argument to the new function, and so it is already an address. This bug is an overrun of a stack variable, since a pointer is at most 8 bytes long and we try to read 64 bytes, as well as being incorrect behaviour. Pass 'desc' rather than '&desc' as the dma_memory_read() argument to fix this. (The same bug is not present in xlnx_dpdma_write_descriptor(), because there we are writing the descriptor from a local struct variable "DPDMADescriptor tmp_desc" and so passing &tmp_desc to dma_memory_write() is correct.) Spotted by Coverity: CID 1546649 Fixes: fdf029762f50101 ("xlnx_dpdma: fix descriptor endianness bug") Signed-off-by: Peter Maydell Reviewed-by: Edgar E. Iglesias Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240531124628.476938-1-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daudé --- hw/dma/xlnx_dpdma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/dma/xlnx_dpdma.c b/hw/dma/xlnx_dpdma.c index dde4aeca40..a685bd28bb 100644 --- a/hw/dma/xlnx_dpdma.c +++ b/hw/dma/xlnx_dpdma.c @@ -619,7 +619,7 @@ static MemTxResult xlnx_dpdma_read_descriptor(XlnxDPDMAState *s, DPDMADescriptor *desc) { MemTxResult res = dma_memory_read(&address_space_memory, desc_addr, - &desc, sizeof(DPDMADescriptor), + desc, sizeof(DPDMADescriptor), MEMTXATTRS_UNSPECIFIED); if (res) { return res; From patchwork Tue Jun 4 09:56:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13684987 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 4B0A7C25B7E for ; Tue, 4 Jun 2024 10:00:43 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEQwP-0007vL-Er; Tue, 04 Jun 2024 05:58:53 -0400 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 1sEQwO-0007oK-Cu for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:58:52 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sEQwL-0002N0-SX for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:58:51 -0400 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-35dce610207so3378663f8f.2 for ; Tue, 04 Jun 2024 02:58:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717495127; x=1718099927; 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=TGqa4LCtUPmfqT7FCKxDXiSWjLBqv6GKh2fc2iPwQg4=; b=Urb4x7Qt7N3XyuJxgXhZbii6bOtI0Sk3xMOqO5B5DlVLF4BntRwNHOW7B1XZfsnQRJ 18HlzU+aKV3giCPdW3If1j/m/DC16YoEklXrl2tYXoyXiKjYcKP9GbrO0a/WAYAvdg9E e6ZmYE2YaH6wvMSHkAek757cqajdJwTN4L+ng+/Crlf0rAWSiH14w1vXLZJAaUORNt3A q1Mlh0qsZT6N10hN1drLa+qp0lQWiUgj2kbIZQk/cLhzgWIed2xQ7m33z1s/5/7aHhx7 iQl5trgOYlfSw2uegTVSpnxzL1kq6CSuvP6stNa3E5H6X99fhstGXcpI6avsHK9fI/hx fV1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717495127; x=1718099927; 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=TGqa4LCtUPmfqT7FCKxDXiSWjLBqv6GKh2fc2iPwQg4=; b=YrIQjH9lvC+JCNnzlrOgxg/94sD867u/k78jlppmulhbbzqN8u2YMKMLsfbcXC831j UmsYvRpfk/FrJHSoOYRkkPaKZ2wDozQssqAefXleMHJZicDNWlM/MrRpCRGKuJ/ZSuWh oaJXmAavgMtWL4sAjkyvn+rSYd5/HZHFmunZBkapLjU5NRGloAVydne+YuD1G2dZ+08d Nzas5EP/3Zx+9ToT2Utkac8e5W6YgYP2z44BBWv++T38lxW/zmxRby6TPzoFytHileui LHdnwcgOVFuDyUdZTz/Ss3VwwUOQCeE2qzXOUdFh4YAu7H//TM5KBjC//mZ1Fke9nXxF R75w== X-Gm-Message-State: AOJu0Yw3MoLluuSJPFGe5oopj+sEKxw0+AOCLh1ChuY3VpFoK/kjhbj/ giechi7eG6aQzcBO21Xo3toUjWoTpotcmDm1CwIS0RcOUJmavbqRXHStYD/BDHqfAy7mCm75q6f z X-Google-Smtp-Source: AGHT+IG94P5WWPomVHoZIPdJKM7vpl6wDv2k1eL81l1TaEoE4MJF3s2yBYxpESSwDCnW58uEBYVcVQ== X-Received: by 2002:adf:e88d:0:b0:351:c960:b5a2 with SMTP id ffacd0b85a97d-35e0f254f8amr10288142f8f.6.1717495127353; Tue, 04 Jun 2024 02:58:47 -0700 (PDT) Received: from m1x-phil.lan ([176.176.159.34]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35dd062ecd3sm11240886f8f.74.2024.06.04.02.58.46 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Jun 2024 02:58:46 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Harsh Prateek Bora , "Michael S . Tsirkin" , Markus Armbruster Subject: [PULL 29/32] hw/acpi: Remove the deprecated QAPI MEM_UNPLUG_ERROR event Date: Tue, 4 Jun 2024 11:56:05 +0200 Message-ID: <20240604095609.12285-30-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240604095609.12285-1-philmd@linaro.org> References: <20240604095609.12285-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=philmd@linaro.org; helo=mail-wr1-x434.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, T_SCC_BODY_TEXT_LINE=-0.01 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 MEM_UNPLUG_ERROR event is deprecated since commit d43f1670c7 ("qapi/qdev.json: add DEVICE_UNPLUG_GUEST_ERROR QAPI event"), time to remove it. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Harsh Prateek Bora Reviewed-by: Michael S. Tsirkin Reviewed-by: Markus Armbruster Message-Id: <20240530071548.20074-2-philmd@linaro.org> --- docs/about/deprecated.rst | 5 ----- docs/about/removed-features.rst | 9 +++++++++ qapi/machine.json | 28 ---------------------------- hw/acpi/memory_hotplug.c | 8 -------- hw/ppc/spapr.c | 11 +---------- 5 files changed, 10 insertions(+), 51 deletions(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 40585ca7d5..4a61894db6 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -151,11 +151,6 @@ property types. QEMU Machine Protocol (QMP) events ---------------------------------- -``MEM_UNPLUG_ERROR`` (since 6.2) -'''''''''''''''''''''''''''''''''''''''''''''''''''''''' - -Use the more generic event ``DEVICE_UNPLUG_GUEST_ERROR`` instead. - ``vcpu`` trace events (since 8.1) ''''''''''''''''''''''''''''''''' diff --git a/docs/about/removed-features.rst b/docs/about/removed-features.rst index fba0cfb0b0..f1e70263e2 100644 --- a/docs/about/removed-features.rst +++ b/docs/about/removed-features.rst @@ -671,6 +671,15 @@ Use ``multifd-channels`` instead. Use ``multifd-compression`` instead. +QEMU Machine Protocol (QMP) events +---------------------------------- + +``MEM_UNPLUG_ERROR`` (removed in 9.1) +''''''''''''''''''''''''''''''''''''' + +MEM_UNPLUG_ERROR has been replaced by the more generic ``DEVICE_UNPLUG_GUEST_ERROR`` event. + + Human Monitor Protocol (HMP) commands ------------------------------------- diff --git a/qapi/machine.json b/qapi/machine.json index bce6e1bbc4..453feb9347 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -1607,34 +1607,6 @@ { 'event': 'MEMORY_DEVICE_SIZE_CHANGE', 'data': { '*id': 'str', 'size': 'size', 'qom-path' : 'str'} } -## -# @MEM_UNPLUG_ERROR: -# -# Emitted when memory hot unplug error occurs. -# -# @device: device name -# -# @msg: Informative message -# -# Features: -# -# @deprecated: This event is deprecated. Use -# @DEVICE_UNPLUG_GUEST_ERROR instead. -# -# Since: 2.4 -# -# Example: -# -# <- { "event": "MEM_UNPLUG_ERROR", -# "data": { "device": "dimm1", -# "msg": "acpi: device unplug for unsupported device" -# }, -# "timestamp": { "seconds": 1265044230, "microseconds": 450486 } } -## -{ 'event': 'MEM_UNPLUG_ERROR', - 'data': { 'device': 'str', 'msg': 'str' }, - 'features': ['deprecated'] } - ## # @BootConfiguration: # diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c index de6f974ebb..9b974b7274 100644 --- a/hw/acpi/memory_hotplug.c +++ b/hw/acpi/memory_hotplug.c @@ -178,14 +178,6 @@ static void acpi_memory_hotplug_write(void *opaque, hwaddr addr, uint64_t data, hotplug_handler_unplug(hotplug_ctrl, dev, &local_err); if (local_err) { trace_mhp_acpi_pc_dimm_delete_failed(mem_st->selector); - - /* - * Send both MEM_UNPLUG_ERROR and DEVICE_UNPLUG_GUEST_ERROR - * while the deprecation of MEM_UNPLUG_ERROR is - * pending. - */ - qapi_event_send_mem_unplug_error(dev->id ? : "", - error_get_pretty(local_err)); qapi_event_send_device_unplug_guest_error(dev->id, dev->canonical_path); error_free(local_err); diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 4345764bce..81a187f126 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -3786,7 +3786,6 @@ void spapr_memory_unplug_rollback(SpaprMachineState *spapr, DeviceState *dev) SpaprDrc *drc; uint32_t nr_lmbs; uint64_t size, addr_start, addr; - g_autofree char *qapi_error = NULL; int i; if (!dev) { @@ -3823,16 +3822,8 @@ void spapr_memory_unplug_rollback(SpaprMachineState *spapr, DeviceState *dev) /* * Tell QAPI that something happened and the memory - * hotunplug wasn't successful. Keep sending - * MEM_UNPLUG_ERROR even while sending - * DEVICE_UNPLUG_GUEST_ERROR until the deprecation of - * MEM_UNPLUG_ERROR is due. + * hotunplug wasn't successful. */ - qapi_error = g_strdup_printf("Memory hotunplug rejected by the guest " - "for device %s", dev->id); - - qapi_event_send_mem_unplug_error(dev->id ? : "", qapi_error); - qapi_event_send_device_unplug_guest_error(dev->id, dev->canonical_path); } From patchwork Tue Jun 4 09:56:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13684982 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 80FDBC27C50 for ; Tue, 4 Jun 2024 10:00:06 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEQwW-0008Ol-Vx; Tue, 04 Jun 2024 05:59:01 -0400 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 1sEQwV-0008E4-1A for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:58:59 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sEQwR-0002Nd-3T for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:58:57 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-42120fc8cbfso41562405e9.2 for ; Tue, 04 Jun 2024 02:58:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717495133; x=1718099933; 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=/VTJJ/3m83pWTt3riL5Bvq0vb1UCAyg2JZO38z+luX4=; b=KvpsUzmjeAIsoBkpuFu0LsS9A2O6+YycXDc7FJpCAkAkAPxb8Zl+wJywdqkQCpkSJ6 NBYEkDHCn95PeK9mi32Y7eFNWMSCc5pLPjB4qbmENOdRM5T55L4TP7PTN6L7S2Zfynvj lc4whVD+oAa1A6ifPn8esKu1gp9ktP8567XOsX3D5tbIMCu6gID0sn+jri3LI5os5dvI BvVVIW0EZCjUrZrTVahCSoS3RkkLpEw3h5IjWO5AjuQXY8/Dqc4QL9nbgCbzr8FjfB+z DaiWmPg+s1WOjbTz53M/DsnKfPlP2wHvTnbOi6DSI2wFgCnYKTyiI/wNnT36NPP7w2SN 9f4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717495133; x=1718099933; 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=/VTJJ/3m83pWTt3riL5Bvq0vb1UCAyg2JZO38z+luX4=; b=LiThmH5aI3AwIbWl54S2kZ1u6j9DBg/30UgJ8fzETfe/1L+/gUqMLY9yyAkeuyjDM0 WkK7atpiyBpCe3fkM2Ab/mThhv+4woWEm6haEqKb6G74BXCyirH5he9sAUKDiX5p/RY8 3tb2CT68jW8nwXtKjFuwX4k4lAtnfUeJvBJBaILe5ffX1w/zeowJrWm/p5G0OcjW8/vM iAsFj34nprvc1KUG+nbnBzoWsGtnkw78hA63EEMvqTpWge1xkQSkzfwl8kKqJxllWI1T XTDBfCLIyOGN5DQLO1GBrmQ9tCE6qlV8VwhXBUJm2VCnUeeATRvdzaerxzG61BOCQfzL mvzA== X-Gm-Message-State: AOJu0YwPfC13Vc/icIq+j2YuILe/wNLAUol0lbQXOLSRb+Qgvd9EQWKz ybEa7NVyCQ4VrcrbktYClYik3ff7vMCn7e+X8Tmj/kANf2aKAHXICEhnLeoNKGIpIGmwHuHpqwq 9 X-Google-Smtp-Source: AGHT+IGAgCk1ZFYpPc2Dl/YiWidc0JYy6Mxgj63pxZhDA+Wefk4eYItmYH6Av1iHM1qW4pxQocE91w== X-Received: by 2002:a05:600c:5488:b0:421:3464:dc7a with SMTP id 5b1f17b1804b1-4213464df71mr84635205e9.39.1717495133228; Tue, 04 Jun 2024 02:58:53 -0700 (PDT) Received: from m1x-phil.lan ([176.176.159.34]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4214a9ff986sm19161995e9.42.2024.06.04.02.58.52 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Jun 2024 02:58:52 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , "Michael S . Tsirkin" , Markus Armbruster Subject: [PULL 30/32] trace: Remove deprecated 'vcpu' field from QMP trace events Date: Tue, 4 Jun 2024 11:56:06 +0200 Message-ID: <20240604095609.12285-31-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240604095609.12285-1-philmd@linaro.org> References: <20240604095609.12285-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 'vcpu' fields are deprecated since commit 5485e52a33 ("qapi: make the vcpu parameters deprecated for 8.1"), time to remove them. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Michael S. Tsirkin Reviewed-by: Markus Armbruster Message-Id: <20240530071548.20074-3-philmd@linaro.org> --- docs/about/deprecated.rst | 11 ----------- docs/about/removed-features.rst | 6 ++++++ qapi/trace.json | 27 +++------------------------ trace/qmp.c | 2 -- trace/trace-hmp-cmds.c | 4 ++-- 5 files changed, 11 insertions(+), 39 deletions(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 4a61894db6..187c8a3f97 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -148,17 +148,6 @@ accepted incorrect commands will return an error. Users should make sure that all arguments passed to ``device_add`` are consistent with the documented property types. -QEMU Machine Protocol (QMP) events ----------------------------------- - -``vcpu`` trace events (since 8.1) -''''''''''''''''''''''''''''''''' - -The ability to instrument QEMU helper functions with vCPU-aware trace -points was removed in 7.0. However QMP still exposed the vcpu -parameter. This argument has now been deprecated and the remaining -remaining trace points that used it are selected just by name. - Host Architectures ------------------ diff --git a/docs/about/removed-features.rst b/docs/about/removed-features.rst index f1e70263e2..1e64c27cd8 100644 --- a/docs/about/removed-features.rst +++ b/docs/about/removed-features.rst @@ -679,6 +679,12 @@ QEMU Machine Protocol (QMP) events MEM_UNPLUG_ERROR has been replaced by the more generic ``DEVICE_UNPLUG_GUEST_ERROR`` event. +``vcpu`` trace events (removed in 9.1) +'''''''''''''''''''''''''''''''''''''' + +The ability to instrument QEMU helper functions with vCPU-aware trace +points was removed in 7.0. + Human Monitor Protocol (HMP) commands ------------------------------------- diff --git a/qapi/trace.json b/qapi/trace.json index 043d12f83e..9ebb6d9eaf 100644 --- a/qapi/trace.json +++ b/qapi/trace.json @@ -35,17 +35,10 @@ # # @state: Tracing state. # -# @vcpu: Whether this is a per-vCPU event (since 2.7). -# -# Features: -# -# @deprecated: Member @vcpu is deprecated, and always ignored. -# # Since: 2.2 ## { 'struct': 'TraceEventInfo', - 'data': {'name': 'str', 'state': 'TraceEventState', - 'vcpu': { 'type': 'bool', 'features': ['deprecated'] } } } + 'data': {'name': 'str', 'state': 'TraceEventState' } } ## # @trace-event-get-state: @@ -54,12 +47,6 @@ # # @name: Event name pattern (case-sensitive glob). # -# @vcpu: The vCPU to query (since 2.7). -# -# Features: -# -# @deprecated: Member @vcpu is deprecated, and always ignored. -# # Returns: a list of @TraceEventInfo for the matching events # # Since: 2.2 @@ -71,8 +58,7 @@ # <- { "return": [ { "name": "qemu_memalign", "state": "disabled", "vcpu": false } ] } ## { 'command': 'trace-event-get-state', - 'data': {'name': 'str', - '*vcpu': {'type': 'int', 'features': ['deprecated'] } }, + 'data': {'name': 'str' }, 'returns': ['TraceEventInfo'] } ## @@ -86,12 +72,6 @@ # # @ignore-unavailable: Do not match unavailable events with @name. # -# @vcpu: The vCPU to act upon (all by default; since 2.7). -# -# Features: -# -# @deprecated: Member @vcpu is deprecated, and always ignored. -# # Since: 2.2 # # Example: @@ -101,5 +81,4 @@ # <- { "return": {} } ## { 'command': 'trace-event-set-state', - 'data': {'name': 'str', 'enable': 'bool', '*ignore-unavailable': 'bool', - '*vcpu': {'type': 'int', 'features': ['deprecated'] } } } + 'data': {'name': 'str', 'enable': 'bool', '*ignore-unavailable': 'bool' } } diff --git a/trace/qmp.c b/trace/qmp.c index 3e3971c6a8..074a27b204 100644 --- a/trace/qmp.c +++ b/trace/qmp.c @@ -48,7 +48,6 @@ static bool check_events(bool ignore_unavailable, bool is_pattern, } TraceEventInfoList *qmp_trace_event_get_state(const char *name, - bool has_vcpu, int64_t vcpu, Error **errp) { TraceEventInfoList *events = NULL; @@ -86,7 +85,6 @@ TraceEventInfoList *qmp_trace_event_get_state(const char *name, void qmp_trace_event_set_state(const char *name, bool enable, bool has_ignore_unavailable, bool ignore_unavailable, - bool has_vcpu, int64_t vcpu, Error **errp) { TraceEventIter iter; diff --git a/trace/trace-hmp-cmds.c b/trace/trace-hmp-cmds.c index 86211fce27..d38dd600de 100644 --- a/trace/trace-hmp-cmds.c +++ b/trace/trace-hmp-cmds.c @@ -40,7 +40,7 @@ void hmp_trace_event(Monitor *mon, const QDict *qdict) Error *local_err = NULL; qmp_trace_event_set_state(tp_name, new_state, - true, true, false, 0, &local_err); + true, true, &local_err); if (local_err) { error_report_err(local_err); } @@ -82,7 +82,7 @@ void hmp_info_trace_events(Monitor *mon, const QDict *qdict) name = "*"; } - events = qmp_trace_event_get_state(name, false, 0, &local_err); + events = qmp_trace_event_get_state(name, &local_err); if (local_err) { error_report_err(local_err); return; From patchwork Tue Jun 4 09:56:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13684988 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 96738C25B78 for ; Tue, 4 Jun 2024 10:01:07 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEQwa-0000Ho-Vs; Tue, 04 Jun 2024 05:59:05 -0400 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 1sEQwY-00005r-WE for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:59:03 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sEQwW-0002Nw-LS for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:59:02 -0400 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-35e4aaa0f33so2674293f8f.0 for ; Tue, 04 Jun 2024 02:59:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717495139; x=1718099939; 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=9IPOKJ4bfj8H7u0AOUJYW14UBzQ/mD/AN0ShzwkJT0k=; b=VgZEP1IYaLhEiCZmyujtyr86zlGWl+CP/mOsP8mykez41DaUhSulyycGdr6MuAB6b8 xftFDoiUqK+gGSiy/gJ6GwwY8JNU3hXOPbzUgU5Ud6gAavqktLqu/qB1y43ihNIR/D5y vna/D9AjX24NNvjYWrMCkwCJvjV4kqHLQCCFCzAMimfKwX5BrcvgGZfMSIpvOrh/o9WG 0nMH4O/d3hxv1AW+u3B8fTJsPH38TYUPWjJ83DizooQuL2xElGadac6l5F5ui/BTYzdj k+4z7Im43hBQZv63dlcWGq5vfUD8vPWj0XMb7KxQNpmYgkyQhpjg3zO1ovaWI48j04Za HxlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717495139; x=1718099939; 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=9IPOKJ4bfj8H7u0AOUJYW14UBzQ/mD/AN0ShzwkJT0k=; b=LVVLaHKXxrTjrtFGDYS0OTbg32lZnxO0DVI9/IAJ8pQSKevKMawfJAAHr+oYEJH6oy VrbUNirKwnpf0QPVBx3yqp9c6jptEtTZjCVrKo+iSbONCeVErEHFyaMQkQpDbQ8GYfQi 2JWIRGdYS8iAW6RTa51vlnJljWqVJn8EXbdjiJYtJgbW293XNQUJHks/Tu7EzWBZsRVK eB9+RnjaFaPLuaIpexOJDnxWao7AvHS7uOZwGrMdjafo93dBs2SOlsym7n9hBkNgn/rC ln/RHpOKjCMs8Tsv9RVbkPnHb7DL4f/cCpzcelbkNGKZTOC7AiFWvJIFwDWb3NTth1fv X3aw== X-Gm-Message-State: AOJu0YxtKbiHDKaGwUt/TriDlf0XA1D18/MM/mh06NqwBKp7jzDLHG9b QIGoMEAvJCKhsqXjrU9IoWZ88e5IyySOiG1o1Ism3oOziW4Mn0kAxVwNnDKHqkhgGnz5X6MxYia E X-Google-Smtp-Source: AGHT+IEsMCMfNlTLfFoGlaytIalXtFxe3kWoNTZLNJxbNmBvUg8YBI4KAfdppRGBrANGXYplZqOpJw== X-Received: by 2002:adf:f68b:0:b0:354:e729:c101 with SMTP id ffacd0b85a97d-35e0f2551f3mr9370060f8f.12.1717495138820; Tue, 04 Jun 2024 02:58:58 -0700 (PDT) Received: from m1x-phil.lan ([176.176.159.34]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35dd04c0f7esm11074701f8f.22.2024.06.04.02.58.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Jun 2024 02:58:58 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Konstantin Kostiuk Subject: [PULL 31/32] qga: Remove deprecated 'blacklist' argument / config key Date: Tue, 4 Jun 2024 11:56:07 +0200 Message-ID: <20240604095609.12285-32-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240604095609.12285-1-philmd@linaro.org> References: <20240604095609.12285-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=philmd@linaro.org; helo=mail-wr1-x434.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, T_SCC_BODY_TEXT_LINE=-0.01 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 'blacklist' argument / config key are deprecated since commit 582a098e6c ("qga: Replace 'blacklist' command line and config file options by 'block-rpcs'"), time to remove them. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Konstantin Kostiuk Message-Id: <20240530070413.19181-1-philmd@linaro.org> --- docs/about/deprecated.rst | 18 ------------------ docs/about/removed-features.rst | 18 ++++++++++++++++++ qga/main.c | 6 ------ 3 files changed, 18 insertions(+), 24 deletions(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 187c8a3f97..a6f4655a3a 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -462,24 +462,6 @@ versions, aliases will point to newer CPU model versions depending on the machine type, so management software must resolve CPU model aliases before starting a virtual machine. -QEMU guest agent ----------------- - -``--blacklist`` command line option (since 7.2) -''''''''''''''''''''''''''''''''''''''''''''''' - -``--blacklist`` has been replaced by ``--block-rpcs`` (which is a better -wording for what this option does). The short form ``-b`` still stays -the same and thus is the preferred way for scripts that should run with -both, older and future versions of QEMU. - -``blacklist`` config file option (since 7.2) -'''''''''''''''''''''''''''''''''''''''''''' - -The ``blacklist`` config file option has been renamed to ``block-rpcs`` -(to be in sync with the renaming of the corresponding command line -option). - Migration --------- diff --git a/docs/about/removed-features.rst b/docs/about/removed-features.rst index 1e64c27cd8..210a90bee8 100644 --- a/docs/about/removed-features.rst +++ b/docs/about/removed-features.rst @@ -1144,4 +1144,22 @@ stable for some time and is now widely used. The command line and feature set is very close to the removed C implementation. +QEMU guest agent +---------------- + +``--blacklist`` command line option (removed in 9.1) +'''''''''''''''''''''''''''''''''''''''''''''''''''' + +``--blacklist`` has been replaced by ``--block-rpcs`` (which is a better +wording for what this option does). The short form ``-b`` still stays +the same and thus is the preferred way for scripts that should run with +both, older and future versions of QEMU. + +``blacklist`` config file option (removed in 9.1) +''''''''''''''''''''''''''''''''''''''''''''''''' + +The ``blacklist`` config file option has been renamed to ``block-rpcs`` +(to be in sync with the renaming of the corresponding command line +option). + .. _Intel discontinuance notification: https://www.intel.com/content/www/us/en/content-details/781327/intel-is-discontinuing-ip-ordering-codes-listed-in-pdn2312-for-nios-ii-ip.html diff --git a/qga/main.c b/qga/main.c index bdf5344584..f4d5f15bb3 100644 --- a/qga/main.c +++ b/qga/main.c @@ -1071,11 +1071,6 @@ static void config_load(GAConfig *config) g_key_file_get_boolean(keyfile, "general", "retry-path", &gerr); } - if (g_key_file_has_key(keyfile, "general", "blacklist", NULL)) { - g_warning("config using deprecated 'blacklist' key, should be replaced" - " with the 'block-rpcs' key."); - blockrpcs_key = "blacklist"; - } if (g_key_file_has_key(keyfile, "general", blockrpcs_key, NULL)) { config->bliststr = g_key_file_get_string(keyfile, "general", blockrpcs_key, &gerr); @@ -1190,7 +1185,6 @@ static void config_parse(GAConfig *config, int argc, char **argv) { "path", 1, NULL, 'p' }, { "daemonize", 0, NULL, 'd' }, { "block-rpcs", 1, NULL, 'b' }, - { "blacklist", 1, NULL, 'b' }, /* deprecated alias for 'block-rpcs' */ { "allow-rpcs", 1, NULL, 'a' }, #ifdef _WIN32 { "service", 1, NULL, 's' }, From patchwork Tue Jun 4 09:56:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 13684981 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 6E4D5C25B78 for ; Tue, 4 Jun 2024 10:00:03 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sEQwi-0000Sq-MM; Tue, 04 Jun 2024 05:59:14 -0400 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 1sEQwd-0000NX-S6 for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:59:11 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sEQwc-0002OT-6A for qemu-devel@nongnu.org; Tue, 04 Jun 2024 05:59:07 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-42134bb9735so29712195e9.1 for ; Tue, 04 Jun 2024 02:59:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717495144; x=1718099944; 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=aW7ooiPiVQKiciK9tXurprOszVnnccUrkSkxiG1Z0Yg=; b=IvnQi8a1g1K3LIsJaeJ3deUtiTfX3P5ndzfeybPQz59OObA58BZ5dx0Iv9ODxc3joq ctfxSvuASzT/Asek96eNPIf0aqk/BTqC/bLn6VOvLwdLqIFwflvaAd6KJvjfc/NMXXxl AG7aO4CzBRmV5jued/Dkd8GlGcGH0Prn2GcmNWNFfcOXrbSvyPVK2QX78Tc5wk2TFqEf 0DIPTlxIGUx0545WBJLjUqsshY2aLwQIF/UthV7QUOemBY17EtaQpaSD9YJNQteQXj1e RWXIE/X18KwSr1i4NDH9pV0RDOP/4ktw0pUwlSQSHf1+A39cSv8PMEekdXQMoAiYS9LL +9fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717495144; x=1718099944; 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=aW7ooiPiVQKiciK9tXurprOszVnnccUrkSkxiG1Z0Yg=; b=AJ46G24ZMd+1FnkLblTaIhkRhUBISi/S6HZTypvVrSO31MSItnbt+yGdMrPRn8Zfa8 inWKBWAB9NB3IMo3W3BYIRcdnP53OJncVIV2SR30m1S3OilAl7I8ILSTh5nrNnoEdUvL KL5q66ZGVD26ddDfGYFljyWt6NnMexg2oBN/s9lQ+BOKM9fuKqlh+2Gmgkk5/2noKB7S icoNcILYazO/hB+WC9qta42hVkhf+vHnt3HGm2fzckRgXZExP3hIaz3uC38FZZhZqVtV VjaQmAq9yUd5FR7whDjtKqFO0ceV+0WI9Yxo/flS/FaObtKKWTeOBIBiKtBKEsUHsvBN JhIw== X-Gm-Message-State: AOJu0YxA82F7XO3K274L4Jarls/C8aoJdtH/kk19WXcnhIOHh+R5ntNt LU6N3um4lQroRtTEY2eiqB8A6+LhTd6QoVtBc2Hq0C09vSgMhn1YKFZUEpNEbol3bJ91gIe/Gsu o X-Google-Smtp-Source: AGHT+IFzprxbOD6h9vNgM6JBcW71mfntRiNSw9wJeoB+Eqylv5maHHZ0yPaeyEGsLahXg6EcDmeWZw== X-Received: by 2002:a05:600c:511c:b0:421:2df7:beb8 with SMTP id 5b1f17b1804b1-4212e05ea16mr102835835e9.14.1717495144565; Tue, 04 Jun 2024 02:59:04 -0700 (PDT) Received: from m1x-phil.lan ([176.176.159.34]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4215310c7easm9559885e9.12.2024.06.04.02.59.03 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Jun 2024 02:59:04 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 32/32] usb: add config options for the hub and hid devices Date: Tue, 4 Jun 2024 11:56:08 +0200 Message-ID: <20240604095609.12285-33-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240604095609.12285-1-philmd@linaro.org> References: <20240604095609.12285-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: Gerd Hoffmann Signed-off-by: Gerd Hoffmann Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240530112718.1752905-3-kraxel@redhat.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/usb/Kconfig | 10 ++++++++++ hw/usb/meson.build | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/hw/usb/Kconfig b/hw/usb/Kconfig index f569ed7eea..84bc7fbe36 100644 --- a/hw/usb/Kconfig +++ b/hw/usb/Kconfig @@ -65,6 +65,16 @@ config TUSB6010 bool select USB_MUSB +config USB_HUB + bool + default y + depends on USB + +config USB_HID + bool + default y + depends on USB + config USB_TABLET_WACOM bool default y diff --git a/hw/usb/meson.build b/hw/usb/meson.build index 23f7f7acb5..d7de1003e3 100644 --- a/hw/usb/meson.build +++ b/hw/usb/meson.build @@ -35,8 +35,8 @@ system_ss.add(when: 'CONFIG_XLNX_VERSAL', if_true: files('xlnx-versal-usb2-ctrl- system_ss.add(when: 'CONFIG_XLNX_USB_SUBSYS', if_true: files('xlnx-usb-subsystem.c')) # emulated usb devices -system_ss.add(when: 'CONFIG_USB', if_true: files('dev-hub.c')) -system_ss.add(when: 'CONFIG_USB', if_true: files('dev-hid.c')) +system_ss.add(when: 'CONFIG_USB_HUB', if_true: files('dev-hub.c')) +system_ss.add(when: 'CONFIG_USB_HID', if_true: files('dev-hid.c')) system_ss.add(when: 'CONFIG_USB_TABLET_WACOM', if_true: files('dev-wacom.c')) system_ss.add(when: 'CONFIG_USB_STORAGE_CORE', if_true: files('dev-storage.c')) system_ss.add(when: 'CONFIG_USB_STORAGE_BOT', if_true: files('dev-storage-bot.c'))