From patchwork Sat Apr 6 22:32:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 786497 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:1101:b0:343:f27d:c44e with SMTP id z1csp764800wrw; Sat, 6 Apr 2024 15:34:49 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVg/5ibSS4KzQPLv9C4Bqv2fAgBC8hfadkli3YxwI/FpidDRMDFIVcypgegOo8JIt17aJhNw284HVZeeYFO54ad X-Google-Smtp-Source: AGHT+IFI234NHyZfi6DXaUWj0aVeyW4dID86qTYsLZ8ROfbOwW7tGRrcTM3RkSqL0FzcAOsQU6UM X-Received: by 2002:ad4:5188:0:b0:691:abc:ade5 with SMTP id b8-20020ad45188000000b006910abcade5mr12184470qvp.27.1712442889745; Sat, 06 Apr 2024 15:34:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1712442889; cv=none; d=google.com; s=arc-20160816; b=DS6JLxteGjTtEoz1eQsv7EdL78qM52fkB7i+izcAi+QCK7nJnZUm0eUsa53zLikq9V k1Q1nyRQ7/Su2IbdwJPagLxHWnbMHJTiM8Ai4yx/8jiXIRKbFiXsgm0rswwf5kK2D3Xi B6wznNSNt+186RMdcZ2nEo87nrK32W39Mt2pZnMuswbp8ExFRhjUvOPsr9MLI88nnss+ CAgUL+WdrYLqnoHvank9MFff6g8xmZhNWAUZXeKkS/SvU8c3SmNkvgZMXKnc+sIp0SQQ IXtz++PEWgClLFzuy56ci3l9XWXcx1dQIuTjYgnnnmCLRscB7tp9qQRdsHz+8h0i4xJ8 YZ/g== 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=QQc6e5RogWeg+/QqEB/0KfIIQRJeLZXWsX6Xz7y/RG8=; fh=/EzrXVxGMvSr5VAgu4NIsk0fqauOAeCxfxr2Kf+iwls=; b=jBh52NxEaO161pXJH7VVjFwpNWKPCady7jHKq8Qa7XhEF+D/9GJkgKzC2UQXlnNBIy 7xCdwTAEhAerxIlR2hly0XpmvBWRVsTxsqgziZHz5ffZpWay4X4UyxP4mkByjQ/1OBTN JfetLbjYfFW3HQlNtBlbqZIXrasDRIuKr1W9Seie2YjkSXZrofzCx5imr+OZqkmFsLCE K1SRNqL/lpF5aPpwIyeVbC0ijFmRXwhko2mk7TTdlJn9Q4NsMQ68T8e5oPklkM+Pbb0W bJxUEwbQ/GCv1x4mFyYfYJ0LJtTBCnR0Ry4mVwznHogAEfZ1y1pMqakh8XTee+Ojmb+3 0Haw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=okzOtzWW; 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 n6-20020a0cdc86000000b006991179d6f6si5268936qvk.46.2024.04.06.15.34.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 06 Apr 2024 15:34:49 -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=okzOtzWW; 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 1rtEas-0003N8-Gy; Sat, 06 Apr 2024 18:33:02 -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 1rtEap-0003M4-Uz for qemu-devel@nongnu.org; Sat, 06 Apr 2024 18:33:00 -0400 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rtEao-0006ft-Ct for qemu-devel@nongnu.org; Sat, 06 Apr 2024 18:32:59 -0400 Received: by mail-pj1-x1036.google.com with SMTP id 98e67ed59e1d1-2a2d0ca3c92so2115561a91.0 for ; Sat, 06 Apr 2024 15:32:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712442777; x=1713047577; 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=QQc6e5RogWeg+/QqEB/0KfIIQRJeLZXWsX6Xz7y/RG8=; b=okzOtzWWY9TyyLE+vDIzRbNyMb8tVFFm66dF6voACRkpHacdT0aELlWF9Urxn7mAZt D4Eq5qjp44bwle4NK/ddgVWssrsDv9U+Uuco+mHBVr93tOgM8PJxAFCKQfzGUeLXkA3X uY7RK6q3bJlhszJiLHTVk34YWOHaRBzLjlDjvz5LQugqLtaVjBX00uVVgS+eLdzrYQ5s 909+w2CzFMs+WZpOsLWoeTX2jkk+OPmpb7v5I+MSs0F8wPi6ttv37RTDXR82InHP1AxC 00PemL7qrLBBTmu/1RettFoEiGFF2MOGmNG6bdAq1gNUKsLfEQa8kfxQIdNOYOibBm1B WGyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712442777; x=1713047577; 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=QQc6e5RogWeg+/QqEB/0KfIIQRJeLZXWsX6Xz7y/RG8=; b=CYWF+ZVVgyoLzeZ3v9xDImLCndAgVqE5703sOpQT3NnXNH4RXtleQatf+EXE0wYJhu 5aLqk2GGsE6TSpFiGhth5tdly36P3W3eExsEWlJzv4VrMggzARMyK06njgwXoO7B75bd kKMtOwjC768DYxS/E1ryvqM1klKehd638zxoJxXBm3j+UfKCH8Qw8TJuqOZ5vacW14ue 0w3AL04jFNrkPPLlU7S/9mSx9wg/EJsPfhGYLTGF/5AYLIYk7UQAZ/fc8JlccXPmpPBg SZWE4nwyfv+oRowiG/j/hMyXK26aXyMT7EB82YOTSRDC04FmrNkUkVXFOI5pBi3m1Q7q fhXQ== X-Gm-Message-State: AOJu0YxIhyrgED4kmgiy09/VNlu2zQm6bgIXNeAM80wC3qmtnY/rJ5tN u8BBIRqrQuEY+L39zf6v8ZU8Gl/99XNRQlQ/uB8TsrRbw05c0+yQOPiru2T9ijpKt7sreLC4jFd / X-Received: by 2002:a17:90a:7c43:b0:2a2:f249:6180 with SMTP id e3-20020a17090a7c4300b002a2f2496180mr8207410pjl.18.1712442777063; Sat, 06 Apr 2024 15:32:57 -0700 (PDT) Received: from stoup.. (098-147-007-212.res.spectrum.com. [98.147.7.212]) by smtp.gmail.com with ESMTPSA id f23-20020a17090ace1700b002a20c0dcebbsm3643279pju.31.2024.04.06.15.32.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Apr 2024 15:32:56 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, Jorgen.Hansen@wdc.com, Jonathan.Cameron@huawei.com, linux-cxl@vger.kernel.org Subject: [PATCH 3/9] target/arm: Use insn_start from DisasContextBase Date: Sat, 6 Apr 2024 12:32:42 -1000 Message-Id: <20240406223248.502699-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240406223248.502699-1-richard.henderson@linaro.org> References: <20240406223248.502699-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1036; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1036.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 To keep the multiple update check, replace insn_start with insn_start_updated. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/arm/tcg/translate.h | 12 ++++++------ target/arm/tcg/translate-a64.c | 2 +- target/arm/tcg/translate.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/target/arm/tcg/translate.h b/target/arm/tcg/translate.h index 93be745cf3..dc66ff2190 100644 --- a/target/arm/tcg/translate.h +++ b/target/arm/tcg/translate.h @@ -165,10 +165,10 @@ typedef struct DisasContext { uint8_t gm_blocksize; /* True if this page is guarded. */ bool guarded_page; + /* True if the current insn_start has been updated. */ + bool insn_start_updated; /* Bottom two bits of XScale c15_cpar coprocessor access control reg */ int c15_cpar; - /* TCG op of the current insn_start. */ - TCGOp *insn_start; /* Offset from VNCR_EL2 when FEAT_NV2 redirects this reg to memory */ uint32_t nv2_redirect_offset; } DisasContext; @@ -276,10 +276,10 @@ static inline void disas_set_insn_syndrome(DisasContext *s, uint32_t syn) syn &= ARM_INSN_START_WORD2_MASK; syn >>= ARM_INSN_START_WORD2_SHIFT; - /* We check and clear insn_start_idx to catch multiple updates. */ - assert(s->insn_start != NULL); - tcg_set_insn_start_param(s->insn_start, 2, syn); - s->insn_start = NULL; + /* Check for multiple updates. */ + assert(!s->insn_start_updated); + s->insn_start_updated = true; + tcg_set_insn_start_param(s->base.insn_start, 2, syn); } static inline int curr_insn_len(DisasContext *s) diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 340265beb0..2666d52711 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -14179,7 +14179,7 @@ static void aarch64_tr_insn_start(DisasContextBase *dcbase, CPUState *cpu) pc_arg &= ~TARGET_PAGE_MASK; } tcg_gen_insn_start(pc_arg, 0, 0); - dc->insn_start = tcg_last_op(); + dc->insn_start_updated = false; } static void aarch64_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu) diff --git a/target/arm/tcg/translate.c b/target/arm/tcg/translate.c index 69585e6003..dc49a8d806 100644 --- a/target/arm/tcg/translate.c +++ b/target/arm/tcg/translate.c @@ -9273,7 +9273,7 @@ static void arm_tr_insn_start(DisasContextBase *dcbase, CPUState *cpu) condexec_bits = (dc->condexec_cond << 4) | (dc->condexec_mask >> 1); } tcg_gen_insn_start(pc_arg, condexec_bits, 0); - dc->insn_start = tcg_last_op(); + dc->insn_start_updated = false; } static bool arm_check_kernelpage(DisasContext *dc)