Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3277040imm; Fri, 25 May 2018 02:56:52 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqGs3dH+wiRkXUxG2bo5m5H0+GzCuQ/bVKF5Kf9QMvGBDohHWjxPuLmxTqh7Lkm1vOfyZ5d X-Received: by 2002:a17:902:2848:: with SMTP id e66-v6mr1909715plb.319.1527242212009; Fri, 25 May 2018 02:56:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527242211; cv=none; d=google.com; s=arc-20160816; b=oB74c3+JHB7jcrVnO+x6EK9tMmXJzSRS+mz4CH0ueQgQXiwTSFebCM35RcIzUrRga7 ez9/149XwfmnPYeL5w/5zpT5WOBOJRrhGb+2DUZOUlNeLfSYdzCHc6dCWE8QgZxNjYxt 7EKSyIUmUvhc3F9vb+B50LBVwU+JeKZ/TZjDzOrnH8Wa/QJQ2q4+Lx2ShEBLZhve1xIc mr0bXzR/95mCM8CU2OwS72fJsGaxHHxcecPUVUnJbER9ZR0hkKsHYFEV9sXiLD6aUA/c oaAwzcQE9KR2nIn6DMpvH8/XGZspFEjeeombjp+uqdPVcb9Ej5E3vgeg4yB9ggq/RUJG FV3w== 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=iYmibtGxBttRxYvcRXcOvOVKNBlcCxFHgmSR44j4jsA=; b=Xdf6WIgw4K+nWveF3dAT/AkactFdG99fbvP9QWVzi5lU2NumEoeEhXnUrviS4dPKBU UkEW+ST6pxha41AHVeR3upmat67aa/dCsBIu8AQk7blr5tfr7ckawDIEN5l+INCWNU8y Wdm7EBcBL12xDjD9aNml+QfbN76UzlmtRfsQ5gQUMQgVkgbYsTHAqkksaUoMlKPpmc4i Fn0jbzjamBQLwh+T9iXa89/fN6ArDD944KE/hIkMKIyfhHO68R3KbN3O9Os+yVsova7p ESxqFC/bDt6RWTySMN3xsysoYoiYV6Tz6zvw+9DNW4dBDZ4NEm663rJIlf+044AP+nGy hOyA== 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 d124-v6si23486410pfc.176.2018.05.25.02.56.37; Fri, 25 May 2018 02:56:51 -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 S965977AbeEYJuS (ORCPT + 99 others); Fri, 25 May 2018 05:50:18 -0400 Received: from foss.arm.com ([217.140.101.70]:57480 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965485AbeEYJuP (ORCPT ); Fri, 25 May 2018 05:50:15 -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 850461596; Fri, 25 May 2018 02:50:15 -0700 (PDT) Received: from e112298-lin.cambridge.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 7AB1B3F25D; Fri, 25 May 2018 02:50:13 -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 v4 08/26] arm64: daifflags: Use irqflags functions for daifflags Date: Fri, 25 May 2018 10:49:14 +0100 Message-Id: <1527241772-48007-9-git-send-email-julien.thierry@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1527241772-48007-1-git-send-email-julien.thierry@arm.com> References: <1527241772-48007-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(-) Note: A latter patch changes the behaviour of arch_local_flags but the daif flag still need to follow the semantics of arch_local_flags. 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