From patchwork Wed May 15 07:52:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 796899 Delivered-To: patch@linaro.org Received: by 2002:a5d:452e:0:b0:34e:ceec:bfcd with SMTP id j14csp2855498wra; Wed, 15 May 2024 01:00:17 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX8jtGRiShIxwsuKmzxiIlZHDw+FM6jW4veSWT6klerwcPMQfmAg4c/zUDenFDtOUK5OruqNgFh9zolabEtIdH7 X-Google-Smtp-Source: AGHT+IEiS85wF4dErsmO77PRRJdQ00Dla87X+dhk5e6nEfKeXwBVuMQbl5bpZMxgGDp8EyzYDv9q X-Received: by 2002:a05:6102:3c9e:b0:47c:18df:9f3d with SMTP id ada2fe7eead31-48077ebbe06mr17564728137.34.1715760017330; Wed, 15 May 2024 01:00:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1715760017; cv=none; d=google.com; s=arc-20160816; b=dVqULJr4PPMlR/rtOeWlJO+ReSh1ArluOIkmMszA8kaZM8kbDgF+CgAzGqSRdugeMf M/xETdWaJYegMfM5ih1E5pO1j5VHeoR6mKf/BpcF50kYP4EjtnoDVshjyJZm/zOe/PDR M4BUrq2Mmu8KExBi6j3pjS5bN2IT5AtStjkYfs0PRbjHh8hQPNjN4Sng8fve/5EPOdjh oxj14Y2IPw/ngFCedyJom1JYZXlzxK+XpTwe0b8PJdEWZml72DweupD/O1BOHyGshnmP p+n2ElfpEq4N6ZxNaEscNcSX/LAt9wonWMTxaaYmxc1dfUqHqsJ9CsBQt+VnggmotYq9 w4aA== 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=zosCwfAqzS9tNL9GWtQRdlVeW1LGv2S9SgE5WNHpqQg=; fh=kQadAhxV42GJ3cd2VUw1RyURv/zJQGvmUdF7iLEVTtc=; b=U3KAVZk/f/NIze9rqC+LlZTSFYNLdSzfs0zK+qErZrqLnBSX4eec/ryxuddgWQxJUP 6pRCO2G+5BItwt5rFfEtzGwV1KOmuB037DC88hm7baeSIebTMwtcY5anPywT9Z3ZRhIM WqoIrCCqeHdkzX9Vx2iSnBxqZF8J6NoBw3dN9MdWsmK1QSqUihXGVyoS8Si0OIbztcUb hE/lQtY3w+a9I3wRvIUmmNEVlfbECTOa5j0KGeXZx+V3z71N2Um03ZHuTUtLwJ4lTKXk +kPg5D0COCDgnsVyU2ekaiFZhLhzAEVu+TpzpfTQFgvGxNuVLbPbTMLvj4Qg7otyh63Z 7uCQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=I10h4Ewd; 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 d75a77b69052e-43df54a1b6bsi134609001cf.79.2024.05.15.01.00.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 May 2024 01:00:17 -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=I10h4Ewd; 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 1s79Rs-0004Hs-64; Wed, 15 May 2024 03:53:16 -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 1s79Ro-0004FT-1f for qemu-devel@nongnu.org; Wed, 15 May 2024 03:53:12 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s79Rh-0001bv-J3 for qemu-devel@nongnu.org; Wed, 15 May 2024 03:53:09 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-41ffad2426eso48854755e9.3 for ; Wed, 15 May 2024 00:53:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1715759583; x=1716364383; 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=zosCwfAqzS9tNL9GWtQRdlVeW1LGv2S9SgE5WNHpqQg=; b=I10h4EwdQtkrAtlww39UGGILScnSdxPxpMTK3U0WNrwwxc3Q0IDUpB13m+uwUVQGs2 ypXgsnbzrVtDEw6WrMWQUYPlkSj85z4yTd/Sh/wOtvyjUZ2dcRupxdek8B6xJLAghMjC tKnN1CMY67IT8OwrLGkgKHBOIN6VyhU5m6muMW/6+AtrMDMGgw+H7oLPPni8pGqQuM44 P5TjuCroEa510xXiZUsKcQ24Jx2lJJ5GOongi4vkYjbZmlU1+AwEiZl6NNirV5IKzpw/ JynfIKIz7mx7etl8/k1dQlgtfR1Uj5DcGGZYhQEWKZveayJa2OFO3h82Stlm4gqmWtrI lA4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715759583; x=1716364383; 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=zosCwfAqzS9tNL9GWtQRdlVeW1LGv2S9SgE5WNHpqQg=; b=UMCFfJU6Ue7hJjRDFBMTJRNyq05RhyRWqu5LbhFvJldfciXSG3oRvR7/BYuilvwtsi PnV8UHfoTMdOFoWahIm7vY+dzA3bGGRBxex6eNGS9VVr9Lr/yZIEuIvkZGIOPrv9lKzr tyi62AEfh18t8mU1x0z5YMaho5TY8Qpf2XSDZbIv6RdAdxdBYNVB++Zd9zgz2wzSdsIm 7AAumqci4ch98Dn4LKa+cdqTogex0zi+3Yxr35bxEmFMHWnxvmpZK0Ct/M7LmvDD5TWc 4NoW8Ua8x39jfKR+bOFGXujiWr5TuBvjHUhGn+f9Ov+JzojbdjymIJnvnO/59Qw/bay+ zklA== X-Gm-Message-State: AOJu0YzTStEriDYlDjqZTEF9SQiNknH4hSL5KV5KETD2xoPtdp8cmP+P 75S/IZsIrH1P936Doda6l/fdtW723Ov9y9Oskbk3gXOjV7U3dCF/FYcgOTUNOnoVQhbmJ1BOnxB XS5M= X-Received: by 2002:a05:600c:5601:b0:41a:adc3:f777 with SMTP id 5b1f17b1804b1-41feaa38ec7mr144269005e9.16.1715759583014; Wed, 15 May 2024 00:53:03 -0700 (PDT) Received: from stoup.. ([149.14.240.163]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-41fccee9292sm222611855e9.37.2024.05.15.00.53.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 00:53:02 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 21/34] target/s390x: Fix translator_fake_ld length Date: Wed, 15 May 2024 09:52:34 +0200 Message-Id: <20240515075247.68024-22-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240515075247.68024-1-richard.henderson@linaro.org> References: <20240515075247.68024-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=richard.henderson@linaro.org; helo=mail-wm1-x331.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 The ilen value extracted from ex_value is the length of the EXECUTE instruction itself, and so is the increment to the pc. However, the length of the synthetic insn is located in the opcode like all other instructions. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/s390x/tcg/translate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c index 2eb787e401..95d4d6ebc3 100644 --- a/target/s390x/tcg/translate.c +++ b/target/s390x/tcg/translate.c @@ -6200,11 +6200,11 @@ static const DisasInsn *extract_insn(CPUS390XState *env, DisasContext *s) /* Extract the values saved by EXECUTE. */ insn = s->ex_value & 0xffffffffffff0000ull; ilen = s->ex_value & 0xf; + op = insn >> 56; /* Register insn bytes with translator so plugins work. */ be_insn = cpu_to_be64(insn); - translator_fake_ld(&s->base, &be_insn, ilen); - op = insn >> 56; + translator_fake_ld(&s->base, &be_insn, get_ilen(op)); } else { insn = ld_code2(env, s, pc); op = (insn >> 8) & 0xff;