From patchwork Thu Mar 20 22:29:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierrick Bouvier X-Patchwork-Id: 874990 Delivered-To: patch@linaro.org Received: by 2002:a5d:5f4c:0:b0:38f:210b:807b with SMTP id cm12csp574518wrb; Thu, 20 Mar 2025 15:34:57 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWiHcZFrr8p3Y+F6gYtrquikFjjzXPxy3eWCpntjTXll/nyNpPOX+PLis3KLSjBE+lfmo3XBA==@linaro.org X-Google-Smtp-Source: AGHT+IEA6WihfN40A9+Dt0M+e2zbxMCtPd7N/rVoom+jeGPClO2vpzKM+qDu4uVht/ePggYFndHt X-Received: by 2002:a05:620a:240b:b0:7c5:57c7:9994 with SMTP id af79cd13be357-7c5ba1a67edmr139974885a.32.1742510096966; Thu, 20 Mar 2025 15:34:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1742510096; cv=none; d=google.com; s=arc-20240605; b=LoJXSAL9NgXUaiWzQIZZOTfFqFVVP76XZ2pJWa6mCF7ZGrNHE83N8ukR0wS8wXWvR8 nnF9aLzn0UuA6vQgcqQnbujtQuVy3XXjVwz5lQkQE3mND5T2MlDb8LOr8d3GZD3IrvtO wgLjqTPukq5IFjK0/TTEdcTCn+PmdyV52tun6P8wF0Rid1oodtG9u3/sjb1RmU8uWT2D wlf3GzfU8hPwWMB+GSBuMYO6Jj/QdtKNgJhQEu7/JU0vCLvLaHr90epLcUlCAu/OURAf ifpxb3wdsBL57rzZntRXF/oXKQtuKwHeXa4y8CwUSQ3vmLVpNgP0edwwrsxrDd71H7gY /rlA== 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=H6JY17RXIOhpi9WGu5PHvZc/K1MBVjPo3G9pvjwYgCU=; fh=nOkKbActdBXNisDSrdwXLE2FHRvxbNZxRZo5bVBICcQ=; b=P+lxypLc3MO8o3qWaG3uOkFIhz73nb/J7KHL3gMIZdt1XtN6NMZ8uTxiWOPb3Tnts+ c549WENhbneIFiZtyA241d/tvcZUcZq+aLIaVyxMMRu2WxHTmU64muai401wstFTgrZ7 1MO1SQ+j9jpc6Cq+YysxGHFhNHVwFjduFllE9KhO6pgq6eHvnBZ7Ca/r5CYzQdqJXKXj lEw0rarSgS3FhCnbD3Wrc+1OxiVXwnUUzepAhvlmfsCzpbNmASKgpTU16PgA2JgSmnBS TljuooTjFlwCSjGQ0qq1yCW57pHBtndEW4CqOcTZKe4MGHcGQCSbVsZdqlawqBWqL7cs Mn3w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KmGeHOyW; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7c5b9348251si77254985a.207.2025.03.20.15.34.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 20 Mar 2025 15:34:56 -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=KmGeHOyW; 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 1tvOQe-0003Y5-VG; Thu, 20 Mar 2025 18:31:57 -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 1tvOPc-0002Ue-4g for qemu-devel@nongnu.org; Thu, 20 Mar 2025 18:30:55 -0400 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tvOPN-0007BW-OX for qemu-devel@nongnu.org; Thu, 20 Mar 2025 18:30:51 -0400 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-226185948ffso26876815ad.0 for ; Thu, 20 Mar 2025 15:30:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1742509833; x=1743114633; 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=H6JY17RXIOhpi9WGu5PHvZc/K1MBVjPo3G9pvjwYgCU=; b=KmGeHOyW8pisf0coyMZI7MBjdk/RNVxjFZrSL0WTDS+8/oqeNrMMqQZWks34sCPnFv pzye6slDUU+r4J8dDr87SgyItYV+ETV2hkDLWb9GjqPhdiVIyqx3Cm5OZr9zFj2n/1/W +xQVhFoj4rX7UH/oLHl0eltuezRqnjuhBbk586w2uHP0XH6oDH+j93iACDNKtKRAc3Mb atlrzUf+UaZCjjy+pOkm/aF0FblwRNGqLfIGEIZlhbhqfBFieBCkwnSGJCX2ecknrEpV pTmw5MhdtLTR8tuy3ur/odJYECB+jCBEek2yjFNr0WAOTVEY/Pt4W5hAV7rbgvzYEyck zqdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742509833; x=1743114633; 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=H6JY17RXIOhpi9WGu5PHvZc/K1MBVjPo3G9pvjwYgCU=; b=ifKGpofDSPXefaw7hDjqFo8N08T38q0FptOac4vZpg9ocwuLncvrq74vUF+mdANnnG K/jR1bMdWtiUWHow2d5DZ6UFosb+9TktVyycZCueZklVTrU7H/AknUPEluiemkOrN0VA hFndS9UC8hizrRIu20S5HqZgWOHcy8tOmDEwYu0g3Cg+Hs0vHdZZyDkavmlYunMAtHRE 2DoqD5ZObZFFfeGqCPoi+j8Bcej0TK5bkKyxfl65dViBY3Lw6KQhzm0bIuSncStBCAUj uHiYN8xP0uFj3W62DOzaVivBbHgZ5ll4oqGL7yUBPi3aquItyrZLb4oOp+6lON0Mk67F XwXw== X-Gm-Message-State: AOJu0YwUX+tRewIwKnwEG4TjN1jYYMue8wjD5TBV/E3QX7gpbmZSYLDJ AED3sVkN5hOaGIdTg37FDDnOXINWSYY9O3YM7jm6f73TPC9RT2vMIJyMVeplUweqvCWfQqI4jF0 R X-Gm-Gg: ASbGnctBWUn7wsnK0SUChrX1nJt+G8yuegT97A8dJJvya4xgRYnxtiVIK4hXlhA8iUu FX5V5NOvrzEjOztzlM8zltIAB3Mac55P4xrvqWsiDorOsQ0y/uZa1jrKZz/mw7wplhDYyhGlLE9 siCXFnTHw+lgGeQgKXk7AT9cccx2kfnlZhgWuoQ1ZDLSkWgaAQIr/GuRLRuc1IxJHAVO1C2cJgh jrop2XjJrj2hJ5Egck/KNIzfAUu1Q42FaR1GPq7iOhH5BVw3hOpvZR54PozLFMiKZ92nP7K6dWV laRU5FSsnMcc8pXONQ9OTBq0/czuDaWF20xXYqboNGPJIXoKBY0gilI= X-Received: by 2002:a17:902:f54e:b0:223:fb3a:8647 with SMTP id d9443c01a7336-22780e0a4b3mr14803805ad.41.1742509832795; Thu, 20 Mar 2025 15:30:32 -0700 (PDT) Received: from pc.. ([38.39.164.180]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-22780f4581csm3370145ad.59.2025.03.20.15.30.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Mar 2025 15:30:32 -0700 (PDT) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org, qemu-arm@nongnu.org, Peter Maydell , Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , Pierrick Bouvier Subject: [PATCH v2 21/30] target/arm/cpu: flags2 is always uint64_t Date: Thu, 20 Mar 2025 15:29:53 -0700 Message-Id: <20250320223002.2915728-22-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250320223002.2915728-1-pierrick.bouvier@linaro.org> References: <20250320223002.2915728-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pl1-x62c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Do not rely on target dependent type, but use a fixed type instead. Since the original type is unsigned, it should be safe to extend its size without any side effect. Reviewed-by: Richard Henderson Signed-off-by: Pierrick Bouvier --- target/arm/cpu.h | 10 ++++------ target/arm/tcg/hflags.c | 4 ++-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index ab7412772bc..cc975175c61 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -194,7 +194,7 @@ typedef struct ARMPACKey { /* See the commentary above the TBFLAG field definitions. */ typedef struct CPUARMTBFlags { uint32_t flags; - target_ulong flags2; + uint64_t flags2; } CPUARMTBFlags; typedef struct ARMMMUFaultInfo ARMMMUFaultInfo; @@ -2968,11 +2968,9 @@ uint64_t arm_sctlr(CPUARMState *env, int el); * We collect these two parts in CPUARMTBFlags where they are named * flags and flags2 respectively. * - * The flags that are shared between all execution modes, TBFLAG_ANY, - * are stored in flags. The flags that are specific to a given mode - * are stores in flags2. Since cs_base is sized on the configured - * address size, flags2 always has 64-bits for A64, and a minimum of - * 32-bits for A32 and M32. + * The flags that are shared between all execution modes, TBFLAG_ANY, are stored + * in flags. The flags that are specific to a given mode are stored in flags2. + * flags2 always has 64-bits, even though only 32-bits are used for A32 and M32. * * The bits for 32-bit A-profile and M-profile partially overlap: * diff --git a/target/arm/tcg/hflags.c b/target/arm/tcg/hflags.c index 8d79b8b7ae1..e51d9f7b159 100644 --- a/target/arm/tcg/hflags.c +++ b/target/arm/tcg/hflags.c @@ -506,8 +506,8 @@ void assert_hflags_rebuild_correctly(CPUARMState *env) if (unlikely(c.flags != r.flags || c.flags2 != r.flags2)) { fprintf(stderr, "TCG hflags mismatch " - "(current:(0x%08x,0x" TARGET_FMT_lx ")" - " rebuilt:(0x%08x,0x" TARGET_FMT_lx ")\n", + "(current:(0x%08x,0x%016" PRIx64 ")" + " rebuilt:(0x%08x,0x%016" PRIx64 ")\n", c.flags, c.flags2, r.flags, r.flags2); abort(); }