Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp7257477imm; Tue, 28 Aug 2018 08:53:34 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYdzB+BqCqeIfGJCu14PG83fZ1vWXbObQU3B4LYNER2VYWsn7im1cjc0Waw52KINXGxSo7E X-Received: by 2002:a62:1a8f:: with SMTP id a137-v6mr2208267pfa.190.1535471614800; Tue, 28 Aug 2018 08:53:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535471614; cv=none; d=google.com; s=arc-20160816; b=YCmDbrrKWoiXQimQeN1uMC0z0zr0GGlNV1FFuaUgh7sJuyklBZp2hj3nTdZAb4GE88 DBj8ks5QBYRqfDB2gWV7T085mBtSRQa+pR/jhxAHsrn+Dz+Yknv4RzFfuM+XBTq9YKNt /j6F6vzgDZCgqy0HCCXZqNJQ7MB4A9oKQB6E0qFnNKBlGjOMl23cd0r61wuahtHTzfEp qykIMXZbwvnbr8TbkIULeD/sisDC1sUwxHORLY73fnnFcAxZvuPKLEvZStzCFjVIUMwx kHcsRHj8dqfFRJ1Ce4Ivl9PqlxukMgHaYtybuOiAcu3NoETI8rYnWvR0ilosqiOMmr1G k1/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=/g9xS6uFdd/ZOYMKPG2sKCJVziMOfCGtoWOLhogt9es=; b=eOugeuhGYeRH0xaoxB4EDS7U9RZNdXeUd2CzYbD3PgyZjmmGBYeARRWu7YNfX9F6P0 R33iBmLMx8LZByn654X0IhHNtqtcwwez2kFiWV4JeTtcfx9jFGMTI8uN7pSpXiy/rY7S j/80s51tscLfPjfVEKG50WVdSqIC8mRUbGgwsnvkd8RK3e08GVPlDQpWKqlpfLM1rOTz XdtyCHl3dSYk8gWRQLwHaoYUBYTGrgfynDTTkZOQNckyXraKeOavAx4TSh4u5Aoh/IFr x3QOG1CWPrC1IW5Y40Jz3I7YC1mkcwFRdcMSBO9Xjzl48oNqk+GZgL/+MGyO363ay9X5 mdeg== 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 a8-v6si1238839plp.61.2018.08.28.08.53.19; Tue, 28 Aug 2018 08:53:34 -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 S1727398AbeH1ToP (ORCPT + 99 others); Tue, 28 Aug 2018 15:44:15 -0400 Received: from foss.arm.com ([217.140.101.70]:40944 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726383AbeH1ToO (ORCPT ); Tue, 28 Aug 2018 15:44:14 -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 38AE41684; Tue, 28 Aug 2018 08:51:58 -0700 (PDT) Received: from e112298-lin.Emea.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 40CB03F557; Tue, 28 Aug 2018 08:51:56 -0700 (PDT) From: Julien Thierry To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, daniel.thompson@linaro.org, joel@joelfernandes.org, marc.zyngier@arm.com, mark.rutland@arm.com, christoffer.dall@arm.com, james.morse@arm.com, catalin.marinas@arm.com, will.deacon@arm.com, Julien Thierry Subject: [PATCH v5 04/27] arm64: daifflags: Use irqflags functions for daifflags Date: Tue, 28 Aug 2018 16:51:14 +0100 Message-Id: <1535471497-38854-5-git-send-email-julien.thierry@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1535471497-38854-1-git-send-email-julien.thierry@arm.com> References: <1535471497-38854-1-git-send-email-julien.thierry@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: Julien Thierry Cc: Catalin Marinas Cc: Will Deacon Cc: James Morse --- arch/arm64/include/asm/daifflags.h | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) 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(); + 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); + if (arch_irqs_disabled_flags(flags)) trace_hardirqs_off(); } -- 1.9.1