From nobody Tue Feb 10 20:30:55 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1694659674; cv=none; d=zohomail.com; s=zohoarc; b=hrOy7dnVtuxhyeuNu05GROCgBSGNWM5ubeFSJpPWIGj/56ENERLs2oHozD1OuqQHiLNLLpPa8QliGkHNWIYxtNazgUTpFDW2Zvb/NkKAyROh1j6RidV2hkTVqgWWiBbg8MwgEQ6zXh4pO8yYKhSfkzPPXmxIXi8OsWAunf4irp4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1694659674; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=pJqwGMxjgTHvkSu2Q4h3DPp0J6KFTcG520NltI7mhoQ=; b=gG4gEFogaRcY0eY1XnYV7+jCVggrPQ3qmIrIRGOc+Qh9SjHEVer3LKJ+lRKRvmRXuthWKBb+q3xFHnTrJpHeZVX/2DKFnRKfsAfqDei/KTRHAB9y0iOUH3d2KzRkSTWkoCuwVh7I132aoxCck1kPV5Bx8Nsv09Q1nOcpTJpzD7g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1694659674622670.4519278484015; Wed, 13 Sep 2023 19:47:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qgcM4-0000mC-Ng; Wed, 13 Sep 2023 22:45:20 -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 1qgcLt-0000jb-3J for qemu-devel@nongnu.org; Wed, 13 Sep 2023 22:45:09 -0400 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qgcLd-0000iG-2t for qemu-devel@nongnu.org; Wed, 13 Sep 2023 22:45:08 -0400 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1c0d5b16aacso3878965ad.1 for ; Wed, 13 Sep 2023 19:44:52 -0700 (PDT) Received: from stoup.. ([71.212.131.115]) by smtp.gmail.com with ESMTPSA id x24-20020a170902b41800b001bbdf32f011sm304336plr.269.2023.09.13.19.44.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 19:44:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1694659492; x=1695264292; 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=pJqwGMxjgTHvkSu2Q4h3DPp0J6KFTcG520NltI7mhoQ=; b=qfBlrK+wJoK3eYnhgKxSwECDeM0WozKH6utVNV7uSw/doSn/yBgJlUcD4V2Q4SL6g9 SAYS2tiOMzOocqsPohv5xg7JVgFkQjHodBtYHjuKcW/kqrpTxTOglYr33fz34B27zsxw Z3HsdPq3NRhq0Uu77CFRfHMao27toUl/4UhV61OXzEoBan/I286XyMKh5hpiYOWiacC0 kuAlBmNFcxgmvd/8hAnmV6swatOKG4DyxAPuYVybqX5iw2ctugjKJqrGw3RjIpAXBTdz rb/WTXGQ5s8HNunTZk0iTNb1yFL9xHI+B3UzExuJ1KZ2lXWtS9VtQwnvY9zl8zqQDyps Be+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694659492; x=1695264292; 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=pJqwGMxjgTHvkSu2Q4h3DPp0J6KFTcG520NltI7mhoQ=; b=kMi8EuX9RpAcqzjVGDeys0Ay6N+FKa7ahcJGnm6CwmCHfcDAh7lW6q/uOR48Ewvear rzQ968zzJjWPyV6u/TBFW5h0JMlWv8VKuJHxhRfqCNqJhPvB8jW5ORUv5VGk6uRYdUa5 OzTziNIHqaeqP6ZvnuDaZmiNTsfL3D4z2RUy+SgTHO+h58bmBTloeKPI6Ikd+qc24/LJ 32A5+QxhM1+FKe1cMPGunyaTfnpupTuzYB5v5BvSthc6KVazdCwWAQWsv/vAVICaWnB3 KnX6x/RsvcebNDRqiXi67hsEyaz60L3zqz99AlUhJyfxLXEO+PI2IsowhQ0OSUeLfKm8 FWsg== X-Gm-Message-State: AOJu0YxzyEDZbhkhsqd9mBsdjUIFq/C1Y3PK7p9usQAfwDApjfm7BVw0 jh6J0TMTIu13byFu2fdd7ES2srRyQYSX7dD4e1M= X-Google-Smtp-Source: AGHT+IEpYXvsnt1qx9p5HKij8rff2QzpySfOxQj4kQNyT5Dz1MPJANnTDq686smZkFdjOtTgWi03Mw== X-Received: by 2002:a17:903:1103:b0:1c3:f745:1cec with SMTP id n3-20020a170903110300b001c3f7451cecmr2279211plh.5.1694659491965; Wed, 13 Sep 2023 19:44:51 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: anjo@rev.ng, ale@rev.ng, philmd@linaro.org Subject: [PATCH v2 16/24] tcg: Remove TCGContext.tlb_fast_offset Date: Wed, 13 Sep 2023 19:44:27 -0700 Message-Id: <20230914024435.1381329-17-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230914024435.1381329-1-richard.henderson@linaro.org> References: <20230914024435.1381329-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::636; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x636.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1694659675826100015 Content-Type: text/plain; charset="utf-8" Now that there is no padding between CPUNegativeOffsetState and CPUArchState, this value is constant across all targets. Signed-off-by: Richard Henderson Reviewed-by: Anton Johansson --- include/tcg/tcg.h | 1 - accel/tcg/translate-all.c | 2 -- tcg/tcg.c | 13 +++++++------ 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/include/tcg/tcg.h b/include/tcg/tcg.h index 3cdbeaf460..7743868dc9 100644 --- a/include/tcg/tcg.h +++ b/include/tcg/tcg.h @@ -489,7 +489,6 @@ struct TCGContext { TCGType addr_type; /* TCG_TYPE_I32 or TCG_TYPE_I64 */ =20 #ifdef CONFIG_SOFTMMU - int tlb_fast_offset; int page_mask; uint8_t page_bits; uint8_t tlb_dyn_max_bits; diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 6fac5b7e29..83e07b830f 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -344,8 +344,6 @@ TranslationBlock *tb_gen_code(CPUState *cpu, tcg_ctx->page_bits =3D TARGET_PAGE_BITS; tcg_ctx->page_mask =3D TARGET_PAGE_MASK; tcg_ctx->tlb_dyn_max_bits =3D CPU_TLB_DYN_MAX_BITS; - tcg_ctx->tlb_fast_offset =3D (int)offsetof(ArchCPU, parent_obj.neg.tlb= .f) - - (int)offsetof(ArchCPU, env); #endif tcg_ctx->insn_start_words =3D TARGET_INSN_START_WORDS; #ifdef TCG_GUEST_DEFAULT_MO diff --git a/tcg/tcg.c b/tcg/tcg.c index 164532bafb..78070ee935 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -405,7 +405,8 @@ static uintptr_t G_GNUC_UNUSED get_jmp_target_addr(TCGC= ontext *s, int which) #if defined(CONFIG_SOFTMMU) && !defined(CONFIG_TCG_INTERPRETER) static int tlb_mask_table_ofs(TCGContext *s, int which) { - return s->tlb_fast_offset + which * sizeof(CPUTLBDescFast); + return (offsetof(CPUNegativeOffsetState, tlb.f[which]) - + sizeof(CPUNegativeOffsetState)); } #endif =20 @@ -733,6 +734,11 @@ static const TCGTargetOpDef constraint_sets[] =3D { =20 #include "tcg-target.c.inc" =20 +/* Validate CPUTLBDescFast placement. */ +QEMU_BUILD_BUG_ON((int)(offsetof(CPUNegativeOffsetState, tlb.f[0]) - + sizeof(CPUNegativeOffsetState)) + < MIN_TLB_MASK_TABLE_OFS); + static void alloc_tcg_plugin_context(TCGContext *s) { #ifdef CONFIG_PLUGIN @@ -1496,11 +1502,6 @@ void tcg_func_start(TCGContext *s) tcg_debug_assert(s->addr_type =3D=3D TCG_TYPE_I32 || s->addr_type =3D=3D TCG_TYPE_I64); =20 -#if defined(CONFIG_SOFTMMU) && !defined(CONFIG_TCG_INTERPRETER) - tcg_debug_assert(s->tlb_fast_offset < 0); - tcg_debug_assert(s->tlb_fast_offset >=3D MIN_TLB_MASK_TABLE_OFS); -#endif - tcg_debug_assert(s->insn_start_words > 0); } =20 --=20 2.34.1