From patchwork Mon Feb 22 14:25:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 62584 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp1281336lbl; Mon, 22 Feb 2016 06:48:33 -0800 (PST) X-Received: by 10.66.218.196 with SMTP id pi4mr38527079pac.147.1456152512949; Mon, 22 Feb 2016 06:48:32 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id x12si40166112pfa.98.2016.02.22.06.48.32 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Feb 2016 06:48:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aXrlr-0006vd-7j; Mon, 22 Feb 2016 14:47:31 +0000 Received: from mail-wm0-x22d.google.com ([2a00:1450:400c:c09::22d]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aXrRg-0000S9-DS for linux-arm-kernel@lists.infradead.org; Mon, 22 Feb 2016 14:27:06 +0000 Received: by mail-wm0-x22d.google.com with SMTP id a4so165147111wme.1 for ; Mon, 22 Feb 2016 06:26:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=E3hzWMWaxjS5MFNHuMU3lchr+Z2nizobikjlfUVCNEI=; b=VTAU8WXUdUKbzeXTxeVu10iB3dX6wHZEsjsV/0rjQ6/SbnxIMVl3dqf3tLGWkH0Yjj sMeQ+jAqTuI/C8w/GCfxYVqOcCHnkHMUCZBX9nJ5/3vg2aJy2OZK6+YDS8chRyXe5/T0 ZXv8S/PQEIWxe6f6PixGTWIIjYdk3upERTru8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=E3hzWMWaxjS5MFNHuMU3lchr+Z2nizobikjlfUVCNEI=; b=J8aleqO97kREoOCaQR/9gJ0fRLuOj0O//V0Uztfvtx5fRtFTsQV+PyWk8TmNzASRea TDV92McfPlIvaz2+ytBzW3C7TPwCORbK0/yioX1a2xDrQiPyeA2MaiqS7yNZ/cKxRs+J dJcd6OFVbX05vMu2/8X4VVUz5MC4QwK85MGa/DDDLm4+/L2L4O1pojfndpJ3zMrqCUF7 0CkbK6EVWOjk1OlRICPRL0bpW8Ekz+d8+vhn8aiI2ErkmjB+b3QNZiJj0w7WKdIweqt8 UB1IxqSXAikxUAiMRoBrYDEAJORghsPm7rVzLuM7s7Bn+IWuFGHho9RRhfTkdGfQCbCO Gczg== X-Gm-Message-State: AG10YOSuJQq/bXUAT6A7UgXTaZEOHqZ2L/0iLcG3mc7LxzRV3cn4P++A5d9U2kV7rOxJuAgZ X-Received: by 10.194.61.209 with SMTP id s17mr27862528wjr.35.1456151178633; Mon, 22 Feb 2016 06:26:18 -0800 (PST) Received: from localhost.localdomain ([195.55.142.58]) by smtp.gmail.com with ESMTPSA id p125sm21377983wmd.16.2016.02.22.06.26.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 22 Feb 2016 06:26:17 -0800 (PST) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, linux-efi@vger.kernel.org, matt@codeblueprint.co.uk, sai.praneeth.prakhya@intel.com Subject: [PATCH 3/5] efi: add support for the EFI_MEMORY_ATTRIBUTES_TABLE config table Date: Mon, 22 Feb 2016 15:25:56 +0100 Message-Id: <1456151158-25849-4-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1456151158-25849-1-git-send-email-ard.biesheuvel@linaro.org> References: <1456151158-25849-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160222_062641_270004_5364609D X-CRM114-Status: GOOD ( 12.23 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c09:0:0:0:22d listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, pjones@redhat.com, linux@arm.linux.org.uk, leif.lindholm@linaro.org, Ard Biesheuvel MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org 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 --- drivers/firmware/efi/efi.c | 2 ++ include/linux/efi.h | 13 +++++++++++++ 2 files changed, 15 insertions(+) -- 2.5.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c index 3a69ed5ecfcb..5683865baa92 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 42be9c92fdf0..808d97299c70 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h @@ -619,6 +619,10 @@ void efi_native_runtime_setup(void); EFI_GUID(0x880aaca3, 0x4adc, 0x4a04, \ 0x90, 0x79, 0xb7, 0x47, 0x34, 0x08, 0x25, 0xe5) +#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; @@ -843,6 +847,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: */ @@ -864,6 +876,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;