Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752697AbcD1Kfv (ORCPT ); Thu, 28 Apr 2016 06:35:51 -0400 Received: from terminus.zytor.com ([198.137.202.10]:47578 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751837AbcD1Kfs (ORCPT ); Thu, 28 Apr 2016 06:35:48 -0400 Date: Thu, 28 Apr 2016 03:34:43 -0700 From: tip-bot for Ard Biesheuvel Message-ID: Cc: will.deacon@arm.com, mingo@kernel.org, leif.lindholm@linaro.org, peterz@infradead.org, tglx@linutronix.de, hpa@zytor.com, ard.biesheuvel@linaro.org, bp@alien8.de, catalin.marinas@arm.com, matt@codeblueprint.co.uk, sai.praneeth.prakhya@intel.com, mark.rutland@arm.com, linux-kernel@vger.kernel.org, pjones@redhat.com Reply-To: hpa@zytor.com, leif.lindholm@linaro.org, mingo@kernel.org, will.deacon@arm.com, tglx@linutronix.de, peterz@infradead.org, mark.rutland@arm.com, pjones@redhat.com, linux-kernel@vger.kernel.org, bp@alien8.de, ard.biesheuvel@linaro.org, sai.praneeth.prakhya@intel.com, catalin.marinas@arm.com, matt@codeblueprint.co.uk In-Reply-To: <1461614832-17633-13-git-send-email-matt@codeblueprint.co.uk> References: <1461614832-17633-13-git-send-email-matt@codeblueprint.co.uk> To: linux-tip-commits@vger.kernel.org Subject: [tip:efi/core] efi: Add support for the EFI_MEMORY_ATTRIBUTES_TABLE config table Git-Commit-ID: a604af075a3226adaff84b7026876f0c6dfe9f52 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: 3253 Lines: 90 Commit-ID: a604af075a3226adaff84b7026876f0c6dfe9f52 Gitweb: http://git.kernel.org/tip/a604af075a3226adaff84b7026876f0c6dfe9f52 Author: Ard Biesheuvel AuthorDate: Mon, 25 Apr 2016 21:06:44 +0100 Committer: Ingo Molnar CommitDate: Thu, 28 Apr 2016 11:33:54 +0200 efi: Add support for the EFI_MEMORY_ATTRIBUTES_TABLE config table This declares the GUID and struct typedef for the new memory attributes table which contains the permissions that can be used to apply stricter permissions to UEFI Runtime Services memory regions. Signed-off-by: Ard Biesheuvel Signed-off-by: Matt Fleming Cc: Borislav Petkov Cc: Catalin Marinas Cc: Leif Lindholm Cc: Mark Rutland Cc: Peter Jones Cc: Peter Zijlstra Cc: Sai Praneeth Prakhya Cc: Thomas Gleixner Cc: Will Deacon Cc: linux-efi@vger.kernel.org Link: http://lkml.kernel.org/r/1461614832-17633-13-git-send-email-matt@codeblueprint.co.uk Signed-off-by: Ingo Molnar --- drivers/firmware/efi/efi.c | 2 ++ include/linux/efi.h | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c index f7d36c6..583e647 100644 --- a/drivers/firmware/efi/efi.c +++ b/drivers/firmware/efi/efi.c @@ -43,6 +43,7 @@ struct efi __read_mostly efi = { .config_table = EFI_INVALID_TABLE_ADDR, .esrt = EFI_INVALID_TABLE_ADDR, .properties_table = EFI_INVALID_TABLE_ADDR, + .mem_attr_table = EFI_INVALID_TABLE_ADDR, }; EXPORT_SYMBOL(efi); @@ -338,6 +339,7 @@ static __initdata efi_config_table_type_t common_tables[] = { {UGA_IO_PROTOCOL_GUID, "UGA", &efi.uga}, {EFI_SYSTEM_RESOURCE_TABLE_GUID, "ESRT", &efi.esrt}, {EFI_PROPERTIES_TABLE_GUID, "PROP", &efi.properties_table}, + {EFI_MEMORY_ATTRIBUTES_TABLE_GUID, "MEMATTR", &efi.mem_attr_table}, {NULL_GUID, NULL, NULL}, }; diff --git a/include/linux/efi.h b/include/linux/efi.h index c2c0da4..81af5fe 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h @@ -623,6 +623,10 @@ void efi_native_runtime_setup(void); EFI_GUID(0x3152bca5, 0xeade, 0x433d, \ 0x86, 0x2e, 0xc0, 0x1c, 0xdc, 0x29, 0x1f, 0x44) +#define EFI_MEMORY_ATTRIBUTES_TABLE_GUID \ + EFI_GUID(0xdcfa911d, 0x26eb, 0x469f, \ + 0xa2, 0x20, 0x38, 0xb7, 0xdc, 0x46, 0x12, 0x20) + typedef struct { efi_guid_t guid; u64 table; @@ -847,6 +851,14 @@ typedef struct { #define EFI_INVALID_TABLE_ADDR (~0UL) +typedef struct { + u32 version; + u32 num_entries; + u32 desc_size; + u32 reserved; + efi_memory_desc_t entry[0]; +} efi_memory_attributes_table_t; + /* * All runtime access to EFI goes through this structure: */ @@ -868,6 +880,7 @@ extern struct efi { unsigned long config_table; /* config tables */ unsigned long esrt; /* ESRT table */ unsigned long properties_table; /* properties table */ + unsigned long mem_attr_table; /* memory attributes table */ efi_get_time_t *get_time; efi_set_time_t *set_time; efi_get_wakeup_time_t *get_wakeup_time;