From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_PASS, URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7B730C10F13 for ; Tue, 16 Apr 2019 17:18:46 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4C4E22087C for ; Tue, 16 Apr 2019 17:18:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="jZGVco/Q" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4C4E22087C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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=e/Ab4ns0+uCFsXZ8nepTnw4E8DPMBcErYXW5geqz0D8=; b=jZGVco/QEzVOMT +awEeuO3RqLEzjPUXEEVzi4IPFyhqjt0oOUuFp9bXkeLEZ/jL5tUoUv2Fw9S8sSfXiCgfs6lyTxkk qMfVTTuXKR3QTsq4dsVO/Bpsaatk90VmWteOXyIom2RydWf9lhJswVsYDaPq8T6QOWF9cMhaYTXSc 05Kr8bcudK+9t9DNmviXwob5K8sv9NN02Ntft2Ar+i9FdejvDOicSPNiRBPv/MRq5DsIZXslofOfS DI2H8hhjU49p6mI0dMMzQVQiVDlOda2Mb9VTaLQdBsF3Bu96QkSUbvzIK7ledQp2RteFyuNtZ9opD 0EM4AwqeG/6JDRyiAMMQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hGRjE-0006oB-4V; Tue, 16 Apr 2019 17:18:40 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hGRjB-0006nX-He for linux-arm-kernel@lists.infradead.org; Tue, 16 Apr 2019 17:18:38 +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 CE0AF80D; Tue, 16 Apr 2019 10:18:34 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DC9F33F690; Tue, 16 Apr 2019 10:18:32 -0700 (PDT) Date: Tue, 16 Apr 2019 18:18:30 +0100 From: Mark Rutland To: Nick Desaulniers Subject: Re: [PATCH v3] arm64: sysreg: make mrs_s and msr_s macros work with Clang and LTO Message-ID: <20190416171829.GD54708@lakrids.cambridge.arm.com> References: <20190415143821.GA46880@beast> <20190415170604.GA44415@lakrids.cambridge.arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.1+11 (2f07cb52) (2018-12-01) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190416_101837_592097_EB8DD3C7 X-CRM114-Status: GOOD ( 14.72 ) 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: Kees Cook , Ard Biesheuvel , Catalin Marinas , Will Deacon , LKML , Yury Norov , Sami Tolvanen , Alex Matveev , Matthias Kaehlcke , Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Apr 15, 2019 at 10:22:27AM -0700, Nick Desaulniers wrote: > On Mon, Apr 15, 2019 at 10:06 AM Mark Rutland wrote: > > On Mon, Apr 15, 2019 at 07:38:21AM -0700, Kees Cook wrote: > > > diff --git a/arch/arm64/include/asm/irqflags.h b/arch/arm64/include/asm/irqflags.h > > > index 43d8366c1e87..06d3987d1546 100644 > > > --- a/arch/arm64/include/asm/irqflags.h > > > +++ b/arch/arm64/include/asm/irqflags.h > > > @@ -43,7 +43,9 @@ static inline void arch_local_irq_enable(void) > > > asm volatile(ALTERNATIVE( > > > "msr daifclr, #2 // arch_local_irq_enable\n" > > > "nop", > > > + DEFINE_MSR_S > > > "msr_s " __stringify(SYS_ICC_PMR_EL1) ",%0\n" > > > + UNDEFINE_MSR_S > > > > If we do need this, can we wrap this in a larger CPP macro that does the > > whole sequence of defining, using, and undefining the asm macros? > > I agree that would be cleaner. For example, __mrs_s/__msr_s can > ALMOST do this (be used in arch/arm64/include/asm/irqflags.h) except > for the input/output constraints. Maybe the constraints can be > removed from the cpp macro definition, then the constraints be left to > the macro expansion sites? That way the DEFINE_MXX_S/UNDEFINE_MXX_S > can be hidden in the cpp macro itself. If those took the register template explicitly, i.e. something like: __mrs_s(SYS_ICC_PMR_EL1, "%x0") __msr_s("%[whatever]", SYS_FOO) ... that would be more generally useful and clear, as they could be used in larger asm sequences. Thanks, Mark. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel