Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965092AbcDYUIg (ORCPT ); Mon, 25 Apr 2016 16:08:36 -0400 Received: from mail-wm0-f50.google.com ([74.125.82.50]:37418 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933434AbcDYUI3 (ORCPT ); Mon, 25 Apr 2016 16:08:29 -0400 From: Matt Fleming To: Ingo Molnar , Thomas Gleixner , "H . Peter Anvin" Cc: Mark Rutland , Ard Biesheuvel , linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, Matt Fleming , Catalin Marinas , Colin Ian King , Leif Lindholm , Russell King , Will Deacon Subject: [PATCH 38/40] arm/efi: Enable runtime call flag checking Date: Mon, 25 Apr 2016 21:07:10 +0100 Message-Id: <1461614832-17633-39-git-send-email-matt@codeblueprint.co.uk> X-Mailer: git-send-email 2.7.3 In-Reply-To: <1461614832-17633-1-git-send-email-matt@codeblueprint.co.uk> References: <1461614832-17633-1-git-send-email-matt@codeblueprint.co.uk> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1782 Lines: 52 From: Mark Rutland 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 Cc: Ard Biesheuvel Cc: Leif Lindholm Cc: Russell King Cc: linux-arm-kernel@lists.infradead.org Cc: linux-efi@vger.kernel.org Cc: Catalin Marinas Cc: "H. Peter Anvin" Cc: Thomas Gleixner Cc: Will Deacon Cc: Colin Ian King Signed-off-by: Matt Fleming --- 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 5f273b43d704..a708fa1f0905 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); -- 2.7.3