From patchwork Fri Dec 15 16:06:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Deacon X-Patchwork-Id: 10115459 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 0DA286019C for ; Fri, 15 Dec 2017 16:07:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EAB1B28F63 for ; Fri, 15 Dec 2017 16:07:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DF5A52928A; Fri, 15 Dec 2017 16:07:04 +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=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3395728F63 for ; Fri, 15 Dec 2017 16:06:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=e9cS/vLSA6cbHzi6Fq/qjrWd63Mr1zBpuvoKqush2no=; b=KFrY9/BS4GZf+O /Z3MjFSqG15egCHH3eALU+X5CL5DB0KIseeNJSFImVFQSjB+XyICOkjJ5iKVHgN5H7wAj8G5uIP3o irjBTLLnEjQHz3Oef9BZka9R0ZPpj1N22+8xt6l9URSdCdyeQy0x4EvvCPslxhl6K/S+Jvqz4qmE+ G5JtWEO1jF2uG/bimVNRgKK6o9dILU9B2X6PHY131ze88451Lch5cz0WChoGXzcrEsJp0Yp1ufPZ4 zEbGg1yet1ahPIr+392z7TpUVFgAUS77vTKG+ChNYUrD3+Ip2s4JZe42PaiWRGa5r69+7Rrd0cm0k 1ZljtbMxFljuMVM8U5bw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1ePsVY-0000Ed-Fs; Fri, 15 Dec 2017 16:06:44 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1ePsVR-0000D9-D1 for linux-arm-kernel@lists.infradead.org; Fri, 15 Dec 2017 16:06:43 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 903A280D; Fri, 15 Dec 2017 08:06:14 -0800 (PST) Received: from edgewater-inn.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 60F2B3F4FF; Fri, 15 Dec 2017 08:06:14 -0800 (PST) Received: by edgewater-inn.cambridge.arm.com (Postfix, from userid 1000) id B49DB1AE5125; Fri, 15 Dec 2017 16:06:23 +0000 (GMT) Date: Fri, 15 Dec 2017 16:06:23 +0000 From: Will Deacon To: Geert Uytterhoeven Subject: Re: arm64: unhandled level 0 translation fault Message-ID: <20171215160623.GQ25650@arm.com> References: <20171214152431.GC12608@e103592.cambridge.arm.com> <20171215112343.GR22781@e103592.cambridge.arm.com> <20171215142732.GL25650@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171215_080637_489612_1BC71B45 X-CRM114-Status: GOOD ( 16.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ard Biesheuvel , Catalin Marinas , Linux Kernel Mailing List , Linux-Renesas , Alex =?iso-8859-1?Q?Benn=E9e?= , Dave Martin , "linux-arm-kernel@lists.infradead.org" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On Fri, Dec 15, 2017 at 04:59:28PM +0100, Geert Uytterhoeven wrote: > On Fri, Dec 15, 2017 at 3:27 PM, Will Deacon wrote: > > On Fri, Dec 15, 2017 at 02:30:00PM +0100, Geert Uytterhoeven wrote: > >> On Fri, Dec 15, 2017 at 12:23 PM, Dave Martin wrote: > >> > The two important differences here seem to be > >> > > >> > 1) Staging the state via current->thread.fpsimd_state instead of loading > >> > directly: > >> > > >> > - fpsimd_load_state(state); > >> > + current->thread.fpsimd_state = *state; > >> > + fpsimd_load_state(¤t->thread.fpsimd_state); > >> > >> The change above introduces the breakage. > > > > I finally managed to reproduce this, but only by using the exact same > > compiler as Geert: > > > > https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/4.9.0/x86_64-gcc-4.9.0-nolibc_aarch64-linux.tar.xz > > > > I then reliably see the problem if I run: > > > > # /usr/bin/update-ca-certificates > > /usr/sbin/... ? > > > from Debian Jessie. > > Funny, I've just got both > > *** Error in `/bin/sh': free(): invalid pointer: 0x0000aaaac17d4988 *** > > and > > mountall.sh[2172]: unhandled level 0 translation fault (11) at > 0x0000004d, esr 0x92000004, in dash[aaaace7e5000+1a000] > > during boot up, but I can't get update-ca-certificates to fail... Can you try the diff below, please? Will --->8 diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c index 540a1e010eb5..fae81f7964b4 100644 --- a/arch/arm64/kernel/fpsimd.c +++ b/arch/arm64/kernel/fpsimd.c @@ -1043,7 +1043,7 @@ void fpsimd_update_current_state(struct fpsimd_state *state) local_bh_disable(); - current->thread.fpsimd_state = *state; + current->thread.fpsimd_state.user_fpsimd = state->user_fpsimd; if (system_supports_sve() && test_thread_flag(TIF_SVE)) fpsimd_to_sve(current);