From patchwork Sun Sep 22 12:01:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 830140 Delivered-To: patch@linaro.org Received: by 2002:adf:ebcc:0:b0:367:895a:4699 with SMTP id v12csp1555411wrn; Sun, 22 Sep 2024 05:08:30 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXMOBRhUUNvLbzS3yjLJMXeASs+UuQCw8IJUs0gKtU9O8pt/8GTYgRJ0DvSvjhf0BTcOykPmw==@linaro.org X-Google-Smtp-Source: AGHT+IFswp74nVkvYTujnXI/E2KzxzKSLvbc+DfIunZeXHtnHQ0l3n6SEahXadLs4QKDQv1DiVCc X-Received: by 2002:a05:6214:3216:b0:6c5:b17d:527b with SMTP id 6a1803df08f44-6c7bc734866mr148982816d6.26.1727006909751; Sun, 22 Sep 2024 05:08:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727006909; cv=none; d=google.com; s=arc-20240605; b=kHTAoFxNoVuf0QI9jwlwuzh1RI91aGe8bqw7M82UI+i76Jo2IFog5U6iyC/XNCGsw0 dM4MCDku5g8JlfL7fc9Uq630DUkdZaGi+J3vIwzBbwnxSdQ/oV2vG9nNsuWssxmQ7vuU nt+FGnpx9FLrmGqEesaejHBOeSg6QFEXBX40N1jC89MQiOjjusUMrABu3PtkAFYk+DpA S2XI66fkU7L6rSnc6/Q9tgxuHLAH6ol+y6jJMsLa5lohSIF1QDc+K90C0pkSXQuSTDvJ brbmsVyypF6agmfJZZX6mB4KvUpAxt0VFFhUE+cAu43SlC212+4/PSAvjlotIx60Ae7c ZsxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=iOGLN+zm8mGiA4+i5QuWHNFagj04fy3fGZDQcrAHPyk=; fh=iYz0PJHR5iIBeesaRtpRHcR797VrB8sTIBQazqUa3oU=; b=hua4hWoxC7Z6pwm+2EWMuirVCLJHGclatVfwLi8WO09ANksiRqFaR24hqTNa0UpigO ckTcoE+fdAQeWuv8QUuAusBygzk9EFW80S3rBK22l3MWLNIiZsznL/SOqOIu6hahm1Oz 7G7M4r2ZucWFj5VROJzIUH6FfiTONuUj2XKmYM5klMdzkGqZYLcOviCAPtfDahW4ypAj 58MwmqVP7+56y7UEc52afaVcVUgcAjtAFDw7KlXcYNbCiL3cFhiQjsNfO/Y0kJKbkgL2 1kw4zm745UnVHs4+6tHHZXmkD9eQf4lS9s+CSt0aNtUNiW0knrIEP8GUNMobXAEIvumc 6NBA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=y5QqlDYm; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6c75e487b1csi85449276d6.176.2024.09.22.05.08.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 22 Sep 2024 05:08:29 -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=y5QqlDYm; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ssLHf-0001e7-F3; Sun, 22 Sep 2024 08:01:47 -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 1ssLHP-0000x7-VS for qemu-devel@nongnu.org; Sun, 22 Sep 2024 08:01:37 -0400 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ssLHM-0002P1-6K for qemu-devel@nongnu.org; Sun, 22 Sep 2024 08:01:31 -0400 Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-a8d60e23b33so440197266b.0 for ; Sun, 22 Sep 2024 05:01:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1727006487; x=1727611287; 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=iOGLN+zm8mGiA4+i5QuWHNFagj04fy3fGZDQcrAHPyk=; b=y5QqlDYmvdteTw5Dlsk/0kjpJwd/ftQzADiMsSZ0SDXZUvVfzfSNwio+Pc1GL2L6fT 6a/51g/rvsJceYXFOu4ezyqrJPrExE55Z9ygY6nJiC/snNt8MinLf86mKnSShweMb0Or T9Iq54/7K546fYXTAIQxop7ZDShLjsjQaJyUIN2fTeUCSBhR0TvSRfF2rViGBeVuOqcE mGwlsGbm+N2KgZU44RUFKyDfZ2oZocjmo18NGJnyiL0DGYtEhtdn6y8k9L109ZWd4EXh hatFGw8yoZnORdSuuLlSpoX4lWkBm79AdjEPkvUHHUBVyllp3/ovFv3f7SvdKc4CapR7 Mb3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727006487; x=1727611287; 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=iOGLN+zm8mGiA4+i5QuWHNFagj04fy3fGZDQcrAHPyk=; b=SrUWNDAb6Xte/lFC0MrKt/jdSpOZv96FFXoGo1K8QaJanABeCSIzKF2z3H39OdSQph KHp928e54gQSZCNPLO5y1rhdUo8K3L/I132FWQRRkAkM0Y0lv9TYbUwNR3M0scSInLiT SzsaZnQBWZLM06aPwwnpWm1uObVqKRVUGtu4MJPV5cRItHKQPEEzifrTrn/Hq54wooVX thf1fK8b33zGOhOjW476kAuFzJDP0Jvpw1n/zUo17WfboQwDCRDl9lzwsKpSTk3TXQfF ScaVZQm43zNSeZsita2oBksVIPGPycS6/GBd2yadOvd2Xj5KzfpwkrA19Qxrn6ihFDMq 7JpQ== X-Gm-Message-State: AOJu0YxBSUJRphiXXWRI/Ebp6W7vxVKfmUgHLr2aeAg8xeV2Tn6F5uqv pJQMNHCu3h2avjdix3HLt5ZrovUGfenzxto5S+ekLP/uqVl9WJQHhDPUC93HjcZH2oxy/2XreAx vqB0= X-Received: by 2002:a17:906:7949:b0:a8d:128a:cc49 with SMTP id a640c23a62f3a-a90d57793f4mr777587766b.52.1727006486822; Sun, 22 Sep 2024 05:01:26 -0700 (PDT) Received: from stoup.. (90-181-218-29.rco.o2.cz. [90.181.218.29]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a90612df525sm1067909966b.159.2024.09.22.05.01.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Sep 2024 05:01:26 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, Fabiano Rosas , qemu-stable@nongnu.org, Claudio Fontana , Ilya Leoshkevich Subject: [PULL 22/31] target/ppc: Fix lxvx/stxvx facility check Date: Sun, 22 Sep 2024 14:01:03 +0200 Message-ID: <20240922120112.5067-23-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240922120112.5067-1-richard.henderson@linaro.org> References: <20240922120112.5067-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::635; envelope-from=richard.henderson@linaro.org; helo=mail-ej1-x635.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 From: Fabiano Rosas The XT check for the lxvx/stxvx instructions is currently inverted. This was introduced during the move to decodetree. >From the ISA: Chapter 7. Vector-Scalar Extension Facility Load VSX Vector Indexed X-form lxvx XT,RA,RB if TX=0 & MSR.VSX=0 then VSX_Unavailable() if TX=1 & MSR.VEC=0 then Vector_Unavailable() ... Let XT be the value 32×TX + T. The code currently does the opposite: if (paired || a->rt >= 32) { REQUIRE_VSX(ctx); } else { REQUIRE_VECTOR(ctx); } This was already fixed for lxv/stxv at commit "2cc0e449d1 (target/ppc: Fix lxv/stxv MSR facility check)", but the indexed forms were missed. Cc: qemu-stable@nongnu.org Fixes: 70426b5bb7 ("target/ppc: moved stxvx and lxvx from legacy to decodtree") Signed-off-by: Fabiano Rosas Reviewed-by: Claudio Fontana Acked-by: Ilya Leoshkevich Reviewed-by: Fabiano Rosas Message-ID: <20240911141651.6914-1-farosas@suse.de> Signed-off-by: Richard Henderson --- target/ppc/translate/vsx-impl.c.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/ppc/translate/vsx-impl.c.inc b/target/ppc/translate/vsx-impl.c.inc index 40a87ddc4a..a869f30e86 100644 --- a/target/ppc/translate/vsx-impl.c.inc +++ b/target/ppc/translate/vsx-impl.c.inc @@ -2244,7 +2244,7 @@ static bool do_lstxv_PLS_D(DisasContext *ctx, arg_PLS_D *a, static bool do_lstxv_X(DisasContext *ctx, arg_X *a, bool store, bool paired) { - if (paired || a->rt >= 32) { + if (paired || a->rt < 32) { REQUIRE_VSX(ctx); } else { REQUIRE_VECTOR(ctx);