Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753398AbcD1KqZ (ORCPT ); Thu, 28 Apr 2016 06:46:25 -0400 Received: from terminus.zytor.com ([198.137.202.10]:48460 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752486AbcD1KqW (ORCPT ); Thu, 28 Apr 2016 06:46:22 -0400 Date: Thu, 28 Apr 2016 03:45:20 -0700 From: tip-bot for Mark Rutland Message-ID: Cc: mark.rutland@arm.com, leif.lindholm@linaro.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, colin.king@canonical.com, ard.biesheuvel@linaro.org, bp@alien8.de, will.deacon@arm.com, catalin.marinas@arm.com, mingo@kernel.org, matt@codeblueprint.co.uk, linux@arm.linux.org.uk, hpa@zytor.com, peterz@infradead.org Reply-To: mingo@kernel.org, will.deacon@arm.com, catalin.marinas@arm.com, bp@alien8.de, peterz@infradead.org, matt@codeblueprint.co.uk, linux@arm.linux.org.uk, hpa@zytor.com, leif.lindholm@linaro.org, mark.rutland@arm.com, ard.biesheuvel@linaro.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, colin.king@canonical.com In-Reply-To: <1461614832-17633-39-git-send-email-matt@codeblueprint.co.uk> References: <1461614832-17633-39-git-send-email-matt@codeblueprint.co.uk> To: linux-tip-commits@vger.kernel.org Subject: [tip:efi/core] arm/efi: Enable runtime call flag checking Git-Commit-ID: 207a90e5cbcdb0674c8a4b499c1407962c46f6d3 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2253 Lines: 60 Commit-ID: 207a90e5cbcdb0674c8a4b499c1407962c46f6d3 Gitweb: http://git.kernel.org/tip/207a90e5cbcdb0674c8a4b499c1407962c46f6d3 Author: Mark Rutland AuthorDate: Mon, 25 Apr 2016 21:07:10 +0100 Committer: Ingo Molnar CommitDate: Thu, 28 Apr 2016 11:34:12 +0200 arm/efi: Enable runtime call flag checking Define ARCH_EFI_IRQ_FLAGS_MASK for arm, which will enable the generic runtime wrapper code to detect when firmware erroneously modifies flags over a runtime services function call. We check all allocated flags, barring those which firmware has legitimate reason to modify (condition flags and IT state). While in practice corruption of some flags (e.g. J) would already be fatal, we include these for consistency and documentation purposes. Signed-off-by: Mark Rutland Signed-off-by: Matt Fleming Cc: Ard Biesheuvel Cc: Borislav Petkov Cc: Catalin Marinas Cc: Colin Ian King Cc: Leif Lindholm Cc: Peter Zijlstra Cc: Russell King Cc: Thomas Gleixner Cc: Will Deacon Cc: linux-arm-kernel@lists.infradead.org Cc: linux-efi@vger.kernel.org Link: http://lkml.kernel.org/r/1461614832-17633-39-git-send-email-matt@codeblueprint.co.uk Signed-off-by: Ingo Molnar --- arch/arm/include/asm/efi.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm/include/asm/efi.h b/arch/arm/include/asm/efi.h index 5f273b43..a708fa1 100644 --- a/arch/arm/include/asm/efi.h +++ b/arch/arm/include/asm/efi.h @@ -17,6 +17,7 @@ #include #include #include +#include #ifdef CONFIG_EFI void efi_init(void); @@ -34,6 +35,10 @@ int efi_set_mapping_permissions(struct mm_struct *mm, efi_memory_desc_t *md); __f(args); \ }) +#define ARCH_EFI_IRQ_FLAGS_MASK \ + (PSR_J_BIT | PSR_E_BIT | PSR_A_BIT | PSR_I_BIT | PSR_F_BIT | \ + PSR_T_BIT | MODE_MASK) + static inline void efi_set_pgd(struct mm_struct *mm) { check_and_switch_context(mm, NULL);