From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752821AbdKTVBt (ORCPT ); Mon, 20 Nov 2017 16:01:49 -0500 Received: from mail-it0-f67.google.com ([209.85.214.67]:33936 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751131AbdKTVBr (ORCPT ); Mon, 20 Nov 2017 16:01:47 -0500 X-Google-Smtp-Source: AGs4zMa/W4f28VBH0hD/HuMxa4E/Tr4tkAMh3A8lncPJOGaajr7uxoj9bFZouDsoxR9VhhWBlaHPhQ== Date: Mon, 20 Nov 2017 13:01:43 -0800 From: Sami Tolvanen To: Ard Biesheuvel Cc: Mark Rutland , Alex Matveev , Andi Kleen , Greg Hackmann , Kees Cook , "linux-arm-kernel@lists.infradead.org" , linux-kbuild@vger.kernel.org, "linux-kernel@vger.kernel.org" , Masahiro Yamada , Maxim Kuvyrkov , Michal Marek , Nick Desaulniers , Yury Norov , Matthias Kaehlcke Subject: Re: [PATCH v2 16/18] arm64: crypto: disable LTO for aes-ce-cipher.c Message-ID: <20171120210143.GD89108@samitolvanen.mtv.corp.google.com> References: <20171115213428.22559-1-samitolvanen@google.com> <20171115213428.22559-17-samitolvanen@google.com> <20171120152014.hftuded4zxwn2r7m@lakrids.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 20, 2017 at 03:25:31PM +0000, Ard Biesheuvel wrote: > However, under LTO this all changes, and it is no longer guaranteed > that the NEON registers are only touched between the kernel mode > neon begin/end calls. LTO operates on LLVM IR, so disabling LTO for this file should make sure there won't be any unsafe optimizations. Are there other places in the kernel that might have this issue? > So the correct way to fix this would be to move the asm into its own > .S file, and call it from between the kernel_mode_neon_begin/end > calls. That should also fix your compat issue. Sure, that would also work. Sami