From nobody Thu May 16 23:27:41 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1591159691; cv=none; d=zohomail.com; s=zohoarc; b=kJdauCJ75l6ME38R4HVlc07JlJzmGUwe7znl8pHjU4gJgzkGZu2w1RGKb24WKelZyROSA4c4H89OZmxRrLxRmLAeS4q0vpmEMnSuksjzgbTQ7i7bdvnzuzGHpBc0niGH5uFYxraydPx0u6d9seNdkIZVzbulldYWR8cd3DKen2A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591159691; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=s6+YMUuVhhNWxmx7LyIpHPOkYQWcY2ok8nyPrVicrec=; b=QivbAbPy6bl4YruXwutBvZ9N+2DAfyTl3AAlzxcxdtuZqA/mWLjl+WMxYcKR9CQ4AmPQyt62PZ5Q+VJFuZPH+OZLP1ytvHJI826jjhr9n297F+yNBOXkBrsTd3n2pPCMeYv6bi3DZe3RhEvbekzzdAKZEsN885TOItP2KNJeMvg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 15911596910821010.0393039035152; Tue, 2 Jun 2020 21:48:11 -0700 (PDT) Received: from localhost ([::1]:41798 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jgLJw-0000BI-It for importer@patchew.org; Wed, 03 Jun 2020 00:48:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50144) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jgLJ6-000834-Vn for qemu-devel@nongnu.org; Wed, 03 Jun 2020 00:47:17 -0400 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]:47009) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jgLJ5-0003U4-Je for qemu-devel@nongnu.org; Wed, 03 Jun 2020 00:47:16 -0400 Received: by mail-qk1-x741.google.com with SMTP id c12so895332qkk.13 for ; Tue, 02 Jun 2020 21:47:14 -0700 (PDT) Received: from localhost.localdomain ([2600:1700:3c90:1b60:a140:f7e4:76fb:39c8]) by smtp.gmail.com with ESMTPSA id p13sm990551qtk.24.2020.06.02.21.47.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2020 21:47:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version:signed-off-by :content-transfer-encoding; bh=s6+YMUuVhhNWxmx7LyIpHPOkYQWcY2ok8nyPrVicrec=; b=h2O0E7kil0cg6g4QGkiLu6WIjKKpeYgWErTJSBcX5nMOmhtR71G/BxImi3mrywf4VE aaDA/Wv9jz81b9tDWkC/kQNhn/VgVQlSZIWE2r+uSDxIIsnB4OYZLzyGGSg/LRgHBnhc /D2mXC7fbqOMDAOp0OLOoCrVpto7FKqp3Uc1ryP9MKAaEashTRQnEJcla2Kf85IcRt17 Jh6nGOTOV2RL/P3+h+WBVpwZDJ0b7AUuTUfdSoXGipPUqeU1KjO6kOfWXq0J4Jf6X66l dwKn56fhWxlobLfwJ1FZqqMPIxMqId/U0kPSXkfDVnEVDy90cmZN5ebPuZwoD2NMq4RH FBRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :signed-off-by:content-transfer-encoding; bh=s6+YMUuVhhNWxmx7LyIpHPOkYQWcY2ok8nyPrVicrec=; b=IMBnbXX9DMWxAnMdh7WlzlU8SIOrU7W68g8kxCQdBKvIN2F4pWdJcLVypf1y0IUvv0 UBipVkKLUWP7HZzE03It33YUghBtO5Kq2t2lEsaBUtDLb6PhrMxtiC4Iw2HSHhYcQteR e9kfvvhMOY2aeUZM/Swh0reZr4nDuIo2D6BGRGwNtOo85S15W0L1MmU3C27KyEqenivd Chr2WmJqG1hi8dwMe7t2nvz+hHGYFRIE5cn5/0ELT4WnBFDXQXUNHoifpXXVr7WhYLeO dKqVPn+JQGVo1Ouz+JYyi7/eOJLDIurSJvm650ytFr5mDcovPgKondj3qWIWign3MyZf uycA== X-Gm-Message-State: AOAM531534OSZQan6oXLYoo/dKGa6pU82gw5bjavmJasdZx9oLIKmPVn xdEELM3WJ4mh5gX4cgupYc2pEXx58Sg= X-Google-Smtp-Source: ABdhPJyZa07nRakHo2Ib+XDeDhiaeDBXanwcju6AGc12tdJg96khKN71Dhl7HXfQ4WPtE1zQ3pwjjA== X-Received: by 2002:a37:6196:: with SMTP id v144mr21088642qkb.337.1591159633232; Tue, 02 Jun 2020 21:47:13 -0700 (PDT) From: agrecascino123@gmail.com To: qemu-devel@nongnu.org Subject: [PATCH] tcg: Sanitize shift constants on ppc64le so that shift operations with large constants don't generate invalid instructions. Date: Wed, 3 Jun 2020 00:47:01 -0400 Message-Id: <20200603044701.10748-1-agrecascino123@gmail.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Signed-off-by: "Catherine A. Frederick" 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::741; envelope-from=agrecascino123@gmail.com; helo=mail-qk1-x741.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Catherine A. Frederick" , rth@twiddle.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: "Catherine A. Frederick" --- tcg/ppc/tcg-target.inc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tcg/ppc/tcg-target.inc.c b/tcg/ppc/tcg-target.inc.c index ee1f9227c1..a5450a5e67 100644 --- a/tcg/ppc/tcg-target.inc.c +++ b/tcg/ppc/tcg-target.inc.c @@ -790,21 +790,25 @@ static inline void tcg_out_ext32u(TCGContext *s, TCGR= eg dst, TCGReg src) =20 static inline void tcg_out_shli32(TCGContext *s, TCGReg dst, TCGReg src, i= nt c) { + c =3D ((unsigned)c > 32) ? 32 : c; tcg_out_rlw(s, RLWINM, dst, src, c, 0, 31 - c); } =20 static inline void tcg_out_shli64(TCGContext *s, TCGReg dst, TCGReg src, i= nt c) { + c =3D ((unsigned)c > 64) ? 64 : c; tcg_out_rld(s, RLDICR, dst, src, c, 63 - c); } =20 static inline void tcg_out_shri32(TCGContext *s, TCGReg dst, TCGReg src, i= nt c) { + c =3D ((unsigned)c > 32) ? 32 : c; tcg_out_rlw(s, RLWINM, dst, src, 32 - c, c, 31); } =20 static inline void tcg_out_shri64(TCGContext *s, TCGReg dst, TCGReg src, i= nt c) { + c =3D ((unsigned)c > 64) ? 64 : c; tcg_out_rld(s, RLDICL, dst, src, 64 - c, c); } =20 --=20 2.26.2