Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3983238imu; Mon, 12 Nov 2018 03:59:57 -0800 (PST) X-Google-Smtp-Source: AJdET5cAK7NHiDlvugvYFaHZTIfErs4DBAK2tiX1+UizukbMYMzwQL9sc8HyI3wmibuOXjZBe9BI X-Received: by 2002:a63:e950:: with SMTP id q16mr584351pgj.138.1542023997793; Mon, 12 Nov 2018 03:59:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542023997; cv=none; d=google.com; s=arc-20160816; b=z2m2hiG3Vy9Mz1zfHBAnI/EtI/TzMQQvzNyH2zXjcn51rkT9iS5Q+04UaEmD+qs8AA wuWEhpEw/JVaC/BKvO0YysmV1yKEuPxp3QX5zqXOUo1BnYXN+LR7wN2meHET+bvn6dEr O6jeH0wpZ2FczA6H4sfKxtgWDsLnzOsRhgIf1rq6TuQt1pWorOD7gwc8o/l5890t9vL2 wK0oEzAp6uXSCyceJZDBxVwFiOXeGReJJlYZBwprUzHhle16WRijQe+uBxOZauSkh1In bXcTjyiBG7WWJ9BzQrjc34jAl05h1gGJx2PQOmkQQ2ijGO6CxSEkMe5HTtsus3eOZG+J 6EWA== 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; bh=3a7yybkfFw/gM17opdoGb472xuxbdSWusXHWU9BdW64=; b=MpjtVpLnDGRBzis5gYej1TVw2YUqv0vSCJ3394i4wdb9Rkyrg9Xlh2B61F0kJNx3mg Vt9RQO3v6uXdOealn6kRV/8ycT8njCLKms7VY/NaCc6+OWrQR8YF76S/Vadah18lRARy QcgeaUNQBlr8aZP1V7X15kCBrYIKnU/LCZ5d9yx4PFhIo64Bj814wur4MZ45ZUhhOopq zPxxYQx9ur0aotRyxZNvZcIebRj2DxFViY35Mn4RgYS//mQVo3kjXPxJ2u30ueqCNq0Z NJ4+/NeugOfKs7hI4z+exIx3C9JsQtcz56uyvY/ZR/ud1OdIrkH9droe7ymF/RCvLLkO sRYQ== 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 61-v6si18204552plr.72.2018.11.12.03.59.42; Mon, 12 Nov 2018 03:59:57 -0800 (PST) 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 S1729865AbeKLVus (ORCPT + 99 others); Mon, 12 Nov 2018 16:50:48 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:34634 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729800AbeKLVus (ORCPT ); Mon, 12 Nov 2018 16:50:48 -0500 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 745BA15BF; Mon, 12 Nov 2018 03:57:51 -0800 (PST) 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 9F8573F5A0; Mon, 12 Nov 2018 03:57:49 -0800 (PST) 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, christoffer.dall@arm.com, james.morse@arm.com, catalin.marinas@arm.com, will.deacon@arm.com, Julien Thierry Subject: [PATCH v6 11/24] arm64: daifflags: Include PMR in daifflags restore operations Date: Mon, 12 Nov 2018 11:57:02 +0000 Message-Id: <1542023835-21446-12-git-send-email-julien.thierry@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1542023835-21446-1-git-send-email-julien.thierry@arm.com> References: <1542023835-21446-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 The addition of PMR should not bypass the semantics of daifflags. When DA_F are set, I bit is also set as no interrupts (even of higher priority) is allowed. When DA_F are cleared, I bit is cleared and interrupt enabling/disabling goes through ICC_PMR_EL1. Signed-off-by: Julien Thierry Cc: Catalin Marinas Cc: Will Deacon Cc: James Morse --- arch/arm64/include/asm/daifflags.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/arm64/include/asm/daifflags.h b/arch/arm64/include/asm/daifflags.h index 546bc39..31936b3 100644 --- a/arch/arm64/include/asm/daifflags.h +++ b/arch/arm64/include/asm/daifflags.h @@ -18,8 +18,14 @@ #include -#define DAIF_PROCCTX 0 -#define DAIF_PROCCTX_NOIRQ PSR_I_BIT +#include + +#define DAIF_PROCCTX MAKE_ARCH_FLAGS(0, GIC_PRIO_IRQON) + +#define DAIF_PROCCTX_NOIRQ \ + (system_supports_irq_prio_masking() ? \ + MAKE_ARCH_FLAGS(0, GIC_PRIO_IRQOFF) : \ + MAKE_ARCH_FLAGS(PSR_I_BIT, GIC_PRIO_IRQON)) /* mask/save/unmask/restore all exceptions, including interrupts. */ static inline void local_daif_mask(void) -- 1.9.1