From patchwork Wed Apr 24 23:31:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 791586 Delivered-To: patch@linaro.org Received: by 2002:a5d:4884:0:b0:346:15ad:a2a with SMTP id g4csp1106333wrq; Wed, 24 Apr 2024 16:33:10 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW25zmovjKqxIoVDVJthozGXRce1rfXljvUTEFezoNZB392ruu3slEL0XyDAaYzg+Nzs5PNYyachMbgzJxz4XT9 X-Google-Smtp-Source: AGHT+IE/XBYqftvhQpVNNUaB4r7xOqSwl99RpEb9yZTfHU2cGHVcsZs1igwnKscfBTagVnTbiRhV X-Received: by 2002:a4a:98c9:0:b0:5af:292b:6982 with SMTP id b9-20020a4a98c9000000b005af292b6982mr4273395ooj.5.1714001589865; Wed, 24 Apr 2024 16:33:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1714001589; cv=none; d=google.com; s=arc-20160816; b=GdizfXp+Lkm0LYGbJZUf/wECfENrQIAMVBF7I1QVFtIY5iUfEyWwtPyOr9nmaAcyHL flVR8FjzayWw//c/4tyUKPZj/f37TdiqkwLljWXoBxdxKFur5flsHy/WPtOm8QjgxP6m UGNaPGrdUsneLNPWGo/7oWgCPQFrjavK+PVXRGrjydHeoPyfQ8Aix1ZFlrGNcZ0+Zft8 eUcQZYfPN9i1WDaONhefzCLHtwnUfG5FwAFIyq4g/s1Aw1a94sYq10ULjpsn2b5feBRt umbRf5KlM8Rd0PR0C5drTWeYZu+leOZ0ZHA7U1RGij+RnTn3H+g5UTFFYtyMgw1OTUGZ eUNg== 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:to:from :dkim-signature; bh=hN1dyhS2K76C29H8D9/k3RGranbkoht6vnkUIzOBC5w=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=0RQtPs74zJ3fMThFJTFzsoK1BU0SgL9Z1+43Hsyq726Xwb1JudqckJFJkqL0BySSjP uoXmuymR4xavV39oR2ELgPpzsEbbSa/eWMJolCjkTcL1OLnJW2N+sIP8etG5pQTciDD3 mtdx0uo0VkS5BD5ZNUNiAzc1xumgJTWy1SrSXF0CDuWW2r+65JWx0bfIul+i7lQMpsSu BigKkgQGrqO3dYh/SLxD9Gt9owfhw0uFmJ8mcdOmbdjHbYKzJ/zp5NOmEKGWfK38lZgl OPpvO3ytGzECfBPIFSto93ySJUWfAjqKRBxhv5h65PZTue0BXeDqLKIamUp/nw6aIche HP4w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=M0JNmKwk; 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 v3-20020a05622a144300b0043a1c643fc8si2754706qtx.645.2024.04.24.16.33.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Apr 2024 16:33:09 -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=M0JNmKwk; 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 1rzm5p-000601-0h; Wed, 24 Apr 2024 19:32:01 -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 1rzm5i-0005vK-IC for qemu-devel@nongnu.org; Wed, 24 Apr 2024 19:31:54 -0400 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rzm5g-0003Yf-Sf for qemu-devel@nongnu.org; Wed, 24 Apr 2024 19:31:54 -0400 Received: by mail-pj1-x102e.google.com with SMTP id 98e67ed59e1d1-2ae229e9176so408405a91.0 for ; Wed, 24 Apr 2024 16:31:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1714001511; x=1714606311; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=hN1dyhS2K76C29H8D9/k3RGranbkoht6vnkUIzOBC5w=; b=M0JNmKwkW1bif/LeGAU5aVaTGOYlTMY3FgsQbI31TKCOZ5TYsW6ArafBCP3y+IkefO IxwLEbKsX6CQzv0yvkGqY8XwMg5iAtyZhrc5rMiGnvdd0U7iuk9XF7KHeCTGNyd1yrX4 h/3wBALCsGJvoyHQjLTY4t9gr7F/q0xrINhmZXhikpFytBxfePwNI//uigTPpCxFBWuh jKQFObUl75oOVoyhnPGmiIyUeSu8HsNmPszWqzZz1q9Ib1zX5y3vehnElkLWNn5EnoTM nO0YBlA+biCC0je7iDNfb+14CEgRIfFzumNjWUKDkqnGBkJrZFnw4tTgicy8nI7Je0R2 k5jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714001511; x=1714606311; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hN1dyhS2K76C29H8D9/k3RGranbkoht6vnkUIzOBC5w=; b=wKMHRmd1R131H60DCXvuZe5AT8HbVxrAXpn1DflEm/l9Bjza9Iz6LylXnn2AtChMI8 aBACn+Oc9gqIjjY50YEfiTTChZ+jJEpz0e7nrdGiAFUFEyizUthOh39v1m6WWC8nhotS Zc1OwJywaRCT2dW3FBfks5M0Z+zVb7l31hpzwwlXVSvEijeYXYeFkw6ZLJZ60HR3OAk0 IHF9YF1fuj6elVIBokK2Xxmpy333tLH8Df9Fx6F9sUZQBFVwRPfonFF21mqDgcJMMdsp kYDg2sViBGqROkLf01z6kijxj8be+2yZOStxIV0JWlhnv1SieYvbCRZwlqr8TyS6nzpd o1eg== X-Gm-Message-State: AOJu0Yxz9YQc4aay+Ba2+Ak2Bat/R5f8nUcLpJUAjTlzhUR/NSK8SpaZ sREKARMQmPcxmCroGh6akraVXdlG3JOAKq97SJThO4nyePsEK6hA6KPrX6zArJgF1jim16U61Yp j X-Received: by 2002:a17:90b:33cf:b0:2a4:752f:b7b7 with SMTP id lk15-20020a17090b33cf00b002a4752fb7b7mr4136603pjb.26.1714001511532; Wed, 24 Apr 2024 16:31:51 -0700 (PDT) Received: from stoup.. ([156.19.246.23]) by smtp.gmail.com with ESMTPSA id z24-20020a17090abd9800b002a56b3931dfsm11737859pjr.49.2024.04.24.16.31.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 16:31:51 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 21/33] target/s390x: Fix translator_fake_ld length Date: Wed, 24 Apr 2024 16:31:19 -0700 Message-Id: <20240424233131.988727-22-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240424233131.988727-1-richard.henderson@linaro.org> References: <20240424233131.988727-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102e; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102e.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. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- 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;