From patchwork Tue Oct 3 17:30:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 728779 Delivered-To: patch@linaro.org Received: by 2002:a5d:60c8:0:b0:31d:da82:a3b4 with SMTP id x8csp2264129wrt; Tue, 3 Oct 2023 10:42:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEdsvbIdDnz3dMQqvgXRYtXp0I97QR4BCk4Pgp5sNsKiMpdrDocIPrkRsiSANli0B84E1Io X-Received: by 2002:a05:620a:1104:b0:774:1d2c:c412 with SMTP id o4-20020a05620a110400b007741d2cc412mr230913qkk.44.1696354924489; Tue, 03 Oct 2023 10:42:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696354924; cv=none; d=google.com; s=arc-20160816; b=C9PFry/WtsmO1kNdnPvZ4BNQAbM2mEL6ywDPWdGPS71mTUiqfMsKEpR8tohntn5IaB 72mseLr5cY1kIqU1j2qB4/AcevNn4lsRZ/jygC5zccKdiDTdX2xS3tJeFuC0lHmGLAW1 bu45PwagHgr2b3Hd3lnWcc58KPPDHopkmuT3/iu0y5jRrq2vwdfsdqcGSV44S/vvK6iQ 2aBJsGE7LdJ2aIpCQzx056MRhpgqzTHa3ZmcG+1jtmkf2e408D8QBtfmp5QiyQwdI791 Tlfrnfjqe0nWZsPxc7hWpFLPbJ9AdHG02Y0LgD0dq0FPW+QIi2ZeUJB3n4KLbLucdVDH UZOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=L2PyAcwWOrXzTpRLzRikulAFK0Th+MdnNR/ePY2JPh0=; fh=l3rThTWYtfg9kQ3pwkdseR7wGfUMT6wsJF5cqMswxYY=; b=fhMhjPQ19kMtvLpZG5WTTWaT56RipUwW4dZsWpUd+bwlhpjrYOiLrvmUiJ3UImDd6V f146X1FJYEvbaZ0scS8c6z8WWxoITf508OYzAVOZ7zLfidmgVv9/rHcg1JNygi6oYjoe uQIb2gCzddRZYWlotwriqa8Qness8Sm/5hoTtt6rVSl4S3gTnOuwkRlRKMi9lwWRn0t0 rxF8g4vjh4HIWFrpnHIYW+D2QGNNl/rW4aPeAfJXrYWWjGk1NrVL4ELEp6kp9bwGsVLu W0ca5Mk2roqqBCTGZoMUFkzsZjx59pR4jd7CF5n+yOeH2D6tBwYhqbaWQBRmD9V6e+t0 mxXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NgtG41sg; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y20-20020a05620a44d400b0077429eb9588si721505qkp.326.2023.10.03.10.42.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Oct 2023 10:42:04 -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=NgtG41sg; 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 Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qnjF5-0008S9-7A; Tue, 03 Oct 2023 13:31: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 1qnjEw-0008M1-TA for qemu-devel@nongnu.org; Tue, 03 Oct 2023 13:31:22 -0400 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qnjEu-0007V7-JS for qemu-devel@nongnu.org; Tue, 03 Oct 2023 13:31:22 -0400 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-69101022969so916392b3a.3 for ; Tue, 03 Oct 2023 10:31:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696354279; x=1696959079; 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=L2PyAcwWOrXzTpRLzRikulAFK0Th+MdnNR/ePY2JPh0=; b=NgtG41sgAlpcpxconLzpXFyCOX8wdhW9L17qqCE4ZfrA+xbSvOQA03mtLNgMIbfFdy ogUwX9CNPL8Cz/gxAuWMMD7oyscHCRniMy7ycD0XQAr2b2zPAR6XxoJs5Ozp7DGT2i5L SeaOZXJafMC0fftdyyKWbCVwd+tGRrnT8OtIBumEVRJtNzUaeauwvMvm68voAbXF7ECY 5QES8T4ioaNKnc+lcvzVJsmP6dT0zxMcxNkVOSKKL2SpusEHBw4vTJjEnKneUA8eYuhu igq0waQhytscgACKDhGzdrjaxKtMLMq/Eutc1okRuhj4Q+JdmjCWGUAeh8mPQZTD1FW9 qPhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696354279; x=1696959079; 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=L2PyAcwWOrXzTpRLzRikulAFK0Th+MdnNR/ePY2JPh0=; b=Zixx2u80ZoShACD4HIuywI6SepafuMdFgH6S2U0ZQQbH6zBI45GtBi5sdMTfGg2sD0 w63QPKUv8BHwQo3GXgxcPKlNKuR1N6n0hpD2TQm5Nrc/g0/P7SKogKZvHhnNIOVIxPq3 I0PKfResgLuS6c5Alife2UDtWpd6vRmy9HprMRI+iPbNm2IkWRx6cnSywlkkJ0k6/TDR vVIuq6O4YTN2KcFuFVodzyB9X/C7Qg6UZCVjzFuEJQihfLXNz8+Iyu78KETmecqdLvkh 2NEE8wPcgX70iisJcykNlSkOVZDdOZl9PRe0++QzvG5Z1TP5OPipzw/7QY7preEb2blr GzMQ== X-Gm-Message-State: AOJu0YyYCVGIYnQEmGws0L22YXE2I5cdGHIv97KThGvC77tOlR29Ndg2 Qh0/P8Iifx9ZGdaH/AReJeWU7LynZpf79bgAazw= X-Received: by 2002:a05:6a00:2e95:b0:68a:54e5:24e6 with SMTP id fd21-20020a056a002e9500b0068a54e524e6mr335164pfb.8.1696354279352; Tue, 03 Oct 2023 10:31:19 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id n7-20020aa78a47000000b00692c5b1a731sm1620195pfa.186.2023.10.03.10.31.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Oct 2023 10:31:18 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Anton Johansson Subject: [PULL 22/47] tcg: Remove TCGContext.tlb_fast_offset Date: Tue, 3 Oct 2023 10:30:27 -0700 Message-Id: <20231003173052.1601813-23-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231003173052.1601813-1-richard.henderson@linaro.org> References: <20231003173052.1601813-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::430; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x430.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 Now that there is no padding between CPUNegativeOffsetState and CPUArchState, this value is constant across all targets. Reviewed-by: Anton Johansson Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 1 - accel/tcg/translate-all.c | 2 -- tcg/tcg.c | 15 +++++++++------ 3 files changed, 9 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 */ #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 = TARGET_PAGE_BITS; tcg_ctx->page_mask = TARGET_PAGE_MASK; tcg_ctx->tlb_dyn_max_bits = CPU_TLB_DYN_MAX_BITS; - tcg_ctx->tlb_fast_offset = (int)offsetof(ArchCPU, parent_obj.neg.tlb.f) - - (int)offsetof(ArchCPU, env); #endif tcg_ctx->insn_start_words = TARGET_INSN_START_WORDS; #ifdef TCG_GUEST_DEFAULT_MO diff --git a/tcg/tcg.c b/tcg/tcg.c index ec3f93a52f..9256217b8f 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -406,7 +406,8 @@ static uintptr_t G_GNUC_UNUSED get_jmp_target_addr(TCGContext *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 @@ -734,6 +735,13 @@ static const TCGTargetOpDef constraint_sets[] = { #include "tcg-target.c.inc" +#ifndef CONFIG_TCG_INTERPRETER +/* Validate CPUTLBDescFast placement. */ +QEMU_BUILD_BUG_ON((int)(offsetof(CPUNegativeOffsetState, tlb.f[0]) - + sizeof(CPUNegativeOffsetState)) + < MIN_TLB_MASK_TABLE_OFS); +#endif + static void alloc_tcg_plugin_context(TCGContext *s) { #ifdef CONFIG_PLUGIN @@ -1497,11 +1505,6 @@ void tcg_func_start(TCGContext *s) tcg_debug_assert(s->addr_type == TCG_TYPE_I32 || s->addr_type == TCG_TYPE_I64); -#if defined(CONFIG_SOFTMMU) && !defined(CONFIG_TCG_INTERPRETER) - tcg_debug_assert(s->tlb_fast_offset < 0); - tcg_debug_assert(s->tlb_fast_offset >= MIN_TLB_MASK_TABLE_OFS); -#endif - tcg_debug_assert(s->insn_start_words > 0); }