Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5392006imm; Wed, 12 Sep 2018 05:30:54 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaycHBggfqJtYvnSFK1r/M2ncO+JviajhnthezgEj/h1VZ8aOaNiVJMM01ZFyTHUxK4dGzr X-Received: by 2002:a63:d401:: with SMTP id a1-v6mr2037583pgh.414.1536755454189; Wed, 12 Sep 2018 05:30:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536755454; cv=none; d=google.com; s=arc-20160816; b=y4NCaTVgzL6KEbPyrIys2snPukrcFOJdJIv/DZnrAlRgWAcPpnvSm5zbdOd+r2++4w AR64LNsqUI4E6+hfvRX5hOk8snuxstxrDeom/K/pS3RIx4Vkcociv4VjP5/jOlIQg1OT rnZ7UHdpo5OkmzYIVZ+4y9p3weH3PfLhzP+OWdboycylAgF1ksMksGM8BS9TR9cWzmBU 6I8sx6lmsNUrtFmP7csTCOiz7Q3Wva/BkJLTJKb9XIa8r7kLWfk3+CdRpmNhud44lyPp uD/d6MSuXbboc1jvscSh3srynLgTMpMWQBfowFOhS9JYvibB5t2s59xyw7gV2mEDetrP Uayg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=DinoD4PTTN/x4f5KCsAHkWj3kicNykPQSVlYEqKkb8o=; b=EiXbq4NtVCCvN9byfRtFxHQrAYMT/8bE+GLzZxyyAjgFgYKnctvDuk41USICWtIHWU ltDxQZJCn/r0WAKhL4ka+H22ODau/eNgOYih+fJOsrQuy4jIJEULsDcLQQ+va03aOli3 S6a7xscci92FN6KZ4MRFDwZFXBSaspARDCj6+dUksFzK1wsqg/JU+vW25rULEP1Y+gJJ +6opU5CcZT7UjfUZNZettHRgJRftT2OgsF/7eqPpTmpyrVRqOvRwzY8c6FMylDq0JAYq K+oSE/tripetCVe1a1hjxNbJNJrSqlw/Z1t2VTF7FZe94aGznL/fQ0UlsxDP+U+iCwvI JO2Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h23-v6si830964pgv.356.2018.09.12.05.30.29; Wed, 12 Sep 2018 05:30:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727825AbeILRcx (ORCPT + 99 others); Wed, 12 Sep 2018 13:32:53 -0400 Received: from foss.arm.com ([217.140.101.70]:58512 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726670AbeILRcx (ORCPT ); Wed, 12 Sep 2018 13:32:53 -0400 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 B95421596; Wed, 12 Sep 2018 05:28:34 -0700 (PDT) Received: from [10.4.12.81] (melchizedek.emea.arm.com [10.4.12.81]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9C4A83F703; Wed, 12 Sep 2018 05:28:32 -0700 (PDT) Subject: Re: [PATCH v5 04/27] arm64: daifflags: Use irqflags functions for daifflags To: Julien Thierry Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, daniel.thompson@linaro.org, joel@joelfernandes.org, marc.zyngier@arm.com, mark.rutland@arm.com, christoffer.dall@arm.com, catalin.marinas@arm.com, will.deacon@arm.com References: <1535471497-38854-1-git-send-email-julien.thierry@arm.com> <1535471497-38854-5-git-send-email-julien.thierry@arm.com> From: James Morse Message-ID: <1031e4c9-9123-7a94-a59c-4249cf51adf4@arm.com> Date: Wed, 12 Sep 2018 13:28:30 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <1535471497-38854-5-git-send-email-julien.thierry@arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Julien, On 28/08/18 16:51, Julien Thierry wrote: > Some of the work done in daifflags save/restore is already provided > by irqflags functions. Daifflags should always be a superset of irqflags > (it handles irq status + status of other flags). Modifying behaviour of > irqflags should alter the behaviour of daifflags. > > Use irqflags_save/restore functions for the corresponding daifflags > operation. > diff --git a/arch/arm64/include/asm/daifflags.h b/arch/arm64/include/asm/daifflags.h > index 22e4c83..8d91f22 100644 > --- a/arch/arm64/include/asm/daifflags.h > +++ b/arch/arm64/include/asm/daifflags.h > @@ -36,11 +36,8 @@ static inline unsigned long local_daif_save(void) > { > unsigned long flags; > > - asm volatile( > - "mrs %0, daif // local_daif_save\n" > - : "=r" (flags) > - : > - : "memory"); > + flags = arch_local_save_flags(); I clearly should have done this from the beginning! (I thought there was some header-loop that prevented it, but I can't reproduce that now!) > local_daif_mask(); > > return flags; > @@ -60,11 +57,9 @@ static inline void local_daif_restore(unsigned long flags) > { > if (!arch_irqs_disabled_flags(flags)) > trace_hardirqs_on(); > - asm volatile( > - "msr daif, %0 // local_daif_restore" > - : > - : "r" (flags) > - : "memory"); > + > + arch_local_irq_restore(flags); And I thought this only messed with the I bit, which it clearly doesn't. Thanks for fixing these! Reviewed-by: James Morse