From patchwork Tue May 14 00:08:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 10941865 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CB4BA76 for ; Tue, 14 May 2019 00:20:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B59D02852C for ; Tue, 14 May 2019 00:20:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A37F22853E; Tue, 14 May 2019 00:20:56 +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=-5.0 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0E0E12852C for ; Tue, 14 May 2019 00:20:56 +0000 (UTC) Received: from localhost ([127.0.0.1]:36794 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQLBf-0005gA-D1 for patchwork-qemu-devel@patchwork.kernel.org; Mon, 13 May 2019 20:20:55 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55553) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQL7f-0002wt-Dx for qemu-devel@nongnu.org; Mon, 13 May 2019 20:19:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hQL0C-0007Z9-Og for qemu-devel@nongnu.org; Mon, 13 May 2019 20:14:01 -0400 Received: from esa2.hgst.iphmx.com ([68.232.143.124]:36048) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hQL01-00074y-Kb; Mon, 13 May 2019 20:08:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1557792581; x=1589328581; h=from:to:cc:subject:date:message-id: content-transfer-encoding:mime-version; bh=afuVLgZaiBnpomTLzlFQq/fFd7yFufaMgh/JKiVySpI=; b=CdSmBJgOmANC0HNAfn3BlCskRtofBVT80fzMGq0bt+8M51po7KuoKeJi rrl4Q+07fj3bseDRnWy50TBk1WFJiUklzwndVULMfJe+3OWJQF0ElbGhT 6ghPWMQjLewWHfyTVTaWruQGkxR4SnvGUGsbfp1wquPlpRZGLcvbrTrVY MW9xK+s494GCvcmC7yQqR4sYyxksDCgDd1xQllhRF80bTGquwL2TT3g4H Sp6QWtP7RyPkfYHa5ZdOV7HSzvCwinGWpkZF2yAG3bzFO8SGm1T+f6IE6 FAWH1aE0QWmp7ioLmBdBvuql1EurGWzoFXKyrfdIdJEcgdZ11X5wFNTKs Q==; X-IronPort-AV: E=Sophos;i="5.60,466,1549900800"; d="scan'208";a="207564701" Received: from mail-co1nam05lp2059.outbound.protection.outlook.com (HELO NAM05-CO1-obe.outbound.protection.outlook.com) ([104.47.48.59]) by ob1.hgst.iphmx.com with ESMTP; 14 May 2019 08:09:14 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sharedspace.onmicrosoft.com; s=selector1-wdc-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=afuVLgZaiBnpomTLzlFQq/fFd7yFufaMgh/JKiVySpI=; b=SujS0qSXVl07RlkYnUtkCKwTMOIZew6rOGsh+hyG5TzLODpi1HB1/oB+q5DjfrzZI7yGdbhchSKisR9koSo6RmfAMhuj6l4BXVl8HXoWuSt/3PvNfznWPHfZJmQwCRZxe159KiiUNzJnsdakpyQpYv7bpwI/UOEuF2imoQO/Q20= Received: from BYAPR04MB4901.namprd04.prod.outlook.com (52.135.232.206) by BYAPR04MB4151.namprd04.prod.outlook.com (20.176.250.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1878.22; Tue, 14 May 2019 00:08:34 +0000 Received: from BYAPR04MB4901.namprd04.prod.outlook.com ([fe80::9583:df9e:7ef5:44b7]) by BYAPR04MB4901.namprd04.prod.outlook.com ([fe80::9583:df9e:7ef5:44b7%4]) with mapi id 15.20.1878.022; Tue, 14 May 2019 00:08:34 +0000 From: Alistair Francis To: "qemu-devel@nongnu.org" , "qemu-arm@nongnu.org" Thread-Topic: [PATCH v1 1/1] target/arm: Fix vector operation segfault Thread-Index: AQHVCekrcCo9rwpap0a2zukCh/2qOA== Date: Tue, 14 May 2019 00:08:34 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.21.0 x-clientproxiedby: BYAPR07CA0042.namprd07.prod.outlook.com (2603:10b6:a03:60::19) To BYAPR04MB4901.namprd04.prod.outlook.com (2603:10b6:a03:4f::14) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alistair.Francis@wdc.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [199.255.44.250] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 93edf739-3ee3-485c-dc91-08d6d8004ddc x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:BYAPR04MB4151; x-ms-traffictypediagnostic: BYAPR04MB4151: wdcipoutbound: EOP-TRUE x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1013; x-forefront-prvs: 0037FD6480 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(39860400002)(366004)(346002)(376002)(396003)(136003)(189003)(199004)(256004)(54906003)(110136005)(118296001)(26005)(71190400001)(71200400001)(476003)(86362001)(486006)(186003)(44832011)(2616005)(66946007)(73956011)(66476007)(66446008)(64756008)(66556008)(2501003)(36756003)(478600001)(72206003)(6512007)(14454004)(6486002)(316002)(6436002)(305945005)(7736002)(68736007)(25786009)(5660300002)(53936002)(4326008)(8936002)(50226002)(8676002)(81156014)(81166006)(102836004)(99286004)(66066001)(6116002)(3846002)(386003)(2906002)(6506007)(52116002); DIR:OUT; SFP:1102; SCL:1; SRVR:BYAPR04MB4151; H:BYAPR04MB4901.namprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: tqAiPZjC6dO8OiITXnrp64Y9SCi1+aJBCOMnxq7n19CXhhW4ej2ZRAJhBLPm98sAqncMSuwUoczDg4AutPWpz1h8cjNwBqN2uoFJribhgbq2fsOZ3OopzGTx5iucqZjJOk1czYk7djHr8PJQXxkhaAvW+PLajEJNFPjP20Sad/bghMVoXnrgN4gYhW+n4sc0+QDR/yJAXizoRXpiSDQU7NQb1s6gfO6jR70J0Au4AnPTTW70cOADG/++k8gmZZ/ayFPzQvrNorVSFPWcqxRHfTNlfZhnSZnkSshqTuoeP21NYYwT7Y8Q4dEZKCTDMWxDM4BVqAm25bY8qtfT+VMypGr2JpY1hyOdnESgb3ezTN8h1xVyIp2gwin8bM1cMDJZGZ1nN1rncIypGobtGNcn+yTjHrUiWgtpR+OLljfhW7k= MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 93edf739-3ee3-485c-dc91-08d6d8004ddc X-MS-Exchange-CrossTenant-originalarrivaltime: 14 May 2019 00:08:34.0781 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b61c8803-16f3-4c35-9b17-6f65f441df86 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR04MB4151 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 68.232.143.124 Subject: [Qemu-devel] [PATCH v1 1/1] target/arm: Fix vector operation segfault 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: , Cc: "peter.maydell@linaro.org" , Alistair Francis , "richard.henderson@linaro.org" , "alistair23@gmail.com" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Commit 89e68b575 "target/arm: Use vector operations for saturation" causes this abort() when booting QEMU ARM with a Cortex-A15: 0 0x00007ffff4c2382f in raise () at /usr/lib/libc.so.6 1 0x00007ffff4c0e672 in abort () at /usr/lib/libc.so.6 2 0x00005555559c1839 in disas_neon_data_insn (insn=, s=) at ./target/arm/translate.c:6673 3 0x00005555559c1839 in disas_neon_data_insn (s=, insn=) at ./target/arm/translate.c:6386 4 0x00005555559cd8a4 in disas_arm_insn (insn=4081107068, s=0x7fffe59a9510) at ./target/arm/translate.c:9289 5 0x00005555559cd8a4 in arm_tr_translate_insn (dcbase=0x7fffe59a9510, cpu=) at ./target/arm/translate.c:13612 6 0x00005555558d1d39 in translator_loop (ops=0x5555561cc580 , db=0x7fffe59a9510, cpu=0x55555686a2f0, tb=, max_insns=) at ./accel/tcg/translator.c:96 7 0x00005555559d10d4 in gen_intermediate_code (cpu=cpu@entry=0x55555686a2f0, tb=tb@entry=0x7fffd7840080 , max_insns=max_insns@entry=512) at ./target/arm/translate.c:13901 8 0x00005555558d06b9 in tb_gen_code (cpu=cpu@entry=0x55555686a2f0, pc=3067096216, cs_base=0, flags=192, cflags=-16252928, cflags@entry=524288) at ./accel/tcg/translate-all.c:1736 9 0x00005555558ce467 in tb_find (cf_mask=524288, tb_exit=1, last_tb=0x7fffd783e640 , cpu=0x1) at ./accel/tcg/cpu-exec.c:407 10 0x00005555558ce467 in cpu_exec (cpu=cpu@entry=0x55555686a2f0) at ./accel/tcg/cpu-exec.c:728 11 0x000055555588b0cf in tcg_cpu_exec (cpu=0x55555686a2f0) at ./cpus.c:1431 12 0x000055555588d223 in qemu_tcg_cpu_thread_fn (arg=0x55555686a2f0) at ./cpus.c:1735 13 0x000055555588d223 in qemu_tcg_cpu_thread_fn (arg=arg@entry=0x55555686a2f0) at ./cpus.c:1709 14 0x0000555555d2629a in qemu_thread_start (args=) at ./util/qemu-thread-posix.c:502 15 0x00007ffff4db8a92 in start_thread () at /usr/lib/libpthread. This patch ensures that we don't hit the abort() in the second switch case in disas_neon_data_insn(). We hit the second switch case as NEON_3R_VQADD and NEON_3R_VQSUB don't return from the function in the first switch case. Signed-off-by: Alistair Francis --- target/arm/translate.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/arm/translate.c b/target/arm/translate.c index 10bc53f91c..cbb32757e9 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -6749,6 +6749,9 @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn) tmp2 = neon_load_reg(rm, pass); } switch (op) { + case NEON_3R_VQADD: + case NEON_3R_VQSUB: + break; case NEON_3R_VHADD: GEN_NEON_INTEGER_OP(hadd); break;