From nobody Mon Feb 9 19:08:57 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1654132696; cv=none; d=zohomail.com; s=zohoarc; b=VloWoSSGjM2gyyFsAxhlR48gRtqCRixlRxyLsJrSrE85wsITYVY4YMJup42slnTHSEHWCWpQhq0+a9loFcyUYdwwEFosKiSEk0n5zygUVo2754Q3XG7x89JQmIcz7XcgTkgNUf29GJm9e6Cnz9pqZ5DZ7AzipTmVY3ww9SXaA9Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1654132696; h=Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=xVOCyk/9DqTERX7d769CfgXBIdRineh6jnjYvaEW1jc=; b=oKG7evVhrhsAVfn3RIz2LFdcIdIsP/7R0C8mL5aGuIh6eXhJvBhk7aa7yyJEdYE4TXqJSkx2WywZhrMoNd488O8QMMNhOjajVI/OSoozO8yJ5Ann7AgdTlEeI4hHX+lFjjXimo8rYIcVIEGmnj6MQUwqpF4y4nL1YBQcMq5INtg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1654132696594951.4035798716604; Wed, 1 Jun 2022 18:18:16 -0700 (PDT) Received: from localhost ([::1]:39622 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nwZTb-00039t-Ey for importer@patchew.org; Wed, 01 Jun 2022 21:18:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40480) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nwZQW-0001ah-Rh for qemu-devel@nongnu.org; Wed, 01 Jun 2022 21:15:05 -0400 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]:52198) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nwZQU-0006bt-Jx for qemu-devel@nongnu.org; Wed, 01 Jun 2022 21:15:04 -0400 Received: by mail-pj1-x1030.google.com with SMTP id cx11so3572706pjb.1 for ; Wed, 01 Jun 2022 18:15:01 -0700 (PDT) Received: from stoup.. ([2602:ae:1547:e101:1eca:8ee3:9269:e00c]) by smtp.gmail.com with ESMTPSA id gf14-20020a17090ac7ce00b001e2f3607625sm4391663pjb.23.2022.06.01.18.14.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 18:15:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=xVOCyk/9DqTERX7d769CfgXBIdRineh6jnjYvaEW1jc=; b=LPy3I0FIdNvFiOwmLUS8R/7nW37Vrztc5+fNnxlRaob7K0SqOnuR251qGY3j0aBJ76 pdkYaZIFfCAMTcNMDmIbmOlKYupAUIc1uMpga6LZyyw+33FnxccktfItNj/nGMvQiBA/ i0oIfxPIT0ItrkXAbBGRTuG1j+kJ7cNSNrOdFLsMooMURnoKRJU9aPBuK+Tkv7BEw3m6 Qb/hY86V8CKiB+Ltrwg5kbY9XZn4U0Pz0V1IArCkht/gU7xtzAKKjLnl9APs0cFuGNxo 1GISiozg5oXn3EsAS9VOtc8x/VnfHqQHcA69Rdxu/ryVBylXG+XJgGw+ddGKt9isyYvh gRcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=xVOCyk/9DqTERX7d769CfgXBIdRineh6jnjYvaEW1jc=; b=y3/orKSyEiMYuNtITHi0H3uo9Qv74KDQQnUAj0308iBd/3Ne027bpk2jh7hWFTmplD 8zx6YwkLhjYjmCI0DAy7baJzaydICxiZjsZRs15ojMgwT+hXkCf9hKey0A3C8eGKThlh xGS9jnYnBy0Rm2G2EG0D5hfMypc0eMzxHbcu+OL7zsQjBKLKdIZYWw1zVcs3WZ7P6oof SoY1cKK+P4Y2DFOS3EhrG4EgUa1HwWwFtMP33iHnUfj08/Prh0EeBXQjQkh483zTL9v+ n4eJrryWolsXLb1P/UBVs+1w5Kj47S2qpTkgcfFQGG7OQq/oOoYMHm20z41ojfBZMIhJ 4zoQ== X-Gm-Message-State: AOAM5331tRLV/Y+w8cXlur+b2TfxC1w9ViDInWJdKjy2dPt+lFKTju3f 2/4Eeld2Oq7QcybiN8mx680R0gDyymeqnQ== X-Google-Smtp-Source: ABdhPJxOvOrKgFzCm0kWeWBj3W2+BuDB9YVTHgwuYyNOCgjc+G2OVm4pqtwJMPTW2Qn8BFL/Qgfzaw== X-Received: by 2002:a17:902:e5cc:b0:166:3217:943a with SMTP id u12-20020a170902e5cc00b001663217943amr2233361plf.69.1654132500612; Wed, 01 Jun 2022 18:15:00 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH] tcg/aarch64: Fix illegal insn from out-of-range shli Date: Wed, 1 Jun 2022 18:14:59 -0700 Message-Id: <20220602011459.294754-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::1030; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1030.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, T_SCC_BODY_TEXT_LINE=-0.01 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1654132698198100001 Content-Type: text/plain; charset="utf-8" The masking in tcg_out_shl was incorrect, producing an illegal instruction, rather than merely unspecified results for the out-of-range shift. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1051 Signed-off-by: Richard Henderson Tested-by: Joel Stanley --- tcg/aarch64/tcg-target.c.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcg/aarch64/tcg-target.c.inc b/tcg/aarch64/tcg-target.c.inc index 61e284bb5c..d997f7922a 100644 --- a/tcg/aarch64/tcg-target.c.inc +++ b/tcg/aarch64/tcg-target.c.inc @@ -1261,7 +1261,7 @@ static inline void tcg_out_shl(TCGContext *s, TCGType= ext, { int bits =3D ext ? 64 : 32; int max =3D bits - 1; - tcg_out_ubfm(s, ext, rd, rn, bits - (m & max), max - (m & max)); + tcg_out_ubfm(s, ext, rd, rn, (bits - m) & max, (max - m) & max); } =20 static inline void tcg_out_shr(TCGContext *s, TCGType ext, --=20 2.34.1