From patchwork Wed Mar 19 13:45:02 2025 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: 874728 Delivered-To: patch@linaro.org Received: by 2002:a5d:6a90:0:b0:38f:210b:807b with SMTP id s16csp407259wru; Wed, 19 Mar 2025 06:47:10 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVkS6ORjX9/Km/9JGftO0c6q0K2i9yr7GZ0CkFoovu8YiwFyQVMu79gl7bDwe8I5AmrGM6yrQ==@linaro.org X-Google-Smtp-Source: AGHT+IGqHLLS2J9YTid2AWjTBwJhKflqTyGN8ekhDVo7TBJ7NJUxvZuTYeB/6oCyZdKvUShtFbtT X-Received: by 2002:ad4:5d41:0:b0:6e8:9e9c:d20f with SMTP id 6a1803df08f44-6eb2938b7d5mr47702916d6.21.1742392030138; Wed, 19 Mar 2025 06:47:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1742392030; cv=none; d=google.com; s=arc-20240605; b=gHwhUggjka7mtX/3xznntt68nyty2/uWbPqA1PyvHksH6PGK/0erENqa6wm4OU2bu4 5lNbfdM8LsJ44z/gEw1cTPDSEdeaYXjQrNlQO7MnmqC0zI3Rl7z1QAX0T7Ja1dJkhsSl krsq8nuTgF/+tzSs/SDkTI3kirHIJ6izHmgLdVS86izWfWuDkxcNch2aRw1KawVqAyH5 dSsFt2XKeSJhnWereO1Q7gw07MSMcyw1icpQq/8YiaDREdTRxQlcSniiNmdFoG32N1N9 ryjAwUbTiEVomcG9U9VcVHuwdnrfA0IB1tFb2/KLfCQjiOXzm+aXkf2dekfKFPpmKz42 4ccg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=SPrx/qQq0qEoYxnErEWIYikr7yzsC+mHkGeoZcaDE8c=; fh=oQsvFjElslmUPxsR6fJkm0Ezna1Yj9KV/ql5u2IKgnk=; b=h7dhCLi4Xbme/QwR20ij+knpgJu+h9oDaj4/0hZ4eloV2B0r/5NAPZ3QkCSCRGTn49 J6hjMNjCiq1shgA9pyvyYmXuW3GmZLP0KzaEdytRwdCDixnGsz1EE6jSoNkoslqIF3XM 5UJDCPoQeZCoBCHF13tuNvc8DWGK6xf6TtWtEq08VADBe8E1uY8+Pj7nzttuK8uIEP8q 77BFegZjWX8+MAWVNW/j3IbG9ievEy/SmV4dgCPAed40lFrZIaoopGhJsYvj/ZZy8i6M ausqIcBeu+/Ppai3WPLM6Sh0qfgnYh/MwczIEd+sQroKXFfCjkXKEnRqMdf/f4QvQ2g3 1zKQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PsPKZDPF; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6eade36968esi150273946d6.391.2025.03.19.06.47.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Mar 2025 06:47:10 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PsPKZDPF; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tutkz-0004EB-7z; Wed, 19 Mar 2025 09:46: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 1tutk0-0003N3-Pm for qemu-devel@nongnu.org; Wed, 19 Mar 2025 09:45:54 -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 1tutjy-00044L-T9 for qemu-devel@nongnu.org; Wed, 19 Mar 2025 09:45:52 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-43cf034d4abso48336815e9.3 for ; Wed, 19 Mar 2025 06:45:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1742391949; x=1742996749; 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=SPrx/qQq0qEoYxnErEWIYikr7yzsC+mHkGeoZcaDE8c=; b=PsPKZDPFcKqX9hO8xoDauVoZ4E8+IuRJSbDoiFdflhJ/FUlwYPp8iTmqkYUDP/9xGH 1LXQboeBOeNZZSUd19ZGPUp1tQ/PiXcuyz52bpiNdgvTaPi537w9jDMRCk3wwzwGNVyK cYXpfbxSP2LuqLjK36MD6ApF1abt9OFbnQlJza19MkrXL2y63bAAbW2fqLXndZWSnuex w6zdyBvPuW0ddcgjgsTl5pVYvTL+qzvkClFYNSld5qCA7gletaL9blrbIWC1cgWHXuVr k7dJq0hReAjBIMeiE8GE4EXoY5JnOhDjneBCri6Hkw5QPUPy8FSRlQ5Ghne9zl7kIYDD YVXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742391949; x=1742996749; 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=SPrx/qQq0qEoYxnErEWIYikr7yzsC+mHkGeoZcaDE8c=; b=pVySWzoKYN/APZRW0v/dl8jqtORb63+Nm/VwG9Y/ioPzYu1qcJ93ayRJFX0r/BDctE yyRvvx7n+Bs0nn/V7JnHGcuwBCZNS2uLxJi2PxfHrthvCayEGBygD2Efva1gS1LK8fyC KmA5HeZsaICu+EiarAKR+r25an8xLp8/GQSk2ZpOh3OzSsuMkvZiIdpmX3lmvsFm42to AERIFrHkPHDqj+JJQOE9N5O0Q31P+8qyUIDNBcUehwbKIRLUAahcQmOTsitLBMxo8drR ES7HUYxmElWpauENsGzjl2a0D0jiUNtFvxL5Lc44OSlKNf9MYU2X90S+36TXVR6B3ejG Pl+Q== X-Gm-Message-State: AOJu0YzD9r70jvyJAJNsHkxA6A8pUEOmEKYsb0rmVqQpjHCLIr78yG3M ILolJ78xPrS9AHxFFZfBn52w6QU/yz95wIAN2viWbzzhadV28VGrT9XUqYVJiulHgu8AEdHDXWc o X-Gm-Gg: ASbGncshxdDsihO5ZTDY9YUz3j5O3Xa6rJczdzkysDnWrBQsDEQLTfgHo4oykHl6VzZ 2su8/it1I/aaGm1msoB6zKDX9BUSYfWqUn4IUZX8OJAkWIvkukNd091U3RKta5yfc5ANgAyP6vU BwaXfiy+aT1FStbdy+ahmuI99Ma+IiIyeHHmtGPbmE/JEW1geRetRQSBlNFLdL78kErKMeoL67n XgyFUf3ESP2uSd4XdiKxH9/36R+n0Mij4lgN5yjwhU5tqSnn6oEHNJ6aNlqL/vp2XOzxrt2s/t5 WAqUUW+C4bMq9GGsvxsrY/GYf7q9jW9UvQQgSvsGFehUyHjR/gi61LQFjIkFr+dzgpnHEMiDaLK 8U/i/nqQ6UsY/T24fWXo= X-Received: by 2002:a05:600c:b8f:b0:43c:f470:7605 with SMTP id 5b1f17b1804b1-43d4379505amr29533475e9.12.1742391948777; Wed, 19 Mar 2025 06:45:48 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43d43f37665sm19623035e9.2.2025.03.19.06.45.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 19 Mar 2025 06:45:48 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Richard Henderson , Anton Johansson , Peter Maydell , Pierrick Bouvier , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= Subject: [PATCH-for-10.1 08/12] tcg: Declare arrays using TARGET_INSN_START_WORDS_MAX Date: Wed, 19 Mar 2025 14:45:02 +0100 Message-ID: <20250319134507.45045-9-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250319134507.45045-1-philmd@linaro.org> References: <20250319134507.45045-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 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Prefer the target-agnostic TARGET_INSN_START_WORDS_MAX definition over the target-specific TARGET_INSN_START_WORDS. The former is guaranty to hold the latter. Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/translate-all.c | 2 +- target/i386/helper.c | 3 ++- target/openrisc/sys_helper.c | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 5e2a89dc474..2f8cf6db144 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -206,7 +206,7 @@ static int cpu_unwind_data_from_tb(TranslationBlock *tb, uintptr_t host_pc, void cpu_restore_state_from_tb(CPUState *cpu, TranslationBlock *tb, uintptr_t host_pc) { - uint64_t data[TARGET_INSN_START_WORDS]; + uint64_t data[TARGET_INSN_START_WORDS_MAX]; int insns_left = cpu_unwind_data_from_tb(tb, host_pc, data); if (insns_left < 0) { diff --git a/target/i386/helper.c b/target/i386/helper.c index c07b1b16ea1..90e113c8b5a 100644 --- a/target/i386/helper.c +++ b/target/i386/helper.c @@ -31,6 +31,7 @@ #include "qemu/log.h" #ifdef CONFIG_TCG #include "tcg/insn-start-words.h" +#include "tcg/tcg.h" #endif void cpu_sync_avx_hflag(CPUX86State *env) @@ -524,7 +525,7 @@ void cpu_x86_inject_mce(Monitor *mon, X86CPU *cpu, int bank, static inline target_ulong get_memio_eip(CPUX86State *env) { #ifdef CONFIG_TCG - uint64_t data[TARGET_INSN_START_WORDS]; + uint64_t data[TARGET_INSN_START_WORDS_MAX]; CPUState *cs = env_cpu(env); if (!cpu_unwind_state_data(cs, cs->mem_io_pc, data)) { diff --git a/target/openrisc/sys_helper.c b/target/openrisc/sys_helper.c index 21bc137ccca..cf521461954 100644 --- a/target/openrisc/sys_helper.c +++ b/target/openrisc/sys_helper.c @@ -28,6 +28,7 @@ #include "hw/boards.h" #endif #include "tcg/insn-start-words.h" +#include "tcg/tcg.h" #define TO_SPR(group, number) (((group) << 11) + (number)) @@ -218,7 +219,7 @@ target_ulong HELPER(mfspr)(CPUOpenRISCState *env, target_ulong rd, { OpenRISCCPU *cpu = env_archcpu(env); #ifndef CONFIG_USER_ONLY - uint64_t data[TARGET_INSN_START_WORDS]; + uint64_t data[TARGET_INSN_START_WORDS_MAX]; MachineState *ms = MACHINE(qdev_get_machine()); CPUState *cs = env_cpu(env); int idx;