lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1453841853-11383-6-git-send-email-bp@alien8.de>
Date:	Tue, 26 Jan 2016 21:57:21 +0100
From:	Borislav Petkov <bp@...en8.de>
To:	Ingo Molnar <mingo@...nel.org>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Fenghua Yu <fenghua.yu@...el.com>, linux-arch@...r.kernel.org,
	linux-efi <linux-efi@...r.kernel.org>,
	linux-ia64@...r.kernel.org, linux-mm <linux-mm@...ck.org>,
	"Luis R. Rodriguez" <mcgrof@...e.com>,
	Matt Fleming <matt@...eblueprint.co.uk>,
	Rusty Russell <rusty@...tcorp.com.au>
Subject: [PATCH 05/17] ia64: Set System RAM type and descriptor

From: Toshi Kani <toshi.kani@....com>

Change efi_initialize_iomem_resources() to set 'flags' and 'desc' for
EFI memory types. IORESOURCE_SYSRAM, a modifier bit, is set for System
RAM as IORESOURCE_MEM is already set. IORESOURCE_SYSTEM_RAM is defined
as (IORESOURCE_MEM|IORESOURCE_SYSRAM). I/O resource descriptor is set
for "ACPI Non-volatile Storage" and "Persistent Memory".

Also set IORESOURCE_SYSTEM_RAM for "Kernel code", "Kernel data", and
"Kernel bss".

Signed-off-by: Toshi Kani <toshi.kani@....com>
Acked-by: Tony Luck <tony.luck@...el.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Fenghua Yu <fenghua.yu@...el.com>
Cc: linux-arch@...r.kernel.org
Cc: linux-efi <linux-efi@...r.kernel.org>
Cc: linux-ia64@...r.kernel.org
Cc: linux-mm <linux-mm@...ck.org>
Cc: "Luis R. Rodriguez" <mcgrof@...e.com>
Cc: Matt Fleming <matt@...eblueprint.co.uk>
Cc: Rusty Russell <rusty@...tcorp.com.au>
Link: http://lkml.kernel.org/r/1452020081-26534-5-git-send-email-toshi.kani@hpe.com
Signed-off-by: Borislav Petkov <bp@...e.de>
---
 arch/ia64/kernel/efi.c   | 13 ++++++++++---
 arch/ia64/kernel/setup.c |  6 +++---
 2 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c
index caae3f4e4341..300dac3702f1 100644
--- a/arch/ia64/kernel/efi.c
+++ b/arch/ia64/kernel/efi.c
@@ -1178,7 +1178,7 @@ efi_initialize_iomem_resources(struct resource *code_resource,
 	efi_memory_desc_t *md;
 	u64 efi_desc_size;
 	char *name;
-	unsigned long flags;
+	unsigned long flags, desc;
 
 	efi_map_start = __va(ia64_boot_param->efi_memmap);
 	efi_map_end   = efi_map_start + ia64_boot_param->efi_memmap_size;
@@ -1193,6 +1193,8 @@ efi_initialize_iomem_resources(struct resource *code_resource,
 			continue;
 
 		flags = IORESOURCE_MEM | IORESOURCE_BUSY;
+		desc = IORES_DESC_NONE;
+
 		switch (md->type) {
 
 			case EFI_MEMORY_MAPPED_IO:
@@ -1207,14 +1209,17 @@ efi_initialize_iomem_resources(struct resource *code_resource,
 				if (md->attribute & EFI_MEMORY_WP) {
 					name = "System ROM";
 					flags |= IORESOURCE_READONLY;
-				} else if (md->attribute == EFI_MEMORY_UC)
+				} else if (md->attribute == EFI_MEMORY_UC) {
 					name = "Uncached RAM";
-				else
+				} else {
 					name = "System RAM";
+					flags |= IORESOURCE_SYSRAM;
+				}
 				break;
 
 			case EFI_ACPI_MEMORY_NVS:
 				name = "ACPI Non-volatile Storage";
+				desc = IORES_DESC_ACPI_NV_STORAGE;
 				break;
 
 			case EFI_UNUSABLE_MEMORY:
@@ -1224,6 +1229,7 @@ efi_initialize_iomem_resources(struct resource *code_resource,
 
 			case EFI_PERSISTENT_MEMORY:
 				name = "Persistent Memory";
+				desc = IORES_DESC_PERSISTENT_MEMORY;
 				break;
 
 			case EFI_RESERVED_TYPE:
@@ -1246,6 +1252,7 @@ efi_initialize_iomem_resources(struct resource *code_resource,
 		res->start = md->phys_addr;
 		res->end = md->phys_addr + efi_md_size(md) - 1;
 		res->flags = flags;
+		res->desc = desc;
 
 		if (insert_resource(&iomem_resource, res) < 0)
 			kfree(res);
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
index 4f118b0d3091..2029a38a72ae 100644
--- a/arch/ia64/kernel/setup.c
+++ b/arch/ia64/kernel/setup.c
@@ -80,17 +80,17 @@ unsigned long vga_console_membase;
 
 static struct resource data_resource = {
 	.name	= "Kernel data",
-	.flags	= IORESOURCE_BUSY | IORESOURCE_MEM
+	.flags	= IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM
 };
 
 static struct resource code_resource = {
 	.name	= "Kernel code",
-	.flags	= IORESOURCE_BUSY | IORESOURCE_MEM
+	.flags	= IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM
 };
 
 static struct resource bss_resource = {
 	.name	= "Kernel bss",
-	.flags	= IORESOURCE_BUSY | IORESOURCE_MEM
+	.flags	= IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM
 };
 
 unsigned long ia64_max_cacheline_size;
-- 
2.3.5

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ