From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965521AbdKPRME (ORCPT ); Thu, 16 Nov 2017 12:12:04 -0500 Received: from mail-it0-f68.google.com ([209.85.214.68]:37256 "EHLO mail-it0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965505AbdKPRL4 (ORCPT ); Thu, 16 Nov 2017 12:11:56 -0500 X-Google-Smtp-Source: AGs4zMZchESYD7CT62IVJD6kSqk12u5qgLBUa12ksXq0JGHt7m72Dwi2S4uMUPZvsyHszkxMQMKByA== Date: Thu, 16 Nov 2017 09:11:52 -0800 From: Sami Tolvanen To: Segher Boessenkool Cc: Yury Norov , Will Deacon , Alex Matveev , Andi Kleen , Ard Biesheuvel , Greg Hackmann , Kees Cook , linux-arm-kernel@lists.infradead.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Mark Rutland , Masahiro Yamada , Maxim Kuvyrkov , Michal Marek , Nick Desaulniers , Matthias Kaehlcke Subject: Re: [PATCH v2 11/18] arm64: make mrs_s and msr_s macros work with LTO Message-ID: <20171116171152.GH94341@samitolvanen.mtv.corp.google.com> References: <20171115213428.22559-1-samitolvanen@google.com> <20171115213428.22559-12-samitolvanen@google.com> <20171116115433.GG9361@arm.com> <20171116130742.wijnukjetoupi4hc@yury-thinkpad> <20171116135650.GQ10515@gate.crashing.org> <20171116164608.GG94341@samitolvanen.mtv.corp.google.com> <20171116170144.GR10515@gate.crashing.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171116170144.GR10515@gate.crashing.org> 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 Thu, Nov 16, 2017 at 11:01:44AM -0600, Segher Boessenkool wrote: > The thing with .purgem can work. Inelegant, sure, but it can work :-) It works, there are already functions in the kernel that use these macros more than once. I agree that this might not be the most elegant solution, but at least it allows us to use the same code path for both compilers. > Just make sure you do the macro define, the code that uses it, and the > undefine, all in the same inline asm statement. Yes, that's what we're doing here. Only KVM uses msr_s/msr_s directly, everything else uses the (read|write)_sysreg_s wrappers instead, which means the DEFINE/UNDEFINE macros are only needed in few places. Sami