From patchwork Sun Dec 4 02:00:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yongbok Kim X-Patchwork-Id: 9459835 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0E5A360515 for ; Sun, 4 Dec 2016 02:01:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F2EFD27F81 for ; Sun, 4 Dec 2016 02:01:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E7A3F27FBB; Sun, 4 Dec 2016 02:01:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7B43F27F81 for ; Sun, 4 Dec 2016 02:01:45 +0000 (UTC) Received: from localhost ([::1]:53120 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cDM7c-0004pp-M0 for patchwork-qemu-devel@patchwork.kernel.org; Sat, 03 Dec 2016 21:01:44 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40963) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cDM76-0004oE-Mm for qemu-devel@nongnu.org; Sat, 03 Dec 2016 21:01:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cDM75-0004ip-OF for qemu-devel@nongnu.org; Sat, 03 Dec 2016 21:01:12 -0500 Received: from mailapp01.imgtec.com ([195.59.15.196]:46542) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cDM75-0004hU-IG for qemu-devel@nongnu.org; Sat, 03 Dec 2016 21:01:11 -0500 Received: from HHMAIL01.hh.imgtec.org (unknown [10.100.10.19]) by Forcepoint Email with ESMTPS id 543FE7FD0EC3F for ; Sun, 4 Dec 2016 02:01:01 +0000 (GMT) Received: from localhost.localdomain (192.168.161.53) by HHMAIL01.hh.imgtec.org (10.100.10.21) with Microsoft SMTP Server (TLS) id 14.3.294.0; Sun, 4 Dec 2016 02:01:02 +0000 From: Yongbok Kim To: Date: Sun, 4 Dec 2016 02:00:17 +0000 Message-ID: <1480816817-53245-5-git-send-email-yongbok.kim@imgtec.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1480816817-53245-1-git-send-email-yongbok.kim@imgtec.com> References: <1480816817-53245-1-git-send-email-yongbok.kim@imgtec.com> MIME-Version: 1.0 X-Originating-IP: [192.168.161.53] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 195.59.15.196 Subject: [Qemu-devel] [PULL 4/4] target-mips: fix bad shifts in {dextp|dextpdp} X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Fixed issues in the MIPSDSP64 instructions dextp and dextpdp. Shifting can go out of 32 bit range. https://bugs.launchpad.net/qemu/+bug/1631625 Reported-by: Thomas Huth Reported-by: Jia Liu Signed-off-by: Yongbok Kim Reviewed-by: Thomas Huth --- target-mips/dsp_helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target-mips/dsp_helper.c b/target-mips/dsp_helper.c index df7d220..dc70793 100644 --- a/target-mips/dsp_helper.c +++ b/target-mips/dsp_helper.c @@ -3477,7 +3477,7 @@ target_ulong helper_dextp(target_ulong ac, target_ulong size, CPUMIPSState *env) if (sub >= -1) { temp = (tempB << (64 - len)) | (tempA >> len); - temp = temp & ((0x01 << (size + 1)) - 1); + temp = temp & ((1ULL << (size + 1)) - 1); set_DSPControl_efi(0, env); } else { set_DSPControl_efi(1, env); @@ -3506,7 +3506,7 @@ target_ulong helper_dextpdp(target_ulong ac, target_ulong size, if (sub >= -1) { temp = (tempB << (64 - len)) | (tempA >> len); - temp = temp & ((0x01 << (size + 1)) - 1); + temp = temp & ((1ULL << (size + 1)) - 1); set_DSPControl_pos(sub, env); set_DSPControl_efi(0, env); } else {