From patchwork Wed May 15 00:21:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 1099815 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=wdc.com header.i=@wdc.com header.b="ln2mrsRs"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=sharedspace.onmicrosoft.com header.i=@sharedspace.onmicrosoft.com header.b="RkcpJ8kj"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 453Zxq1k4Gz9sCJ for ; Wed, 15 May 2019 10:22:21 +1000 (AEST) Received: from localhost ([127.0.0.1]:56833 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQhgU-0003G6-T2 for incoming@patchwork.ozlabs.org; Tue, 14 May 2019 20:22:14 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47540) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQhg0-0003Fo-6f for qemu-devel@nongnu.org; Tue, 14 May 2019 20:21:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hQhfz-0002Na-0M for qemu-devel@nongnu.org; Tue, 14 May 2019 20:21:44 -0400 Received: from esa5.hgst.iphmx.com ([216.71.153.144]:58755) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hQhfy-0002DV-5L; Tue, 14 May 2019 20:21:42 -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=1557879702; x=1589415702; h=from:to:cc:subject:date:message-id: content-transfer-encoding:mime-version; bh=bEXl0lNBk+H7euQ14dFlwNR9T30XjwU3iU6BGCxDsGU=; b=ln2mrsRsxLtpl2z3k/0ibJvyFgkpT4+pHGTiIlkCy42vlXck9L9zikk6 N38HmdfNNwoHFlkurwh04rRNmE5ty1YPa2LoMMzh5nUflHPJ/MrjH5t8X htSwniZ1/h/Ph2eDHGE2c0wU9LgDO+uKfyPKMVLdUH6iXwoWsipnqv/vh oumtZrLAwKVayESK1KYF4WhSkTHGdu9UVavoRlvOMuMxbMOO60A2LnZVa E9pIPXn5AS++VbYQd5OMaL2M5TY+ai08S7HenpymkTThoy7pYxUNjsYEa 0WVV5ffjH1GdyckxBAEby3Ptmfp33ygZdy0L6jXu8qLSpQj/tUKSbTTvQ g==; X-IronPort-AV: E=Sophos;i="5.60,470,1549900800"; d="scan'208";a="109507454" Received: from mail-sn1nam01lp2059.outbound.protection.outlook.com (HELO NAM01-SN1-obe.outbound.protection.outlook.com) ([104.47.32.59]) by ob1.hgst.iphmx.com with ESMTP; 15 May 2019 08:21:36 +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=bEXl0lNBk+H7euQ14dFlwNR9T30XjwU3iU6BGCxDsGU=; b=RkcpJ8kjtgr78sqr4lQmJzgynmWDbrwcbZ4uT1g+88hxyi2Flm4zxSbtt7T1NpVYAz/kRdaVBs5g09MvccVbnQwfGe5n6mkwz1Wf4CZnfkDr2+tWEnWgBggTZ1uX+OYlgl/nmJz8jbNMDVoblXj0VG+f7n3+i52xjUhgEyoM+M8= Received: from BYAPR04MB4901.namprd04.prod.outlook.com (52.135.232.206) by BYAPR04MB6229.namprd04.prod.outlook.com (20.178.235.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1878.22; Wed, 15 May 2019 00:21: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.1900.010; Wed, 15 May 2019 00:21:34 +0000 From: Alistair Francis To: "qemu-devel@nongnu.org" , "qemu-arm@nongnu.org" Thread-Topic: [PATCH v2 1/1] target/arm: Fix vector operation segfault Thread-Index: AQHVCrQmh+Ko5HkmvEGc3iReziFjOw== Date: Wed, 15 May 2019 00:21:33 +0000 Message-ID: <78cf484c4d991e899d0065b2dab3a2e204ce8723.1557879499.git.alistair.francis@wdc.com> 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: BYAPR11CA0081.namprd11.prod.outlook.com (2603:10b6:a03:f4::22) 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: 75c026aa-8733-4196-bae3-08d6d8cb491b 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:BYAPR04MB6229; x-ms-traffictypediagnostic: BYAPR04MB6229: wdcipoutbound: EOP-TRUE x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:586; x-forefront-prvs: 0038DE95A2 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(346002)(136003)(396003)(366004)(376002)(39860400002)(199004)(189003)(66066001)(2616005)(110136005)(44832011)(7736002)(476003)(305945005)(6486002)(486006)(54906003)(186003)(99286004)(6512007)(2906002)(316002)(6436002)(68736007)(73956011)(66946007)(66476007)(66556008)(64756008)(66446008)(26005)(53936002)(2501003)(36756003)(71200400001)(50226002)(478600001)(4326008)(81156014)(14454004)(5660300002)(72206003)(71190400001)(81166006)(8676002)(86362001)(8936002)(25786009)(118296001)(52116002)(6116002)(3846002)(386003)(256004)(6506007)(102836004); DIR:OUT; SFP:1102; SCL:1; SRVR:BYAPR04MB6229; H:BYAPR04MB4901.namprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: U6aXCKGtFX8KmiTtgRgOkdXyFbzANUc8718N0zGyV94gEkOcAqdTR/0uBcNqrQbbIETzV0dTFnEbTb8X8UBEZXw/G9QFhb1ysFrWNCNqPI82S3WHOA0BMjyNHiKNN7ffg0KFgcdIalOBtK4HBvCqTJFIGSjx3u89BH7hQH6sIDp+dS1NhtRhHSWOt5dWRsXwQhNTWgrcLYXDSLb0uPNtfp6HMA2Ku9N6J2GY74DeE/NllmHsJzsFGeo7HfGnGrCuMGt+Z6c1GNziYvJGZ3kkxACqt+khKsxMe8AhvMx9oBnN1z8q6SLM6KI2uuscWw8NeXIy6kOSFvIG3VDj68DRWZuBLGsshz6MIj0+4nh9YvoWNS7Rv+sZHlbEHw3BrkdTeFNImhBp4Qg+VojQpaMwDLSoTGQAHsahw9zjd7VTTN8= MIME-Version: 1.0 X-OriginatorOrg: wdc.com X-MS-Exchange-CrossTenant-Network-Message-Id: 75c026aa-8733-4196-bae3-08d6d8cb491b X-MS-Exchange-CrossTenant-originalarrivaltime: 15 May 2019 00:21:33.8757 (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: BYAPR04MB6229 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 216.71.153.144 Subject: [Qemu-devel] [PATCH v2 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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() as we will return from the first case. Signed-off-by: Alistair Francis Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée Tested-by: Alex Bennée --- target/arm/translate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/arm/translate.c b/target/arm/translate.c index dd053c80d6..298c262825 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -6598,13 +6598,13 @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn) tcg_gen_gvec_4(rd_ofs, offsetof(CPUARMState, vfp.qc), rn_ofs, rm_ofs, vec_size, vec_size, (u ? uqadd_op : sqadd_op) + size); - break; + return 0; case NEON_3R_VQSUB: tcg_gen_gvec_4(rd_ofs, offsetof(CPUARMState, vfp.qc), rn_ofs, rm_ofs, vec_size, vec_size, (u ? uqsub_op : sqsub_op) + size); - break; + return 0; case NEON_3R_VMUL: /* VMUL */ if (u) {