Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6360180imu; Mon, 21 Jan 2019 07:36:05 -0800 (PST) X-Google-Smtp-Source: ALg8bN7GYAdyrtRyvj/YRO4InruioAqaCJCsXyXAdbH7e8jw4LeBSYHRyYFGJPlQPZTr3X+DqVUX X-Received: by 2002:a63:9712:: with SMTP id n18mr28077921pge.295.1548084964975; Mon, 21 Jan 2019 07:36:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548084964; cv=none; d=google.com; s=arc-20160816; b=WpZ+VYjWwOfqhMfdFNrTsTZ9lWsiZ0z3nvmUkWpfuUYDcyDOv1SitxW2tQfdkZ0p+t WL4SXhqHdOdeU7MSu2o2uRfq5/G63Dmjgm25LXoGIUpoGvosjXSgQi8V2G2DT0aulHbj 6JanFXhe0VTadZSeP6uFgS5v7YbnNyEzC6Wb8HZtYcIWPzhw7Js/z9LmGXJMcFfkEjAf tU+Yg07pAqnHL0fHvWvvqzTtBV4mc9orPkGZD59iFRpaLkiLPdG3C9fFInIVCelSzRqm FU0Hi9rEsKp2iNbVYC677LoddMszXETQRBicdHLCF3w4sy3iZ5pxh/LdS9kawQiHi1fX hnQw== 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=polCnKeJhvR/0soVgR0KBiOrjp+zemOvxSHfcneWT8A=; b=mPJ80Sm9eOItnPs//2bBLirjkBpWj8PNilYvAvJ1KUlRAg3cAPaDHJ0hfSUe7L7efh l/RSpne81o3kp3A2I+p6cyrRKi6YXo4B4ANP6dNgnfTBUzF5xjwgJ9n5+plseQRQgtla IQmuIgXEoDdbKMZTBwkGrNVZv3BV1FF4sjzdWym9TBNyeyxA8OVf8jXbpK/fWM5UMUmP CDZUVGlG0kgfOKxZxikSCFHMy9uBiQXNYzQxBsqT1OMGxpgwi+udGyHETDQsdTN3Tq6H Lx+tIwJzPxaUl1vjBS8RDVs2VKozXQ6SBRW4mK9sT0nHQ1TN04f+BdWFwr5jMD6LEAdE 5pPw== 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 v16si13478923pgg.290.2019.01.21.07.35.49; Mon, 21 Jan 2019 07:36:04 -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 S1730080AbfAUPeV (ORCPT + 99 others); Mon, 21 Jan 2019 10:34:21 -0500 Received: from foss.arm.com ([217.140.101.70]:36450 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729773AbfAUPeR (ORCPT ); Mon, 21 Jan 2019 10:34:17 -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 69F3F1650; Mon, 21 Jan 2019 07:34:17 -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 4DBA73F5C1; Mon, 21 Jan 2019 07:34:15 -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, mark.rutland@arm.com, Julien Thierry , Oleg Nesterov Subject: [PATCH v9 07/26] arm64: ptrace: Provide definitions for PMR values Date: Mon, 21 Jan 2019 15:33:26 +0000 Message-Id: <1548084825-8803-8-git-send-email-julien.thierry@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1548084825-8803-1-git-send-email-julien.thierry@arm.com> References: <1548084825-8803-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 Introduce fixed values for PMR that are going to be used to mask and unmask interrupts by priority. The current priority given to GIC interrupts is 0xa0, so clearing PMR's most significant bit is enough to mask interrupts. Signed-off-by: Julien Thierry Suggested-by: Daniel Thompson Acked-by: Catalin Marinas Cc: Oleg Nesterov Cc: Catalin Marinas Cc: Will Deacon --- arch/arm64/include/asm/ptrace.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/arm64/include/asm/ptrace.h b/arch/arm64/include/asm/ptrace.h index fce22c4..05cf913 100644 --- a/arch/arm64/include/asm/ptrace.h +++ b/arch/arm64/include/asm/ptrace.h @@ -25,6 +25,18 @@ #define CurrentEL_EL1 (1 << 2) #define CurrentEL_EL2 (2 << 2) +/* + * PMR values used to mask/unmask interrupts. + * + * GIC priority masking works as follows: if an IRQ's priority is a higher value + * than the value held in PMR, that interrupt is masked. A lower value of PMR + * means more IRQ priorities are masked. + * + * To mask priorities, we clear the most significant bit of PMR. + */ +#define GIC_PRIO_IRQON 0xf0 +#define GIC_PRIO_IRQOFF (GIC_PRIO_IRQON & ~0x80) + /* Additional SPSR bits not exposed in the UABI */ #define PSR_IL_BIT (1 << 20) -- 1.9.1