From patchwork Mon Oct 12 13:56:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Fleming X-Patchwork-Id: 54759 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by patches.linaro.org (Postfix) with ESMTPS id 0C9BB22DB6 for ; Mon, 12 Oct 2015 13:57:54 +0000 (UTC) Received: by wibzt1 with SMTP id zt1sf15735587wib.0 for ; Mon, 12 Oct 2015 06:57:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=HY2g/7lPgihMeBTZtxg/TOVTrWsslSW4+ymVSgNzzc4=; b=mNbMyYdspS/zz2P4M9y2pL1I4EsOB2XbcqD/KDjHU+oEvX5Cn6cT5KHOjYvz/RVVA2 DJDvAhT3Q0vRrjvZgfLTnuDqpSRp3yTjhkJUgHPuS2xT9kF7ZIKX3m89vWp/iLSM/L3c ozmcAZ3UE0U7t7YLBD/Gy16msXrW7BB7vUHG4Gx7UE+v/elTf113ZUQZiRTjalQ/86MV M/k7KL5XFJJBg/m3p91YGHYBukJSNgHkG9Lxx/Xzfw/Kh6iKv1J+rMH+mD+4V589UToM OKKAA/gEV/WYa/UtXYv4ROC7jU9Z2SkMV24pvXyRIp9boNuH2iZ4hvv1Fx48sF9pYsp7 WYmQ== X-Gm-Message-State: ALoCoQmqFqzp1oubtz9Hxr46/7qY25Hpox5ZZBMEXWR3Z/O4Zt3PK8dTHdzhr8NQy+XTIQsdz8sw X-Received: by 10.112.198.33 with SMTP id iz1mr5606294lbc.8.1444658273314; Mon, 12 Oct 2015 06:57:53 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.29.148 with SMTP id d142ls488699lfd.27.gmail; Mon, 12 Oct 2015 06:57:53 -0700 (PDT) X-Received: by 10.25.146.193 with SMTP id u184mr8128314lfd.50.1444658273132; Mon, 12 Oct 2015 06:57:53 -0700 (PDT) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com. [209.85.217.179]) by mx.google.com with ESMTPS id 22si5155830lfu.87.2015.10.12.06.57.53 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Oct 2015 06:57:53 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) client-ip=209.85.217.179; Received: by lbcao8 with SMTP id ao8so144045272lbc.3 for ; Mon, 12 Oct 2015 06:57:53 -0700 (PDT) X-Received: by 10.112.64.72 with SMTP id m8mr12171234lbs.41.1444658272984; Mon, 12 Oct 2015 06:57:52 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp1564361lbq; Mon, 12 Oct 2015 06:57:52 -0700 (PDT) X-Received: by 10.50.118.42 with SMTP id kj10mr11571229igb.71.1444658271986; Mon, 12 Oct 2015 06:57:51 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c16si8393528igo.67.2015.10.12.06.57.51; Mon, 12 Oct 2015 06:57:51 -0700 (PDT) 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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752774AbbJLN5t (ORCPT + 30 others); Mon, 12 Oct 2015 09:57:49 -0400 Received: from mail-wi0-f176.google.com ([209.85.212.176]:34821 "EHLO mail-wi0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751657AbbJLN42 (ORCPT ); Mon, 12 Oct 2015 09:56:28 -0400 Received: by wicge5 with SMTP id ge5so151398534wic.0 for ; Mon, 12 Oct 2015 06:56:27 -0700 (PDT) X-Received: by 10.180.206.52 with SMTP id ll20mr13693730wic.48.1444658186972; Mon, 12 Oct 2015 06:56:26 -0700 (PDT) Received: from localhost ([90.203.240.153]) by smtp.gmail.com with ESMTPSA id ld5sm20036270wjc.18.2015.10.12.06.56.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Oct 2015 06:56:26 -0700 (PDT) From: Matt Fleming To: Ingo Molnar , Thomas Gleixner , "H. Peter Anvin" Cc: Ard Biesheuvel , linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, Leif Lindholm , Matt Fleming , Dave Young Subject: [PATCH 07/11] efi: Add support for UEFIv2.5 Properties table Date: Mon, 12 Oct 2015 14:56:10 +0100 Message-Id: <1444658174-23378-8-git-send-email-matt@codeblueprint.co.uk> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1444658174-23378-1-git-send-email-matt@codeblueprint.co.uk> References: <1444658174-23378-1-git-send-email-matt@codeblueprint.co.uk> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: matt@codeblueprint.co.uk X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Ard Biesheuvel Version 2.5 of the UEFI spec introduces a new configuration table called the 'EFI Properties table'. Currently, it is only used to convey whether the Memory Protection feature is enabled, which splits PE/COFF images into separate code and data memory regions. Signed-off-by: Ard Biesheuvel Cc: Leif Lindholm Acked-by: Dave Young Signed-off-by: Matt Fleming --- drivers/firmware/efi/efi.c | 30 ++++++++++++++++-------------- include/linux/efi.h | 13 +++++++++++++ 2 files changed, 29 insertions(+), 14 deletions(-) diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c index 278d4d88d250..c297d78f50fd 100644 --- a/drivers/firmware/efi/efi.c +++ b/drivers/firmware/efi/efi.c @@ -26,20 +26,21 @@ #include struct efi __read_mostly efi = { - .mps = EFI_INVALID_TABLE_ADDR, - .acpi = EFI_INVALID_TABLE_ADDR, - .acpi20 = EFI_INVALID_TABLE_ADDR, - .smbios = EFI_INVALID_TABLE_ADDR, - .smbios3 = EFI_INVALID_TABLE_ADDR, - .sal_systab = EFI_INVALID_TABLE_ADDR, - .boot_info = EFI_INVALID_TABLE_ADDR, - .hcdp = EFI_INVALID_TABLE_ADDR, - .uga = EFI_INVALID_TABLE_ADDR, - .uv_systab = EFI_INVALID_TABLE_ADDR, - .fw_vendor = EFI_INVALID_TABLE_ADDR, - .runtime = EFI_INVALID_TABLE_ADDR, - .config_table = EFI_INVALID_TABLE_ADDR, - .esrt = EFI_INVALID_TABLE_ADDR, + .mps = EFI_INVALID_TABLE_ADDR, + .acpi = EFI_INVALID_TABLE_ADDR, + .acpi20 = EFI_INVALID_TABLE_ADDR, + .smbios = EFI_INVALID_TABLE_ADDR, + .smbios3 = EFI_INVALID_TABLE_ADDR, + .sal_systab = EFI_INVALID_TABLE_ADDR, + .boot_info = EFI_INVALID_TABLE_ADDR, + .hcdp = EFI_INVALID_TABLE_ADDR, + .uga = EFI_INVALID_TABLE_ADDR, + .uv_systab = EFI_INVALID_TABLE_ADDR, + .fw_vendor = EFI_INVALID_TABLE_ADDR, + .runtime = EFI_INVALID_TABLE_ADDR, + .config_table = EFI_INVALID_TABLE_ADDR, + .esrt = EFI_INVALID_TABLE_ADDR, + .properties_table = EFI_INVALID_TABLE_ADDR, }; EXPORT_SYMBOL(efi); @@ -365,6 +366,7 @@ static __initdata efi_config_table_type_t common_tables[] = { {SMBIOS3_TABLE_GUID, "SMBIOS 3.0", &efi.smbios3}, {UGA_IO_PROTOCOL_GUID, "UGA", &efi.uga}, {EFI_SYSTEM_RESOURCE_TABLE_GUID, "ESRT", &efi.esrt}, + {EFI_PROPERTIES_TABLE_GUID, "PROP", &efi.properties_table}, {NULL_GUID, NULL, NULL}, }; diff --git a/include/linux/efi.h b/include/linux/efi.h index 4677d8a1bfd0..d6a9bee755f2 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h @@ -596,6 +596,9 @@ void efi_native_runtime_setup(void); #define DEVICE_TREE_GUID \ EFI_GUID( 0xb1b621d5, 0xf19c, 0x41a5, 0x83, 0x0b, 0xd9, 0x15, 0x2c, 0x69, 0xaa, 0xe0 ) +#define EFI_PROPERTIES_TABLE_GUID \ + EFI_GUID( 0x880aaca3, 0x4adc, 0x4a04, 0x90, 0x79, 0xb7, 0x47, 0x34, 0x08, 0x25, 0xe5 ) + typedef struct { efi_guid_t guid; u64 table; @@ -809,6 +812,15 @@ typedef struct _efi_file_io_interface { #define EFI_FILE_MODE_WRITE 0x0000000000000002 #define EFI_FILE_MODE_CREATE 0x8000000000000000 +typedef struct { + u32 version; + u32 length; + u64 memory_protection_attribute; +} efi_properties_table_t; + +#define EFI_PROPERTIES_TABLE_VERSION 0x00010000 +#define EFI_PROPERTIES_RUNTIME_MEMORY_PROTECTION_NON_EXECUTABLE_PE_DATA 0x1 + #define EFI_INVALID_TABLE_ADDR (~0UL) /* @@ -831,6 +843,7 @@ extern struct efi { unsigned long runtime; /* runtime table */ unsigned long config_table; /* config tables */ unsigned long esrt; /* ESRT table */ + unsigned long properties_table; /* properties table */ efi_get_time_t *get_time; efi_set_time_t *set_time; efi_get_wakeup_time_t *get_wakeup_time;