Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3983040imu; Mon, 12 Nov 2018 03:59:46 -0800 (PST) X-Google-Smtp-Source: AJdET5fB5VcaaIFANLK8mJW8xuFqD282t9cW5Ps30XnhsSEtUF6aWxqoH72Rh1xeMrRoCuu+wmX3 X-Received: by 2002:a17:902:2863:: with SMTP id e90-v6mr675614plb.244.1542023986444; Mon, 12 Nov 2018 03:59:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542023986; cv=none; d=google.com; s=arc-20160816; b=Ax2CElq/kKaKQLbZwGBmktwlAGcWie810k5UZtvNgl1a7cpLhJdULQKxeBdiXtrDX5 A11UPs0axn5XO+G2oCo4lvceyIGXjN+gJthpCLt/Ao43OoxyGCeXD7/IEz9zalBd0OTv QLISfP9rOccwz1WnFzGlZNKnhJppaP2WKezBIwGh5LKjtfSWKUvP/LNSv4P1hr8WHlKF sVe3Z1F5vrFGO755gQR99nV76wVupbL9SYJZVTWTk9RQX3LXuwyGVmVN82Spsptd+z9J +/+wn78qozq33A+xDnYWpw1nOo1ScwPIHJX+wF40Phq14HGYy+XlrBAuZ+uA/oQ7O1Wa Dgzg== 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=Euc601zqTvnBMMkK6js3I5VEx9e1XZ1VmR0PRSTduRE=; b=cE9eNvOuaPMim1xdAOUu6Bqky7glN5FpJymIrtHJRlWfweqzx2JsYCFb+e9yiTxQWc Nk9Bpo5oeYhoWtywz0HiMjSDKoj4ZvOn/iWQHqpEQ9UsAIowjuVeWTaPKqY7zehRcK+J 5shPy+i1pJyDG+Am22yBBIlwTYCNr7uR5hSRhjVkz9mwlaY/6m1NiJHEMjjnxOZ71zTQ 3HUTleYB4yPhS7yFvOtpLNwHO4iBaNMzO2MAwkKG1h0E/+tWJy+D1eapiX9q1RSTzhL1 NEwyRViAdtYw8YZ8iix/kxfZ77ioTD2UN5MCNQAgAA85FXRPdDeTTi6YpA+1MWrDzGFF 4rgw== 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 f189-v6si19193939pfg.84.2018.11.12.03.59.31; Mon, 12 Nov 2018 03:59:46 -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 S1729992AbeKLVu7 (ORCPT + 99 others); Mon, 12 Nov 2018 16:50:59 -0500 Received: from foss.arm.com ([217.140.101.70]:34700 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729756AbeKLVu7 (ORCPT ); Mon, 12 Nov 2018 16:50:59 -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 45BFB15BF; Mon, 12 Nov 2018 03:58:02 -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 9C2EF3F5A0; Mon, 12 Nov 2018 03:58:00 -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 16/24] arm64: gic-v3: Implement arch support for priority masking Date: Mon, 12 Nov 2018 11:57:07 +0000 Message-Id: <1542023835-21446-17-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 Implement architecture specific primitive allowing the GICv3 driver to use priorities to mask interrupts. Lower the default priority of interrupts to a value maskable with priority mask used for PMR. This is safe to do as both arm and arm64 only use one priority and are do not currently care about which priority value it is, as long as all interrupts use the same priority. Signed-off-by: Julien Thierry Suggested-by: Daniel Thompson Cc: Marc Zyngier Cc: Catalin Marinas Cc: Will Deacon --- arch/arm64/include/asm/arch_gicv3.h | 8 ++++---- include/linux/irqchip/arm-gic-common.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/arm64/include/asm/arch_gicv3.h b/arch/arm64/include/asm/arch_gicv3.h index 3f8d5f4..154612a 100644 --- a/arch/arm64/include/asm/arch_gicv3.h +++ b/arch/arm64/include/asm/arch_gicv3.h @@ -22,6 +22,7 @@ #ifndef __ASSEMBLY__ +#include #include #include #include @@ -162,14 +163,13 @@ static inline bool gic_prio_masking_enabled(void) static inline void gic_pmr_mask_irqs(void) { - /* Should not get called yet. */ - WARN_ON_ONCE(true); + BUILD_BUG_ON(GICD_INT_DEF_PRI <= GIC_PRIO_IRQOFF); + gic_write_pmr(GIC_PRIO_IRQOFF); } static inline void gic_arch_enable_irqs(void) { - /* Should not get called yet. */ - WARN_ON_ONCE(true); + asm volatile ("msr daifclr, #2" : : : "memory"); } #endif /* __ASSEMBLY__ */ diff --git a/include/linux/irqchip/arm-gic-common.h b/include/linux/irqchip/arm-gic-common.h index 9a1a479..2c9a4b3 100644 --- a/include/linux/irqchip/arm-gic-common.h +++ b/include/linux/irqchip/arm-gic-common.h @@ -13,7 +13,7 @@ #include #include -#define GICD_INT_DEF_PRI 0xa0 +#define GICD_INT_DEF_PRI 0xc0 #define GICD_INT_DEF_PRI_X4 ((GICD_INT_DEF_PRI << 24) |\ (GICD_INT_DEF_PRI << 16) |\ (GICD_INT_DEF_PRI << 8) |\ -- 1.9.1