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: <tip-f0f4711aa16b82016c0b6e59871934bbd71258da@git.kernel.org>
Date:	Sat, 30 Jan 2016 01:32:50 -0800
From:	tip-bot for Toshi Kani <tipbot@...or.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	toshi.kani@....com, toshi.kani@...com,
	linux-kernel@...r.kernel.org, dan.j.williams@...el.com,
	sfr@...b.auug.org.au, indou.takao@...fujitsu.com,
	linux-mm@...ck.org, mingo@...nel.org, dvlasenk@...hat.com,
	torvalds@...ux-foundation.org, luto@...nel.org,
	joeyli.kernel@...il.com, dzickus@...hat.com,
	akpm@...ux-foundation.org, peterz@...radead.org,
	luto@...capital.net, tglx@...utronix.de, brgerst@...il.com,
	bp@...e.de, dyoung@...hat.com, ross.zwisler@...ux.intel.com,
	mnfhuang@...il.com, hpa@...or.com, mcgrof@...e.com, bp@...en8.de
Subject: [tip:core/resources] x86, kexec, nvdimm: Use walk_iomem_res_desc(
 ) for iomem search

Commit-ID:  f0f4711aa16b82016c0b6e59871934bbd71258da
Gitweb:     http://git.kernel.org/tip/f0f4711aa16b82016c0b6e59871934bbd71258da
Author:     Toshi Kani <toshi.kani@....com>
AuthorDate: Tue, 26 Jan 2016 21:57:30 +0100
Committer:  Ingo Molnar <mingo@...nel.org>
CommitDate: Sat, 30 Jan 2016 09:49:59 +0100

x86, kexec, nvdimm: Use walk_iomem_res_desc() for iomem search

Change the callers of walk_iomem_res() scanning for the
following resources by name to use walk_iomem_res_desc()
instead.

 "ACPI Tables"
 "ACPI Non-volatile Storage"
 "Persistent Memory (legacy)"
 "Crash kernel"

Note, the caller of walk_iomem_res() with "GART" will be removed
in a later patch.

Signed-off-by: Toshi Kani <toshi.kani@....com>
Signed-off-by: Borislav Petkov <bp@...e.de>
Reviewed-by: Dave Young <dyoung@...hat.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Andy Lutomirski <luto@...capital.net>
Cc: Andy Lutomirski <luto@...nel.org>
Cc: Borislav Petkov <bp@...en8.de>
Cc: Brian Gerst <brgerst@...il.com>
Cc: Chun-Yi <joeyli.kernel@...il.com>
Cc: Dan Williams <dan.j.williams@...el.com>
Cc: Denys Vlasenko <dvlasenk@...hat.com>
Cc: Don Zickus <dzickus@...hat.com>
Cc: H. Peter Anvin <hpa@...or.com>
Cc: Lee, Chun-Yi <joeyli.kernel@...il.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Luis R. Rodriguez <mcgrof@...e.com>
Cc: Minfei Huang <mnfhuang@...il.com>
Cc: Peter Zijlstra (Intel) <peterz@...radead.org>
Cc: Ross Zwisler <ross.zwisler@...ux.intel.com>
Cc: Stephen Rothwell <sfr@...b.auug.org.au>
Cc: Takao Indoh <indou.takao@...fujitsu.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Toshi Kani <toshi.kani@...com>
Cc: kexec@...ts.infradead.org
Cc: linux-arch@...r.kernel.org
Cc: linux-mm <linux-mm@...ck.org>
Cc: linux-nvdimm@...ts.01.org
Link: http://lkml.kernel.org/r/1453841853-11383-15-git-send-email-bp@alien8.de
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
 arch/x86/kernel/crash.c | 4 ++--
 arch/x86/kernel/pmem.c  | 4 ++--
 drivers/nvdimm/e820.c   | 2 +-
 kernel/kexec_file.c     | 8 ++++----
 4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c
index 58f3431..35e152e 100644
--- a/arch/x86/kernel/crash.c
+++ b/arch/x86/kernel/crash.c
@@ -599,12 +599,12 @@ int crash_setup_memmap_entries(struct kimage *image, struct boot_params *params)
 	/* Add ACPI tables */
 	cmd.type = E820_ACPI;
 	flags = IORESOURCE_MEM | IORESOURCE_BUSY;
-	walk_iomem_res("ACPI Tables", flags, 0, -1, &cmd,
+	walk_iomem_res_desc(IORES_DESC_ACPI_TABLES, flags, 0, -1, &cmd,
 		       memmap_entry_callback);
 
 	/* Add ACPI Non-volatile Storage */
 	cmd.type = E820_NVS;
-	walk_iomem_res("ACPI Non-volatile Storage", flags, 0, -1, &cmd,
+	walk_iomem_res_desc(IORES_DESC_ACPI_NV_STORAGE, flags, 0, -1, &cmd,
 			memmap_entry_callback);
 
 	/* Add crashk_low_res region */
diff --git a/arch/x86/kernel/pmem.c b/arch/x86/kernel/pmem.c
index 14415af..92f7014 100644
--- a/arch/x86/kernel/pmem.c
+++ b/arch/x86/kernel/pmem.c
@@ -13,11 +13,11 @@ static int found(u64 start, u64 end, void *data)
 
 static __init int register_e820_pmem(void)
 {
-	char *pmem = "Persistent Memory (legacy)";
 	struct platform_device *pdev;
 	int rc;
 
-	rc = walk_iomem_res(pmem, IORESOURCE_MEM, 0, -1, NULL, found);
+	rc = walk_iomem_res_desc(IORES_DESC_PERSISTENT_MEMORY_LEGACY,
+				 IORESOURCE_MEM, 0, -1, NULL, found);
 	if (rc <= 0)
 		return 0;
 
diff --git a/drivers/nvdimm/e820.c b/drivers/nvdimm/e820.c
index b0045a5..95825b3 100644
--- a/drivers/nvdimm/e820.c
+++ b/drivers/nvdimm/e820.c
@@ -55,7 +55,7 @@ static int e820_pmem_probe(struct platform_device *pdev)
 	for (p = iomem_resource.child; p ; p = p->sibling) {
 		struct nd_region_desc ndr_desc;
 
-		if (strncmp(p->name, "Persistent Memory (legacy)", 26) != 0)
+		if (p->desc != IORES_DESC_PERSISTENT_MEMORY_LEGACY)
 			continue;
 
 		memset(&ndr_desc, 0, sizeof(ndr_desc));
diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c
index 2bfcdc0..56b18eb 100644
--- a/kernel/kexec_file.c
+++ b/kernel/kexec_file.c
@@ -524,10 +524,10 @@ int kexec_add_buffer(struct kimage *image, char *buffer, unsigned long bufsz,
 
 	/* Walk the RAM ranges and allocate a suitable range for the buffer */
 	if (image->type == KEXEC_TYPE_CRASH)
-		ret = walk_iomem_res("Crash kernel",
-				     IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY,
-				     crashk_res.start, crashk_res.end, kbuf,
-				     locate_mem_hole_callback);
+		ret = walk_iomem_res_desc(crashk_res.desc,
+				IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY,
+				crashk_res.start, crashk_res.end, kbuf,
+				locate_mem_hole_callback);
 	else
 		ret = walk_system_ram_res(0, -1, kbuf,
 					  locate_mem_hole_callback);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ