From patchwork Tue Apr 9 19:35:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 787250 Delivered-To: patch@linaro.org Received: by 2002:adf:fdd2:0:b0:346:15ad:a2a with SMTP id i18csp384265wrs; Tue, 9 Apr 2024 12:39:47 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVxyrPv2x2Bbzc8TWnY108GvWaHqToqxSECUQcYPj1xgYuwHbK9bA1CofQ+3PllVy2kb4UgrZ5UYbZ61YSeZclS X-Google-Smtp-Source: AGHT+IFZ4NZpQBocX5Ivv3xU+bcCBvIJ9agmmEfe/ePnIJmdN+XSo7e/SUoVnLManUvz7nHq64Bk X-Received: by 2002:a81:6e8b:0:b0:618:b08:2ab6 with SMTP id j133-20020a816e8b000000b006180b082ab6mr736890ywc.47.1712691587408; Tue, 09 Apr 2024 12:39:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1712691587; cv=none; d=google.com; s=arc-20160816; b=MPl57r7PNo8Yyx/X+z6uK+BHxWgS+iyL6R4nZgjhkO6aUFzf1QNG9HTez1/rXQYyrs LXmgrWxJQ0rXDC2LlQGhezic9l9KHxxFdNO/hiEng7NX2crNyXQP1jke+5Em5SiIGOMt JdP+WDwH2dH9gKggV1mNF36yej+CDfx2/tsGm9ZnpzbiwqunsLxz2F1sr1jSA9v6YTzk Gh6eC0pNDXltvanqRLLSQlyx+2/kp3dbbjhZijXwZrW2E4pLb59R32fZUM+1x8YAAXzB hfVoJFHmoZYz2IF8U7dnRObEQL8zGqr4bpYbivkpwJvO6+iP94U37sZ6Q81lYqWMNhSd hqyQ== 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=qqej1cqMOghQjm8tlS0ZXIP7cn0Zxc/ocvLIj3d7Cp0=; fh=69wYhyM+2lwzu21CVQStuhnFbyS0KWUUX3s78fgxEOA=; b=zKOx99WooJCXcSDLGOEQ1CEp4TjNo/RS+E0KZB7lcx8kRUKGYE0q0WibAROX6vmgEY PEEUOcNjRIfjuEGJYe2FZzt4xSjLCwCRoK45PXZQ+xfjWUIsO/L6lW8FTWdnybd+9v1j RU8DXvV+/EiqU8L5Mz1gTWraEvdREm9+oSU9nF6yM1nT5AflH40Q+e99U5EICFv8KI9B I+qREX0rnNXa9SKmx+m5MHhJbPq+EkAdYQwz168DgzNN9BdDk9I0F8cVO5nHOZKcOZgV F1awrgg4hT1OIUAsvszvvVMT0dkprgWd403OEDltoc36vGtTy5xZTn+GBpk8y23Bu9IP mOVA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=C2LY+22D; 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 m13-20020a05622a118d00b004343f236d85si2729212qtk.702.2024.04.09.12.39.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Apr 2024 12:39:47 -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=C2LY+22D; 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 1ruHGj-0000e9-CU; Tue, 09 Apr 2024 15:36:33 -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 1ruHGh-0000dB-3h for qemu-devel@nongnu.org; Tue, 09 Apr 2024 15:36:31 -0400 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ruHGf-0004fU-IW for qemu-devel@nongnu.org; Tue, 09 Apr 2024 15:36:30 -0400 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-1e3ca4fe4cfso24518625ad.2 for ; Tue, 09 Apr 2024 12:36:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712691388; x=1713296188; 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=qqej1cqMOghQjm8tlS0ZXIP7cn0Zxc/ocvLIj3d7Cp0=; b=C2LY+22DL8Nx/SZfG6LqgC+WG8D1Icnl6pSLExAjj8WVy9uQkliL3iduFENtY09lIB 8ORDRXsdLLlZ1JaGcnuof0DP3vS/oRDIP56j4anQs2EpfwtQrY8ICANiz7KrgbD+k2f/ oqtz9TYDEm4y8Mne0YYlgo6QsgXt/wkI2vhQmiblCusAZdiePRMaCf7yBaMDHliD4sDj vOsUCp/knPNSUqy50hAai5/uQYdKcqFqnyQIptNJAtpLn1cxgc1gWCSpvf74VNkrFsIW lD4J+r7UnDEtKJy3kKVb4V8s/XlxoR13qQryN/OEe8jBQElbcrMeCYfSCAgvgBwsCvFP tFNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712691388; x=1713296188; 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=qqej1cqMOghQjm8tlS0ZXIP7cn0Zxc/ocvLIj3d7Cp0=; b=Wcm2a3luocN0FJDwtLbfd+IDeU9sfD2hv98Y8/alZm0zf3T5CBY4LimG7gzIsgsF8d hWHNwCFPG66PjyLFuVFolmyzV9MSH+CUt8kveVLakmzpbc3dciGi9XKBoXlc0gSDNVet XblQUvinuEhWguTKbZbQjCAnsSBWd+0xul10uvtlvLg/OtlHZAJogjXllR7LnGrT7tYs tpHDEPlExNrmENqz3FNqYReZirr4vdpUmROdDWuqRGjy/w6itpRKefq3vUnXm5Qc40Uz YNZUpqytE9Wp4g0KCcmVMnQaoSyAFXaL6vE2pHpfSpfLx5805sF0Fihp1MGyuK4uBrFO YfJQ== X-Gm-Message-State: AOJu0YwrsLRQRYmrHZKOjyGBv2UmLZGyKRKm6yJSwK/frnW5UlzyN+Ps 7TaDhSW+lh2iWvS1g7J5AJEQ8Iyf3clZMq2N6fjYMUKmGH9nOIx8IYUaIc+5pzpZgnCaKGOMZaD O X-Received: by 2002:a17:903:22d0:b0:1e2:aa62:2fbf with SMTP id y16-20020a17090322d000b001e2aa622fbfmr747566plg.45.1712691388290; Tue, 09 Apr 2024 12:36:28 -0700 (PDT) Received: from stoup.. (098-147-007-212.res.spectrum.com. [98.147.7.212]) by smtp.gmail.com with ESMTPSA id c17-20020a170902d49100b001e1071cf0bbsm6065843plg.302.2024.04.09.12.36.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 12:36:27 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Paolo Bonzini , =?utf-8?q?J=C3=B8rgen_Hansen?= , =?utf-8?q?Philippe_?= =?utf-8?q?Mathieu-Daud=C3=A9?= Subject: [PULL v2 15/20] target/i386: Preserve DisasContextBase.insn_start across rewind Date: Tue, 9 Apr 2024 09:35:58 -1000 Message-Id: <20240409193603.1703216-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240409193603.1703216-1-richard.henderson@linaro.org> References: <20240409193603.1703216-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x634.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 When aborting translation of the current insn, restore the previous value of insn_start. Acked-by: Paolo Bonzini Tested-by: Jørgen Hansen Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/i386/tcg/translate.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c index 07f642dc9e..76a42c679c 100644 --- a/target/i386/tcg/translate.c +++ b/target/i386/tcg/translate.c @@ -139,6 +139,7 @@ typedef struct DisasContext { TCGv_i64 tmp1_i64; sigjmp_buf jmpbuf; + TCGOp *prev_insn_start; TCGOp *prev_insn_end; } DisasContext; @@ -3123,6 +3124,7 @@ static bool disas_insn(DisasContext *s, CPUState *cpu) /* END TODO */ s->base.num_insns--; tcg_remove_ops_after(s->prev_insn_end); + s->base.insn_start = s->prev_insn_start; s->base.is_jmp = DISAS_TOO_MANY; return false; default: @@ -6995,6 +6997,7 @@ static void i386_tr_insn_start(DisasContextBase *dcbase, CPUState *cpu) DisasContext *dc = container_of(dcbase, DisasContext, base); target_ulong pc_arg = dc->base.pc_next; + dc->prev_insn_start = dc->base.insn_start; dc->prev_insn_end = tcg_last_op(); if (tb_cflags(dcbase->tb) & CF_PCREL) { pc_arg &= ~TARGET_PAGE_MASK;