All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 01/16] resource: Add System RAM resource type
@ 2015-12-25 22:09 ` Toshi Kani
  0 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2015-12-25 22:09 UTC (permalink / raw)
  To: akpm, bp
  Cc: linux-arch, linux-mm, linux-kernel, Linus Torvalds,
	Rafael J. Wysocki, Dan Williams, Toshi Kani

I/O resource type, IORESOURCE_MEM, is used for all types of
memory-mapped ranges, ex. System RAM, System ROM, Video RAM,
Persistent Memory, PCI Bus, PCI MMCONFIG, ACPI Tables, IOAPIC,
reserved, and so on.  This requires walk_system_ram_range(),
walk_system_ram_res(), and region_intersects() to use strcmp()
against string "System RAM" to search for System RAM ranges in
the iomem table, which is inefficient.  __ioremap_caller() and
reserve_memtype() on x86, for instance, call walk_system_ram_range()
for every request to check if a given range is in System RAM ranges.

However, adding a new I/O resource type for System RAM is not
a viable option [1].  There are approx. 3800 references to
IORESOURCE_MEM in the kernel/drivers, which make it very
difficult to distinguish their usages between new type and
IORESOURCE_MEM.  The I/O resource types are also used by the
PNP subsystem.  Therefore, this patch introduces an extended
I/O resource type, IORESOURCE_SYSTEM_RAM, which consists of
IORESOURCE_MEM and a new modifier flag IORESOURCE_SYSRAM [2].

To keep the code 'if (resource_type(r) == IORESOURCE_MEM)' to
work continuously for System RAM, resource_ext_type() is added
for extracting extended type bit(s).

Link[1]: http://lkml.kernel.org/r/<1449168859.9855.54.camel@hpe.com>
Link[2]: http://lkml.kernel.org/r/<CA+55aFy4WQrWexC4u2LxX9Mw2NVoznw7p3Yh=iF4Xtf7zKWnRw@mail.gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
---
 include/linux/ioport.h |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index 24bea08..4b65d94 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -49,12 +49,19 @@ struct resource {
 #define IORESOURCE_WINDOW	0x00200000	/* forwarded by bridge */
 #define IORESOURCE_MUXED	0x00400000	/* Resource is software muxed */
 
+#define IORESOURCE_EXT_TYPE_BITS 0x01000000	/* Resource extended types */
+#define IORESOURCE_SYSRAM	0x01000000	/* System RAM (modifier) */
+
 #define IORESOURCE_EXCLUSIVE	0x08000000	/* Userland may not map this resource */
+
 #define IORESOURCE_DISABLED	0x10000000
 #define IORESOURCE_UNSET	0x20000000	/* No address assigned yet */
 #define IORESOURCE_AUTO		0x40000000
 #define IORESOURCE_BUSY		0x80000000	/* Driver has marked this resource busy */
 
+/* I/O resource extended types */
+#define IORESOURCE_SYSTEM_RAM		(IORESOURCE_MEM|IORESOURCE_SYSRAM)
+
 /* PnP IRQ specific bits (IORESOURCE_BITS) */
 #define IORESOURCE_IRQ_HIGHEDGE		(1<<0)
 #define IORESOURCE_IRQ_LOWEDGE		(1<<1)
@@ -170,6 +177,10 @@ static inline unsigned long resource_type(const struct resource *res)
 {
 	return res->flags & IORESOURCE_TYPE_BITS;
 }
+static inline unsigned long resource_ext_type(const struct resource *res)
+{
+	return res->flags & IORESOURCE_EXT_TYPE_BITS;
+}
 /* True iff r1 completely contains r2 */
 static inline bool resource_contains(struct resource *r1, struct resource *r2)
 {

^ permalink raw reply related	[flat|nested] 90+ messages in thread

* [PATCH v2 01/16] resource: Add System RAM resource type
@ 2015-12-25 22:09 ` Toshi Kani
  0 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2015-12-25 22:09 UTC (permalink / raw)
  To: akpm, bp
  Cc: linux-arch, linux-mm, linux-kernel, Linus Torvalds,
	Rafael J. Wysocki, Dan Williams, Toshi Kani

I/O resource type, IORESOURCE_MEM, is used for all types of
memory-mapped ranges, ex. System RAM, System ROM, Video RAM,
Persistent Memory, PCI Bus, PCI MMCONFIG, ACPI Tables, IOAPIC,
reserved, and so on.  This requires walk_system_ram_range(),
walk_system_ram_res(), and region_intersects() to use strcmp()
against string "System RAM" to search for System RAM ranges in
the iomem table, which is inefficient.  __ioremap_caller() and
reserve_memtype() on x86, for instance, call walk_system_ram_range()
for every request to check if a given range is in System RAM ranges.

However, adding a new I/O resource type for System RAM is not
a viable option [1].  There are approx. 3800 references to
IORESOURCE_MEM in the kernel/drivers, which make it very
difficult to distinguish their usages between new type and
IORESOURCE_MEM.  The I/O resource types are also used by the
PNP subsystem.  Therefore, this patch introduces an extended
I/O resource type, IORESOURCE_SYSTEM_RAM, which consists of
IORESOURCE_MEM and a new modifier flag IORESOURCE_SYSRAM [2].

To keep the code 'if (resource_type(r) == IORESOURCE_MEM)' to
work continuously for System RAM, resource_ext_type() is added
for extracting extended type bit(s).

Link[1]: http://lkml.kernel.org/r/<1449168859.9855.54.camel@hpe.com>
Link[2]: http://lkml.kernel.org/r/<CA+55aFy4WQrWexC4u2LxX9Mw2NVoznw7p3Yh=iF4Xtf7zKWnRw@mail.gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
---
 include/linux/ioport.h |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index 24bea08..4b65d94 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -49,12 +49,19 @@ struct resource {
 #define IORESOURCE_WINDOW	0x00200000	/* forwarded by bridge */
 #define IORESOURCE_MUXED	0x00400000	/* Resource is software muxed */
 
+#define IORESOURCE_EXT_TYPE_BITS 0x01000000	/* Resource extended types */
+#define IORESOURCE_SYSRAM	0x01000000	/* System RAM (modifier) */
+
 #define IORESOURCE_EXCLUSIVE	0x08000000	/* Userland may not map this resource */
+
 #define IORESOURCE_DISABLED	0x10000000
 #define IORESOURCE_UNSET	0x20000000	/* No address assigned yet */
 #define IORESOURCE_AUTO		0x40000000
 #define IORESOURCE_BUSY		0x80000000	/* Driver has marked this resource busy */
 
+/* I/O resource extended types */
+#define IORESOURCE_SYSTEM_RAM		(IORESOURCE_MEM|IORESOURCE_SYSRAM)
+
 /* PnP IRQ specific bits (IORESOURCE_BITS) */
 #define IORESOURCE_IRQ_HIGHEDGE		(1<<0)
 #define IORESOURCE_IRQ_LOWEDGE		(1<<1)
@@ -170,6 +177,10 @@ static inline unsigned long resource_type(const struct resource *res)
 {
 	return res->flags & IORESOURCE_TYPE_BITS;
 }
+static inline unsigned long resource_ext_type(const struct resource *res)
+{
+	return res->flags & IORESOURCE_EXT_TYPE_BITS;
+}
 /* True iff r1 completely contains r2 */
 static inline bool resource_contains(struct resource *r1, struct resource *r2)
 {

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 90+ messages in thread

* [PATCH v2 02/16] resource: make resource flags handled properly
  2015-12-25 22:09 ` Toshi Kani
@ 2015-12-25 22:09   ` Toshi Kani
  -1 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2015-12-25 22:09 UTC (permalink / raw)
  To: akpm, bp
  Cc: linux-arch, linux-mm, linux-kernel, Linus Torvalds, Dan Williams,
	Rafael J. Wysocki, Toshi Kani

I/O resource flags consist of I/O resource types and modifier
bits.  Therefore, checking an I/O resource type in 'flags' must
be performed with a bitwise operation.

Fix find_next_iomem_res() and region_intersects() that simply
compare 'flags' against a given value.

Also change __request_region() to set 'res->flags' from
resource_type() and resource_ext_type() of the parent, so that
children nodes will inherit the extended I/O resource type.

Link: http://lkml.kernel.org/r/<CA+55aFy4WQrWexC4u2LxX9Mw2NVoznw7p3Yh=iF4Xtf7zKWnRw@mail.gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
---
 kernel/resource.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/kernel/resource.c b/kernel/resource.c
index f150dbb..d30a175 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -358,7 +358,7 @@ static int find_next_iomem_res(struct resource *res, char *name,
 	read_lock(&resource_lock);
 
 	for (p = iomem_resource.child; p; p = next_resource(p, sibling_only)) {
-		if (p->flags != res->flags)
+		if ((p->flags & res->flags) != res->flags)
 			continue;
 		if (name && strcmp(p->name, name))
 			continue;
@@ -519,7 +519,8 @@ int region_intersects(resource_size_t start, size_t size, const char *name)
 
 	read_lock(&resource_lock);
 	for (p = iomem_resource.child; p ; p = p->sibling) {
-		bool is_type = strcmp(p->name, name) == 0 && p->flags == flags;
+		bool is_type = strcmp(p->name, name) == 0 &&
+				((p->flags & flags) == flags);
 
 		if (start >= p->start && start <= p->end)
 			is_type ? type++ : other++;
@@ -1071,7 +1072,7 @@ struct resource * __request_region(struct resource *parent,
 	res->name = name;
 	res->start = start;
 	res->end = start + n - 1;
-	res->flags = resource_type(parent);
+	res->flags = resource_type(parent) | resource_ext_type(parent);
 	res->flags |= IORESOURCE_BUSY | flags;
 
 	write_lock(&resource_lock);

^ permalink raw reply related	[flat|nested] 90+ messages in thread

* [PATCH v2 02/16] resource: make resource flags handled properly
@ 2015-12-25 22:09   ` Toshi Kani
  0 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2015-12-25 22:09 UTC (permalink / raw)
  To: akpm, bp
  Cc: linux-arch, linux-mm, linux-kernel, Linus Torvalds, Dan Williams,
	Rafael J. Wysocki, Toshi Kani

I/O resource flags consist of I/O resource types and modifier
bits.  Therefore, checking an I/O resource type in 'flags' must
be performed with a bitwise operation.

Fix find_next_iomem_res() and region_intersects() that simply
compare 'flags' against a given value.

Also change __request_region() to set 'res->flags' from
resource_type() and resource_ext_type() of the parent, so that
children nodes will inherit the extended I/O resource type.

Link: http://lkml.kernel.org/r/<CA+55aFy4WQrWexC4u2LxX9Mw2NVoznw7p3Yh=iF4Xtf7zKWnRw@mail.gmail.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
---
 kernel/resource.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/kernel/resource.c b/kernel/resource.c
index f150dbb..d30a175 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -358,7 +358,7 @@ static int find_next_iomem_res(struct resource *res, char *name,
 	read_lock(&resource_lock);
 
 	for (p = iomem_resource.child; p; p = next_resource(p, sibling_only)) {
-		if (p->flags != res->flags)
+		if ((p->flags & res->flags) != res->flags)
 			continue;
 		if (name && strcmp(p->name, name))
 			continue;
@@ -519,7 +519,8 @@ int region_intersects(resource_size_t start, size_t size, const char *name)
 
 	read_lock(&resource_lock);
 	for (p = iomem_resource.child; p ; p = p->sibling) {
-		bool is_type = strcmp(p->name, name) == 0 && p->flags == flags;
+		bool is_type = strcmp(p->name, name) == 0 &&
+				((p->flags & flags) == flags);
 
 		if (start >= p->start && start <= p->end)
 			is_type ? type++ : other++;
@@ -1071,7 +1072,7 @@ struct resource * __request_region(struct resource *parent,
 	res->name = name;
 	res->start = start;
 	res->end = start + n - 1;
-	res->flags = resource_type(parent);
+	res->flags = resource_type(parent) | resource_ext_type(parent);
 	res->flags |= IORESOURCE_BUSY | flags;
 
 	write_lock(&resource_lock);

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 90+ messages in thread

* [PATCH v2 03/16] resource: Add I/O resource descriptor
  2015-12-25 22:09 ` Toshi Kani
@ 2015-12-25 22:09   ` Toshi Kani
  -1 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2015-12-25 22:09 UTC (permalink / raw)
  To: akpm, bp
  Cc: linux-arch, linux-mm, linux-kernel, Linus Torvalds, Dan Williams,
	Toshi Kani

walk_iomem_res() and region_intersects() still need to use
strcmp() for searching a resource entry by @name in the
iomem table.

This patch introduces I/O resource descriptor, 'desc' in
struct resoruce, for the iomem search interfaces.  Drivers
can assign their unique descritor to a range when they
support the search interfaces.  Otherwise, 'desc' is set to
IORES_DESC_NONE (0).  This avoids changing most of the drivers
as they typically allocate resource entries statically, or
by calling alloc_resource(), kzalloc(), or alloc_bootmem_low(),
which set the field to zero by default.  A later patch will
address some drivers that use kmalloc() without zero'ing
the field.

Also change release_mem_region_adjustable() to set 'desc'
when its resource entry gets separated.  Other resource
interfaces are also changed to initialize 'desc' explicitly
although alloc_resource() sets it to 0.

Link: http://lkml.kernel.org/r/<20151216181712.GJ29775@pd.tnic>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
---
 include/linux/ioport.h |   19 +++++++++++++++++++
 kernel/resource.c      |    5 +++++
 2 files changed, 24 insertions(+)

diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index 4b65d94..b7350c0 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -20,6 +20,7 @@ struct resource {
 	resource_size_t end;
 	const char *name;
 	unsigned long flags;
+	unsigned long desc;
 	struct resource *parent, *sibling, *child;
 };
 
@@ -112,6 +113,23 @@ struct resource {
 /* PCI control bits.  Shares IORESOURCE_BITS with above PCI ROM.  */
 #define IORESOURCE_PCI_FIXED		(1<<4)	/* Do not move resource */
 
+/*
+ * I/O Resource Descriptors
+ *
+ * Descriptors are used by walk_iomem_res_desc() and region_intersects()
+ * for searching a specific resource range in the iomem table.  Assign
+ * a new descriptor when a resource range supports the search interfaces.
+ * Otherwise, resource.desc must be set to IORES_DESC_NONE (0).
+ */
+enum {
+	IORES_DESC_NONE				= 0,
+	IORES_DESC_CRASH_KERNEL			= 1,
+	IORES_DESC_ACPI_TABLES			= 2,
+	IORES_DESC_ACPI_NV_STORAGE		= 3,
+	IORES_DESC_GART				= 4,
+	IORES_DESC_PERSISTENT_MEMORY		= 5,
+	IORES_DESC_PERSISTENT_MEMORY_LEGACY	= 6,
+};
 
 /* helpers to define resources */
 #define DEFINE_RES_NAMED(_start, _size, _name, _flags)			\
@@ -120,6 +138,7 @@ struct resource {
 		.end = (_start) + (_size) - 1,				\
 		.name = (_name),					\
 		.flags = (_flags),					\
+		.desc = IORES_DESC_NONE,				\
 	}
 
 #define DEFINE_RES_IO_NAMED(_start, _size, _name)			\
diff --git a/kernel/resource.c b/kernel/resource.c
index d30a175..65eca4d 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -949,6 +949,7 @@ static void __init __reserve_region_with_split(struct resource *root,
 	res->start = start;
 	res->end = end;
 	res->flags = IORESOURCE_BUSY;
+	res->desc = IORES_DESC_NONE;
 
 	while (1) {
 
@@ -983,6 +984,7 @@ static void __init __reserve_region_with_split(struct resource *root,
 				next_res->start = conflict->end + 1;
 				next_res->end = end;
 				next_res->flags = IORESOURCE_BUSY;
+				next_res->desc = IORES_DESC_NONE;
 			}
 		} else {
 			res->start = conflict->end + 1;
@@ -1074,6 +1076,7 @@ struct resource * __request_region(struct resource *parent,
 	res->end = start + n - 1;
 	res->flags = resource_type(parent) | resource_ext_type(parent);
 	res->flags |= IORESOURCE_BUSY | flags;
+	res->desc = IORES_DESC_NONE;
 
 	write_lock(&resource_lock);
 
@@ -1238,6 +1241,7 @@ int release_mem_region_adjustable(struct resource *parent,
 			new_res->start = end + 1;
 			new_res->end = res->end;
 			new_res->flags = res->flags;
+			new_res->desc = res->desc;
 			new_res->parent = res->parent;
 			new_res->sibling = res->sibling;
 			new_res->child = NULL;
@@ -1413,6 +1417,7 @@ static int __init reserve_setup(char *str)
 			res->start = io_start;
 			res->end = io_start + io_num - 1;
 			res->flags = IORESOURCE_BUSY;
+			res->desc = IORES_DESC_NONE;
 			res->child = NULL;
 			if (request_resource(res->start >= 0x10000 ? &iomem_resource : &ioport_resource, res) == 0)
 				reserved = x+1;

^ permalink raw reply related	[flat|nested] 90+ messages in thread

* [PATCH v2 03/16] resource: Add I/O resource descriptor
@ 2015-12-25 22:09   ` Toshi Kani
  0 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2015-12-25 22:09 UTC (permalink / raw)
  To: akpm, bp
  Cc: linux-arch, linux-mm, linux-kernel, Linus Torvalds, Dan Williams,
	Toshi Kani

walk_iomem_res() and region_intersects() still need to use
strcmp() for searching a resource entry by @name in the
iomem table.

This patch introduces I/O resource descriptor, 'desc' in
struct resoruce, for the iomem search interfaces.  Drivers
can assign their unique descritor to a range when they
support the search interfaces.  Otherwise, 'desc' is set to
IORES_DESC_NONE (0).  This avoids changing most of the drivers
as they typically allocate resource entries statically, or
by calling alloc_resource(), kzalloc(), or alloc_bootmem_low(),
which set the field to zero by default.  A later patch will
address some drivers that use kmalloc() without zero'ing
the field.

Also change release_mem_region_adjustable() to set 'desc'
when its resource entry gets separated.  Other resource
interfaces are also changed to initialize 'desc' explicitly
although alloc_resource() sets it to 0.

Link: http://lkml.kernel.org/r/<20151216181712.GJ29775@pd.tnic>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
---
 include/linux/ioport.h |   19 +++++++++++++++++++
 kernel/resource.c      |    5 +++++
 2 files changed, 24 insertions(+)

diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index 4b65d94..b7350c0 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -20,6 +20,7 @@ struct resource {
 	resource_size_t end;
 	const char *name;
 	unsigned long flags;
+	unsigned long desc;
 	struct resource *parent, *sibling, *child;
 };
 
@@ -112,6 +113,23 @@ struct resource {
 /* PCI control bits.  Shares IORESOURCE_BITS with above PCI ROM.  */
 #define IORESOURCE_PCI_FIXED		(1<<4)	/* Do not move resource */
 
+/*
+ * I/O Resource Descriptors
+ *
+ * Descriptors are used by walk_iomem_res_desc() and region_intersects()
+ * for searching a specific resource range in the iomem table.  Assign
+ * a new descriptor when a resource range supports the search interfaces.
+ * Otherwise, resource.desc must be set to IORES_DESC_NONE (0).
+ */
+enum {
+	IORES_DESC_NONE				= 0,
+	IORES_DESC_CRASH_KERNEL			= 1,
+	IORES_DESC_ACPI_TABLES			= 2,
+	IORES_DESC_ACPI_NV_STORAGE		= 3,
+	IORES_DESC_GART				= 4,
+	IORES_DESC_PERSISTENT_MEMORY		= 5,
+	IORES_DESC_PERSISTENT_MEMORY_LEGACY	= 6,
+};
 
 /* helpers to define resources */
 #define DEFINE_RES_NAMED(_start, _size, _name, _flags)			\
@@ -120,6 +138,7 @@ struct resource {
 		.end = (_start) + (_size) - 1,				\
 		.name = (_name),					\
 		.flags = (_flags),					\
+		.desc = IORES_DESC_NONE,				\
 	}
 
 #define DEFINE_RES_IO_NAMED(_start, _size, _name)			\
diff --git a/kernel/resource.c b/kernel/resource.c
index d30a175..65eca4d 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -949,6 +949,7 @@ static void __init __reserve_region_with_split(struct resource *root,
 	res->start = start;
 	res->end = end;
 	res->flags = IORESOURCE_BUSY;
+	res->desc = IORES_DESC_NONE;
 
 	while (1) {
 
@@ -983,6 +984,7 @@ static void __init __reserve_region_with_split(struct resource *root,
 				next_res->start = conflict->end + 1;
 				next_res->end = end;
 				next_res->flags = IORESOURCE_BUSY;
+				next_res->desc = IORES_DESC_NONE;
 			}
 		} else {
 			res->start = conflict->end + 1;
@@ -1074,6 +1076,7 @@ struct resource * __request_region(struct resource *parent,
 	res->end = start + n - 1;
 	res->flags = resource_type(parent) | resource_ext_type(parent);
 	res->flags |= IORESOURCE_BUSY | flags;
+	res->desc = IORES_DESC_NONE;
 
 	write_lock(&resource_lock);
 
@@ -1238,6 +1241,7 @@ int release_mem_region_adjustable(struct resource *parent,
 			new_res->start = end + 1;
 			new_res->end = res->end;
 			new_res->flags = res->flags;
+			new_res->desc = res->desc;
 			new_res->parent = res->parent;
 			new_res->sibling = res->sibling;
 			new_res->child = NULL;
@@ -1413,6 +1417,7 @@ static int __init reserve_setup(char *str)
 			res->start = io_start;
 			res->end = io_start + io_num - 1;
 			res->flags = IORESOURCE_BUSY;
+			res->desc = IORES_DESC_NONE;
 			res->child = NULL;
 			if (request_resource(res->start >= 0x10000 ? &iomem_resource : &ioport_resource, res) == 0)
 				reserved = x+1;

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 90+ messages in thread

* [PATCH v2 04/16] x86/e820: Set System RAM type and descriptor
  2015-12-25 22:09 ` Toshi Kani
@ 2015-12-25 22:09   ` Toshi Kani
  -1 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2015-12-25 22:09 UTC (permalink / raw)
  To: akpm, bp; +Cc: linux-arch, linux-mm, linux-kernel, x86, Toshi Kani

Change e820_reserve_resources() to set 'flags' and 'desc' from
e820 types.

IORESOURCE_SYSTEM_RAM is set to 'flags' for System RAM, which
are E820_RESERVED_KERN and E820_RAM.  IORESOURCE_SYSTEM_RAM is
also set to "Kernel data", "Kernel code", and "Kernel bss",
which are children nodes of System RAM.

I/O resource descriptor is set to 'desc' for entries that are
(and will be) target ranges of walk_iomem_res() and
region_intersects().

Cc: Borislav Petkov <bp@alien8.de>
Cc: x86@kernel.org
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
---
 arch/x86/kernel/e820.c  |   38 +++++++++++++++++++++++++++++++++++++-
 arch/x86/kernel/setup.c |    6 +++---
 2 files changed, 40 insertions(+), 4 deletions(-)

diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index 569c1e4..837365f 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -925,6 +925,41 @@ static const char *e820_type_to_string(int e820_type)
 	}
 }
 
+static unsigned long e820_type_to_iomem_type(int e820_type)
+{
+	switch (e820_type) {
+	case E820_RESERVED_KERN:
+	case E820_RAM:
+		return IORESOURCE_SYSTEM_RAM;
+	case E820_ACPI:
+	case E820_NVS:
+	case E820_UNUSABLE:
+	case E820_PRAM:
+	case E820_PMEM:
+	default:
+		return IORESOURCE_MEM;
+	}
+}
+
+static unsigned long e820_type_to_iores_desc(int e820_type)
+{
+	switch (e820_type) {
+	case E820_ACPI:
+		return IORES_DESC_ACPI_TABLES;
+	case E820_NVS:
+		return IORES_DESC_ACPI_NV_STORAGE;
+	case E820_PMEM:
+		return IORES_DESC_PERSISTENT_MEMORY;
+	case E820_PRAM:
+		return IORES_DESC_PERSISTENT_MEMORY_LEGACY;
+	case E820_RESERVED_KERN:
+	case E820_RAM:
+	case E820_UNUSABLE:
+	default:
+		return IORES_DESC_NONE;
+	}
+}
+
 static bool do_mark_busy(u32 type, struct resource *res)
 {
 	/* this is the legacy bios/dos rom-shadow + mmio region */
@@ -967,7 +1002,8 @@ void __init e820_reserve_resources(void)
 		res->start = e820.map[i].addr;
 		res->end = end;
 
-		res->flags = IORESOURCE_MEM;
+		res->flags = e820_type_to_iomem_type(e820.map[i].type);
+		res->desc = e820_type_to_iores_desc(e820.map[i].type);
 
 		/*
 		 * don't register the region that could be conflicted with
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index d2bbe34..a492c30 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -152,21 +152,21 @@ static struct resource data_resource = {
 	.name	= "Kernel data",
 	.start	= 0,
 	.end	= 0,
-	.flags	= IORESOURCE_BUSY | IORESOURCE_MEM
+	.flags	= IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM
 };
 
 static struct resource code_resource = {
 	.name	= "Kernel code",
 	.start	= 0,
 	.end	= 0,
-	.flags	= IORESOURCE_BUSY | IORESOURCE_MEM
+	.flags	= IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM
 };
 
 static struct resource bss_resource = {
 	.name	= "Kernel bss",
 	.start	= 0,
 	.end	= 0,
-	.flags	= IORESOURCE_BUSY | IORESOURCE_MEM
+	.flags	= IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM
 };
 
 

^ permalink raw reply related	[flat|nested] 90+ messages in thread

* [PATCH v2 04/16] x86/e820: Set System RAM type and descriptor
@ 2015-12-25 22:09   ` Toshi Kani
  0 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2015-12-25 22:09 UTC (permalink / raw)
  To: akpm, bp; +Cc: linux-arch, linux-mm, linux-kernel, x86, Toshi Kani

Change e820_reserve_resources() to set 'flags' and 'desc' from
e820 types.

IORESOURCE_SYSTEM_RAM is set to 'flags' for System RAM, which
are E820_RESERVED_KERN and E820_RAM.  IORESOURCE_SYSTEM_RAM is
also set to "Kernel data", "Kernel code", and "Kernel bss",
which are children nodes of System RAM.

I/O resource descriptor is set to 'desc' for entries that are
(and will be) target ranges of walk_iomem_res() and
region_intersects().

Cc: Borislav Petkov <bp@alien8.de>
Cc: x86@kernel.org
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
---
 arch/x86/kernel/e820.c  |   38 +++++++++++++++++++++++++++++++++++++-
 arch/x86/kernel/setup.c |    6 +++---
 2 files changed, 40 insertions(+), 4 deletions(-)

diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index 569c1e4..837365f 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -925,6 +925,41 @@ static const char *e820_type_to_string(int e820_type)
 	}
 }
 
+static unsigned long e820_type_to_iomem_type(int e820_type)
+{
+	switch (e820_type) {
+	case E820_RESERVED_KERN:
+	case E820_RAM:
+		return IORESOURCE_SYSTEM_RAM;
+	case E820_ACPI:
+	case E820_NVS:
+	case E820_UNUSABLE:
+	case E820_PRAM:
+	case E820_PMEM:
+	default:
+		return IORESOURCE_MEM;
+	}
+}
+
+static unsigned long e820_type_to_iores_desc(int e820_type)
+{
+	switch (e820_type) {
+	case E820_ACPI:
+		return IORES_DESC_ACPI_TABLES;
+	case E820_NVS:
+		return IORES_DESC_ACPI_NV_STORAGE;
+	case E820_PMEM:
+		return IORES_DESC_PERSISTENT_MEMORY;
+	case E820_PRAM:
+		return IORES_DESC_PERSISTENT_MEMORY_LEGACY;
+	case E820_RESERVED_KERN:
+	case E820_RAM:
+	case E820_UNUSABLE:
+	default:
+		return IORES_DESC_NONE;
+	}
+}
+
 static bool do_mark_busy(u32 type, struct resource *res)
 {
 	/* this is the legacy bios/dos rom-shadow + mmio region */
@@ -967,7 +1002,8 @@ void __init e820_reserve_resources(void)
 		res->start = e820.map[i].addr;
 		res->end = end;
 
-		res->flags = IORESOURCE_MEM;
+		res->flags = e820_type_to_iomem_type(e820.map[i].type);
+		res->desc = e820_type_to_iores_desc(e820.map[i].type);
 
 		/*
 		 * don't register the region that could be conflicted with
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index d2bbe34..a492c30 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -152,21 +152,21 @@ static struct resource data_resource = {
 	.name	= "Kernel data",
 	.start	= 0,
 	.end	= 0,
-	.flags	= IORESOURCE_BUSY | IORESOURCE_MEM
+	.flags	= IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM
 };
 
 static struct resource code_resource = {
 	.name	= "Kernel code",
 	.start	= 0,
 	.end	= 0,
-	.flags	= IORESOURCE_BUSY | IORESOURCE_MEM
+	.flags	= IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM
 };
 
 static struct resource bss_resource = {
 	.name	= "Kernel bss",
 	.start	= 0,
 	.end	= 0,
-	.flags	= IORESOURCE_BUSY | IORESOURCE_MEM
+	.flags	= IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM
 };
 
 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 90+ messages in thread

* [PATCH v2 05/16] ia64: Set System RAM type and descriptor
  2015-12-25 22:09 ` Toshi Kani
  (?)
@ 2015-12-25 22:09   ` Toshi Kani
  -1 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2015-12-25 22:09 UTC (permalink / raw)
  To: akpm, bp
  Cc: linux-arch, linux-mm, linux-kernel, Tony Luck, linux-ia64, Toshi Kani

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

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

Cc: Tony Luck <tony.luck@intel.com>
Cc: linux-ia64@vger.kernel.org
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
---
 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 caae3f4..300dac3 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 4f118b0..2029a38 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;

^ permalink raw reply related	[flat|nested] 90+ messages in thread

* [PATCH v2 05/16] ia64: Set System RAM type and descriptor
@ 2015-12-25 22:09   ` Toshi Kani
  0 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2015-12-25 22:09 UTC (permalink / raw)
  To: akpm, bp
  Cc: linux-arch, linux-mm, linux-kernel, Tony Luck, linux-ia64, Toshi Kani

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

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

Cc: Tony Luck <tony.luck@intel.com>
Cc: linux-ia64@vger.kernel.org
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
---
 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 caae3f4..300dac3 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 4f118b0..2029a38 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;

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 90+ messages in thread

* [PATCH v2 05/16] ia64: Set System RAM type and descriptor
@ 2015-12-25 22:09   ` Toshi Kani
  0 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2015-12-25 22:09 UTC (permalink / raw)
  To: akpm, bp
  Cc: linux-arch, linux-mm, linux-kernel, Tony Luck, linux-ia64, Toshi Kani

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

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

Cc: Tony Luck <tony.luck@intel.com>
Cc: linux-ia64@vger.kernel.org
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
---
 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 caae3f4..300dac3 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 4f118b0..2029a38 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;

^ permalink raw reply related	[flat|nested] 90+ messages in thread

* [PATCH v2 06/16] arch: Set IORESOURCE_SYSTEM_RAM to System RAM
  2015-12-25 22:09 ` Toshi Kani
@ 2015-12-25 22:09   ` Toshi Kani
  -1 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2015-12-25 22:09 UTC (permalink / raw)
  To: akpm, bp; +Cc: linux-arch, linux-mm, linux-kernel, Toshi Kani

Set IORESOURCE_SYSTEM_RAM to 'flags' of resource ranges with
"System RAM", "Kernel code", "Kernel data", and "Kernel bss".

Note that:
 - IORESOURCE_SYSRAM (i.e. modifier bit) is set to 'flags'
   when IORESOURCE_MEM is already set.  IORESOURCE_SYSTEM_RAM
   is defined as (IORESOURCE_MEM|IORESOURCE_SYSRAM).
 - Some archs do not set 'flags' for children nodes, such as
   "Kernel code".  This patch does not change 'flags' in this
   case.

Cc: linux-arch@vger.kernel.org
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
---
 arch/arm/kernel/setup.c       |    6 +++---
 arch/arm64/kernel/setup.c     |    6 +++---
 arch/avr32/kernel/setup.c     |    6 +++---
 arch/m32r/kernel/setup.c      |    4 ++--
 arch/mips/kernel/setup.c      |   10 ++++++----
 arch/parisc/mm/init.c         |    6 +++---
 arch/powerpc/mm/mem.c         |    2 +-
 arch/s390/kernel/setup.c      |    8 ++++----
 arch/score/kernel/setup.c     |    2 +-
 arch/sh/kernel/setup.c        |    8 ++++----
 arch/sparc/mm/init_64.c       |    8 ++++----
 arch/tile/kernel/setup.c      |   11 ++++++++---
 arch/unicore32/kernel/setup.c |    6 +++---
 13 files changed, 45 insertions(+), 38 deletions(-)

diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 20edd34..ae44e09 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -173,13 +173,13 @@ static struct resource mem_res[] = {
 		.name = "Kernel code",
 		.start = 0,
 		.end = 0,
-		.flags = IORESOURCE_MEM
+		.flags = IORESOURCE_SYSTEM_RAM
 	},
 	{
 		.name = "Kernel data",
 		.start = 0,
 		.end = 0,
-		.flags = IORESOURCE_MEM
+		.flags = IORESOURCE_SYSTEM_RAM
 	}
 };
 
@@ -781,7 +781,7 @@ static void __init request_standard_resources(const struct machine_desc *mdesc)
 		res->name  = "System RAM";
 		res->start = __pfn_to_phys(memblock_region_memory_base_pfn(region));
 		res->end = __pfn_to_phys(memblock_region_memory_end_pfn(region)) - 1;
-		res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
+		res->flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY;
 
 		request_resource(&iomem_resource, res);
 
diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
index 8119479..450987d 100644
--- a/arch/arm64/kernel/setup.c
+++ b/arch/arm64/kernel/setup.c
@@ -73,13 +73,13 @@ static struct resource mem_res[] = {
 		.name = "Kernel code",
 		.start = 0,
 		.end = 0,
-		.flags = IORESOURCE_MEM
+		.flags = IORESOURCE_SYSTEM_RAM
 	},
 	{
 		.name = "Kernel data",
 		.start = 0,
 		.end = 0,
-		.flags = IORESOURCE_MEM
+		.flags = IORESOURCE_SYSTEM_RAM
 	}
 };
 
@@ -210,7 +210,7 @@ static void __init request_standard_resources(void)
 		res->name  = "System RAM";
 		res->start = __pfn_to_phys(memblock_region_memory_base_pfn(region));
 		res->end = __pfn_to_phys(memblock_region_memory_end_pfn(region)) - 1;
-		res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
+		res->flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY;
 
 		request_resource(&iomem_resource, res);
 
diff --git a/arch/avr32/kernel/setup.c b/arch/avr32/kernel/setup.c
index 209ae5a..e692889 100644
--- a/arch/avr32/kernel/setup.c
+++ b/arch/avr32/kernel/setup.c
@@ -49,13 +49,13 @@ static struct resource __initdata kernel_data = {
 	.name	= "Kernel data",
 	.start	= 0,
 	.end	= 0,
-	.flags	= IORESOURCE_MEM,
+	.flags	= IORESOURCE_SYSTEM_RAM,
 };
 static struct resource __initdata kernel_code = {
 	.name	= "Kernel code",
 	.start	= 0,
 	.end	= 0,
-	.flags	= IORESOURCE_MEM,
+	.flags	= IORESOURCE_SYSTEM_RAM,
 	.sibling = &kernel_data,
 };
 
@@ -134,7 +134,7 @@ add_physical_memory(resource_size_t start, resource_size_t end)
 	new->start = start;
 	new->end = end;
 	new->name = "System RAM";
-	new->flags = IORESOURCE_MEM;
+	new->flags = IORESOURCE_SYSTEM_RAM;
 
 	*pprev = new;
 }
diff --git a/arch/m32r/kernel/setup.c b/arch/m32r/kernel/setup.c
index 0392112..5f62ff0 100644
--- a/arch/m32r/kernel/setup.c
+++ b/arch/m32r/kernel/setup.c
@@ -70,14 +70,14 @@ static struct resource data_resource = {
 	.name   = "Kernel data",
 	.start  = 0,
 	.end    = 0,
-	.flags  = IORESOURCE_BUSY | IORESOURCE_MEM
+	.flags  = IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM
 };
 
 static struct resource code_resource = {
 	.name   = "Kernel code",
 	.start  = 0,
 	.end    = 0,
-	.flags  = IORESOURCE_BUSY | IORESOURCE_MEM
+	.flags  = IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM
 };
 
 unsigned long memory_start;
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index 66aac55..c385af1 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -732,21 +732,23 @@ static void __init resource_init(void)
 			end = HIGHMEM_START - 1;
 
 		res = alloc_bootmem(sizeof(struct resource));
+
+		res->start = start;
+		res->end = end;
+		res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
+
 		switch (boot_mem_map.map[i].type) {
 		case BOOT_MEM_RAM:
 		case BOOT_MEM_INIT_RAM:
 		case BOOT_MEM_ROM_DATA:
 			res->name = "System RAM";
+			res->flags |= IORESOURCE_SYSRAM;
 			break;
 		case BOOT_MEM_RESERVED:
 		default:
 			res->name = "reserved";
 		}
 
-		res->start = start;
-		res->end = end;
-
-		res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
 		request_resource(&iomem_resource, res);
 
 		/*
diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
index 1b366c4..3c07d6b 100644
--- a/arch/parisc/mm/init.c
+++ b/arch/parisc/mm/init.c
@@ -55,12 +55,12 @@ signed char pfnnid_map[PFNNID_MAP_MAX] __read_mostly;
 
 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 pdcdata_resource = {
@@ -201,7 +201,7 @@ static void __init setup_bootmem(void)
 		res->name = "System RAM";
 		res->start = pmem_ranges[i].start_pfn << PAGE_SHIFT;
 		res->end = res->start + (pmem_ranges[i].pages << PAGE_SHIFT)-1;
-		res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
+		res->flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY;
 		request_resource(&iomem_resource, res);
 	}
 
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index 22d94c3..e78a2b7 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -541,7 +541,7 @@ static int __init add_system_ram_resources(void)
 			res->name = "System RAM";
 			res->start = base;
 			res->end = base + size - 1;
-			res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
+			res->flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY;
 			WARN_ON(request_resource(&iomem_resource, res) < 0);
 		}
 	}
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index c837bca..b65a883 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -376,17 +376,17 @@ static void __init setup_lowcore(void)
 
 static struct resource code_resource = {
 	.name  = "Kernel code",
-	.flags = IORESOURCE_BUSY | IORESOURCE_MEM,
+	.flags = IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM,
 };
 
 static struct resource data_resource = {
 	.name = "Kernel data",
-	.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,
 };
 
 static struct resource __initdata *standard_resources[] = {
@@ -410,7 +410,7 @@ static void __init setup_resources(void)
 
 	for_each_memblock(memory, reg) {
 		res = alloc_bootmem_low(sizeof(*res));
-		res->flags = IORESOURCE_BUSY | IORESOURCE_MEM;
+		res->flags = IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM;
 
 		res->name = "System RAM";
 		res->start = reg->base;
diff --git a/arch/score/kernel/setup.c b/arch/score/kernel/setup.c
index b48459a..f3a0649 100644
--- a/arch/score/kernel/setup.c
+++ b/arch/score/kernel/setup.c
@@ -101,7 +101,7 @@ static void __init resource_init(void)
 	res->name = "System RAM";
 	res->start = MEMORY_START;
 	res->end = MEMORY_START + MEMORY_SIZE - 1;
-	res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
+	res->flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY;
 	request_resource(&iomem_resource, res);
 
 	request_resource(res, &code_resource);
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c
index de19cfa..3f1c18b 100644
--- a/arch/sh/kernel/setup.c
+++ b/arch/sh/kernel/setup.c
@@ -78,17 +78,17 @@ static char __initdata command_line[COMMAND_LINE_SIZE] = { 0, };
 
 static struct resource code_resource = {
 	.name = "Kernel code",
-	.flags = IORESOURCE_BUSY | IORESOURCE_MEM,
+	.flags = IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM,
 };
 
 static struct resource data_resource = {
 	.name = "Kernel data",
-	.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 memory_start;
@@ -202,7 +202,7 @@ void __init __add_active_range(unsigned int nid, unsigned long start_pfn,
 	res->name = "System RAM";
 	res->start = start;
 	res->end = end - 1;
-	res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
+	res->flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY;
 
 	if (request_resource(&iomem_resource, res)) {
 		pr_err("unable to request memory_resource 0x%lx 0x%lx\n",
diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
index 3025bd5..a02d43d 100644
--- a/arch/sparc/mm/init_64.c
+++ b/arch/sparc/mm/init_64.c
@@ -2862,17 +2862,17 @@ void hugetlb_setup(struct pt_regs *regs)
 
 static struct resource code_resource = {
 	.name	= "Kernel code",
-	.flags	= IORESOURCE_BUSY | IORESOURCE_MEM
+	.flags	= IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM
 };
 
 static struct resource data_resource = {
 	.name	= "Kernel data",
-	.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
 };
 
 static inline resource_size_t compute_kern_paddr(void *addr)
@@ -2908,7 +2908,7 @@ static int __init report_memory(void)
 		res->name = "System RAM";
 		res->start = pavail[i].phys_addr;
 		res->end = pavail[i].phys_addr + pavail[i].reg_size - 1;
-		res->flags = IORESOURCE_BUSY | IORESOURCE_MEM;
+		res->flags = IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM;
 
 		if (insert_resource(&iomem_resource, res) < 0) {
 			pr_warn("Resource insertion failed.\n");
diff --git a/arch/tile/kernel/setup.c b/arch/tile/kernel/setup.c
index 6b755d1..6606fe2 100644
--- a/arch/tile/kernel/setup.c
+++ b/arch/tile/kernel/setup.c
@@ -1632,14 +1632,14 @@ static struct resource data_resource = {
 	.name	= "Kernel data",
 	.start	= 0,
 	.end	= 0,
-	.flags	= IORESOURCE_BUSY | IORESOURCE_MEM
+	.flags	= IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM
 };
 
 static struct resource code_resource = {
 	.name	= "Kernel code",
 	.start	= 0,
 	.end	= 0,
-	.flags	= IORESOURCE_BUSY | IORESOURCE_MEM
+	.flags	= IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM
 };
 
 /*
@@ -1673,10 +1673,15 @@ insert_ram_resource(u64 start_pfn, u64 end_pfn, bool reserved)
 		kzalloc(sizeof(struct resource), GFP_ATOMIC);
 	if (!res)
 		return NULL;
-	res->name = reserved ? "Reserved" : "System RAM";
 	res->start = start_pfn << PAGE_SHIFT;
 	res->end = (end_pfn << PAGE_SHIFT) - 1;
 	res->flags = IORESOURCE_BUSY | IORESOURCE_MEM;
+	if (reserved) {
+		res->name = "Reserved";
+	} else {
+		res->name = "System RAM";
+		res->flags |= IORESOURCE_SYSRAM;
+	}
 	if (insert_resource(&iomem_resource, res)) {
 		kfree(res);
 		return NULL;
diff --git a/arch/unicore32/kernel/setup.c b/arch/unicore32/kernel/setup.c
index 3fa317f..c2bffa5 100644
--- a/arch/unicore32/kernel/setup.c
+++ b/arch/unicore32/kernel/setup.c
@@ -72,13 +72,13 @@ static struct resource mem_res[] = {
 		.name = "Kernel code",
 		.start = 0,
 		.end = 0,
-		.flags = IORESOURCE_MEM
+		.flags = IORESOURCE_SYSTEM_RAM
 	},
 	{
 		.name = "Kernel data",
 		.start = 0,
 		.end = 0,
-		.flags = IORESOURCE_MEM
+		.flags = IORESOURCE_SYSTEM_RAM
 	}
 };
 
@@ -211,7 +211,7 @@ request_standard_resources(struct meminfo *mi)
 		res->name  = "System RAM";
 		res->start = mi->bank[i].start;
 		res->end   = mi->bank[i].start + mi->bank[i].size - 1;
-		res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
+		res->flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY;
 
 		request_resource(&iomem_resource, res);
 

^ permalink raw reply related	[flat|nested] 90+ messages in thread

* [PATCH v2 06/16] arch: Set IORESOURCE_SYSTEM_RAM to System RAM
@ 2015-12-25 22:09   ` Toshi Kani
  0 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2015-12-25 22:09 UTC (permalink / raw)
  To: akpm, bp; +Cc: linux-arch, linux-mm, linux-kernel, Toshi Kani

Set IORESOURCE_SYSTEM_RAM to 'flags' of resource ranges with
"System RAM", "Kernel code", "Kernel data", and "Kernel bss".

Note that:
 - IORESOURCE_SYSRAM (i.e. modifier bit) is set to 'flags'
   when IORESOURCE_MEM is already set.  IORESOURCE_SYSTEM_RAM
   is defined as (IORESOURCE_MEM|IORESOURCE_SYSRAM).
 - Some archs do not set 'flags' for children nodes, such as
   "Kernel code".  This patch does not change 'flags' in this
   case.

Cc: linux-arch@vger.kernel.org
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
---
 arch/arm/kernel/setup.c       |    6 +++---
 arch/arm64/kernel/setup.c     |    6 +++---
 arch/avr32/kernel/setup.c     |    6 +++---
 arch/m32r/kernel/setup.c      |    4 ++--
 arch/mips/kernel/setup.c      |   10 ++++++----
 arch/parisc/mm/init.c         |    6 +++---
 arch/powerpc/mm/mem.c         |    2 +-
 arch/s390/kernel/setup.c      |    8 ++++----
 arch/score/kernel/setup.c     |    2 +-
 arch/sh/kernel/setup.c        |    8 ++++----
 arch/sparc/mm/init_64.c       |    8 ++++----
 arch/tile/kernel/setup.c      |   11 ++++++++---
 arch/unicore32/kernel/setup.c |    6 +++---
 13 files changed, 45 insertions(+), 38 deletions(-)

diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 20edd34..ae44e09 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -173,13 +173,13 @@ static struct resource mem_res[] = {
 		.name = "Kernel code",
 		.start = 0,
 		.end = 0,
-		.flags = IORESOURCE_MEM
+		.flags = IORESOURCE_SYSTEM_RAM
 	},
 	{
 		.name = "Kernel data",
 		.start = 0,
 		.end = 0,
-		.flags = IORESOURCE_MEM
+		.flags = IORESOURCE_SYSTEM_RAM
 	}
 };
 
@@ -781,7 +781,7 @@ static void __init request_standard_resources(const struct machine_desc *mdesc)
 		res->name  = "System RAM";
 		res->start = __pfn_to_phys(memblock_region_memory_base_pfn(region));
 		res->end = __pfn_to_phys(memblock_region_memory_end_pfn(region)) - 1;
-		res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
+		res->flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY;
 
 		request_resource(&iomem_resource, res);
 
diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
index 8119479..450987d 100644
--- a/arch/arm64/kernel/setup.c
+++ b/arch/arm64/kernel/setup.c
@@ -73,13 +73,13 @@ static struct resource mem_res[] = {
 		.name = "Kernel code",
 		.start = 0,
 		.end = 0,
-		.flags = IORESOURCE_MEM
+		.flags = IORESOURCE_SYSTEM_RAM
 	},
 	{
 		.name = "Kernel data",
 		.start = 0,
 		.end = 0,
-		.flags = IORESOURCE_MEM
+		.flags = IORESOURCE_SYSTEM_RAM
 	}
 };
 
@@ -210,7 +210,7 @@ static void __init request_standard_resources(void)
 		res->name  = "System RAM";
 		res->start = __pfn_to_phys(memblock_region_memory_base_pfn(region));
 		res->end = __pfn_to_phys(memblock_region_memory_end_pfn(region)) - 1;
-		res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
+		res->flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY;
 
 		request_resource(&iomem_resource, res);
 
diff --git a/arch/avr32/kernel/setup.c b/arch/avr32/kernel/setup.c
index 209ae5a..e692889 100644
--- a/arch/avr32/kernel/setup.c
+++ b/arch/avr32/kernel/setup.c
@@ -49,13 +49,13 @@ static struct resource __initdata kernel_data = {
 	.name	= "Kernel data",
 	.start	= 0,
 	.end	= 0,
-	.flags	= IORESOURCE_MEM,
+	.flags	= IORESOURCE_SYSTEM_RAM,
 };
 static struct resource __initdata kernel_code = {
 	.name	= "Kernel code",
 	.start	= 0,
 	.end	= 0,
-	.flags	= IORESOURCE_MEM,
+	.flags	= IORESOURCE_SYSTEM_RAM,
 	.sibling = &kernel_data,
 };
 
@@ -134,7 +134,7 @@ add_physical_memory(resource_size_t start, resource_size_t end)
 	new->start = start;
 	new->end = end;
 	new->name = "System RAM";
-	new->flags = IORESOURCE_MEM;
+	new->flags = IORESOURCE_SYSTEM_RAM;
 
 	*pprev = new;
 }
diff --git a/arch/m32r/kernel/setup.c b/arch/m32r/kernel/setup.c
index 0392112..5f62ff0 100644
--- a/arch/m32r/kernel/setup.c
+++ b/arch/m32r/kernel/setup.c
@@ -70,14 +70,14 @@ static struct resource data_resource = {
 	.name   = "Kernel data",
 	.start  = 0,
 	.end    = 0,
-	.flags  = IORESOURCE_BUSY | IORESOURCE_MEM
+	.flags  = IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM
 };
 
 static struct resource code_resource = {
 	.name   = "Kernel code",
 	.start  = 0,
 	.end    = 0,
-	.flags  = IORESOURCE_BUSY | IORESOURCE_MEM
+	.flags  = IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM
 };
 
 unsigned long memory_start;
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index 66aac55..c385af1 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -732,21 +732,23 @@ static void __init resource_init(void)
 			end = HIGHMEM_START - 1;
 
 		res = alloc_bootmem(sizeof(struct resource));
+
+		res->start = start;
+		res->end = end;
+		res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
+
 		switch (boot_mem_map.map[i].type) {
 		case BOOT_MEM_RAM:
 		case BOOT_MEM_INIT_RAM:
 		case BOOT_MEM_ROM_DATA:
 			res->name = "System RAM";
+			res->flags |= IORESOURCE_SYSRAM;
 			break;
 		case BOOT_MEM_RESERVED:
 		default:
 			res->name = "reserved";
 		}
 
-		res->start = start;
-		res->end = end;
-
-		res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
 		request_resource(&iomem_resource, res);
 
 		/*
diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
index 1b366c4..3c07d6b 100644
--- a/arch/parisc/mm/init.c
+++ b/arch/parisc/mm/init.c
@@ -55,12 +55,12 @@ signed char pfnnid_map[PFNNID_MAP_MAX] __read_mostly;
 
 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 pdcdata_resource = {
@@ -201,7 +201,7 @@ static void __init setup_bootmem(void)
 		res->name = "System RAM";
 		res->start = pmem_ranges[i].start_pfn << PAGE_SHIFT;
 		res->end = res->start + (pmem_ranges[i].pages << PAGE_SHIFT)-1;
-		res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
+		res->flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY;
 		request_resource(&iomem_resource, res);
 	}
 
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
index 22d94c3..e78a2b7 100644
--- a/arch/powerpc/mm/mem.c
+++ b/arch/powerpc/mm/mem.c
@@ -541,7 +541,7 @@ static int __init add_system_ram_resources(void)
 			res->name = "System RAM";
 			res->start = base;
 			res->end = base + size - 1;
-			res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
+			res->flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY;
 			WARN_ON(request_resource(&iomem_resource, res) < 0);
 		}
 	}
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index c837bca..b65a883 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -376,17 +376,17 @@ static void __init setup_lowcore(void)
 
 static struct resource code_resource = {
 	.name  = "Kernel code",
-	.flags = IORESOURCE_BUSY | IORESOURCE_MEM,
+	.flags = IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM,
 };
 
 static struct resource data_resource = {
 	.name = "Kernel data",
-	.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,
 };
 
 static struct resource __initdata *standard_resources[] = {
@@ -410,7 +410,7 @@ static void __init setup_resources(void)
 
 	for_each_memblock(memory, reg) {
 		res = alloc_bootmem_low(sizeof(*res));
-		res->flags = IORESOURCE_BUSY | IORESOURCE_MEM;
+		res->flags = IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM;
 
 		res->name = "System RAM";
 		res->start = reg->base;
diff --git a/arch/score/kernel/setup.c b/arch/score/kernel/setup.c
index b48459a..f3a0649 100644
--- a/arch/score/kernel/setup.c
+++ b/arch/score/kernel/setup.c
@@ -101,7 +101,7 @@ static void __init resource_init(void)
 	res->name = "System RAM";
 	res->start = MEMORY_START;
 	res->end = MEMORY_START + MEMORY_SIZE - 1;
-	res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
+	res->flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY;
 	request_resource(&iomem_resource, res);
 
 	request_resource(res, &code_resource);
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c
index de19cfa..3f1c18b 100644
--- a/arch/sh/kernel/setup.c
+++ b/arch/sh/kernel/setup.c
@@ -78,17 +78,17 @@ static char __initdata command_line[COMMAND_LINE_SIZE] = { 0, };
 
 static struct resource code_resource = {
 	.name = "Kernel code",
-	.flags = IORESOURCE_BUSY | IORESOURCE_MEM,
+	.flags = IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM,
 };
 
 static struct resource data_resource = {
 	.name = "Kernel data",
-	.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 memory_start;
@@ -202,7 +202,7 @@ void __init __add_active_range(unsigned int nid, unsigned long start_pfn,
 	res->name = "System RAM";
 	res->start = start;
 	res->end = end - 1;
-	res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
+	res->flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY;
 
 	if (request_resource(&iomem_resource, res)) {
 		pr_err("unable to request memory_resource 0x%lx 0x%lx\n",
diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
index 3025bd5..a02d43d 100644
--- a/arch/sparc/mm/init_64.c
+++ b/arch/sparc/mm/init_64.c
@@ -2862,17 +2862,17 @@ void hugetlb_setup(struct pt_regs *regs)
 
 static struct resource code_resource = {
 	.name	= "Kernel code",
-	.flags	= IORESOURCE_BUSY | IORESOURCE_MEM
+	.flags	= IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM
 };
 
 static struct resource data_resource = {
 	.name	= "Kernel data",
-	.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
 };
 
 static inline resource_size_t compute_kern_paddr(void *addr)
@@ -2908,7 +2908,7 @@ static int __init report_memory(void)
 		res->name = "System RAM";
 		res->start = pavail[i].phys_addr;
 		res->end = pavail[i].phys_addr + pavail[i].reg_size - 1;
-		res->flags = IORESOURCE_BUSY | IORESOURCE_MEM;
+		res->flags = IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM;
 
 		if (insert_resource(&iomem_resource, res) < 0) {
 			pr_warn("Resource insertion failed.\n");
diff --git a/arch/tile/kernel/setup.c b/arch/tile/kernel/setup.c
index 6b755d1..6606fe2 100644
--- a/arch/tile/kernel/setup.c
+++ b/arch/tile/kernel/setup.c
@@ -1632,14 +1632,14 @@ static struct resource data_resource = {
 	.name	= "Kernel data",
 	.start	= 0,
 	.end	= 0,
-	.flags	= IORESOURCE_BUSY | IORESOURCE_MEM
+	.flags	= IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM
 };
 
 static struct resource code_resource = {
 	.name	= "Kernel code",
 	.start	= 0,
 	.end	= 0,
-	.flags	= IORESOURCE_BUSY | IORESOURCE_MEM
+	.flags	= IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM
 };
 
 /*
@@ -1673,10 +1673,15 @@ insert_ram_resource(u64 start_pfn, u64 end_pfn, bool reserved)
 		kzalloc(sizeof(struct resource), GFP_ATOMIC);
 	if (!res)
 		return NULL;
-	res->name = reserved ? "Reserved" : "System RAM";
 	res->start = start_pfn << PAGE_SHIFT;
 	res->end = (end_pfn << PAGE_SHIFT) - 1;
 	res->flags = IORESOURCE_BUSY | IORESOURCE_MEM;
+	if (reserved) {
+		res->name = "Reserved";
+	} else {
+		res->name = "System RAM";
+		res->flags |= IORESOURCE_SYSRAM;
+	}
 	if (insert_resource(&iomem_resource, res)) {
 		kfree(res);
 		return NULL;
diff --git a/arch/unicore32/kernel/setup.c b/arch/unicore32/kernel/setup.c
index 3fa317f..c2bffa5 100644
--- a/arch/unicore32/kernel/setup.c
+++ b/arch/unicore32/kernel/setup.c
@@ -72,13 +72,13 @@ static struct resource mem_res[] = {
 		.name = "Kernel code",
 		.start = 0,
 		.end = 0,
-		.flags = IORESOURCE_MEM
+		.flags = IORESOURCE_SYSTEM_RAM
 	},
 	{
 		.name = "Kernel data",
 		.start = 0,
 		.end = 0,
-		.flags = IORESOURCE_MEM
+		.flags = IORESOURCE_SYSTEM_RAM
 	}
 };
 
@@ -211,7 +211,7 @@ request_standard_resources(struct meminfo *mi)
 		res->name  = "System RAM";
 		res->start = mi->bank[i].start;
 		res->end   = mi->bank[i].start + mi->bank[i].size - 1;
-		res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
+		res->flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY;
 
 		request_resource(&iomem_resource, res);
 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 90+ messages in thread

* [PATCH v2 07/16] kexec: Set IORESOURCE_SYSTEM_RAM to System RAM
  2015-12-25 22:09 ` Toshi Kani
@ 2015-12-25 22:09   ` Toshi Kani
  -1 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2015-12-25 22:09 UTC (permalink / raw)
  To: akpm, bp; +Cc: linux-arch, linux-mm, linux-kernel, Dave Young, Toshi Kani

Set IORESOURCE_SYSTEM_RAM to 'flags' and IORES_DESC_CRASH_KERNEL
to 'desc' of "Crash kernel" resource ranges, which are child
nodes of System RAM.

Change crash_shrink_memory() to set IORESOURCE_SYSTEM_RAM for
a System RAM range.

Change kexec_add_buffer() to call walk_iomem_res() with
IORESOURCE_SYSTEM_RAM type for "Crash kernel".

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Dave Young <dyoung@redhat.com>
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
---
 kernel/kexec_core.c |    8 +++++---
 kernel/kexec_file.c |    2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c
index 11b64a6..80bff05 100644
--- a/kernel/kexec_core.c
+++ b/kernel/kexec_core.c
@@ -66,13 +66,15 @@ struct resource crashk_res = {
 	.name  = "Crash kernel",
 	.start = 0,
 	.end   = 0,
-	.flags = IORESOURCE_BUSY | IORESOURCE_MEM
+	.flags = IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM,
+	.desc  = IORES_DESC_CRASH_KERNEL
 };
 struct resource crashk_low_res = {
 	.name  = "Crash kernel",
 	.start = 0,
 	.end   = 0,
-	.flags = IORESOURCE_BUSY | IORESOURCE_MEM
+	.flags = IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM,
+	.desc  = IORES_DESC_CRASH_KERNEL
 };
 
 int kexec_should_crash(struct task_struct *p)
@@ -934,7 +936,7 @@ int crash_shrink_memory(unsigned long new_size)
 
 	ram_res->start = end;
 	ram_res->end = crashk_res.end;
-	ram_res->flags = IORESOURCE_BUSY | IORESOURCE_MEM;
+	ram_res->flags = IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM;
 	ram_res->name = "System RAM";
 
 	crashk_res.end = end - 1;
diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c
index b70ada0..c245085 100644
--- a/kernel/kexec_file.c
+++ b/kernel/kexec_file.c
@@ -523,7 +523,7 @@ 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_MEM | IORESOURCE_BUSY,
+				     IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY,
 				     crashk_res.start, crashk_res.end, kbuf,
 				     locate_mem_hole_callback);
 	else

^ permalink raw reply related	[flat|nested] 90+ messages in thread

* [PATCH v2 07/16] kexec: Set IORESOURCE_SYSTEM_RAM to System RAM
@ 2015-12-25 22:09   ` Toshi Kani
  0 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2015-12-25 22:09 UTC (permalink / raw)
  To: akpm, bp; +Cc: linux-arch, linux-mm, linux-kernel, Dave Young, Toshi Kani

Set IORESOURCE_SYSTEM_RAM to 'flags' and IORES_DESC_CRASH_KERNEL
to 'desc' of "Crash kernel" resource ranges, which are child
nodes of System RAM.

Change crash_shrink_memory() to set IORESOURCE_SYSTEM_RAM for
a System RAM range.

Change kexec_add_buffer() to call walk_iomem_res() with
IORESOURCE_SYSTEM_RAM type for "Crash kernel".

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Dave Young <dyoung@redhat.com>
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
---
 kernel/kexec_core.c |    8 +++++---
 kernel/kexec_file.c |    2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c
index 11b64a6..80bff05 100644
--- a/kernel/kexec_core.c
+++ b/kernel/kexec_core.c
@@ -66,13 +66,15 @@ struct resource crashk_res = {
 	.name  = "Crash kernel",
 	.start = 0,
 	.end   = 0,
-	.flags = IORESOURCE_BUSY | IORESOURCE_MEM
+	.flags = IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM,
+	.desc  = IORES_DESC_CRASH_KERNEL
 };
 struct resource crashk_low_res = {
 	.name  = "Crash kernel",
 	.start = 0,
 	.end   = 0,
-	.flags = IORESOURCE_BUSY | IORESOURCE_MEM
+	.flags = IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM,
+	.desc  = IORES_DESC_CRASH_KERNEL
 };
 
 int kexec_should_crash(struct task_struct *p)
@@ -934,7 +936,7 @@ int crash_shrink_memory(unsigned long new_size)
 
 	ram_res->start = end;
 	ram_res->end = crashk_res.end;
-	ram_res->flags = IORESOURCE_BUSY | IORESOURCE_MEM;
+	ram_res->flags = IORESOURCE_BUSY | IORESOURCE_SYSTEM_RAM;
 	ram_res->name = "System RAM";
 
 	crashk_res.end = end - 1;
diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c
index b70ada0..c245085 100644
--- a/kernel/kexec_file.c
+++ b/kernel/kexec_file.c
@@ -523,7 +523,7 @@ 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_MEM | IORESOURCE_BUSY,
+				     IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY,
 				     crashk_res.start, crashk_res.end, kbuf,
 				     locate_mem_hole_callback);
 	else

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 90+ messages in thread

* [PATCH v2 08/16] xen, mm: Set IORESOURCE_SYSTEM_RAM to System RAM
  2015-12-25 22:09 ` Toshi Kani
@ 2015-12-25 22:09   ` Toshi Kani
  -1 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2015-12-25 22:09 UTC (permalink / raw)
  To: akpm, bp
  Cc: linux-arch, linux-mm, linux-kernel, Konrad Rzeszutek Wilk,
	xen-devel, Toshi Kani

Set IORESOURCE_SYSTEM_RAM to 'flags' of struct resource entries
with "System RAM".

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: xen-devel@lists.xenproject.org
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
---
 drivers/xen/balloon.c |    2 +-
 mm/memory_hotplug.c   |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
index 12eab50..dc4305b 100644
--- a/drivers/xen/balloon.c
+++ b/drivers/xen/balloon.c
@@ -257,7 +257,7 @@ static struct resource *additional_memory_resource(phys_addr_t size)
 		return NULL;
 
 	res->name = "System RAM";
-	res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
+	res->flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY;
 
 	ret = allocate_resource(&iomem_resource, res,
 				size, 0, -1,
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 67d488a..9458423 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -136,7 +136,7 @@ static struct resource *register_memory_resource(u64 start, u64 size)
 	res->name = "System RAM";
 	res->start = start;
 	res->end = start + size - 1;
-	res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
+	res->flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY;
 	if (request_resource(&iomem_resource, res) < 0) {
 		pr_debug("System RAM resource %pR cannot be added\n", res);
 		kfree(res);

^ permalink raw reply related	[flat|nested] 90+ messages in thread

* [PATCH v2 08/16] xen, mm: Set IORESOURCE_SYSTEM_RAM to System RAM
@ 2015-12-25 22:09   ` Toshi Kani
  0 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2015-12-25 22:09 UTC (permalink / raw)
  To: akpm, bp
  Cc: linux-arch, linux-mm, linux-kernel, Konrad Rzeszutek Wilk,
	xen-devel, Toshi Kani

Set IORESOURCE_SYSTEM_RAM to 'flags' of struct resource entries
with "System RAM".

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: xen-devel@lists.xenproject.org
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
---
 drivers/xen/balloon.c |    2 +-
 mm/memory_hotplug.c   |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
index 12eab50..dc4305b 100644
--- a/drivers/xen/balloon.c
+++ b/drivers/xen/balloon.c
@@ -257,7 +257,7 @@ static struct resource *additional_memory_resource(phys_addr_t size)
 		return NULL;
 
 	res->name = "System RAM";
-	res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
+	res->flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY;
 
 	ret = allocate_resource(&iomem_resource, res,
 				size, 0, -1,
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 67d488a..9458423 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -136,7 +136,7 @@ static struct resource *register_memory_resource(u64 start, u64 size)
 	res->name = "System RAM";
 	res->start = start;
 	res->end = start + size - 1;
-	res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
+	res->flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY;
 	if (request_resource(&iomem_resource, res) < 0) {
 		pr_debug("System RAM resource %pR cannot be added\n", res);
 		kfree(res);

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 90+ messages in thread

* [PATCH v2 08/16] xen, mm: Set IORESOURCE_SYSTEM_RAM to System RAM
  2015-12-25 22:09 ` Toshi Kani
                   ` (7 preceding siblings ...)
  (?)
@ 2015-12-25 22:09 ` Toshi Kani
  -1 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2015-12-25 22:09 UTC (permalink / raw)
  To: akpm, bp; +Cc: linux-arch, Toshi Kani, linux-kernel, linux-mm, xen-devel

Set IORESOURCE_SYSTEM_RAM to 'flags' of struct resource entries
with "System RAM".

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: xen-devel@lists.xenproject.org
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
---
 drivers/xen/balloon.c |    2 +-
 mm/memory_hotplug.c   |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c
index 12eab50..dc4305b 100644
--- a/drivers/xen/balloon.c
+++ b/drivers/xen/balloon.c
@@ -257,7 +257,7 @@ static struct resource *additional_memory_resource(phys_addr_t size)
 		return NULL;
 
 	res->name = "System RAM";
-	res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
+	res->flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY;
 
 	ret = allocate_resource(&iomem_resource, res,
 				size, 0, -1,
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 67d488a..9458423 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -136,7 +136,7 @@ static struct resource *register_memory_resource(u64 start, u64 size)
 	res->name = "System RAM";
 	res->start = start;
 	res->end = start + size - 1;
-	res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
+	res->flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY;
 	if (request_resource(&iomem_resource, res) < 0) {
 		pr_debug("System RAM resource %pR cannot be added\n", res);
 		kfree(res);

^ permalink raw reply related	[flat|nested] 90+ messages in thread

* [PATCH v2 09/16] drivers: Initialize resource entry to zero
  2015-12-25 22:09 ` Toshi Kani
  (?)
@ 2015-12-25 22:09   ` Toshi Kani
  -1 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2015-12-25 22:09 UTC (permalink / raw)
  To: akpm, bp
  Cc: linux-arch, linux-mm, linux-kernel, linux-acpi, linux-parisc,
	linux-sh, Toshi Kani

I/O resource descriptor, 'desc' added to struct resource, needs
to be initialized to zero by default.  Some drivers call kmalloc()
to allocate a resource entry, but does not initialize it to zero
by memset().  Change these drivers to call kzalloc(), instead.

Cc: linux-acpi@vger.kernel.org
Cc: linux-parisc@vger.kernel.org
Cc: linux-sh@vger.kernel.org
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
---
 drivers/acpi/acpi_platform.c       |    2 +-
 drivers/parisc/eisa_enumerator.c   |    4 ++--
 drivers/rapidio/rio.c              |    8 ++++----
 drivers/sh/superhyway/superhyway.c |    2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/acpi/acpi_platform.c b/drivers/acpi/acpi_platform.c
index 296b7a1..b6f7fa3 100644
--- a/drivers/acpi/acpi_platform.c
+++ b/drivers/acpi/acpi_platform.c
@@ -62,7 +62,7 @@ struct platform_device *acpi_create_platform_device(struct acpi_device *adev)
 	if (count < 0) {
 		return NULL;
 	} else if (count > 0) {
-		resources = kmalloc(count * sizeof(struct resource),
+		resources = kzalloc(count * sizeof(struct resource),
 				    GFP_KERNEL);
 		if (!resources) {
 			dev_err(&adev->dev, "No memory for resources\n");
diff --git a/drivers/parisc/eisa_enumerator.c b/drivers/parisc/eisa_enumerator.c
index a656d9e..21905fe 100644
--- a/drivers/parisc/eisa_enumerator.c
+++ b/drivers/parisc/eisa_enumerator.c
@@ -91,7 +91,7 @@ static int configure_memory(const unsigned char *buf,
 	for (i=0;i<HPEE_MEMORY_MAX_ENT;i++) {
 		c = get_8(buf+len);
 		
-		if (NULL != (res = kmalloc(sizeof(struct resource), GFP_KERNEL))) {
+		if (NULL != (res = kzalloc(sizeof(struct resource), GFP_KERNEL))) {
 			int result;
 			
 			res->name = name;
@@ -183,7 +183,7 @@ static int configure_port(const unsigned char *buf, struct resource *io_parent,
 	for (i=0;i<HPEE_PORT_MAX_ENT;i++) {
 		c = get_8(buf+len);
 		
-		if (NULL != (res = kmalloc(sizeof(struct resource), GFP_KERNEL))) {
+		if (NULL != (res = kzalloc(sizeof(struct resource), GFP_KERNEL))) {
 			res->name = board;
 			res->start = get_16(buf+len+1);
 			res->end = get_16(buf+len+1)+(c&HPEE_PORT_SIZE_MASK)+1;
diff --git a/drivers/rapidio/rio.c b/drivers/rapidio/rio.c
index d7b87c6..e220edc 100644
--- a/drivers/rapidio/rio.c
+++ b/drivers/rapidio/rio.c
@@ -117,7 +117,7 @@ int rio_request_inb_mbox(struct rio_mport *mport,
 	if (mport->ops->open_inb_mbox = NULL)
 		goto out;
 
-	res = kmalloc(sizeof(struct resource), GFP_KERNEL);
+	res = kzalloc(sizeof(struct resource), GFP_KERNEL);
 
 	if (res) {
 		rio_init_mbox_res(res, mbox, mbox);
@@ -185,7 +185,7 @@ int rio_request_outb_mbox(struct rio_mport *mport,
 	if (mport->ops->open_outb_mbox = NULL)
 		goto out;
 
-	res = kmalloc(sizeof(struct resource), GFP_KERNEL);
+	res = kzalloc(sizeof(struct resource), GFP_KERNEL);
 
 	if (res) {
 		rio_init_mbox_res(res, mbox, mbox);
@@ -285,7 +285,7 @@ int rio_request_inb_dbell(struct rio_mport *mport,
 {
 	int rc = 0;
 
-	struct resource *res = kmalloc(sizeof(struct resource), GFP_KERNEL);
+	struct resource *res = kzalloc(sizeof(struct resource), GFP_KERNEL);
 
 	if (res) {
 		rio_init_dbell_res(res, start, end);
@@ -360,7 +360,7 @@ int rio_release_inb_dbell(struct rio_mport *mport, u16 start, u16 end)
 struct resource *rio_request_outb_dbell(struct rio_dev *rdev, u16 start,
 					u16 end)
 {
-	struct resource *res = kmalloc(sizeof(struct resource), GFP_KERNEL);
+	struct resource *res = kzalloc(sizeof(struct resource), GFP_KERNEL);
 
 	if (res) {
 		rio_init_dbell_res(res, start, end);
diff --git a/drivers/sh/superhyway/superhyway.c b/drivers/sh/superhyway/superhyway.c
index 2d9e7f3..bb1fb771 100644
--- a/drivers/sh/superhyway/superhyway.c
+++ b/drivers/sh/superhyway/superhyway.c
@@ -66,7 +66,7 @@ int superhyway_add_device(unsigned long base, struct superhyway_device *sdev,
 	superhyway_read_vcr(dev, base, &dev->vcr);
 
 	if (!dev->resource) {
-		dev->resource = kmalloc(sizeof(struct resource), GFP_KERNEL);
+		dev->resource = kzalloc(sizeof(struct resource), GFP_KERNEL);
 		if (!dev->resource) {
 			kfree(dev);
 			return -ENOMEM;

^ permalink raw reply related	[flat|nested] 90+ messages in thread

* [PATCH v2 09/16] drivers: Initialize resource entry to zero
@ 2015-12-25 22:09   ` Toshi Kani
  0 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2015-12-25 22:09 UTC (permalink / raw)
  To: akpm, bp
  Cc: linux-arch, linux-mm, linux-kernel, linux-acpi, linux-parisc,
	linux-sh, Toshi Kani

I/O resource descriptor, 'desc' added to struct resource, needs
to be initialized to zero by default.  Some drivers call kmalloc()
to allocate a resource entry, but does not initialize it to zero
by memset().  Change these drivers to call kzalloc(), instead.

Cc: linux-acpi@vger.kernel.org
Cc: linux-parisc@vger.kernel.org
Cc: linux-sh@vger.kernel.org
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
---
 drivers/acpi/acpi_platform.c       |    2 +-
 drivers/parisc/eisa_enumerator.c   |    4 ++--
 drivers/rapidio/rio.c              |    8 ++++----
 drivers/sh/superhyway/superhyway.c |    2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/acpi/acpi_platform.c b/drivers/acpi/acpi_platform.c
index 296b7a1..b6f7fa3 100644
--- a/drivers/acpi/acpi_platform.c
+++ b/drivers/acpi/acpi_platform.c
@@ -62,7 +62,7 @@ struct platform_device *acpi_create_platform_device(struct acpi_device *adev)
 	if (count < 0) {
 		return NULL;
 	} else if (count > 0) {
-		resources = kmalloc(count * sizeof(struct resource),
+		resources = kzalloc(count * sizeof(struct resource),
 				    GFP_KERNEL);
 		if (!resources) {
 			dev_err(&adev->dev, "No memory for resources\n");
diff --git a/drivers/parisc/eisa_enumerator.c b/drivers/parisc/eisa_enumerator.c
index a656d9e..21905fe 100644
--- a/drivers/parisc/eisa_enumerator.c
+++ b/drivers/parisc/eisa_enumerator.c
@@ -91,7 +91,7 @@ static int configure_memory(const unsigned char *buf,
 	for (i=0;i<HPEE_MEMORY_MAX_ENT;i++) {
 		c = get_8(buf+len);
 		
-		if (NULL != (res = kmalloc(sizeof(struct resource), GFP_KERNEL))) {
+		if (NULL != (res = kzalloc(sizeof(struct resource), GFP_KERNEL))) {
 			int result;
 			
 			res->name = name;
@@ -183,7 +183,7 @@ static int configure_port(const unsigned char *buf, struct resource *io_parent,
 	for (i=0;i<HPEE_PORT_MAX_ENT;i++) {
 		c = get_8(buf+len);
 		
-		if (NULL != (res = kmalloc(sizeof(struct resource), GFP_KERNEL))) {
+		if (NULL != (res = kzalloc(sizeof(struct resource), GFP_KERNEL))) {
 			res->name = board;
 			res->start = get_16(buf+len+1);
 			res->end = get_16(buf+len+1)+(c&HPEE_PORT_SIZE_MASK)+1;
diff --git a/drivers/rapidio/rio.c b/drivers/rapidio/rio.c
index d7b87c6..e220edc 100644
--- a/drivers/rapidio/rio.c
+++ b/drivers/rapidio/rio.c
@@ -117,7 +117,7 @@ int rio_request_inb_mbox(struct rio_mport *mport,
 	if (mport->ops->open_inb_mbox == NULL)
 		goto out;
 
-	res = kmalloc(sizeof(struct resource), GFP_KERNEL);
+	res = kzalloc(sizeof(struct resource), GFP_KERNEL);
 
 	if (res) {
 		rio_init_mbox_res(res, mbox, mbox);
@@ -185,7 +185,7 @@ int rio_request_outb_mbox(struct rio_mport *mport,
 	if (mport->ops->open_outb_mbox == NULL)
 		goto out;
 
-	res = kmalloc(sizeof(struct resource), GFP_KERNEL);
+	res = kzalloc(sizeof(struct resource), GFP_KERNEL);
 
 	if (res) {
 		rio_init_mbox_res(res, mbox, mbox);
@@ -285,7 +285,7 @@ int rio_request_inb_dbell(struct rio_mport *mport,
 {
 	int rc = 0;
 
-	struct resource *res = kmalloc(sizeof(struct resource), GFP_KERNEL);
+	struct resource *res = kzalloc(sizeof(struct resource), GFP_KERNEL);
 
 	if (res) {
 		rio_init_dbell_res(res, start, end);
@@ -360,7 +360,7 @@ int rio_release_inb_dbell(struct rio_mport *mport, u16 start, u16 end)
 struct resource *rio_request_outb_dbell(struct rio_dev *rdev, u16 start,
 					u16 end)
 {
-	struct resource *res = kmalloc(sizeof(struct resource), GFP_KERNEL);
+	struct resource *res = kzalloc(sizeof(struct resource), GFP_KERNEL);
 
 	if (res) {
 		rio_init_dbell_res(res, start, end);
diff --git a/drivers/sh/superhyway/superhyway.c b/drivers/sh/superhyway/superhyway.c
index 2d9e7f3..bb1fb771 100644
--- a/drivers/sh/superhyway/superhyway.c
+++ b/drivers/sh/superhyway/superhyway.c
@@ -66,7 +66,7 @@ int superhyway_add_device(unsigned long base, struct superhyway_device *sdev,
 	superhyway_read_vcr(dev, base, &dev->vcr);
 
 	if (!dev->resource) {
-		dev->resource = kmalloc(sizeof(struct resource), GFP_KERNEL);
+		dev->resource = kzalloc(sizeof(struct resource), GFP_KERNEL);
 		if (!dev->resource) {
 			kfree(dev);
 			return -ENOMEM;

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 90+ messages in thread

* [PATCH v2 09/16] drivers: Initialize resource entry to zero
@ 2015-12-25 22:09   ` Toshi Kani
  0 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2015-12-25 22:09 UTC (permalink / raw)
  To: akpm, bp
  Cc: linux-arch, linux-mm, linux-kernel, linux-acpi, linux-parisc,
	linux-sh, Toshi Kani

I/O resource descriptor, 'desc' added to struct resource, needs
to be initialized to zero by default.  Some drivers call kmalloc()
to allocate a resource entry, but does not initialize it to zero
by memset().  Change these drivers to call kzalloc(), instead.

Cc: linux-acpi@vger.kernel.org
Cc: linux-parisc@vger.kernel.org
Cc: linux-sh@vger.kernel.org
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
---
 drivers/acpi/acpi_platform.c       |    2 +-
 drivers/parisc/eisa_enumerator.c   |    4 ++--
 drivers/rapidio/rio.c              |    8 ++++----
 drivers/sh/superhyway/superhyway.c |    2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/acpi/acpi_platform.c b/drivers/acpi/acpi_platform.c
index 296b7a1..b6f7fa3 100644
--- a/drivers/acpi/acpi_platform.c
+++ b/drivers/acpi/acpi_platform.c
@@ -62,7 +62,7 @@ struct platform_device *acpi_create_platform_device(struct acpi_device *adev)
 	if (count < 0) {
 		return NULL;
 	} else if (count > 0) {
-		resources = kmalloc(count * sizeof(struct resource),
+		resources = kzalloc(count * sizeof(struct resource),
 				    GFP_KERNEL);
 		if (!resources) {
 			dev_err(&adev->dev, "No memory for resources\n");
diff --git a/drivers/parisc/eisa_enumerator.c b/drivers/parisc/eisa_enumerator.c
index a656d9e..21905fe 100644
--- a/drivers/parisc/eisa_enumerator.c
+++ b/drivers/parisc/eisa_enumerator.c
@@ -91,7 +91,7 @@ static int configure_memory(const unsigned char *buf,
 	for (i=0;i<HPEE_MEMORY_MAX_ENT;i++) {
 		c = get_8(buf+len);
 		
-		if (NULL != (res = kmalloc(sizeof(struct resource), GFP_KERNEL))) {
+		if (NULL != (res = kzalloc(sizeof(struct resource), GFP_KERNEL))) {
 			int result;
 			
 			res->name = name;
@@ -183,7 +183,7 @@ static int configure_port(const unsigned char *buf, struct resource *io_parent,
 	for (i=0;i<HPEE_PORT_MAX_ENT;i++) {
 		c = get_8(buf+len);
 		
-		if (NULL != (res = kmalloc(sizeof(struct resource), GFP_KERNEL))) {
+		if (NULL != (res = kzalloc(sizeof(struct resource), GFP_KERNEL))) {
 			res->name = board;
 			res->start = get_16(buf+len+1);
 			res->end = get_16(buf+len+1)+(c&HPEE_PORT_SIZE_MASK)+1;
diff --git a/drivers/rapidio/rio.c b/drivers/rapidio/rio.c
index d7b87c6..e220edc 100644
--- a/drivers/rapidio/rio.c
+++ b/drivers/rapidio/rio.c
@@ -117,7 +117,7 @@ int rio_request_inb_mbox(struct rio_mport *mport,
 	if (mport->ops->open_inb_mbox == NULL)
 		goto out;
 
-	res = kmalloc(sizeof(struct resource), GFP_KERNEL);
+	res = kzalloc(sizeof(struct resource), GFP_KERNEL);
 
 	if (res) {
 		rio_init_mbox_res(res, mbox, mbox);
@@ -185,7 +185,7 @@ int rio_request_outb_mbox(struct rio_mport *mport,
 	if (mport->ops->open_outb_mbox == NULL)
 		goto out;
 
-	res = kmalloc(sizeof(struct resource), GFP_KERNEL);
+	res = kzalloc(sizeof(struct resource), GFP_KERNEL);
 
 	if (res) {
 		rio_init_mbox_res(res, mbox, mbox);
@@ -285,7 +285,7 @@ int rio_request_inb_dbell(struct rio_mport *mport,
 {
 	int rc = 0;
 
-	struct resource *res = kmalloc(sizeof(struct resource), GFP_KERNEL);
+	struct resource *res = kzalloc(sizeof(struct resource), GFP_KERNEL);
 
 	if (res) {
 		rio_init_dbell_res(res, start, end);
@@ -360,7 +360,7 @@ int rio_release_inb_dbell(struct rio_mport *mport, u16 start, u16 end)
 struct resource *rio_request_outb_dbell(struct rio_dev *rdev, u16 start,
 					u16 end)
 {
-	struct resource *res = kmalloc(sizeof(struct resource), GFP_KERNEL);
+	struct resource *res = kzalloc(sizeof(struct resource), GFP_KERNEL);
 
 	if (res) {
 		rio_init_dbell_res(res, start, end);
diff --git a/drivers/sh/superhyway/superhyway.c b/drivers/sh/superhyway/superhyway.c
index 2d9e7f3..bb1fb771 100644
--- a/drivers/sh/superhyway/superhyway.c
+++ b/drivers/sh/superhyway/superhyway.c
@@ -66,7 +66,7 @@ int superhyway_add_device(unsigned long base, struct superhyway_device *sdev,
 	superhyway_read_vcr(dev, base, &dev->vcr);
 
 	if (!dev->resource) {
-		dev->resource = kmalloc(sizeof(struct resource), GFP_KERNEL);
+		dev->resource = kzalloc(sizeof(struct resource), GFP_KERNEL);
 		if (!dev->resource) {
 			kfree(dev);
 			return -ENOMEM;

^ permalink raw reply related	[flat|nested] 90+ messages in thread

* [PATCH v2 10/16] resource: Change walk_system_ram to use System RAM type
  2015-12-25 22:09 ` Toshi Kani
@ 2015-12-25 22:09   ` Toshi Kani
  -1 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2015-12-25 22:09 UTC (permalink / raw)
  To: akpm, bp; +Cc: linux-arch, linux-mm, linux-kernel, Dan Williams, Toshi Kani

Now that all System RAM resource entries have been initialized
to IORESOURCE_SYSTEM_RAM type, change walk_system_ram_res() and
walk_system_ram_range() to call find_next_iomem_res() by setting
IORESOURCE_SYSTEM_RAM to @res.flags and NULL to @name.  With
this change, they walk through the iomem table to find System
RAM ranges without using strcmp().

No functional change is made to the interfaces.

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
---
 kernel/resource.c |   22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/kernel/resource.c b/kernel/resource.c
index 65eca4d..1d3ea50 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -415,9 +415,9 @@ int walk_iomem_res(char *name, unsigned long flags, u64 start, u64 end,
 }
 
 /*
- * This function calls callback against all memory range of "System RAM"
- * which are marked as IORESOURCE_MEM and IORESOUCE_BUSY.
- * Now, this function is only for "System RAM". This function deals with
+ * This function calls callback against all memory range of System RAM
+ * which are marked as IORESOURCE_SYSTEM_RAM and IORESOUCE_BUSY.
+ * Now, this function is only for System RAM. This function deals with
  * full ranges and not pfn. If resources are not pfn aligned, dealing
  * with pfn can truncate ranges.
  */
@@ -430,10 +430,10 @@ int walk_system_ram_res(u64 start, u64 end, void *arg,
 
 	res.start = start;
 	res.end = end;
-	res.flags = IORESOURCE_MEM | IORESOURCE_BUSY;
+	res.flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY;
 	orig_end = res.end;
 	while ((res.start < res.end) &&
-		(!find_next_iomem_res(&res, "System RAM", true))) {
+		(!find_next_iomem_res(&res, NULL, true))) {
 		ret = (*func)(res.start, res.end, arg);
 		if (ret)
 			break;
@@ -446,9 +446,9 @@ int walk_system_ram_res(u64 start, u64 end, void *arg,
 #if !defined(CONFIG_ARCH_HAS_WALK_MEMORY)
 
 /*
- * This function calls callback against all memory range of "System RAM"
- * which are marked as IORESOURCE_MEM and IORESOUCE_BUSY.
- * Now, this function is only for "System RAM".
+ * This function calls callback against all memory range of System RAM
+ * which are marked as IORESOURCE_SYSTEM_RAM and IORESOUCE_BUSY.
+ * Now, this function is only for System RAM.
  */
 int walk_system_ram_range(unsigned long start_pfn, unsigned long nr_pages,
 		void *arg, int (*func)(unsigned long, unsigned long, void *))
@@ -460,10 +460,10 @@ int walk_system_ram_range(unsigned long start_pfn, unsigned long nr_pages,
 
 	res.start = (u64) start_pfn << PAGE_SHIFT;
 	res.end = ((u64)(start_pfn + nr_pages) << PAGE_SHIFT) - 1;
-	res.flags = IORESOURCE_MEM | IORESOURCE_BUSY;
+	res.flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY;
 	orig_end = res.end;
 	while ((res.start < res.end) &&
-		(find_next_iomem_res(&res, "System RAM", true) >= 0)) {
+		(find_next_iomem_res(&res, NULL, true) >= 0)) {
 		pfn = (res.start + PAGE_SIZE - 1) >> PAGE_SHIFT;
 		end_pfn = (res.end + 1) >> PAGE_SHIFT;
 		if (end_pfn > pfn)
@@ -484,7 +484,7 @@ static int __is_ram(unsigned long pfn, unsigned long nr_pages, void *arg)
 }
 /*
  * This generic page_is_ram() returns true if specified address is
- * registered as "System RAM" in iomem_resource list.
+ * registered as System RAM in iomem_resource list.
  */
 int __weak page_is_ram(unsigned long pfn)
 {

^ permalink raw reply related	[flat|nested] 90+ messages in thread

* [PATCH v2 10/16] resource: Change walk_system_ram to use System RAM type
@ 2015-12-25 22:09   ` Toshi Kani
  0 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2015-12-25 22:09 UTC (permalink / raw)
  To: akpm, bp; +Cc: linux-arch, linux-mm, linux-kernel, Dan Williams, Toshi Kani

Now that all System RAM resource entries have been initialized
to IORESOURCE_SYSTEM_RAM type, change walk_system_ram_res() and
walk_system_ram_range() to call find_next_iomem_res() by setting
IORESOURCE_SYSTEM_RAM to @res.flags and NULL to @name.  With
this change, they walk through the iomem table to find System
RAM ranges without using strcmp().

No functional change is made to the interfaces.

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
---
 kernel/resource.c |   22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/kernel/resource.c b/kernel/resource.c
index 65eca4d..1d3ea50 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -415,9 +415,9 @@ int walk_iomem_res(char *name, unsigned long flags, u64 start, u64 end,
 }
 
 /*
- * This function calls callback against all memory range of "System RAM"
- * which are marked as IORESOURCE_MEM and IORESOUCE_BUSY.
- * Now, this function is only for "System RAM". This function deals with
+ * This function calls callback against all memory range of System RAM
+ * which are marked as IORESOURCE_SYSTEM_RAM and IORESOUCE_BUSY.
+ * Now, this function is only for System RAM. This function deals with
  * full ranges and not pfn. If resources are not pfn aligned, dealing
  * with pfn can truncate ranges.
  */
@@ -430,10 +430,10 @@ int walk_system_ram_res(u64 start, u64 end, void *arg,
 
 	res.start = start;
 	res.end = end;
-	res.flags = IORESOURCE_MEM | IORESOURCE_BUSY;
+	res.flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY;
 	orig_end = res.end;
 	while ((res.start < res.end) &&
-		(!find_next_iomem_res(&res, "System RAM", true))) {
+		(!find_next_iomem_res(&res, NULL, true))) {
 		ret = (*func)(res.start, res.end, arg);
 		if (ret)
 			break;
@@ -446,9 +446,9 @@ int walk_system_ram_res(u64 start, u64 end, void *arg,
 #if !defined(CONFIG_ARCH_HAS_WALK_MEMORY)
 
 /*
- * This function calls callback against all memory range of "System RAM"
- * which are marked as IORESOURCE_MEM and IORESOUCE_BUSY.
- * Now, this function is only for "System RAM".
+ * This function calls callback against all memory range of System RAM
+ * which are marked as IORESOURCE_SYSTEM_RAM and IORESOUCE_BUSY.
+ * Now, this function is only for System RAM.
  */
 int walk_system_ram_range(unsigned long start_pfn, unsigned long nr_pages,
 		void *arg, int (*func)(unsigned long, unsigned long, void *))
@@ -460,10 +460,10 @@ int walk_system_ram_range(unsigned long start_pfn, unsigned long nr_pages,
 
 	res.start = (u64) start_pfn << PAGE_SHIFT;
 	res.end = ((u64)(start_pfn + nr_pages) << PAGE_SHIFT) - 1;
-	res.flags = IORESOURCE_MEM | IORESOURCE_BUSY;
+	res.flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY;
 	orig_end = res.end;
 	while ((res.start < res.end) &&
-		(find_next_iomem_res(&res, "System RAM", true) >= 0)) {
+		(find_next_iomem_res(&res, NULL, true) >= 0)) {
 		pfn = (res.start + PAGE_SIZE - 1) >> PAGE_SHIFT;
 		end_pfn = (res.end + 1) >> PAGE_SHIFT;
 		if (end_pfn > pfn)
@@ -484,7 +484,7 @@ static int __is_ram(unsigned long pfn, unsigned long nr_pages, void *arg)
 }
 /*
  * This generic page_is_ram() returns true if specified address is
- * registered as "System RAM" in iomem_resource list.
+ * registered as System RAM in iomem_resource list.
  */
 int __weak page_is_ram(unsigned long pfn)
 {

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 90+ messages in thread

* [PATCH v2 11/16] arm/samsung: Change s3c_pm_run_res() to use System RAM type
  2015-12-25 22:09 ` Toshi Kani
@ 2015-12-25 22:09   ` Toshi Kani
  -1 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2015-12-25 22:09 UTC (permalink / raw)
  To: akpm, bp
  Cc: linux-arch, linux-mm, linux-kernel, Krzysztof Kozlowski,
	linux-samsung-soc, Toshi Kani

Change s3c_pm_run_res() to check with IORESOURCE_SYSTEM_RAM,
instead of strcmp() with "System RAM", to walk through
System RAM ranges in the iomem table.

No functional change is made to the interface.

Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: linux-samsung-soc@vger.kernel.org
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
---
 arch/arm/plat-samsung/pm-check.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/plat-samsung/pm-check.c b/arch/arm/plat-samsung/pm-check.c
index 04aff2c..70f2f69 100644
--- a/arch/arm/plat-samsung/pm-check.c
+++ b/arch/arm/plat-samsung/pm-check.c
@@ -53,8 +53,8 @@ static void s3c_pm_run_res(struct resource *ptr, run_fn_t fn, u32 *arg)
 		if (ptr->child != NULL)
 			s3c_pm_run_res(ptr->child, fn, arg);
 
-		if ((ptr->flags & IORESOURCE_MEM) &&
-		    strcmp(ptr->name, "System RAM") == 0) {
+		if ((ptr->flags & IORESOURCE_SYSTEM_RAM)
+				== IORESOURCE_SYSTEM_RAM) {
 			S3C_PMDBG("Found system RAM at %08lx..%08lx\n",
 				  (unsigned long)ptr->start,
 				  (unsigned long)ptr->end);

^ permalink raw reply related	[flat|nested] 90+ messages in thread

* [PATCH v2 11/16] arm/samsung: Change s3c_pm_run_res() to use System RAM type
@ 2015-12-25 22:09   ` Toshi Kani
  0 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2015-12-25 22:09 UTC (permalink / raw)
  To: akpm, bp
  Cc: linux-arch, linux-mm, linux-kernel, Krzysztof Kozlowski,
	linux-samsung-soc, Toshi Kani

Change s3c_pm_run_res() to check with IORESOURCE_SYSTEM_RAM,
instead of strcmp() with "System RAM", to walk through
System RAM ranges in the iomem table.

No functional change is made to the interface.

Cc: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Cc: linux-samsung-soc@vger.kernel.org
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
---
 arch/arm/plat-samsung/pm-check.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/plat-samsung/pm-check.c b/arch/arm/plat-samsung/pm-check.c
index 04aff2c..70f2f69 100644
--- a/arch/arm/plat-samsung/pm-check.c
+++ b/arch/arm/plat-samsung/pm-check.c
@@ -53,8 +53,8 @@ static void s3c_pm_run_res(struct resource *ptr, run_fn_t fn, u32 *arg)
 		if (ptr->child != NULL)
 			s3c_pm_run_res(ptr->child, fn, arg);
 
-		if ((ptr->flags & IORESOURCE_MEM) &&
-		    strcmp(ptr->name, "System RAM") == 0) {
+		if ((ptr->flags & IORESOURCE_SYSTEM_RAM)
+				== IORESOURCE_SYSTEM_RAM) {
 			S3C_PMDBG("Found system RAM at %08lx..%08lx\n",
 				  (unsigned long)ptr->start,
 				  (unsigned long)ptr->end);

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 90+ messages in thread

* [PATCH v2 12/16] memremap: Change region_intersects() to take @flags and @desc
  2015-12-25 22:09 ` Toshi Kani
@ 2015-12-25 22:09   ` Toshi Kani
  -1 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2015-12-25 22:09 UTC (permalink / raw)
  To: akpm, bp; +Cc: linux-arch, linux-mm, linux-kernel, Dan Williams, Toshi Kani

Change region_intersects() to identify a target with @flags
and @desc, instead of @name with strcmp().

Change the callers of region_intersects(), memremap() and
devm_memremap(), to set IORESOURCE_SYSTEM_RAM to @flags and
IORES_DESC_NONE to @desc for searching System RAM.

Also, export region_intersects() so that the EINJ driver can
call this function in a later patch.

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
---
 include/linux/mm.h |    3 ++-
 kernel/memremap.c  |   13 +++++++------
 kernel/resource.c  |   26 +++++++++++++++-----------
 3 files changed, 24 insertions(+), 18 deletions(-)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index 00bad77..82f6ca9 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -362,7 +362,8 @@ enum {
 	REGION_MIXED,
 };
 
-int region_intersects(resource_size_t offset, size_t size, const char *type);
+int region_intersects(resource_size_t offset, size_t size, unsigned long flags,
+			unsigned long desc);
 
 /* Support for virtually mapped pages */
 struct page *vmalloc_to_page(const void *addr);
diff --git a/kernel/memremap.c b/kernel/memremap.c
index 7658d32..47f3436 100644
--- a/kernel/memremap.c
+++ b/kernel/memremap.c
@@ -44,7 +44,7 @@ static void *try_ram_remap(resource_size_t offset, size_t size)
  * being mapped does not have i/o side effects and the __iomem
  * annotation is not applicable.
  *
- * MEMREMAP_WB - matches the default mapping for "System RAM" on
+ * MEMREMAP_WB - matches the default mapping for System RAM on
  * the architecture.  This is usually a read-allocate write-back cache.
  * Morever, if MEMREMAP_WB is specified and the requested remap region is RAM
  * memremap() will bypass establishing a new mapping and instead return
@@ -53,11 +53,12 @@ static void *try_ram_remap(resource_size_t offset, size_t size)
  * MEMREMAP_WT - establish a mapping whereby writes either bypass the
  * cache or are written through to memory and never exist in a
  * cache-dirty state with respect to program visibility.  Attempts to
- * map "System RAM" with this mapping type will fail.
+ * map System RAM with this mapping type will fail.
  */
 void *memremap(resource_size_t offset, size_t size, unsigned long flags)
 {
-	int is_ram = region_intersects(offset, size, "System RAM");
+	int is_ram = region_intersects(offset, size,
+					IORESOURCE_SYSTEM_RAM, IORES_DESC_NONE);
 	void *addr = NULL;
 
 	if (is_ram == REGION_MIXED) {
@@ -73,7 +74,7 @@ void *memremap(resource_size_t offset, size_t size, unsigned long flags)
 		 * MEMREMAP_WB is special in that it can be satisifed
 		 * from the direct map.  Some archs depend on the
 		 * capability of memremap() to autodetect cases where
-		 * the requested range is potentially in "System RAM"
+		 * the requested range is potentially in System RAM.
 		 */
 		if (is_ram == REGION_INTERSECTS)
 			addr = try_ram_remap(offset, size);
@@ -85,7 +86,7 @@ void *memremap(resource_size_t offset, size_t size, unsigned long flags)
 	 * If we don't have a mapping yet and more request flags are
 	 * pending then we will be attempting to establish a new virtual
 	 * address mapping.  Enforce that this mapping is not aliasing
-	 * "System RAM"
+	 * System RAM.
 	 */
 	if (!addr && is_ram == REGION_INTERSECTS && flags) {
 		WARN_ONCE(1, "memremap attempted on ram %pa size: %#lx\n",
@@ -163,7 +164,7 @@ static void devm_memremap_pages_release(struct device *dev, void *res)
 void *devm_memremap_pages(struct device *dev, struct resource *res)
 {
 	int is_ram = region_intersects(res->start, resource_size(res),
-			"System RAM");
+					IORESOURCE_SYSTEM_RAM, IORES_DESC_NONE);
 	struct page_map *page_map;
 	int error, nid;
 
diff --git a/kernel/resource.c b/kernel/resource.c
index 1d3ea50..52e6380 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -496,31 +496,34 @@ EXPORT_SYMBOL_GPL(page_is_ram);
  * region_intersects() - determine intersection of region with known resources
  * @start: region start address
  * @size: size of region
- * @name: name of resource (in iomem_resource)
+ * @flags: flags of resource (in iomem_resource)
+ * @desc: descriptor of resource (in iomem_resource) or IORES_DESC_NONE
  *
  * Check if the specified region partially overlaps or fully eclipses a
- * resource identified by @name.  Return REGION_DISJOINT if the region
- * does not overlap @name, return REGION_MIXED if the region overlaps
- * @type and another resource, and return REGION_INTERSECTS if the
- * region overlaps @type and no other defined resource. Note, that
- * REGION_INTERSECTS is also returned in the case when the specified
- * region overlaps RAM and undefined memory holes.
+ * resource identified by @flags and @desc (optinal with IORES_DESC_NONE).
+ * Return REGION_DISJOINT if the region does not overlap @flags/@desc,
+ * return REGION_MIXED if the region overlaps @flags/@desc and another
+ * resource, and return REGION_INTERSECTS if the region overlaps @flags/@desc
+ * and no other defined resource. Note, that REGION_INTERSECTS is also
+ * returned in the case when the specified region overlaps RAM and undefined
+ * memory holes.
  *
  * region_intersect() is used by memory remapping functions to ensure
  * the user is not remapping RAM and is a vast speed up over walking
  * through the resource table page by page.
  */
-int region_intersects(resource_size_t start, size_t size, const char *name)
+int region_intersects(resource_size_t start, size_t size, unsigned long flags,
+			unsigned long desc)
 {
-	unsigned long flags = IORESOURCE_MEM | IORESOURCE_BUSY;
 	resource_size_t end = start + size - 1;
 	int type = 0; int other = 0;
 	struct resource *p;
 
 	read_lock(&resource_lock);
 	for (p = iomem_resource.child; p ; p = p->sibling) {
-		bool is_type = strcmp(p->name, name) == 0 &&
-				((p->flags & flags) == flags);
+		bool is_type = (((p->flags & flags) == flags) &&
+				((desc == IORES_DESC_NONE) ||
+				 (desc == p->desc)));
 
 		if (start >= p->start && start <= p->end)
 			is_type ? type++ : other++;
@@ -539,6 +542,7 @@ int region_intersects(resource_size_t start, size_t size, const char *name)
 
 	return REGION_DISJOINT;
 }
+EXPORT_SYMBOL_GPL(region_intersects);
 
 void __weak arch_remove_reservations(struct resource *avail)
 {

^ permalink raw reply related	[flat|nested] 90+ messages in thread

* [PATCH v2 12/16] memremap: Change region_intersects() to take @flags and @desc
@ 2015-12-25 22:09   ` Toshi Kani
  0 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2015-12-25 22:09 UTC (permalink / raw)
  To: akpm, bp; +Cc: linux-arch, linux-mm, linux-kernel, Dan Williams, Toshi Kani

Change region_intersects() to identify a target with @flags
and @desc, instead of @name with strcmp().

Change the callers of region_intersects(), memremap() and
devm_memremap(), to set IORESOURCE_SYSTEM_RAM to @flags and
IORES_DESC_NONE to @desc for searching System RAM.

Also, export region_intersects() so that the EINJ driver can
call this function in a later patch.

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
---
 include/linux/mm.h |    3 ++-
 kernel/memremap.c  |   13 +++++++------
 kernel/resource.c  |   26 +++++++++++++++-----------
 3 files changed, 24 insertions(+), 18 deletions(-)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index 00bad77..82f6ca9 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -362,7 +362,8 @@ enum {
 	REGION_MIXED,
 };
 
-int region_intersects(resource_size_t offset, size_t size, const char *type);
+int region_intersects(resource_size_t offset, size_t size, unsigned long flags,
+			unsigned long desc);
 
 /* Support for virtually mapped pages */
 struct page *vmalloc_to_page(const void *addr);
diff --git a/kernel/memremap.c b/kernel/memremap.c
index 7658d32..47f3436 100644
--- a/kernel/memremap.c
+++ b/kernel/memremap.c
@@ -44,7 +44,7 @@ static void *try_ram_remap(resource_size_t offset, size_t size)
  * being mapped does not have i/o side effects and the __iomem
  * annotation is not applicable.
  *
- * MEMREMAP_WB - matches the default mapping for "System RAM" on
+ * MEMREMAP_WB - matches the default mapping for System RAM on
  * the architecture.  This is usually a read-allocate write-back cache.
  * Morever, if MEMREMAP_WB is specified and the requested remap region is RAM
  * memremap() will bypass establishing a new mapping and instead return
@@ -53,11 +53,12 @@ static void *try_ram_remap(resource_size_t offset, size_t size)
  * MEMREMAP_WT - establish a mapping whereby writes either bypass the
  * cache or are written through to memory and never exist in a
  * cache-dirty state with respect to program visibility.  Attempts to
- * map "System RAM" with this mapping type will fail.
+ * map System RAM with this mapping type will fail.
  */
 void *memremap(resource_size_t offset, size_t size, unsigned long flags)
 {
-	int is_ram = region_intersects(offset, size, "System RAM");
+	int is_ram = region_intersects(offset, size,
+					IORESOURCE_SYSTEM_RAM, IORES_DESC_NONE);
 	void *addr = NULL;
 
 	if (is_ram == REGION_MIXED) {
@@ -73,7 +74,7 @@ void *memremap(resource_size_t offset, size_t size, unsigned long flags)
 		 * MEMREMAP_WB is special in that it can be satisifed
 		 * from the direct map.  Some archs depend on the
 		 * capability of memremap() to autodetect cases where
-		 * the requested range is potentially in "System RAM"
+		 * the requested range is potentially in System RAM.
 		 */
 		if (is_ram == REGION_INTERSECTS)
 			addr = try_ram_remap(offset, size);
@@ -85,7 +86,7 @@ void *memremap(resource_size_t offset, size_t size, unsigned long flags)
 	 * If we don't have a mapping yet and more request flags are
 	 * pending then we will be attempting to establish a new virtual
 	 * address mapping.  Enforce that this mapping is not aliasing
-	 * "System RAM"
+	 * System RAM.
 	 */
 	if (!addr && is_ram == REGION_INTERSECTS && flags) {
 		WARN_ONCE(1, "memremap attempted on ram %pa size: %#lx\n",
@@ -163,7 +164,7 @@ static void devm_memremap_pages_release(struct device *dev, void *res)
 void *devm_memremap_pages(struct device *dev, struct resource *res)
 {
 	int is_ram = region_intersects(res->start, resource_size(res),
-			"System RAM");
+					IORESOURCE_SYSTEM_RAM, IORES_DESC_NONE);
 	struct page_map *page_map;
 	int error, nid;
 
diff --git a/kernel/resource.c b/kernel/resource.c
index 1d3ea50..52e6380 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -496,31 +496,34 @@ EXPORT_SYMBOL_GPL(page_is_ram);
  * region_intersects() - determine intersection of region with known resources
  * @start: region start address
  * @size: size of region
- * @name: name of resource (in iomem_resource)
+ * @flags: flags of resource (in iomem_resource)
+ * @desc: descriptor of resource (in iomem_resource) or IORES_DESC_NONE
  *
  * Check if the specified region partially overlaps or fully eclipses a
- * resource identified by @name.  Return REGION_DISJOINT if the region
- * does not overlap @name, return REGION_MIXED if the region overlaps
- * @type and another resource, and return REGION_INTERSECTS if the
- * region overlaps @type and no other defined resource. Note, that
- * REGION_INTERSECTS is also returned in the case when the specified
- * region overlaps RAM and undefined memory holes.
+ * resource identified by @flags and @desc (optinal with IORES_DESC_NONE).
+ * Return REGION_DISJOINT if the region does not overlap @flags/@desc,
+ * return REGION_MIXED if the region overlaps @flags/@desc and another
+ * resource, and return REGION_INTERSECTS if the region overlaps @flags/@desc
+ * and no other defined resource. Note, that REGION_INTERSECTS is also
+ * returned in the case when the specified region overlaps RAM and undefined
+ * memory holes.
  *
  * region_intersect() is used by memory remapping functions to ensure
  * the user is not remapping RAM and is a vast speed up over walking
  * through the resource table page by page.
  */
-int region_intersects(resource_size_t start, size_t size, const char *name)
+int region_intersects(resource_size_t start, size_t size, unsigned long flags,
+			unsigned long desc)
 {
-	unsigned long flags = IORESOURCE_MEM | IORESOURCE_BUSY;
 	resource_size_t end = start + size - 1;
 	int type = 0; int other = 0;
 	struct resource *p;
 
 	read_lock(&resource_lock);
 	for (p = iomem_resource.child; p ; p = p->sibling) {
-		bool is_type = strcmp(p->name, name) == 0 &&
-				((p->flags & flags) == flags);
+		bool is_type = (((p->flags & flags) == flags) &&
+				((desc == IORES_DESC_NONE) ||
+				 (desc == p->desc)));
 
 		if (start >= p->start && start <= p->end)
 			is_type ? type++ : other++;
@@ -539,6 +542,7 @@ int region_intersects(resource_size_t start, size_t size, const char *name)
 
 	return REGION_DISJOINT;
 }
+EXPORT_SYMBOL_GPL(region_intersects);
 
 void __weak arch_remove_reservations(struct resource *avail)
 {

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 90+ messages in thread

* [PATCH v2 13/16] resource: Add walk_iomem_res_desc()
  2015-12-25 22:09 ` Toshi Kani
@ 2015-12-25 22:09   ` Toshi Kani
  -1 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2015-12-25 22:09 UTC (permalink / raw)
  To: akpm, bp; +Cc: linux-arch, linux-mm, linux-kernel, Dan Williams, Toshi Kani

Add a new interface, walk_iomem_res_desc(), which walks through
the iomem table by identifying a target with @flags and @desc.
This interface provides the same functionality as walk_iomem_res(),
but does not use strcmp() to @name for better efficiency.

walk_iomem_res() is deprecated, but is maintained for backward
compatibility since walk_iomem_res_desc() requires 'desc' of
a target resource entry be initialized with its descriptor ID.

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
---
 include/linux/ioport.h |    3 ++
 kernel/resource.c      |   58 ++++++++++++++++++++++++++++++++++++++++++------
 2 files changed, 54 insertions(+), 7 deletions(-)

diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index b7350c0..c4cd43a 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -269,6 +269,9 @@ extern int
 walk_system_ram_res(u64 start, u64 end, void *arg,
 		    int (*func)(u64, u64, void *));
 extern int
+walk_iomem_res_desc(unsigned long desc, unsigned long flags, u64 start, u64 end,
+		    void *arg, int (*func)(u64, u64, void *));
+extern int
 walk_iomem_res(char *name, unsigned long flags, u64 start, u64 end, void *arg,
 	       int (*func)(u64, u64, void *));
 
diff --git a/kernel/resource.c b/kernel/resource.c
index 52e6380..579b0e1 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -334,13 +334,14 @@ EXPORT_SYMBOL(release_resource);
 
 /*
  * Finds the lowest iomem reosurce exists with-in [res->start.res->end)
- * the caller must specify res->start, res->end, res->flags and "name".
- * If found, returns 0, res is overwritten, if not found, returns -1.
+ * the caller must specify res->start, res->end, res->flags, and optionally
+ * desc and "name".  If found, returns 0, res is overwritten, if not found,
+ * returns -1.
  * This walks through whole tree and not just first level children
  * until and unless first_level_children_only is true.
  */
-static int find_next_iomem_res(struct resource *res, char *name,
-			       bool first_level_children_only)
+static int find_next_iomem_res(struct resource *res, unsigned long desc,
+				char *name, bool first_level_children_only)
 {
 	resource_size_t start, end;
 	struct resource *p;
@@ -360,6 +361,8 @@ static int find_next_iomem_res(struct resource *res, char *name,
 	for (p = iomem_resource.child; p; p = next_resource(p, sibling_only)) {
 		if ((p->flags & res->flags) != res->flags)
 			continue;
+		if ((desc != IORES_DESC_NONE) && (desc != p->desc))
+			continue;
 		if (name && strcmp(p->name, name))
 			continue;
 		if (p->start > end) {
@@ -387,10 +390,51 @@ static int find_next_iomem_res(struct resource *res, char *name,
  * All the memory ranges which overlap start,end and also match flags and
  * name are valid candidates.
  *
+ * @desc: I/O resource descriptor. Use IORES_DESC_NONE to skip this check.
+ * @flags: I/O resource flags
+ * @start: start addr
+ * @end: end addr
+ *
+ * NOTE: For a new descriptor search, define a new IORES_DESC in
+ * <linux/ioport.h> and set it to 'desc' of a target resource entry.
+ */
+int walk_iomem_res_desc(unsigned long desc, unsigned long flags, u64 start,
+		u64 end, void *arg, int (*func)(u64, u64, void *))
+{
+	struct resource res;
+	u64 orig_end;
+	int ret = -1;
+
+	res.start = start;
+	res.end = end;
+	res.flags = flags;
+	orig_end = res.end;
+
+	while ((res.start < res.end) &&
+		(!find_next_iomem_res(&res, desc, NULL, false))) {
+		ret = (*func)(res.start, res.end, arg);
+		if (ret)
+			break;
+		res.start = res.end + 1;
+		res.end = orig_end;
+	}
+
+	return ret;
+}
+
+/*
+ * Walks through iomem resources and calls func() with matching resource
+ * ranges. This walks through whole tree and not just first level children.
+ * All the memory ranges which overlap start,end and also match flags and
+ * name are valid candidates.
+ *
  * @name: name of resource
  * @flags: resource flags
  * @start: start addr
  * @end: end addr
+ *
+ * NOTE: This function is deprecated and should not be used in new code.
+ *       Use walk_iomem_res_desc(), instead.
  */
 int walk_iomem_res(char *name, unsigned long flags, u64 start, u64 end,
 		void *arg, int (*func)(u64, u64, void *))
@@ -404,7 +448,7 @@ int walk_iomem_res(char *name, unsigned long flags, u64 start, u64 end,
 	res.flags = flags;
 	orig_end = res.end;
 	while ((res.start < res.end) &&
-		(!find_next_iomem_res(&res, name, false))) {
+		(!find_next_iomem_res(&res, IORES_DESC_NONE, name, false))) {
 		ret = (*func)(res.start, res.end, arg);
 		if (ret)
 			break;
@@ -433,7 +477,7 @@ int walk_system_ram_res(u64 start, u64 end, void *arg,
 	res.flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY;
 	orig_end = res.end;
 	while ((res.start < res.end) &&
-		(!find_next_iomem_res(&res, NULL, true))) {
+		(!find_next_iomem_res(&res, IORES_DESC_NONE, NULL, true))) {
 		ret = (*func)(res.start, res.end, arg);
 		if (ret)
 			break;
@@ -463,7 +507,7 @@ int walk_system_ram_range(unsigned long start_pfn, unsigned long nr_pages,
 	res.flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY;
 	orig_end = res.end;
 	while ((res.start < res.end) &&
-		(find_next_iomem_res(&res, NULL, true) >= 0)) {
+		(find_next_iomem_res(&res, IORES_DESC_NONE, NULL, true) >= 0)) {
 		pfn = (res.start + PAGE_SIZE - 1) >> PAGE_SHIFT;
 		end_pfn = (res.end + 1) >> PAGE_SHIFT;
 		if (end_pfn > pfn)

^ permalink raw reply related	[flat|nested] 90+ messages in thread

* [PATCH v2 13/16] resource: Add walk_iomem_res_desc()
@ 2015-12-25 22:09   ` Toshi Kani
  0 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2015-12-25 22:09 UTC (permalink / raw)
  To: akpm, bp; +Cc: linux-arch, linux-mm, linux-kernel, Dan Williams, Toshi Kani

Add a new interface, walk_iomem_res_desc(), which walks through
the iomem table by identifying a target with @flags and @desc.
This interface provides the same functionality as walk_iomem_res(),
but does not use strcmp() to @name for better efficiency.

walk_iomem_res() is deprecated, but is maintained for backward
compatibility since walk_iomem_res_desc() requires 'desc' of
a target resource entry be initialized with its descriptor ID.

Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
---
 include/linux/ioport.h |    3 ++
 kernel/resource.c      |   58 ++++++++++++++++++++++++++++++++++++++++++------
 2 files changed, 54 insertions(+), 7 deletions(-)

diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index b7350c0..c4cd43a 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -269,6 +269,9 @@ extern int
 walk_system_ram_res(u64 start, u64 end, void *arg,
 		    int (*func)(u64, u64, void *));
 extern int
+walk_iomem_res_desc(unsigned long desc, unsigned long flags, u64 start, u64 end,
+		    void *arg, int (*func)(u64, u64, void *));
+extern int
 walk_iomem_res(char *name, unsigned long flags, u64 start, u64 end, void *arg,
 	       int (*func)(u64, u64, void *));
 
diff --git a/kernel/resource.c b/kernel/resource.c
index 52e6380..579b0e1 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -334,13 +334,14 @@ EXPORT_SYMBOL(release_resource);
 
 /*
  * Finds the lowest iomem reosurce exists with-in [res->start.res->end)
- * the caller must specify res->start, res->end, res->flags and "name".
- * If found, returns 0, res is overwritten, if not found, returns -1.
+ * the caller must specify res->start, res->end, res->flags, and optionally
+ * desc and "name".  If found, returns 0, res is overwritten, if not found,
+ * returns -1.
  * This walks through whole tree and not just first level children
  * until and unless first_level_children_only is true.
  */
-static int find_next_iomem_res(struct resource *res, char *name,
-			       bool first_level_children_only)
+static int find_next_iomem_res(struct resource *res, unsigned long desc,
+				char *name, bool first_level_children_only)
 {
 	resource_size_t start, end;
 	struct resource *p;
@@ -360,6 +361,8 @@ static int find_next_iomem_res(struct resource *res, char *name,
 	for (p = iomem_resource.child; p; p = next_resource(p, sibling_only)) {
 		if ((p->flags & res->flags) != res->flags)
 			continue;
+		if ((desc != IORES_DESC_NONE) && (desc != p->desc))
+			continue;
 		if (name && strcmp(p->name, name))
 			continue;
 		if (p->start > end) {
@@ -387,10 +390,51 @@ static int find_next_iomem_res(struct resource *res, char *name,
  * All the memory ranges which overlap start,end and also match flags and
  * name are valid candidates.
  *
+ * @desc: I/O resource descriptor. Use IORES_DESC_NONE to skip this check.
+ * @flags: I/O resource flags
+ * @start: start addr
+ * @end: end addr
+ *
+ * NOTE: For a new descriptor search, define a new IORES_DESC in
+ * <linux/ioport.h> and set it to 'desc' of a target resource entry.
+ */
+int walk_iomem_res_desc(unsigned long desc, unsigned long flags, u64 start,
+		u64 end, void *arg, int (*func)(u64, u64, void *))
+{
+	struct resource res;
+	u64 orig_end;
+	int ret = -1;
+
+	res.start = start;
+	res.end = end;
+	res.flags = flags;
+	orig_end = res.end;
+
+	while ((res.start < res.end) &&
+		(!find_next_iomem_res(&res, desc, NULL, false))) {
+		ret = (*func)(res.start, res.end, arg);
+		if (ret)
+			break;
+		res.start = res.end + 1;
+		res.end = orig_end;
+	}
+
+	return ret;
+}
+
+/*
+ * Walks through iomem resources and calls func() with matching resource
+ * ranges. This walks through whole tree and not just first level children.
+ * All the memory ranges which overlap start,end and also match flags and
+ * name are valid candidates.
+ *
  * @name: name of resource
  * @flags: resource flags
  * @start: start addr
  * @end: end addr
+ *
+ * NOTE: This function is deprecated and should not be used in new code.
+ *       Use walk_iomem_res_desc(), instead.
  */
 int walk_iomem_res(char *name, unsigned long flags, u64 start, u64 end,
 		void *arg, int (*func)(u64, u64, void *))
@@ -404,7 +448,7 @@ int walk_iomem_res(char *name, unsigned long flags, u64 start, u64 end,
 	res.flags = flags;
 	orig_end = res.end;
 	while ((res.start < res.end) &&
-		(!find_next_iomem_res(&res, name, false))) {
+		(!find_next_iomem_res(&res, IORES_DESC_NONE, name, false))) {
 		ret = (*func)(res.start, res.end, arg);
 		if (ret)
 			break;
@@ -433,7 +477,7 @@ int walk_system_ram_res(u64 start, u64 end, void *arg,
 	res.flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY;
 	orig_end = res.end;
 	while ((res.start < res.end) &&
-		(!find_next_iomem_res(&res, NULL, true))) {
+		(!find_next_iomem_res(&res, IORES_DESC_NONE, NULL, true))) {
 		ret = (*func)(res.start, res.end, arg);
 		if (ret)
 			break;
@@ -463,7 +507,7 @@ int walk_system_ram_range(unsigned long start_pfn, unsigned long nr_pages,
 	res.flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY;
 	orig_end = res.end;
 	while ((res.start < res.end) &&
-		(find_next_iomem_res(&res, NULL, true) >= 0)) {
+		(find_next_iomem_res(&res, IORES_DESC_NONE, NULL, true) >= 0)) {
 		pfn = (res.start + PAGE_SIZE - 1) >> PAGE_SHIFT;
 		end_pfn = (res.end + 1) >> PAGE_SHIFT;
 		if (end_pfn > pfn)

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 90+ messages in thread

* [PATCH v2 14/16] x86,nvdimm,kexec: Use walk_iomem_res_desc() for iomem search
  2015-12-25 22:09 ` Toshi Kani
  (?)
@ 2015-12-25 22:09   ` Toshi Kani
  -1 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2015-12-25 22:09 UTC (permalink / raw)
  To: akpm, bp
  Cc: linux-arch, linux-mm, linux-kernel, Dan Williams, Dave Young,
	x86, linux-nvdimm, Toshi Kani

Change to call walk_iomem_res_desc() for searching resource entries
with the following names:
 "ACPI Tables"
 "ACPI Non-volatile Storage"
 "Persistent Memory (legacy)"
 "Crash kernel"

Note, the caller of walk_iomem_res() with "GART" is left unchanged
because this entry may be initialized by out-of-tree drivers, which
do not have 'desc' set to IORES_DESC_GART.

Cc: Borislav Petkov <bp@alien8.de>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: x86@kernel.org
Cc: linux-nvdimm@lists.01.org
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
---
 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 2c1910f..082373b 100644
--- a/arch/x86/kernel/crash.c
+++ b/arch/x86/kernel/crash.c
@@ -588,12 +588,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 c245085..e2bd737 100644
--- a/kernel/kexec_file.c
+++ b/kernel/kexec_file.c
@@ -522,10 +522,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(IORES_DESC_CRASH_KERNEL,
+				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);

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 90+ messages in thread

* [PATCH v2 14/16] x86,nvdimm,kexec: Use walk_iomem_res_desc() for iomem search
@ 2015-12-25 22:09   ` Toshi Kani
  0 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2015-12-25 22:09 UTC (permalink / raw)
  To: akpm, bp
  Cc: linux-arch, linux-mm, linux-kernel, Dan Williams, Dave Young,
	x86, linux-nvdimm, Toshi Kani

Change to call walk_iomem_res_desc() for searching resource entries
with the following names:
 "ACPI Tables"
 "ACPI Non-volatile Storage"
 "Persistent Memory (legacy)"
 "Crash kernel"

Note, the caller of walk_iomem_res() with "GART" is left unchanged
because this entry may be initialized by out-of-tree drivers, which
do not have 'desc' set to IORES_DESC_GART.

Cc: Borislav Petkov <bp@alien8.de>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: x86@kernel.org
Cc: linux-nvdimm@lists.01.org
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
---
 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 2c1910f..082373b 100644
--- a/arch/x86/kernel/crash.c
+++ b/arch/x86/kernel/crash.c
@@ -588,12 +588,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 c245085..e2bd737 100644
--- a/kernel/kexec_file.c
+++ b/kernel/kexec_file.c
@@ -522,10 +522,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(IORES_DESC_CRASH_KERNEL,
+				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);

^ permalink raw reply related	[flat|nested] 90+ messages in thread

* [PATCH v2 14/16] x86,nvdimm,kexec: Use walk_iomem_res_desc() for iomem search
@ 2015-12-25 22:09   ` Toshi Kani
  0 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2015-12-25 22:09 UTC (permalink / raw)
  To: akpm, bp
  Cc: linux-arch, linux-mm, linux-kernel, Dan Williams, Dave Young,
	x86, linux-nvdimm, Toshi Kani

Change to call walk_iomem_res_desc() for searching resource entries
with the following names:
 "ACPI Tables"
 "ACPI Non-volatile Storage"
 "Persistent Memory (legacy)"
 "Crash kernel"

Note, the caller of walk_iomem_res() with "GART" is left unchanged
because this entry may be initialized by out-of-tree drivers, which
do not have 'desc' set to IORES_DESC_GART.

Cc: Borislav Petkov <bp@alien8.de>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: x86@kernel.org
Cc: linux-nvdimm@lists.01.org
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
---
 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 2c1910f..082373b 100644
--- a/arch/x86/kernel/crash.c
+++ b/arch/x86/kernel/crash.c
@@ -588,12 +588,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 c245085..e2bd737 100644
--- a/kernel/kexec_file.c
+++ b/kernel/kexec_file.c
@@ -522,10 +522,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(IORES_DESC_CRASH_KERNEL,
+				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);

^ permalink raw reply related	[flat|nested] 90+ messages in thread

* [PATCH v2 15/16] checkpatch: Add warning on deprecated walk_iomem_res
  2015-12-25 22:09 ` Toshi Kani
@ 2015-12-25 22:09   ` Toshi Kani
  -1 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2015-12-25 22:09 UTC (permalink / raw)
  To: akpm, bp
  Cc: linux-arch, linux-mm, linux-kernel, Andy Whitcroft, Joe Perches,
	Toshi Kani

Use of walk_iomem_res() is deprecated in new code.  Change
checkpatch.pl to check new use of walk_iomem_res() and suggest
to use walk_iomem_res_desc() instead.

Cc: Andy Whitcroft <apw@canonical.com>
Cc: Joe Perches <joe@perches.com>
Cc: Borislav Petkov <bp@alien8.de>
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
---
 scripts/checkpatch.pl |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 2b3c228..07a2dbe 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3424,6 +3424,12 @@ sub process {
 			}
 		}
 
+# check for uses of walk_iomem_res()
+		if ($line =~ /\bwalk_iomem_res\(/) {
+			WARN("walk_iomem_res",
+			     "Use of walk_iomem_res is deprecated, please use walk_iomem_res_desc instead\n" . $herecurr)
+		}
+
 # check for new typedefs, only function parameters and sparse annotations
 # make sense.
 		if ($line =~ /\btypedef\s/ &&

^ permalink raw reply related	[flat|nested] 90+ messages in thread

* [PATCH v2 15/16] checkpatch: Add warning on deprecated walk_iomem_res
@ 2015-12-25 22:09   ` Toshi Kani
  0 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2015-12-25 22:09 UTC (permalink / raw)
  To: akpm, bp
  Cc: linux-arch, linux-mm, linux-kernel, Andy Whitcroft, Joe Perches,
	Toshi Kani

Use of walk_iomem_res() is deprecated in new code.  Change
checkpatch.pl to check new use of walk_iomem_res() and suggest
to use walk_iomem_res_desc() instead.

Cc: Andy Whitcroft <apw@canonical.com>
Cc: Joe Perches <joe@perches.com>
Cc: Borislav Petkov <bp@alien8.de>
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
---
 scripts/checkpatch.pl |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 2b3c228..07a2dbe 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3424,6 +3424,12 @@ sub process {
 			}
 		}
 
+# check for uses of walk_iomem_res()
+		if ($line =~ /\bwalk_iomem_res\(/) {
+			WARN("walk_iomem_res",
+			     "Use of walk_iomem_res is deprecated, please use walk_iomem_res_desc instead\n" . $herecurr)
+		}
+
 # check for new typedefs, only function parameters and sparse annotations
 # make sense.
 		if ($line =~ /\btypedef\s/ &&

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 90+ messages in thread

* [PATCH v2 16/16] ACPI/EINJ: Allow memory error injection to NVDIMM
  2015-12-25 22:09 ` Toshi Kani
  (?)
@ 2015-12-25 22:09   ` Toshi Kani
  -1 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2015-12-25 22:09 UTC (permalink / raw)
  To: akpm, bp
  Cc: linux-arch, linux-mm, linux-kernel, Rafael J. Wysocki,
	Vishal Verma, Tony Luck, Dan Williams, linux-nvdimm, linux-acpi,
	Toshi Kani

In the case of memory error injection, einj_error_inject() checks
if a target address is System RAM.  Change this check to allow
injecting a memory error to NVDIMM by calling region_intersects()
with IORES_DESC_PERSISTENT_MEMORY.  This enables memory error
testing on both System RAM and NVDIMM.

In addition, page_is_ram() is replaced with region_intersects()
with IORESOURCE_SYSTEM_RAM, so that it can verify a target address
range with the requested size.

Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Vishal Verma <vishal.l.verma@intel.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: linux-nvdimm@lists.01.org
Cc: linux-acpi@vger.kernel.org
Acked-by: Tony Luck <tony.luck@intel.com>
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
---
 drivers/acpi/apei/einj.c |   15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/acpi/apei/einj.c b/drivers/acpi/apei/einj.c
index 0431883..16cae66 100644
--- a/drivers/acpi/apei/einj.c
+++ b/drivers/acpi/apei/einj.c
@@ -519,7 +519,7 @@ static int einj_error_inject(u32 type, u32 flags, u64 param1, u64 param2,
 			     u64 param3, u64 param4)
 {
 	int rc;
-	unsigned long pfn;
+	u64 base_addr, size;
 
 	/* If user manually set "flags", make sure it is legal */
 	if (flags && (flags &
@@ -545,10 +545,17 @@ static int einj_error_inject(u32 type, u32 flags, u64 param1, u64 param2,
 	/*
 	 * Disallow crazy address masks that give BIOS leeway to pick
 	 * injection address almost anywhere. Insist on page or
-	 * better granularity and that target address is normal RAM.
+	 * better granularity and that target address is normal RAM or
+	 * NVDIMM.
 	 */
-	pfn = PFN_DOWN(param1 & param2);
-	if (!page_is_ram(pfn) || ((param2 & PAGE_MASK) != PAGE_MASK))
+	base_addr = param1 & param2;
+	size = ~param2 + 1;
+
+	if (((param2 & PAGE_MASK) != PAGE_MASK) ||
+	    ((region_intersects(base_addr, size, IORESOURCE_SYSTEM_RAM,
+			IORES_DESC_NONE) != REGION_INTERSECTS) &&
+	     (region_intersects(base_addr, size, IORESOURCE_MEM,
+			IORES_DESC_PERSISTENT_MEMORY) != REGION_INTERSECTS)))
 		return -EINVAL;
 
 inject:

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 90+ messages in thread

* [PATCH v2 16/16] ACPI/EINJ: Allow memory error injection to NVDIMM
@ 2015-12-25 22:09   ` Toshi Kani
  0 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2015-12-25 22:09 UTC (permalink / raw)
  To: akpm, bp
  Cc: linux-arch, linux-mm, linux-kernel, Rafael J. Wysocki,
	Vishal Verma, Tony Luck, Dan Williams, linux-nvdimm, linux-acpi,
	Toshi Kani

In the case of memory error injection, einj_error_inject() checks
if a target address is System RAM.  Change this check to allow
injecting a memory error to NVDIMM by calling region_intersects()
with IORES_DESC_PERSISTENT_MEMORY.  This enables memory error
testing on both System RAM and NVDIMM.

In addition, page_is_ram() is replaced with region_intersects()
with IORESOURCE_SYSTEM_RAM, so that it can verify a target address
range with the requested size.

Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Vishal Verma <vishal.l.verma@intel.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: linux-nvdimm@lists.01.org
Cc: linux-acpi@vger.kernel.org
Acked-by: Tony Luck <tony.luck@intel.com>
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
---
 drivers/acpi/apei/einj.c |   15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/acpi/apei/einj.c b/drivers/acpi/apei/einj.c
index 0431883..16cae66 100644
--- a/drivers/acpi/apei/einj.c
+++ b/drivers/acpi/apei/einj.c
@@ -519,7 +519,7 @@ static int einj_error_inject(u32 type, u32 flags, u64 param1, u64 param2,
 			     u64 param3, u64 param4)
 {
 	int rc;
-	unsigned long pfn;
+	u64 base_addr, size;
 
 	/* If user manually set "flags", make sure it is legal */
 	if (flags && (flags &
@@ -545,10 +545,17 @@ static int einj_error_inject(u32 type, u32 flags, u64 param1, u64 param2,
 	/*
 	 * Disallow crazy address masks that give BIOS leeway to pick
 	 * injection address almost anywhere. Insist on page or
-	 * better granularity and that target address is normal RAM.
+	 * better granularity and that target address is normal RAM or
+	 * NVDIMM.
 	 */
-	pfn = PFN_DOWN(param1 & param2);
-	if (!page_is_ram(pfn) || ((param2 & PAGE_MASK) != PAGE_MASK))
+	base_addr = param1 & param2;
+	size = ~param2 + 1;
+
+	if (((param2 & PAGE_MASK) != PAGE_MASK) ||
+	    ((region_intersects(base_addr, size, IORESOURCE_SYSTEM_RAM,
+			IORES_DESC_NONE) != REGION_INTERSECTS) &&
+	     (region_intersects(base_addr, size, IORESOURCE_MEM,
+			IORES_DESC_PERSISTENT_MEMORY) != REGION_INTERSECTS)))
 		return -EINVAL;
 
 inject:

^ permalink raw reply related	[flat|nested] 90+ messages in thread

* [PATCH v2 16/16] ACPI/EINJ: Allow memory error injection to NVDIMM
@ 2015-12-25 22:09   ` Toshi Kani
  0 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2015-12-25 22:09 UTC (permalink / raw)
  To: akpm, bp
  Cc: linux-arch, linux-mm, linux-kernel, Rafael J. Wysocki,
	Vishal Verma, Tony Luck, Dan Williams, linux-nvdimm, linux-acpi,
	Toshi Kani

In the case of memory error injection, einj_error_inject() checks
if a target address is System RAM.  Change this check to allow
injecting a memory error to NVDIMM by calling region_intersects()
with IORES_DESC_PERSISTENT_MEMORY.  This enables memory error
testing on both System RAM and NVDIMM.

In addition, page_is_ram() is replaced with region_intersects()
with IORESOURCE_SYSTEM_RAM, so that it can verify a target address
range with the requested size.

Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Vishal Verma <vishal.l.verma@intel.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: linux-nvdimm@lists.01.org
Cc: linux-acpi@vger.kernel.org
Acked-by: Tony Luck <tony.luck@intel.com>
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
---
 drivers/acpi/apei/einj.c |   15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/acpi/apei/einj.c b/drivers/acpi/apei/einj.c
index 0431883..16cae66 100644
--- a/drivers/acpi/apei/einj.c
+++ b/drivers/acpi/apei/einj.c
@@ -519,7 +519,7 @@ static int einj_error_inject(u32 type, u32 flags, u64 param1, u64 param2,
 			     u64 param3, u64 param4)
 {
 	int rc;
-	unsigned long pfn;
+	u64 base_addr, size;
 
 	/* If user manually set "flags", make sure it is legal */
 	if (flags && (flags &
@@ -545,10 +545,17 @@ static int einj_error_inject(u32 type, u32 flags, u64 param1, u64 param2,
 	/*
 	 * Disallow crazy address masks that give BIOS leeway to pick
 	 * injection address almost anywhere. Insist on page or
-	 * better granularity and that target address is normal RAM.
+	 * better granularity and that target address is normal RAM or
+	 * NVDIMM.
 	 */
-	pfn = PFN_DOWN(param1 & param2);
-	if (!page_is_ram(pfn) || ((param2 & PAGE_MASK) != PAGE_MASK))
+	base_addr = param1 & param2;
+	size = ~param2 + 1;
+
+	if (((param2 & PAGE_MASK) != PAGE_MASK) ||
+	    ((region_intersects(base_addr, size, IORESOURCE_SYSTEM_RAM,
+			IORES_DESC_NONE) != REGION_INTERSECTS) &&
+	     (region_intersects(base_addr, size, IORESOURCE_MEM,
+			IORES_DESC_PERSISTENT_MEMORY) != REGION_INTERSECTS)))
 		return -EINVAL;
 
 inject:

^ permalink raw reply related	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 15/16] checkpatch: Add warning on deprecated walk_iomem_res
  2015-12-25 22:09   ` Toshi Kani
  (?)
@ 2015-12-26  0:05     ` Joe Perches
  -1 siblings, 0 replies; 90+ messages in thread
From: Joe Perches @ 2015-12-26  0:05 UTC (permalink / raw)
  To: Toshi Kani, akpm, bp; +Cc: linux-arch, linux-mm, linux-kernel, Andy Whitcroft

On Fri, 2015-12-25 at 15:09 -0700, Toshi Kani wrote:
> Use of walk_iomem_res() is deprecated in new code.  Change
> checkpatch.pl to check new use of walk_iomem_res() and suggest
> to use walk_iomem_res_desc() instead.
[]
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> @@ -3424,6 +3424,12 @@ sub process {
>  			}
>  		}
>  
> +# check for uses of walk_iomem_res()
> +		if ($line =~ /\bwalk_iomem_res\(/) {
> +			WARN("walk_iomem_res",
> +			     "Use of walk_iomem_res is deprecated, please use walk_iomem_res_desc instead\n" . $herecurr)
> +		}
> +
>  # check for new typedefs, only function parameters and sparse annotations
>  # make sense.
>  		if ($line =~ /\btypedef\s/ &&

There are 6 uses of this function in the entire kernel tree.
Why not just change them, remove the function and avoid this?


^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 15/16] checkpatch: Add warning on deprecated walk_iomem_res
@ 2015-12-26  0:05     ` Joe Perches
  0 siblings, 0 replies; 90+ messages in thread
From: Joe Perches @ 2015-12-26  0:05 UTC (permalink / raw)
  To: Toshi Kani, akpm, bp; +Cc: linux-arch, linux-mm, linux-kernel, Andy Whitcroft

On Fri, 2015-12-25 at 15:09 -0700, Toshi Kani wrote:
> Use of walk_iomem_res() is deprecated in new code.  Change
> checkpatch.pl to check new use of walk_iomem_res() and suggest
> to use walk_iomem_res_desc() instead.
[]
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> @@ -3424,6 +3424,12 @@ sub process {
>  			}
>  		}
>  
> +# check for uses of walk_iomem_res()
> +		if ($line =~ /\bwalk_iomem_res\(/) {
> +			WARN("walk_iomem_res",
> +			     "Use of walk_iomem_res is deprecated, please use walk_iomem_res_desc instead\n" . $herecurr)
> +		}
> +
>  # check for new typedefs, only function parameters and sparse annotations
>  # make sense.
>  		if ($line =~ /\btypedef\s/ &&

There are 6 uses of this function in the entire kernel tree.
Why not just change them, remove the function and avoid this?

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 15/16] checkpatch: Add warning on deprecated walk_iomem_res
@ 2015-12-26  0:05     ` Joe Perches
  0 siblings, 0 replies; 90+ messages in thread
From: Joe Perches @ 2015-12-26  0:05 UTC (permalink / raw)
  To: Toshi Kani, akpm, bp; +Cc: linux-arch, linux-mm, linux-kernel, Andy Whitcroft

On Fri, 2015-12-25 at 15:09 -0700, Toshi Kani wrote:
> Use of walk_iomem_res() is deprecated in new code.  Change
> checkpatch.pl to check new use of walk_iomem_res() and suggest
> to use walk_iomem_res_desc() instead.
[]
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> @@ -3424,6 +3424,12 @@ sub process {
>  			}
>  		}
>  
> +# check for uses of walk_iomem_res()
> +		if ($line =~ /\bwalk_iomem_res\(/) {
> +			WARN("walk_iomem_res",
> +			     "Use of walk_iomem_res is deprecated, please use walk_iomem_res_desc instead\n" . $herecurr)
> +		}
> +
>  # check for new typedefs, only function parameters and sparse annotations
>  # make sense.
>  		if ($line =~ /\btypedef\s/ &&

There are 6 uses of this function in the entire kernel tree.
Why not just change them, remove the function and avoid this?

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 14/16] x86,nvdimm,kexec: Use walk_iomem_res_desc() for iomem search
  2015-12-25 22:09   ` Toshi Kani
@ 2015-12-26 10:38     ` Borislav Petkov
  -1 siblings, 0 replies; 90+ messages in thread
From: Borislav Petkov @ 2015-12-26 10:38 UTC (permalink / raw)
  To: Toshi Kani
  Cc: akpm, linux-arch, linux-mm, linux-kernel, Dan Williams,
	Dave Young, x86, linux-nvdimm

On Fri, Dec 25, 2015 at 03:09:23PM -0700, Toshi Kani wrote:
> Change to call walk_iomem_res_desc() for searching resource entries
> with the following names:
>  "ACPI Tables"
>  "ACPI Non-volatile Storage"
>  "Persistent Memory (legacy)"
>  "Crash kernel"
> 
> Note, the caller of walk_iomem_res() with "GART" is left unchanged
> because this entry may be initialized by out-of-tree drivers, which
> do not have 'desc' set to IORES_DESC_GART.

There's this out-of-tree bogus argument again. :\

Why do we care about out-of-tree drivers?

You can just as well fix the "GART" case too and kill walk_iomem_res()
altogether...

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.

^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 14/16] x86,nvdimm,kexec: Use walk_iomem_res_desc() for iomem search
@ 2015-12-26 10:38     ` Borislav Petkov
  0 siblings, 0 replies; 90+ messages in thread
From: Borislav Petkov @ 2015-12-26 10:38 UTC (permalink / raw)
  To: Toshi Kani
  Cc: akpm, linux-arch, linux-mm, linux-kernel, Dan Williams,
	Dave Young, x86, linux-nvdimm

On Fri, Dec 25, 2015 at 03:09:23PM -0700, Toshi Kani wrote:
> Change to call walk_iomem_res_desc() for searching resource entries
> with the following names:
>  "ACPI Tables"
>  "ACPI Non-volatile Storage"
>  "Persistent Memory (legacy)"
>  "Crash kernel"
> 
> Note, the caller of walk_iomem_res() with "GART" is left unchanged
> because this entry may be initialized by out-of-tree drivers, which
> do not have 'desc' set to IORES_DESC_GART.

There's this out-of-tree bogus argument again. :\

Why do we care about out-of-tree drivers?

You can just as well fix the "GART" case too and kill walk_iomem_res()
altogether...

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.

^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 14/16] x86,nvdimm,kexec: Use walk_iomem_res_desc() for iomem search
  2015-12-25 22:09   ` Toshi Kani
  (?)
@ 2015-12-26 16:05     ` Minfei Huang
  -1 siblings, 0 replies; 90+ messages in thread
From: Minfei Huang @ 2015-12-26 16:05 UTC (permalink / raw)
  To: Toshi Kani
  Cc: akpm, bp, linux-arch, linux-mm, linux-kernel, Dan Williams,
	Dave Young, x86, linux-nvdimm, kexec

Ccing kexec maillist.

On 12/25/15 at 03:09pm, Toshi Kani wrote:
> diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c
> index c245085..e2bd737 100644
> --- a/kernel/kexec_file.c
> +++ b/kernel/kexec_file.c
> @@ -522,10 +522,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(IORES_DESC_CRASH_KERNEL,

Since crashk_res's desc has been assigned to IORES_DESC_CRASH_KERNEL, it
is better to use crashk_res.desc, instead of using
IORES_DESC_CRASH_KERNEL directly.

Thanks
Minfei

> +				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);

^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 14/16] x86,nvdimm,kexec: Use walk_iomem_res_desc() for iomem search
@ 2015-12-26 16:05     ` Minfei Huang
  0 siblings, 0 replies; 90+ messages in thread
From: Minfei Huang @ 2015-12-26 16:05 UTC (permalink / raw)
  To: Toshi Kani
  Cc: akpm, bp, linux-arch, linux-mm, linux-kernel, Dan Williams,
	Dave Young, x86, linux-nvdimm, kexec

Ccing kexec maillist.

On 12/25/15 at 03:09pm, Toshi Kani wrote:
> diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c
> index c245085..e2bd737 100644
> --- a/kernel/kexec_file.c
> +++ b/kernel/kexec_file.c
> @@ -522,10 +522,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(IORES_DESC_CRASH_KERNEL,

Since crashk_res's desc has been assigned to IORES_DESC_CRASH_KERNEL, it
is better to use crashk_res.desc, instead of using
IORES_DESC_CRASH_KERNEL directly.

Thanks
Minfei

> +				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);

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 14/16] x86, nvdimm, kexec: Use walk_iomem_res_desc() for iomem search
@ 2015-12-26 16:05     ` Minfei Huang
  0 siblings, 0 replies; 90+ messages in thread
From: Minfei Huang @ 2015-12-26 16:05 UTC (permalink / raw)
  To: Toshi Kani
  Cc: linux-arch, linux-nvdimm, x86, kexec, linux-kernel, linux-mm, bp,
	akpm, Dave Young, Dan Williams

Ccing kexec maillist.

On 12/25/15 at 03:09pm, Toshi Kani wrote:
> diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c
> index c245085..e2bd737 100644
> --- a/kernel/kexec_file.c
> +++ b/kernel/kexec_file.c
> @@ -522,10 +522,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(IORES_DESC_CRASH_KERNEL,

Since crashk_res's desc has been assigned to IORES_DESC_CRASH_KERNEL, it
is better to use crashk_res.desc, instead of using
IORES_DESC_CRASH_KERNEL directly.

Thanks
Minfei

> +				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);

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 14/16] x86,nvdimm,kexec: Use walk_iomem_res_desc() for iomem search
  2015-12-26 10:38     ` Borislav Petkov
  (?)
  (?)
@ 2015-12-27  0:31       ` Toshi Kani
  -1 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2015-12-27  0:31 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: akpm, linux-arch, kexec, linux-mm, linux-kernel, Dan Williams,
	Dave Young, x86, linux-nvdimm

+ cc: kexec list

On 12/26/2015 3:38 AM, Borislav Petkov wrote:
> On Fri, Dec 25, 2015 at 03:09:23PM -0700, Toshi Kani wrote:
>> Change to call walk_iomem_res_desc() for searching resource entries
>> with the following names:
>>   "ACPI Tables"
>>   "ACPI Non-volatile Storage"
>>   "Persistent Memory (legacy)"
>>   "Crash kernel"
>>
>> Note, the caller of walk_iomem_res() with "GART" is left unchanged
>> because this entry may be initialized by out-of-tree drivers, which
>> do not have 'desc' set to IORES_DESC_GART.
>
> There's this out-of-tree bogus argument again. :\
>
> Why do we care about out-of-tree drivers?
>
> You can just as well fix the "GART" case too and kill walk_iomem_res()
> altogether...

Right, but I do not see any "GART" case in the upstream code, so I 
cannot change it...

Thanks,
-Toshi

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 14/16] x86,nvdimm,kexec: Use walk_iomem_res_desc() for iomem search
@ 2015-12-27  0:31       ` Toshi Kani
  0 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2015-12-27  0:31 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: akpm, linux-arch, kexec, linux-mm, linux-kernel, Dan Williams,
	Dave Young, x86, linux-nvdimm

+ cc: kexec list

On 12/26/2015 3:38 AM, Borislav Petkov wrote:
> On Fri, Dec 25, 2015 at 03:09:23PM -0700, Toshi Kani wrote:
>> Change to call walk_iomem_res_desc() for searching resource entries
>> with the following names:
>>   "ACPI Tables"
>>   "ACPI Non-volatile Storage"
>>   "Persistent Memory (legacy)"
>>   "Crash kernel"
>>
>> Note, the caller of walk_iomem_res() with "GART" is left unchanged
>> because this entry may be initialized by out-of-tree drivers, which
>> do not have 'desc' set to IORES_DESC_GART.
>
> There's this out-of-tree bogus argument again. :\
>
> Why do we care about out-of-tree drivers?
>
> You can just as well fix the "GART" case too and kill walk_iomem_res()
> altogether...

Right, but I do not see any "GART" case in the upstream code, so I 
cannot change it...

Thanks,
-Toshi

^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 14/16] x86,nvdimm,kexec: Use walk_iomem_res_desc() for iomem search
@ 2015-12-27  0:31       ` Toshi Kani
  0 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2015-12-27  0:31 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: akpm, linux-arch, kexec, linux-mm, linux-kernel, Dan Williams,
	Dave Young, x86, linux-nvdimm

+ cc: kexec list

On 12/26/2015 3:38 AM, Borislav Petkov wrote:
> On Fri, Dec 25, 2015 at 03:09:23PM -0700, Toshi Kani wrote:
>> Change to call walk_iomem_res_desc() for searching resource entries
>> with the following names:
>>   "ACPI Tables"
>>   "ACPI Non-volatile Storage"
>>   "Persistent Memory (legacy)"
>>   "Crash kernel"
>>
>> Note, the caller of walk_iomem_res() with "GART" is left unchanged
>> because this entry may be initialized by out-of-tree drivers, which
>> do not have 'desc' set to IORES_DESC_GART.
>
> There's this out-of-tree bogus argument again. :\
>
> Why do we care about out-of-tree drivers?
>
> You can just as well fix the "GART" case too and kill walk_iomem_res()
> altogether...

Right, but I do not see any "GART" case in the upstream code, so I 
cannot change it...

Thanks,
-Toshi

^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 14/16] x86, nvdimm, kexec: Use walk_iomem_res_desc() for iomem search
@ 2015-12-27  0:31       ` Toshi Kani
  0 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2015-12-27  0:31 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: linux-arch, linux-nvdimm, x86, kexec, linux-kernel, linux-mm,
	akpm, Dave Young, Dan Williams

+ cc: kexec list

On 12/26/2015 3:38 AM, Borislav Petkov wrote:
> On Fri, Dec 25, 2015 at 03:09:23PM -0700, Toshi Kani wrote:
>> Change to call walk_iomem_res_desc() for searching resource entries
>> with the following names:
>>   "ACPI Tables"
>>   "ACPI Non-volatile Storage"
>>   "Persistent Memory (legacy)"
>>   "Crash kernel"
>>
>> Note, the caller of walk_iomem_res() with "GART" is left unchanged
>> because this entry may be initialized by out-of-tree drivers, which
>> do not have 'desc' set to IORES_DESC_GART.
>
> There's this out-of-tree bogus argument again. :\
>
> Why do we care about out-of-tree drivers?
>
> You can just as well fix the "GART" case too and kill walk_iomem_res()
> altogether...

Right, but I do not see any "GART" case in the upstream code, so I 
cannot change it...

Thanks,
-Toshi

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 14/16] x86,nvdimm,kexec: Use walk_iomem_res_desc() for iomem search
  2015-12-26 16:05     ` [PATCH v2 14/16] x86,nvdimm,kexec: " Minfei Huang
  (?)
@ 2015-12-27  0:39       ` Toshi Kani
  -1 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2015-12-27  0:39 UTC (permalink / raw)
  To: Minfei Huang
  Cc: akpm, bp, linux-arch, linux-mm, linux-kernel, Dan Williams,
	Dave Young, x86, linux-nvdimm, kexec

On 12/26/2015 9:05 AM, Minfei Huang wrote:
> Ccing kexec maillist.
>
> On 12/25/15 at 03:09pm, Toshi Kani wrote:
>> diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c
>> index c245085..e2bd737 100644
>> --- a/kernel/kexec_file.c
>> +++ b/kernel/kexec_file.c
>> @@ -522,10 +522,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(IORES_DESC_CRASH_KERNEL,
>
> Since crashk_res's desc has been assigned to IORES_DESC_CRASH_KERNEL, it
> is better to use crashk_res.desc, instead of using
> IORES_DESC_CRASH_KERNEL directly.

Sounds good. I will change it to use crashk_res.desc.

Thanks,
-Toshi

^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 14/16] x86,nvdimm,kexec: Use walk_iomem_res_desc() for iomem search
@ 2015-12-27  0:39       ` Toshi Kani
  0 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2015-12-27  0:39 UTC (permalink / raw)
  To: Minfei Huang
  Cc: akpm, bp, linux-arch, linux-mm, linux-kernel, Dan Williams,
	Dave Young, x86, linux-nvdimm, kexec

On 12/26/2015 9:05 AM, Minfei Huang wrote:
> Ccing kexec maillist.
>
> On 12/25/15 at 03:09pm, Toshi Kani wrote:
>> diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c
>> index c245085..e2bd737 100644
>> --- a/kernel/kexec_file.c
>> +++ b/kernel/kexec_file.c
>> @@ -522,10 +522,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(IORES_DESC_CRASH_KERNEL,
>
> Since crashk_res's desc has been assigned to IORES_DESC_CRASH_KERNEL, it
> is better to use crashk_res.desc, instead of using
> IORES_DESC_CRASH_KERNEL directly.

Sounds good. I will change it to use crashk_res.desc.

Thanks,
-Toshi

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 14/16] x86, nvdimm, kexec: Use walk_iomem_res_desc() for iomem search
@ 2015-12-27  0:39       ` Toshi Kani
  0 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2015-12-27  0:39 UTC (permalink / raw)
  To: Minfei Huang
  Cc: linux-arch, linux-nvdimm, x86, kexec, linux-kernel, linux-mm, bp,
	akpm, Dave Young, Dan Williams

On 12/26/2015 9:05 AM, Minfei Huang wrote:
> Ccing kexec maillist.
>
> On 12/25/15 at 03:09pm, Toshi Kani wrote:
>> diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c
>> index c245085..e2bd737 100644
>> --- a/kernel/kexec_file.c
>> +++ b/kernel/kexec_file.c
>> @@ -522,10 +522,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(IORES_DESC_CRASH_KERNEL,
>
> Since crashk_res's desc has been assigned to IORES_DESC_CRASH_KERNEL, it
> is better to use crashk_res.desc, instead of using
> IORES_DESC_CRASH_KERNEL directly.

Sounds good. I will change it to use crashk_res.desc.

Thanks,
-Toshi

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 15/16] checkpatch: Add warning on deprecated walk_iomem_res
  2015-12-26  0:05     ` Joe Perches
@ 2015-12-27  0:52       ` Toshi Kani
  -1 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2015-12-27  0:52 UTC (permalink / raw)
  To: Joe Perches, akpm, bp; +Cc: linux-arch, linux-mm, linux-kernel, Andy Whitcroft

On 12/25/2015 5:05 PM, Joe Perches wrote:
> On Fri, 2015-12-25 at 15:09 -0700, Toshi Kani wrote:
>> Use of walk_iomem_res() is deprecated in new code.  Change
>> checkpatch.pl to check new use of walk_iomem_res() and suggest
>> to use walk_iomem_res_desc() instead.
> []
>> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> []
>> @@ -3424,6 +3424,12 @@ sub process {
>>   			}
>>   		}
>>
>> +# check for uses of walk_iomem_res()
>> +		if ($line =~ /\bwalk_iomem_res\(/) {
>> +			WARN("walk_iomem_res",
>> +			     "Use of walk_iomem_res is deprecated, please use walk_iomem_res_desc instead\n" . $herecurr)
>> +		}
>> +
>>   # check for new typedefs, only function parameters and sparse annotations
>>   # make sense.
>>   		if ($line =~ /\btypedef\s/ &&
>
> There are 6 uses of this function in the entire kernel tree.
> Why not just change them, remove the function and avoid this?

Sorry, I should have put some background in the description.  We have 
discussed if we can remove walk_iomem_res() in the thread below.
https://lkml.org/lkml/2015/12/23/248

But this may depend on how we deal with the last remaining caller, 
walk_iomem_res() with "GART", being discussed in the thread below.  I 
will update according to the outcome.
https://lkml.org/lkml/2015/12/26/144

Thanks,
-Toshi

^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 15/16] checkpatch: Add warning on deprecated walk_iomem_res
@ 2015-12-27  0:52       ` Toshi Kani
  0 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2015-12-27  0:52 UTC (permalink / raw)
  To: Joe Perches, akpm, bp; +Cc: linux-arch, linux-mm, linux-kernel, Andy Whitcroft

On 12/25/2015 5:05 PM, Joe Perches wrote:
> On Fri, 2015-12-25 at 15:09 -0700, Toshi Kani wrote:
>> Use of walk_iomem_res() is deprecated in new code.  Change
>> checkpatch.pl to check new use of walk_iomem_res() and suggest
>> to use walk_iomem_res_desc() instead.
> []
>> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> []
>> @@ -3424,6 +3424,12 @@ sub process {
>>   			}
>>   		}
>>
>> +# check for uses of walk_iomem_res()
>> +		if ($line =~ /\bwalk_iomem_res\(/) {
>> +			WARN("walk_iomem_res",
>> +			     "Use of walk_iomem_res is deprecated, please use walk_iomem_res_desc instead\n" . $herecurr)
>> +		}
>> +
>>   # check for new typedefs, only function parameters and sparse annotations
>>   # make sense.
>>   		if ($line =~ /\btypedef\s/ &&
>
> There are 6 uses of this function in the entire kernel tree.
> Why not just change them, remove the function and avoid this?

Sorry, I should have put some background in the description.  We have 
discussed if we can remove walk_iomem_res() in the thread below.
https://lkml.org/lkml/2015/12/23/248

But this may depend on how we deal with the last remaining caller, 
walk_iomem_res() with "GART", being discussed in the thread below.  I 
will update according to the outcome.
https://lkml.org/lkml/2015/12/26/144

Thanks,
-Toshi

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 14/16] x86, nvdimm, kexec: Use walk_iomem_res_desc() for iomem search
  2015-12-27  0:31       ` Toshi Kani
  (?)
@ 2015-12-27  2:12         ` Minfei Huang
  -1 siblings, 0 replies; 90+ messages in thread
From: Minfei Huang @ 2015-12-27  2:12 UTC (permalink / raw)
  To: Toshi Kani
  Cc: Borislav Petkov, linux-arch, linux-nvdimm, x86, kexec,
	linux-kernel, linux-mm, akpm, Dave Young, Dan Williams

On 12/26/15 at 05:31pm, Toshi Kani wrote:
> + cc: kexec list
> 
> On 12/26/2015 3:38 AM, Borislav Petkov wrote:
> >On Fri, Dec 25, 2015 at 03:09:23PM -0700, Toshi Kani wrote:
> >>Change to call walk_iomem_res_desc() for searching resource entries
> >>with the following names:
> >>  "ACPI Tables"
> >>  "ACPI Non-volatile Storage"
> >>  "Persistent Memory (legacy)"
> >>  "Crash kernel"
> >>
> >>Note, the caller of walk_iomem_res() with "GART" is left unchanged
> >>because this entry may be initialized by out-of-tree drivers, which
> >>do not have 'desc' set to IORES_DESC_GART.
> >
> >There's this out-of-tree bogus argument again. :\
> >
> >Why do we care about out-of-tree drivers?
> >
> >You can just as well fix the "GART" case too and kill walk_iomem_res()
> >altogether...
> 
> Right, but I do not see any "GART" case in the upstream code, so I
> cannot change it...

Hi, Toshi.

You can refer the below link that you may get a clue about GART. This is
the fisrt time kexec-tools tried to support to ignore GART region in 2nd
kernel.

http://lists.infradead.org/pipermail/kexec/2008-December/003096.html

Thanks
Minfei

^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 14/16] x86, nvdimm, kexec: Use walk_iomem_res_desc() for iomem search
@ 2015-12-27  2:12         ` Minfei Huang
  0 siblings, 0 replies; 90+ messages in thread
From: Minfei Huang @ 2015-12-27  2:12 UTC (permalink / raw)
  To: Toshi Kani
  Cc: Borislav Petkov, linux-arch, linux-nvdimm, x86, kexec,
	linux-kernel, linux-mm, akpm, Dave Young, Dan Williams

On 12/26/15 at 05:31pm, Toshi Kani wrote:
> + cc: kexec list
> 
> On 12/26/2015 3:38 AM, Borislav Petkov wrote:
> >On Fri, Dec 25, 2015 at 03:09:23PM -0700, Toshi Kani wrote:
> >>Change to call walk_iomem_res_desc() for searching resource entries
> >>with the following names:
> >>  "ACPI Tables"
> >>  "ACPI Non-volatile Storage"
> >>  "Persistent Memory (legacy)"
> >>  "Crash kernel"
> >>
> >>Note, the caller of walk_iomem_res() with "GART" is left unchanged
> >>because this entry may be initialized by out-of-tree drivers, which
> >>do not have 'desc' set to IORES_DESC_GART.
> >
> >There's this out-of-tree bogus argument again. :\
> >
> >Why do we care about out-of-tree drivers?
> >
> >You can just as well fix the "GART" case too and kill walk_iomem_res()
> >altogether...
> 
> Right, but I do not see any "GART" case in the upstream code, so I
> cannot change it...

Hi, Toshi.

You can refer the below link that you may get a clue about GART. This is
the fisrt time kexec-tools tried to support to ignore GART region in 2nd
kernel.

http://lists.infradead.org/pipermail/kexec/2008-December/003096.html

Thanks
Minfei

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 14/16] x86, nvdimm, kexec: Use walk_iomem_res_desc() for iomem search
@ 2015-12-27  2:12         ` Minfei Huang
  0 siblings, 0 replies; 90+ messages in thread
From: Minfei Huang @ 2015-12-27  2:12 UTC (permalink / raw)
  To: Toshi Kani
  Cc: linux-arch, linux-nvdimm, x86, kexec, linux-kernel, linux-mm,
	Borislav Petkov, akpm, Dave Young, Dan Williams

On 12/26/15 at 05:31pm, Toshi Kani wrote:
> + cc: kexec list
> 
> On 12/26/2015 3:38 AM, Borislav Petkov wrote:
> >On Fri, Dec 25, 2015 at 03:09:23PM -0700, Toshi Kani wrote:
> >>Change to call walk_iomem_res_desc() for searching resource entries
> >>with the following names:
> >>  "ACPI Tables"
> >>  "ACPI Non-volatile Storage"
> >>  "Persistent Memory (legacy)"
> >>  "Crash kernel"
> >>
> >>Note, the caller of walk_iomem_res() with "GART" is left unchanged
> >>because this entry may be initialized by out-of-tree drivers, which
> >>do not have 'desc' set to IORES_DESC_GART.
> >
> >There's this out-of-tree bogus argument again. :\
> >
> >Why do we care about out-of-tree drivers?
> >
> >You can just as well fix the "GART" case too and kill walk_iomem_res()
> >altogether...
> 
> Right, but I do not see any "GART" case in the upstream code, so I
> cannot change it...

Hi, Toshi.

You can refer the below link that you may get a clue about GART. This is
the fisrt time kexec-tools tried to support to ignore GART region in 2nd
kernel.

http://lists.infradead.org/pipermail/kexec/2008-December/003096.html

Thanks
Minfei

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 14/16] x86, nvdimm, kexec: Use walk_iomem_res_desc() for iomem search
@ 2015-12-27 10:24           ` Borislav Petkov
  0 siblings, 0 replies; 90+ messages in thread
From: Borislav Petkov @ 2015-12-27 10:24 UTC (permalink / raw)
  To: Minfei Huang, Toshi Kani
  Cc: linux-arch, linux-nvdimm, x86, kexec, linux-kernel, linux-mm,
	akpm, Dave Young, Dan Williams

On Sun, Dec 27, 2015 at 10:12:57AM +0800, Minfei Huang wrote:
> You can refer the below link that you may get a clue about GART. This is
> the fisrt time kexec-tools tried to support to ignore GART region in 2nd
> kernel.
> 
> http://lists.infradead.org/pipermail/kexec/2008-December/003096.html

So theoretically we could export that IORES_DESC* enum in an uapi header and
move kexec-tools to use that.

However, I'm fuzzy on how exactly the whole compatibility thing is done
with kexec-tools and the kernel. We probably would have to support
newer kexec-tools on an older kernel and vice versa so I'd guess we
should mark walk_iomem_res() deprecated so that people are encouraged to
upgrade to newer kexec-tools...


Hmmm.

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.
--

^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 14/16] x86, nvdimm, kexec: Use walk_iomem_res_desc() for iomem search
@ 2015-12-27 10:24           ` Borislav Petkov
  0 siblings, 0 replies; 90+ messages in thread
From: Borislav Petkov @ 2015-12-27 10:24 UTC (permalink / raw)
  To: Minfei Huang, Toshi Kani
  Cc: linux-arch-u79uwXL29TY76Z2rM5mHXA,
	linux-nvdimm-y27Ovi1pjclAfugRpC6u6w, x86-DgEjT+Ai2ygdnm+yROfE0A,
	kexec-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-mm-Bw31MaZKKs3YtjvyW6yDsg,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b, Dave Young, Dan Williams

On Sun, Dec 27, 2015 at 10:12:57AM +0800, Minfei Huang wrote:
> You can refer the below link that you may get a clue about GART. This is
> the fisrt time kexec-tools tried to support to ignore GART region in 2nd
> kernel.
> 
> http://lists.infradead.org/pipermail/kexec/2008-December/003096.html

So theoretically we could export that IORES_DESC* enum in an uapi header and
move kexec-tools to use that.

However, I'm fuzzy on how exactly the whole compatibility thing is done
with kexec-tools and the kernel. We probably would have to support
newer kexec-tools on an older kernel and vice versa so I'd guess we
should mark walk_iomem_res() deprecated so that people are encouraged to
upgrade to newer kexec-tools...


Hmmm.

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.
--

^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 14/16] x86, nvdimm, kexec: Use walk_iomem_res_desc() for iomem search
@ 2015-12-27 10:24           ` Borislav Petkov
  0 siblings, 0 replies; 90+ messages in thread
From: Borislav Petkov @ 2015-12-27 10:24 UTC (permalink / raw)
  To: Minfei Huang, Toshi Kani
  Cc: linux-arch, linux-nvdimm, x86, kexec, linux-kernel, linux-mm,
	akpm, Dave Young, Dan Williams

On Sun, Dec 27, 2015 at 10:12:57AM +0800, Minfei Huang wrote:
> You can refer the below link that you may get a clue about GART. This is
> the fisrt time kexec-tools tried to support to ignore GART region in 2nd
> kernel.
> 
> http://lists.infradead.org/pipermail/kexec/2008-December/003096.html

So theoretically we could export that IORES_DESC* enum in an uapi header and
move kexec-tools to use that.

However, I'm fuzzy on how exactly the whole compatibility thing is done
with kexec-tools and the kernel. We probably would have to support
newer kexec-tools on an older kernel and vice versa so I'd guess we
should mark walk_iomem_res() deprecated so that people are encouraged to
upgrade to newer kexec-tools...


Hmmm.

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.
--

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 09/16] drivers: Initialize resource entry to zero
  2015-12-25 22:09   ` Toshi Kani
  (?)
@ 2015-12-28 21:37     ` Simon Horman
  -1 siblings, 0 replies; 90+ messages in thread
From: Simon Horman @ 2015-12-28 21:37 UTC (permalink / raw)
  To: Toshi Kani
  Cc: akpm, bp, linux-arch, linux-mm, linux-kernel, linux-acpi,
	linux-parisc, linux-sh

On Fri, Dec 25, 2015 at 03:09:18PM -0700, Toshi Kani wrote:
> I/O resource descriptor, 'desc' added to struct resource, needs
> to be initialized to zero by default.  Some drivers call kmalloc()
> to allocate a resource entry, but does not initialize it to zero
> by memset().  Change these drivers to call kzalloc(), instead.
> 
> Cc: linux-acpi@vger.kernel.org
> Cc: linux-parisc@vger.kernel.org
> Cc: linux-sh@vger.kernel.org
> Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
> ---
>  drivers/acpi/acpi_platform.c       |    2 +-
>  drivers/parisc/eisa_enumerator.c   |    4 ++--
>  drivers/rapidio/rio.c              |    8 ++++----
>  drivers/sh/superhyway/superhyway.c |    2 +-
>  4 files changed, 8 insertions(+), 8 deletions(-)

drivers/sh/ portion:

Acked-by: Simon Horman <horms+renesas@verge.net.au>


^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 09/16] drivers: Initialize resource entry to zero
@ 2015-12-28 21:37     ` Simon Horman
  0 siblings, 0 replies; 90+ messages in thread
From: Simon Horman @ 2015-12-28 21:37 UTC (permalink / raw)
  To: Toshi Kani
  Cc: akpm, bp, linux-arch, linux-mm, linux-kernel, linux-acpi,
	linux-parisc, linux-sh

On Fri, Dec 25, 2015 at 03:09:18PM -0700, Toshi Kani wrote:
> I/O resource descriptor, 'desc' added to struct resource, needs
> to be initialized to zero by default.  Some drivers call kmalloc()
> to allocate a resource entry, but does not initialize it to zero
> by memset().  Change these drivers to call kzalloc(), instead.
> 
> Cc: linux-acpi@vger.kernel.org
> Cc: linux-parisc@vger.kernel.org
> Cc: linux-sh@vger.kernel.org
> Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
> ---
>  drivers/acpi/acpi_platform.c       |    2 +-
>  drivers/parisc/eisa_enumerator.c   |    4 ++--
>  drivers/rapidio/rio.c              |    8 ++++----
>  drivers/sh/superhyway/superhyway.c |    2 +-
>  4 files changed, 8 insertions(+), 8 deletions(-)

drivers/sh/ portion:

Acked-by: Simon Horman <horms+renesas@verge.net.au>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 09/16] drivers: Initialize resource entry to zero
@ 2015-12-28 21:37     ` Simon Horman
  0 siblings, 0 replies; 90+ messages in thread
From: Simon Horman @ 2015-12-28 21:37 UTC (permalink / raw)
  To: Toshi Kani
  Cc: akpm, bp, linux-arch, linux-mm, linux-kernel, linux-acpi,
	linux-parisc, linux-sh

On Fri, Dec 25, 2015 at 03:09:18PM -0700, Toshi Kani wrote:
> I/O resource descriptor, 'desc' added to struct resource, needs
> to be initialized to zero by default.  Some drivers call kmalloc()
> to allocate a resource entry, but does not initialize it to zero
> by memset().  Change these drivers to call kzalloc(), instead.
> 
> Cc: linux-acpi@vger.kernel.org
> Cc: linux-parisc@vger.kernel.org
> Cc: linux-sh@vger.kernel.org
> Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
> ---
>  drivers/acpi/acpi_platform.c       |    2 +-
>  drivers/parisc/eisa_enumerator.c   |    4 ++--
>  drivers/rapidio/rio.c              |    8 ++++----
>  drivers/sh/superhyway/superhyway.c |    2 +-
>  4 files changed, 8 insertions(+), 8 deletions(-)

drivers/sh/ portion:

Acked-by: Simon Horman <horms+renesas@verge.net.au>


^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 14/16] x86,nvdimm,kexec: Use walk_iomem_res_desc() for iomem search
  2015-12-25 22:09   ` Toshi Kani
  (?)
@ 2016-01-04  9:25     ` Dave Young
  -1 siblings, 0 replies; 90+ messages in thread
From: Dave Young @ 2016-01-04  9:25 UTC (permalink / raw)
  To: Toshi Kani
  Cc: akpm, bp, linux-arch, linux-mm, linux-kernel, Dan Williams, x86,
	linux-nvdimm, kexec

Hi, Toshi,

On 12/25/15 at 03:09pm, Toshi Kani wrote:
> Change to call walk_iomem_res_desc() for searching resource entries
> with the following names:
>  "ACPI Tables"
>  "ACPI Non-volatile Storage"
>  "Persistent Memory (legacy)"
>  "Crash kernel"
> 
> Note, the caller of walk_iomem_res() with "GART" is left unchanged
> because this entry may be initialized by out-of-tree drivers, which
> do not have 'desc' set to IORES_DESC_GART.

Found below commit which initialize the GART entry:
commit 56dd669a138c40ea6cdae487f233430d12372767
Author: Aaron Durbin <adurbin@google.com>
Date:   Tue Sep 26 10:52:40 2006 +0200

    [PATCH] Insert GART region into resource map
    
    Patch inserts the GART region into the iomem resource map. The GART will then
    be visible within /proc/iomem. It will also allow for other users
    utilizing the GART to subreserve the region (agp or IOMMU).
    
    Signed-off-by: Aaron Durbin <adurbin@google.com>

But later it was reverted:
commit 707d4eefbdb31f8e588277157056b0ce637d6c68
Author: Bjorn Helgaas <bhelgaas@google.com>
Date:   Tue Mar 18 14:26:12 2014 -0600

    Revert "[PATCH] Insert GART region into resource map"
    
    This reverts commit 56dd669a138c, which makes the GART visible in
    /proc/iomem.  This fixes a regression: e501b3d87f00 ("agp: Support 64-bit
    APBASE") exposed an existing problem with a conflict between the GART
    region and a PCI BAR region.
    
    The GART addresses are bus addresses, not CPU addresses, and therefore
    should not be inserted in iomem_resource.
    
    On many machines, the GART region is addressable by the CPU as well as by
    an AGP master, but CPU addressability is not required by the spec.  On some
    of these machines, the GART is mapped by a PCI BAR, and in that case, the
    PCI core automatically inserts it into iomem_resource, just as it does for
    all BARs.
    
    Inserting it here means we'll have a conflict if the PCI core later tries
    to claim the GART region, so let's drop the insertion here.
    
    The conflict indirectly causes X failures, as reported by Jouni in the
    bugzilla below.  We detected the conflict even before e501b3d87f00, but
    after it the AGP code (fix_northbridge()) uses the PCI resource (which is
    zeroed because of the conflict) instead of reading the BAR again.
    
    Conflicts:
        arch/x86_64/kernel/aperture.c
    
    Fixes: e501b3d87f00 agp: Support 64-bit APBASE
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=72201
    Reported-and-tested-by: Jouni Mettälä <jtmettala@gmail.com>
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>


For amd64 agp, currently the region name is "aperture" instead:
drivers/char/agp/amd64-agp.c: agp_aperture_valid()

This may not be the only case, but I doubt that anyone is testing this since
long time ago kexec-tools excluding the 'GART' region. Kexec-tools and kexec_file
may need update to use "aperture" if someone can test it.

I think adding an enum value for compatibility is reasonable, we do not care
about third party drivers in mainline.

Thanks
Dave

^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 14/16] x86,nvdimm,kexec: Use walk_iomem_res_desc() for iomem search
@ 2016-01-04  9:25     ` Dave Young
  0 siblings, 0 replies; 90+ messages in thread
From: Dave Young @ 2016-01-04  9:25 UTC (permalink / raw)
  To: Toshi Kani
  Cc: akpm, bp, linux-arch, linux-mm, linux-kernel, Dan Williams, x86,
	linux-nvdimm, kexec

Hi, Toshi,

On 12/25/15 at 03:09pm, Toshi Kani wrote:
> Change to call walk_iomem_res_desc() for searching resource entries
> with the following names:
>  "ACPI Tables"
>  "ACPI Non-volatile Storage"
>  "Persistent Memory (legacy)"
>  "Crash kernel"
> 
> Note, the caller of walk_iomem_res() with "GART" is left unchanged
> because this entry may be initialized by out-of-tree drivers, which
> do not have 'desc' set to IORES_DESC_GART.

Found below commit which initialize the GART entry:
commit 56dd669a138c40ea6cdae487f233430d12372767
Author: Aaron Durbin <adurbin@google.com>
Date:   Tue Sep 26 10:52:40 2006 +0200

    [PATCH] Insert GART region into resource map
    
    Patch inserts the GART region into the iomem resource map. The GART will then
    be visible within /proc/iomem. It will also allow for other users
    utilizing the GART to subreserve the region (agp or IOMMU).
    
    Signed-off-by: Aaron Durbin <adurbin@google.com>

But later it was reverted:
commit 707d4eefbdb31f8e588277157056b0ce637d6c68
Author: Bjorn Helgaas <bhelgaas@google.com>
Date:   Tue Mar 18 14:26:12 2014 -0600

    Revert "[PATCH] Insert GART region into resource map"
    
    This reverts commit 56dd669a138c, which makes the GART visible in
    /proc/iomem.  This fixes a regression: e501b3d87f00 ("agp: Support 64-bit
    APBASE") exposed an existing problem with a conflict between the GART
    region and a PCI BAR region.
    
    The GART addresses are bus addresses, not CPU addresses, and therefore
    should not be inserted in iomem_resource.
    
    On many machines, the GART region is addressable by the CPU as well as by
    an AGP master, but CPU addressability is not required by the spec.  On some
    of these machines, the GART is mapped by a PCI BAR, and in that case, the
    PCI core automatically inserts it into iomem_resource, just as it does for
    all BARs.
    
    Inserting it here means we'll have a conflict if the PCI core later tries
    to claim the GART region, so let's drop the insertion here.
    
    The conflict indirectly causes X failures, as reported by Jouni in the
    bugzilla below.  We detected the conflict even before e501b3d87f00, but
    after it the AGP code (fix_northbridge()) uses the PCI resource (which is
    zeroed because of the conflict) instead of reading the BAR again.
    
    Conflicts:
        arch/x86_64/kernel/aperture.c
    
    Fixes: e501b3d87f00 agp: Support 64-bit APBASE
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=72201
    Reported-and-tested-by: Jouni Mettala <jtmettala@gmail.com>
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>


For amd64 agp, currently the region name is "aperture" instead:
drivers/char/agp/amd64-agp.c: agp_aperture_valid()

This may not be the only case, but I doubt that anyone is testing this since
long time ago kexec-tools excluding the 'GART' region. Kexec-tools and kexec_file
may need update to use "aperture" if someone can test it.

I think adding an enum value for compatibility is reasonable, we do not care
about third party drivers in mainline.

Thanks
Dave

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 14/16] x86, nvdimm, kexec: Use walk_iomem_res_desc() for iomem search
@ 2016-01-04  9:25     ` Dave Young
  0 siblings, 0 replies; 90+ messages in thread
From: Dave Young @ 2016-01-04  9:25 UTC (permalink / raw)
  To: Toshi Kani
  Cc: linux-arch, linux-nvdimm, x86, kexec, linux-kernel, linux-mm, bp,
	akpm, Dan Williams

Hi, Toshi,

On 12/25/15 at 03:09pm, Toshi Kani wrote:
> Change to call walk_iomem_res_desc() for searching resource entries
> with the following names:
>  "ACPI Tables"
>  "ACPI Non-volatile Storage"
>  "Persistent Memory (legacy)"
>  "Crash kernel"
> 
> Note, the caller of walk_iomem_res() with "GART" is left unchanged
> because this entry may be initialized by out-of-tree drivers, which
> do not have 'desc' set to IORES_DESC_GART.

Found below commit which initialize the GART entry:
commit 56dd669a138c40ea6cdae487f233430d12372767
Author: Aaron Durbin <adurbin@google.com>
Date:   Tue Sep 26 10:52:40 2006 +0200

    [PATCH] Insert GART region into resource map
    
    Patch inserts the GART region into the iomem resource map. The GART will then
    be visible within /proc/iomem. It will also allow for other users
    utilizing the GART to subreserve the region (agp or IOMMU).
    
    Signed-off-by: Aaron Durbin <adurbin@google.com>

But later it was reverted:
commit 707d4eefbdb31f8e588277157056b0ce637d6c68
Author: Bjorn Helgaas <bhelgaas@google.com>
Date:   Tue Mar 18 14:26:12 2014 -0600

    Revert "[PATCH] Insert GART region into resource map"
    
    This reverts commit 56dd669a138c, which makes the GART visible in
    /proc/iomem.  This fixes a regression: e501b3d87f00 ("agp: Support 64-bit
    APBASE") exposed an existing problem with a conflict between the GART
    region and a PCI BAR region.
    
    The GART addresses are bus addresses, not CPU addresses, and therefore
    should not be inserted in iomem_resource.
    
    On many machines, the GART region is addressable by the CPU as well as by
    an AGP master, but CPU addressability is not required by the spec.  On some
    of these machines, the GART is mapped by a PCI BAR, and in that case, the
    PCI core automatically inserts it into iomem_resource, just as it does for
    all BARs.
    
    Inserting it here means we'll have a conflict if the PCI core later tries
    to claim the GART region, so let's drop the insertion here.
    
    The conflict indirectly causes X failures, as reported by Jouni in the
    bugzilla below.  We detected the conflict even before e501b3d87f00, but
    after it the AGP code (fix_northbridge()) uses the PCI resource (which is
    zeroed because of the conflict) instead of reading the BAR again.
    
    Conflicts:
        arch/x86_64/kernel/aperture.c
    
    Fixes: e501b3d87f00 agp: Support 64-bit APBASE
    Link: https://bugzilla.kernel.org/show_bug.cgi?id=72201
    Reported-and-tested-by: Jouni Mettälä <jtmettala@gmail.com>
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>


For amd64 agp, currently the region name is "aperture" instead:
drivers/char/agp/amd64-agp.c: agp_aperture_valid()

This may not be the only case, but I doubt that anyone is testing this since
long time ago kexec-tools excluding the 'GART' region. Kexec-tools and kexec_file
may need update to use "aperture" if someone can test it.

I think adding an enum value for compatibility is reasonable, we do not care
about third party drivers in mainline.

Thanks
Dave

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 14/16] x86, nvdimm, kexec: Use walk_iomem_res_desc() for iomem search
  2015-12-27 10:24           ` Borislav Petkov
  (?)
@ 2016-01-04  9:29             ` Dave Young
  -1 siblings, 0 replies; 90+ messages in thread
From: Dave Young @ 2016-01-04  9:29 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: Minfei Huang, Toshi Kani, linux-arch, linux-nvdimm, x86, kexec,
	linux-kernel, linux-mm, akpm, Dan Williams

Hi, Boris

On 12/27/15 at 11:24am, Borislav Petkov wrote:
> On Sun, Dec 27, 2015 at 10:12:57AM +0800, Minfei Huang wrote:
> > You can refer the below link that you may get a clue about GART. This is
> > the fisrt time kexec-tools tried to support to ignore GART region in 2nd
> > kernel.
> > 
> > http://lists.infradead.org/pipermail/kexec/2008-December/003096.html
> 
> So theoretically we could export that IORES_DESC* enum in an uapi header and
> move kexec-tools to use that.
> 
> However, I'm fuzzy on how exactly the whole compatibility thing is done
> with kexec-tools and the kernel. We probably would have to support
> newer kexec-tools on an older kernel and vice versa so I'd guess we
> should mark walk_iomem_res() deprecated so that people are encouraged to
> upgrade to newer kexec-tools...

Replied to Toshi old kernel will export the "GART" region for amd cards.
So for old kernel and new kexec-tools we will have problem.

I think add the GART desc for compitibility purpose is doable, no?

Thanks
Dave

^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 14/16] x86, nvdimm, kexec: Use walk_iomem_res_desc() for iomem search
@ 2016-01-04  9:29             ` Dave Young
  0 siblings, 0 replies; 90+ messages in thread
From: Dave Young @ 2016-01-04  9:29 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: Minfei Huang, Toshi Kani, linux-arch, linux-nvdimm, x86, kexec,
	linux-kernel, linux-mm, akpm, Dan Williams

Hi, Boris

On 12/27/15 at 11:24am, Borislav Petkov wrote:
> On Sun, Dec 27, 2015 at 10:12:57AM +0800, Minfei Huang wrote:
> > You can refer the below link that you may get a clue about GART. This is
> > the fisrt time kexec-tools tried to support to ignore GART region in 2nd
> > kernel.
> > 
> > http://lists.infradead.org/pipermail/kexec/2008-December/003096.html
> 
> So theoretically we could export that IORES_DESC* enum in an uapi header and
> move kexec-tools to use that.
> 
> However, I'm fuzzy on how exactly the whole compatibility thing is done
> with kexec-tools and the kernel. We probably would have to support
> newer kexec-tools on an older kernel and vice versa so I'd guess we
> should mark walk_iomem_res() deprecated so that people are encouraged to
> upgrade to newer kexec-tools...

Replied to Toshi old kernel will export the "GART" region for amd cards.
So for old kernel and new kexec-tools we will have problem.

I think add the GART desc for compitibility purpose is doable, no?

Thanks
Dave

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 14/16] x86, nvdimm, kexec: Use walk_iomem_res_desc() for iomem search
@ 2016-01-04  9:29             ` Dave Young
  0 siblings, 0 replies; 90+ messages in thread
From: Dave Young @ 2016-01-04  9:29 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: linux-arch, Toshi Kani, Minfei Huang, linux-nvdimm, x86, kexec,
	linux-kernel, linux-mm, akpm, Dan Williams

Hi, Boris

On 12/27/15 at 11:24am, Borislav Petkov wrote:
> On Sun, Dec 27, 2015 at 10:12:57AM +0800, Minfei Huang wrote:
> > You can refer the below link that you may get a clue about GART. This is
> > the fisrt time kexec-tools tried to support to ignore GART region in 2nd
> > kernel.
> > 
> > http://lists.infradead.org/pipermail/kexec/2008-December/003096.html
> 
> So theoretically we could export that IORES_DESC* enum in an uapi header and
> move kexec-tools to use that.
> 
> However, I'm fuzzy on how exactly the whole compatibility thing is done
> with kexec-tools and the kernel. We probably would have to support
> newer kexec-tools on an older kernel and vice versa so I'd guess we
> should mark walk_iomem_res() deprecated so that people are encouraged to
> upgrade to newer kexec-tools...

Replied to Toshi old kernel will export the "GART" region for amd cards.
So for old kernel and new kexec-tools we will have problem.

I think add the GART desc for compitibility purpose is doable, no?

Thanks
Dave

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 14/16] x86,nvdimm,kexec: Use walk_iomem_res_desc() for iomem search
  2016-01-04  9:25     ` [PATCH v2 14/16] x86,nvdimm,kexec: " Dave Young
  (?)
@ 2016-01-04 11:04       ` Dave Young
  -1 siblings, 0 replies; 90+ messages in thread
From: Dave Young @ 2016-01-04 11:04 UTC (permalink / raw)
  To: Toshi Kani
  Cc: akpm, bp, linux-arch, linux-mm, linux-kernel, Dan Williams, x86,
	linux-nvdimm, kexec

On 01/04/16 at 05:25pm, Dave Young wrote:
> Hi, Toshi,
> 
> On 12/25/15 at 03:09pm, Toshi Kani wrote:
> > Change to call walk_iomem_res_desc() for searching resource entries
> > with the following names:
> >  "ACPI Tables"
> >  "ACPI Non-volatile Storage"
> >  "Persistent Memory (legacy)"
> >  "Crash kernel"
> > 
> > Note, the caller of walk_iomem_res() with "GART" is left unchanged
> > because this entry may be initialized by out-of-tree drivers, which
> > do not have 'desc' set to IORES_DESC_GART.
> 
> Found below commit which initialize the GART entry:
> commit 56dd669a138c40ea6cdae487f233430d12372767
> Author: Aaron Durbin <adurbin@google.com>
> Date:   Tue Sep 26 10:52:40 2006 +0200
> 
>     [PATCH] Insert GART region into resource map
>     
>     Patch inserts the GART region into the iomem resource map. The GART will then
>     be visible within /proc/iomem. It will also allow for other users
>     utilizing the GART to subreserve the region (agp or IOMMU).
>     
>     Signed-off-by: Aaron Durbin <adurbin@google.com>
> 
> But later it was reverted:
> commit 707d4eefbdb31f8e588277157056b0ce637d6c68
> Author: Bjorn Helgaas <bhelgaas@google.com>
> Date:   Tue Mar 18 14:26:12 2014 -0600
> 
>     Revert "[PATCH] Insert GART region into resource map"
>     
>     This reverts commit 56dd669a138c, which makes the GART visible in
>     /proc/iomem.  This fixes a regression: e501b3d87f00 ("agp: Support 64-bit
>     APBASE") exposed an existing problem with a conflict between the GART
>     region and a PCI BAR region.
>     
>     The GART addresses are bus addresses, not CPU addresses, and therefore
>     should not be inserted in iomem_resource.
>     
>     On many machines, the GART region is addressable by the CPU as well as by
>     an AGP master, but CPU addressability is not required by the spec.  On some
>     of these machines, the GART is mapped by a PCI BAR, and in that case, the
>     PCI core automatically inserts it into iomem_resource, just as it does for
>     all BARs.
>     
>     Inserting it here means we'll have a conflict if the PCI core later tries
>     to claim the GART region, so let's drop the insertion here.
>     
>     The conflict indirectly causes X failures, as reported by Jouni in the
>     bugzilla below.  We detected the conflict even before e501b3d87f00, but
>     after it the AGP code (fix_northbridge()) uses the PCI resource (which is
>     zeroed because of the conflict) instead of reading the BAR again.
>     
>     Conflicts:
>         arch/x86_64/kernel/aperture.c
>     
>     Fixes: e501b3d87f00 agp: Support 64-bit APBASE
>     Link: https://bugzilla.kernel.org/show_bug.cgi?id=72201
>     Reported-and-tested-by: Jouni Mettälä <jtmettala@gmail.com>
>     Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
> 
> 
> For amd64 agp, currently the region name is "aperture" instead:
> drivers/char/agp/amd64-agp.c: agp_aperture_valid()
> 
> This may not be the only case, but I doubt that anyone is testing this since
> long time ago kexec-tools excluding the 'GART' region. Kexec-tools and kexec_file
> may need update to use "aperture" if someone can test it.
> 
> I think adding an enum value for compatibility is reasonable, we do not care
> about third party drivers in mainline.

Hmm, rethink about it, the new kernel will not export "GART" regions thus the in-kernel loader should never see such regions as long as there's no other drivers exporting it. Thus dropping the code chunk in crash.c about 'GART' should be fine.

Thanks
Dave

^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 14/16] x86,nvdimm,kexec: Use walk_iomem_res_desc() for iomem search
@ 2016-01-04 11:04       ` Dave Young
  0 siblings, 0 replies; 90+ messages in thread
From: Dave Young @ 2016-01-04 11:04 UTC (permalink / raw)
  To: Toshi Kani
  Cc: akpm, bp, linux-arch, linux-mm, linux-kernel, Dan Williams, x86,
	linux-nvdimm, kexec

On 01/04/16 at 05:25pm, Dave Young wrote:
> Hi, Toshi,
> 
> On 12/25/15 at 03:09pm, Toshi Kani wrote:
> > Change to call walk_iomem_res_desc() for searching resource entries
> > with the following names:
> >  "ACPI Tables"
> >  "ACPI Non-volatile Storage"
> >  "Persistent Memory (legacy)"
> >  "Crash kernel"
> > 
> > Note, the caller of walk_iomem_res() with "GART" is left unchanged
> > because this entry may be initialized by out-of-tree drivers, which
> > do not have 'desc' set to IORES_DESC_GART.
> 
> Found below commit which initialize the GART entry:
> commit 56dd669a138c40ea6cdae487f233430d12372767
> Author: Aaron Durbin <adurbin@google.com>
> Date:   Tue Sep 26 10:52:40 2006 +0200
> 
>     [PATCH] Insert GART region into resource map
>     
>     Patch inserts the GART region into the iomem resource map. The GART will then
>     be visible within /proc/iomem. It will also allow for other users
>     utilizing the GART to subreserve the region (agp or IOMMU).
>     
>     Signed-off-by: Aaron Durbin <adurbin@google.com>
> 
> But later it was reverted:
> commit 707d4eefbdb31f8e588277157056b0ce637d6c68
> Author: Bjorn Helgaas <bhelgaas@google.com>
> Date:   Tue Mar 18 14:26:12 2014 -0600
> 
>     Revert "[PATCH] Insert GART region into resource map"
>     
>     This reverts commit 56dd669a138c, which makes the GART visible in
>     /proc/iomem.  This fixes a regression: e501b3d87f00 ("agp: Support 64-bit
>     APBASE") exposed an existing problem with a conflict between the GART
>     region and a PCI BAR region.
>     
>     The GART addresses are bus addresses, not CPU addresses, and therefore
>     should not be inserted in iomem_resource.
>     
>     On many machines, the GART region is addressable by the CPU as well as by
>     an AGP master, but CPU addressability is not required by the spec.  On some
>     of these machines, the GART is mapped by a PCI BAR, and in that case, the
>     PCI core automatically inserts it into iomem_resource, just as it does for
>     all BARs.
>     
>     Inserting it here means we'll have a conflict if the PCI core later tries
>     to claim the GART region, so let's drop the insertion here.
>     
>     The conflict indirectly causes X failures, as reported by Jouni in the
>     bugzilla below.  We detected the conflict even before e501b3d87f00, but
>     after it the AGP code (fix_northbridge()) uses the PCI resource (which is
>     zeroed because of the conflict) instead of reading the BAR again.
>     
>     Conflicts:
>         arch/x86_64/kernel/aperture.c
>     
>     Fixes: e501b3d87f00 agp: Support 64-bit APBASE
>     Link: https://bugzilla.kernel.org/show_bug.cgi?id=72201
>     Reported-and-tested-by: Jouni Mettala <jtmettala@gmail.com>
>     Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
> 
> 
> For amd64 agp, currently the region name is "aperture" instead:
> drivers/char/agp/amd64-agp.c: agp_aperture_valid()
> 
> This may not be the only case, but I doubt that anyone is testing this since
> long time ago kexec-tools excluding the 'GART' region. Kexec-tools and kexec_file
> may need update to use "aperture" if someone can test it.
> 
> I think adding an enum value for compatibility is reasonable, we do not care
> about third party drivers in mainline.

Hmm, rethink about it, the new kernel will not export "GART" regions thus the in-kernel loader should never see such regions as long as there's no other drivers exporting it. Thus dropping the code chunk in crash.c about 'GART' should be fine.

Thanks
Dave

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 14/16] x86, nvdimm, kexec: Use walk_iomem_res_desc() for iomem search
@ 2016-01-04 11:04       ` Dave Young
  0 siblings, 0 replies; 90+ messages in thread
From: Dave Young @ 2016-01-04 11:04 UTC (permalink / raw)
  To: Toshi Kani
  Cc: linux-arch, linux-nvdimm, x86, kexec, linux-kernel, linux-mm, bp,
	akpm, Dan Williams

On 01/04/16 at 05:25pm, Dave Young wrote:
> Hi, Toshi,
> 
> On 12/25/15 at 03:09pm, Toshi Kani wrote:
> > Change to call walk_iomem_res_desc() for searching resource entries
> > with the following names:
> >  "ACPI Tables"
> >  "ACPI Non-volatile Storage"
> >  "Persistent Memory (legacy)"
> >  "Crash kernel"
> > 
> > Note, the caller of walk_iomem_res() with "GART" is left unchanged
> > because this entry may be initialized by out-of-tree drivers, which
> > do not have 'desc' set to IORES_DESC_GART.
> 
> Found below commit which initialize the GART entry:
> commit 56dd669a138c40ea6cdae487f233430d12372767
> Author: Aaron Durbin <adurbin@google.com>
> Date:   Tue Sep 26 10:52:40 2006 +0200
> 
>     [PATCH] Insert GART region into resource map
>     
>     Patch inserts the GART region into the iomem resource map. The GART will then
>     be visible within /proc/iomem. It will also allow for other users
>     utilizing the GART to subreserve the region (agp or IOMMU).
>     
>     Signed-off-by: Aaron Durbin <adurbin@google.com>
> 
> But later it was reverted:
> commit 707d4eefbdb31f8e588277157056b0ce637d6c68
> Author: Bjorn Helgaas <bhelgaas@google.com>
> Date:   Tue Mar 18 14:26:12 2014 -0600
> 
>     Revert "[PATCH] Insert GART region into resource map"
>     
>     This reverts commit 56dd669a138c, which makes the GART visible in
>     /proc/iomem.  This fixes a regression: e501b3d87f00 ("agp: Support 64-bit
>     APBASE") exposed an existing problem with a conflict between the GART
>     region and a PCI BAR region.
>     
>     The GART addresses are bus addresses, not CPU addresses, and therefore
>     should not be inserted in iomem_resource.
>     
>     On many machines, the GART region is addressable by the CPU as well as by
>     an AGP master, but CPU addressability is not required by the spec.  On some
>     of these machines, the GART is mapped by a PCI BAR, and in that case, the
>     PCI core automatically inserts it into iomem_resource, just as it does for
>     all BARs.
>     
>     Inserting it here means we'll have a conflict if the PCI core later tries
>     to claim the GART region, so let's drop the insertion here.
>     
>     The conflict indirectly causes X failures, as reported by Jouni in the
>     bugzilla below.  We detected the conflict even before e501b3d87f00, but
>     after it the AGP code (fix_northbridge()) uses the PCI resource (which is
>     zeroed because of the conflict) instead of reading the BAR again.
>     
>     Conflicts:
>         arch/x86_64/kernel/aperture.c
>     
>     Fixes: e501b3d87f00 agp: Support 64-bit APBASE
>     Link: https://bugzilla.kernel.org/show_bug.cgi?id=72201
>     Reported-and-tested-by: Jouni Mettälä <jtmettala@gmail.com>
>     Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
> 
> 
> For amd64 agp, currently the region name is "aperture" instead:
> drivers/char/agp/amd64-agp.c: agp_aperture_valid()
> 
> This may not be the only case, but I doubt that anyone is testing this since
> long time ago kexec-tools excluding the 'GART' region. Kexec-tools and kexec_file
> may need update to use "aperture" if someone can test it.
> 
> I think adding an enum value for compatibility is reasonable, we do not care
> about third party drivers in mainline.

Hmm, rethink about it, the new kernel will not export "GART" regions thus the in-kernel loader should never see such regions as long as there's no other drivers exporting it. Thus dropping the code chunk in crash.c about 'GART' should be fine.

Thanks
Dave

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [Xen-devel] [PATCH v2 08/16] xen, mm: Set IORESOURCE_SYSTEM_RAM to System RAM
  2015-12-25 22:09   ` Toshi Kani
  (?)
@ 2016-01-04 11:41     ` David Vrabel
  -1 siblings, 0 replies; 90+ messages in thread
From: David Vrabel @ 2016-01-04 11:41 UTC (permalink / raw)
  To: Toshi Kani, akpm, bp; +Cc: linux-arch, linux-kernel, linux-mm, xen-devel

On 25/12/15 22:09, Toshi Kani wrote:
> Set IORESOURCE_SYSTEM_RAM to 'flags' of struct resource entries
> with "System RAM".
[...]
> --- a/drivers/xen/balloon.c
> +++ b/drivers/xen/balloon.c
> @@ -257,7 +257,7 @@ static struct resource *additional_memory_resource(phys_addr_t size)
>  		return NULL;
>  
>  	res->name = "System RAM";
> -	res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
> +	res->flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY;
>  
>  	ret = allocate_resource(&iomem_resource, res,
>  				size, 0, -1,

Acked-by: David Vrabel <david.vrabel@citrix.com>

David

^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [Xen-devel] [PATCH v2 08/16] xen, mm: Set IORESOURCE_SYSTEM_RAM to System RAM
@ 2016-01-04 11:41     ` David Vrabel
  0 siblings, 0 replies; 90+ messages in thread
From: David Vrabel @ 2016-01-04 11:41 UTC (permalink / raw)
  To: Toshi Kani, akpm, bp; +Cc: linux-arch, linux-kernel, linux-mm, xen-devel

On 25/12/15 22:09, Toshi Kani wrote:
> Set IORESOURCE_SYSTEM_RAM to 'flags' of struct resource entries
> with "System RAM".
[...]
> --- a/drivers/xen/balloon.c
> +++ b/drivers/xen/balloon.c
> @@ -257,7 +257,7 @@ static struct resource *additional_memory_resource(phys_addr_t size)
>  		return NULL;
>  
>  	res->name = "System RAM";
> -	res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
> +	res->flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY;
>  
>  	ret = allocate_resource(&iomem_resource, res,
>  				size, 0, -1,

Acked-by: David Vrabel <david.vrabel@citrix.com>

David

^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [Xen-devel] [PATCH v2 08/16] xen, mm: Set IORESOURCE_SYSTEM_RAM to System RAM
@ 2016-01-04 11:41     ` David Vrabel
  0 siblings, 0 replies; 90+ messages in thread
From: David Vrabel @ 2016-01-04 11:41 UTC (permalink / raw)
  To: Toshi Kani, akpm, bp; +Cc: linux-arch, linux-kernel, linux-mm, xen-devel

On 25/12/15 22:09, Toshi Kani wrote:
> Set IORESOURCE_SYSTEM_RAM to 'flags' of struct resource entries
> with "System RAM".
[...]
> --- a/drivers/xen/balloon.c
> +++ b/drivers/xen/balloon.c
> @@ -257,7 +257,7 @@ static struct resource *additional_memory_resource(phys_addr_t size)
>  		return NULL;
>  
>  	res->name = "System RAM";
> -	res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
> +	res->flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY;
>  
>  	ret = allocate_resource(&iomem_resource, res,
>  				size, 0, -1,

Acked-by: David Vrabel <david.vrabel@citrix.com>

David

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 08/16] xen, mm: Set IORESOURCE_SYSTEM_RAM to System RAM
  2015-12-25 22:09   ` Toshi Kani
  (?)
  (?)
@ 2016-01-04 11:41   ` David Vrabel
  -1 siblings, 0 replies; 90+ messages in thread
From: David Vrabel @ 2016-01-04 11:41 UTC (permalink / raw)
  To: Toshi Kani, akpm, bp; +Cc: linux-arch, linux-mm, linux-kernel, xen-devel

On 25/12/15 22:09, Toshi Kani wrote:
> Set IORESOURCE_SYSTEM_RAM to 'flags' of struct resource entries
> with "System RAM".
[...]
> --- a/drivers/xen/balloon.c
> +++ b/drivers/xen/balloon.c
> @@ -257,7 +257,7 @@ static struct resource *additional_memory_resource(phys_addr_t size)
>  		return NULL;
>  
>  	res->name = "System RAM";
> -	res->flags = IORESOURCE_MEM | IORESOURCE_BUSY;
> +	res->flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY;
>  
>  	ret = allocate_resource(&iomem_resource, res,
>  				size, 0, -1,

Acked-by: David Vrabel <david.vrabel@citrix.com>

David

^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 14/16] x86, nvdimm, kexec: Use walk_iomem_res_desc() for iomem search
@ 2016-01-04 12:26               ` Borislav Petkov
  0 siblings, 0 replies; 90+ messages in thread
From: Borislav Petkov @ 2016-01-04 12:26 UTC (permalink / raw)
  To: Dave Young
  Cc: Minfei Huang, Toshi Kani, linux-arch, linux-nvdimm, x86, kexec,
	linux-kernel, linux-mm, akpm, Dan Williams

On Mon, Jan 04, 2016 at 05:29:37PM +0800, Dave Young wrote:
> Replied to Toshi old kernel will export the "GART" region for amd cards.
> So for old kernel and new kexec-tools we will have problem.
> 
> I think add the GART desc for compitibility purpose is doable, no?

Just read your other mails too. If I see it correctly, there's only one
place which has "GART":

$ git grep -e \"GART\"
arch/x86/kernel/crash.c:235:    walk_iomem_res("GART", IORESOURCE_MEM, 0, -1,

So crash.c only excludes this region but the kernel doesn't create it.
Right?

So we can kill that walk_iomem_res(), as you say. Which would be even
nicer...

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.

^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 14/16] x86, nvdimm, kexec: Use walk_iomem_res_desc() for iomem search
@ 2016-01-04 12:26               ` Borislav Petkov
  0 siblings, 0 replies; 90+ messages in thread
From: Borislav Petkov @ 2016-01-04 12:26 UTC (permalink / raw)
  To: Dave Young
  Cc: linux-arch-u79uwXL29TY76Z2rM5mHXA, Toshi Kani, Minfei Huang,
	linux-nvdimm-y27Ovi1pjclAfugRpC6u6w, x86-DgEjT+Ai2ygdnm+yROfE0A,
	kexec-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-mm-Bw31MaZKKs3YtjvyW6yDsg,
	akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b, Dan Williams

On Mon, Jan 04, 2016 at 05:29:37PM +0800, Dave Young wrote:
> Replied to Toshi old kernel will export the "GART" region for amd cards.
> So for old kernel and new kexec-tools we will have problem.
> 
> I think add the GART desc for compitibility purpose is doable, no?

Just read your other mails too. If I see it correctly, there's only one
place which has "GART":

$ git grep -e \"GART\"
arch/x86/kernel/crash.c:235:    walk_iomem_res("GART", IORESOURCE_MEM, 0, -1,

So crash.c only excludes this region but the kernel doesn't create it.
Right?

So we can kill that walk_iomem_res(), as you say. Which would be even
nicer...

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.

^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 14/16] x86, nvdimm, kexec: Use walk_iomem_res_desc() for iomem search
@ 2016-01-04 12:26               ` Borislav Petkov
  0 siblings, 0 replies; 90+ messages in thread
From: Borislav Petkov @ 2016-01-04 12:26 UTC (permalink / raw)
  To: Dave Young
  Cc: linux-arch, Toshi Kani, Minfei Huang, linux-nvdimm, x86, kexec,
	linux-kernel, linux-mm, akpm, Dan Williams

On Mon, Jan 04, 2016 at 05:29:37PM +0800, Dave Young wrote:
> Replied to Toshi old kernel will export the "GART" region for amd cards.
> So for old kernel and new kexec-tools we will have problem.
> 
> I think add the GART desc for compitibility purpose is doable, no?

Just read your other mails too. If I see it correctly, there's only one
place which has "GART":

$ git grep -e \"GART\"
arch/x86/kernel/crash.c:235:    walk_iomem_res("GART", IORESOURCE_MEM, 0, -1,

So crash.c only excludes this region but the kernel doesn't create it.
Right?

So we can kill that walk_iomem_res(), as you say. Which would be even
nicer...

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 14/16] x86, nvdimm, kexec: Use walk_iomem_res_desc() for iomem search
  2016-01-04 12:26               ` Borislav Petkov
  (?)
@ 2016-01-04 17:57                 ` Toshi Kani
  -1 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2016-01-04 17:57 UTC (permalink / raw)
  To: Borislav Petkov, Dave Young
  Cc: Minfei Huang, linux-arch, linux-nvdimm, x86, kexec, linux-kernel,
	linux-mm, akpm, Dan Williams

On Mon, 2016-01-04 at 13:26 +0100, Borislav Petkov wrote:
> On Mon, Jan 04, 2016 at 05:29:37PM +0800, Dave Young wrote:
> > Replied to Toshi old kernel will export the "GART" region for amd
> > cards.
> > So for old kernel and new kexec-tools we will have problem.
> > 
> > I think add the GART desc for compitibility purpose is doable, no?
> 
> Just read your other mails too. If I see it correctly, there's only one
> place which has "GART":
> 
> $ git grep -e \"GART\"
> arch/x86/kernel/crash.c:235:    walk_iomem_res("GART", IORESOURCE_MEM, 0,
> -1,
> 
> So crash.c only excludes this region but the kernel doesn't create it.
> Right?
> 
> So we can kill that walk_iomem_res(), as you say. Which would be even
> nicer...

Agreed.  As Dave suggested in the other thread, we can simply remove the
walk_iomem_res("GART",) call in crash.c.  

With this change, there will be no caller to walk_iomem_res().  Should we
remove walk_iomem_res() altogether, or keep it for now as a deprecated func
with the checkpatch check? 

Thanks,
-Toshi


^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 14/16] x86, nvdimm, kexec: Use walk_iomem_res_desc() for iomem search
@ 2016-01-04 17:57                 ` Toshi Kani
  0 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2016-01-04 17:57 UTC (permalink / raw)
  To: Borislav Petkov, Dave Young
  Cc: Minfei Huang, linux-arch, linux-nvdimm, x86, kexec, linux-kernel,
	linux-mm, akpm, Dan Williams

On Mon, 2016-01-04 at 13:26 +0100, Borislav Petkov wrote:
> On Mon, Jan 04, 2016 at 05:29:37PM +0800, Dave Young wrote:
> > Replied to Toshi old kernel will export the "GART" region for amd
> > cards.
> > So for old kernel and new kexec-tools we will have problem.
> > 
> > I think add the GART desc for compitibility purpose is doable, no?
> 
> Just read your other mails too. If I see it correctly, there's only one
> place which has "GART":
> 
> $ git grep -e \"GART\"
> arch/x86/kernel/crash.c:235:    walk_iomem_res("GART", IORESOURCE_MEM, 0,
> -1,
> 
> So crash.c only excludes this region but the kernel doesn't create it.
> Right?
> 
> So we can kill that walk_iomem_res(), as you say. Which would be even
> nicer...

Agreed.  As Dave suggested in the other thread, we can simply remove the
walk_iomem_res("GART",) call in crash.c.  

With this change, there will be no caller to walk_iomem_res().  Should we
remove walk_iomem_res() altogether, or keep it for now as a deprecated func
with the checkpatch check? 

Thanks,
-Toshi

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 14/16] x86, nvdimm, kexec: Use walk_iomem_res_desc() for iomem search
@ 2016-01-04 17:57                 ` Toshi Kani
  0 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2016-01-04 17:57 UTC (permalink / raw)
  To: Borislav Petkov, Dave Young
  Cc: linux-arch, Minfei Huang, linux-nvdimm, x86, kexec, linux-kernel,
	linux-mm, akpm, Dan Williams

On Mon, 2016-01-04 at 13:26 +0100, Borislav Petkov wrote:
> On Mon, Jan 04, 2016 at 05:29:37PM +0800, Dave Young wrote:
> > Replied to Toshi old kernel will export the "GART" region for amd
> > cards.
> > So for old kernel and new kexec-tools we will have problem.
> > 
> > I think add the GART desc for compitibility purpose is doable, no?
> 
> Just read your other mails too. If I see it correctly, there's only one
> place which has "GART":
> 
> $ git grep -e \"GART\"
> arch/x86/kernel/crash.c:235:    walk_iomem_res("GART", IORESOURCE_MEM, 0,
> -1,
> 
> So crash.c only excludes this region but the kernel doesn't create it.
> Right?
> 
> So we can kill that walk_iomem_res(), as you say. Which would be even
> nicer...

Agreed.  As Dave suggested in the other thread, we can simply remove the
walk_iomem_res("GART",) call in crash.c.  

With this change, there will be no caller to walk_iomem_res().  Should we
remove walk_iomem_res() altogether, or keep it for now as a deprecated func
with the checkpatch check? 

Thanks,
-Toshi


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 14/16] x86, nvdimm, kexec: Use walk_iomem_res_desc() for iomem search
  2016-01-04 17:57                 ` Toshi Kani
@ 2016-01-04 19:41                   ` Borislav Petkov
  -1 siblings, 0 replies; 90+ messages in thread
From: Borislav Petkov @ 2016-01-04 19:41 UTC (permalink / raw)
  To: Toshi Kani
  Cc: Dave Young, Minfei Huang, linux-arch, linux-nvdimm, x86, kexec,
	linux-kernel, linux-mm, akpm, Dan Williams

On Mon, Jan 04, 2016 at 10:57:40AM -0700, Toshi Kani wrote:
> With this change, there will be no caller to walk_iomem_res().  Should we
> remove walk_iomem_res() altogether, or keep it for now as a deprecated func
> with the checkpatch check?

Yes, kill it on the spot so that people don't get crazy ideas.

Thanks!

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.

^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 14/16] x86, nvdimm, kexec: Use walk_iomem_res_desc() for iomem search
@ 2016-01-04 19:41                   ` Borislav Petkov
  0 siblings, 0 replies; 90+ messages in thread
From: Borislav Petkov @ 2016-01-04 19:41 UTC (permalink / raw)
  To: Toshi Kani
  Cc: linux-arch, Minfei Huang, linux-nvdimm, x86, kexec, linux-kernel,
	linux-mm, akpm, Dave Young, Dan Williams

On Mon, Jan 04, 2016 at 10:57:40AM -0700, Toshi Kani wrote:
> With this change, there will be no caller to walk_iomem_res().  Should we
> remove walk_iomem_res() altogether, or keep it for now as a deprecated func
> with the checkpatch check?

Yes, kill it on the spot so that people don't get crazy ideas.

Thanks!

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 14/16] x86, nvdimm, kexec: Use walk_iomem_res_desc() for iomem search
  2016-01-04 19:41                   ` Borislav Petkov
  (?)
@ 2016-01-04 19:45                     ` Toshi Kani
  -1 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2016-01-04 19:45 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: Dave Young, Minfei Huang, linux-arch, linux-nvdimm, x86, kexec,
	linux-kernel, linux-mm, akpm, Dan Williams

On Mon, 2016-01-04 at 20:41 +0100, Borislav Petkov wrote:
> On Mon, Jan 04, 2016 at 10:57:40AM -0700, Toshi Kani wrote:
> > With this change, there will be no caller to walk_iomem_res().  Should 
> > we remove walk_iomem_res() altogether, or keep it for now as a 
> > deprecated func with the checkpatch check?
> 
> Yes, kill it on the spot so that people don't get crazy ideas.

Will do.  

Thanks!
-Toshi


^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 14/16] x86, nvdimm, kexec: Use walk_iomem_res_desc() for iomem search
@ 2016-01-04 19:45                     ` Toshi Kani
  0 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2016-01-04 19:45 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: Dave Young, Minfei Huang, linux-arch, linux-nvdimm, x86, kexec,
	linux-kernel, linux-mm, akpm, Dan Williams

On Mon, 2016-01-04 at 20:41 +0100, Borislav Petkov wrote:
> On Mon, Jan 04, 2016 at 10:57:40AM -0700, Toshi Kani wrote:
> > With this change, there will be no caller to walk_iomem_res().  Should 
> > we remove walk_iomem_res() altogether, or keep it for now as a 
> > deprecated func with the checkpatch check?
> 
> Yes, kill it on the spot so that people don't get crazy ideas.

Will do.  

Thanks!
-Toshi

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 14/16] x86, nvdimm, kexec: Use walk_iomem_res_desc() for iomem search
@ 2016-01-04 19:45                     ` Toshi Kani
  0 siblings, 0 replies; 90+ messages in thread
From: Toshi Kani @ 2016-01-04 19:45 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: linux-arch, Minfei Huang, linux-nvdimm, x86, kexec, linux-kernel,
	linux-mm, akpm, Dave Young, Dan Williams

On Mon, 2016-01-04 at 20:41 +0100, Borislav Petkov wrote:
> On Mon, Jan 04, 2016 at 10:57:40AM -0700, Toshi Kani wrote:
> > With this change, there will be no caller to walk_iomem_res().  Should 
> > we remove walk_iomem_res() altogether, or keep it for now as a 
> > deprecated func with the checkpatch check?
> 
> Yes, kill it on the spot so that people don't get crazy ideas.

Will do.  

Thanks!
-Toshi


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 14/16] x86, nvdimm, kexec: Use walk_iomem_res_desc() for iomem search
  2016-01-04 12:26               ` Borislav Petkov
  (?)
@ 2016-01-05  5:20                 ` Dave Young
  -1 siblings, 0 replies; 90+ messages in thread
From: Dave Young @ 2016-01-05  5:20 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: Minfei Huang, Toshi Kani, linux-arch, linux-nvdimm, x86, kexec,
	linux-kernel, linux-mm, akpm, Dan Williams

On 01/04/16 at 01:26pm, Borislav Petkov wrote:
> On Mon, Jan 04, 2016 at 05:29:37PM +0800, Dave Young wrote:
> > Replied to Toshi old kernel will export the "GART" region for amd cards.
> > So for old kernel and new kexec-tools we will have problem.
> > 
> > I think add the GART desc for compitibility purpose is doable, no?
> 
> Just read your other mails too. If I see it correctly, there's only one
> place which has "GART":
> 
> $ git grep -e \"GART\"
> arch/x86/kernel/crash.c:235:    walk_iomem_res("GART", IORESOURCE_MEM, 0, -1,
> 
> So crash.c only excludes this region but the kernel doesn't create it.
> Right?

Right.

> 
> So we can kill that walk_iomem_res(), as you say. Which would be even
> nicer...

Yes, I think it is ok to kill walk_iomem_res()

Thanks
Dave

^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 14/16] x86, nvdimm, kexec: Use walk_iomem_res_desc() for iomem search
@ 2016-01-05  5:20                 ` Dave Young
  0 siblings, 0 replies; 90+ messages in thread
From: Dave Young @ 2016-01-05  5:20 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: Minfei Huang, Toshi Kani, linux-arch, linux-nvdimm, x86, kexec,
	linux-kernel, linux-mm, akpm, Dan Williams

On 01/04/16 at 01:26pm, Borislav Petkov wrote:
> On Mon, Jan 04, 2016 at 05:29:37PM +0800, Dave Young wrote:
> > Replied to Toshi old kernel will export the "GART" region for amd cards.
> > So for old kernel and new kexec-tools we will have problem.
> > 
> > I think add the GART desc for compitibility purpose is doable, no?
> 
> Just read your other mails too. If I see it correctly, there's only one
> place which has "GART":
> 
> $ git grep -e \"GART\"
> arch/x86/kernel/crash.c:235:    walk_iomem_res("GART", IORESOURCE_MEM, 0, -1,
> 
> So crash.c only excludes this region but the kernel doesn't create it.
> Right?

Right.

> 
> So we can kill that walk_iomem_res(), as you say. Which would be even
> nicer...

Yes, I think it is ok to kill walk_iomem_res()

Thanks
Dave

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 90+ messages in thread

* Re: [PATCH v2 14/16] x86, nvdimm, kexec: Use walk_iomem_res_desc() for iomem search
@ 2016-01-05  5:20                 ` Dave Young
  0 siblings, 0 replies; 90+ messages in thread
From: Dave Young @ 2016-01-05  5:20 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: linux-arch, Toshi Kani, Minfei Huang, linux-nvdimm, x86, kexec,
	linux-kernel, linux-mm, akpm, Dan Williams

On 01/04/16 at 01:26pm, Borislav Petkov wrote:
> On Mon, Jan 04, 2016 at 05:29:37PM +0800, Dave Young wrote:
> > Replied to Toshi old kernel will export the "GART" region for amd cards.
> > So for old kernel and new kexec-tools we will have problem.
> > 
> > I think add the GART desc for compitibility purpose is doable, no?
> 
> Just read your other mails too. If I see it correctly, there's only one
> place which has "GART":
> 
> $ git grep -e \"GART\"
> arch/x86/kernel/crash.c:235:    walk_iomem_res("GART", IORESOURCE_MEM, 0, -1,
> 
> So crash.c only excludes this region but the kernel doesn't create it.
> Right?

Right.

> 
> So we can kill that walk_iomem_res(), as you say. Which would be even
> nicer...

Yes, I think it is ok to kill walk_iomem_res()

Thanks
Dave

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

^ permalink raw reply	[flat|nested] 90+ messages in thread

end of thread, other threads:[~2016-01-05  5:20 UTC | newest]

Thread overview: 90+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-25 22:09 [PATCH v2 01/16] resource: Add System RAM resource type Toshi Kani
2015-12-25 22:09 ` Toshi Kani
2015-12-25 22:09 ` [PATCH v2 02/16] resource: make resource flags handled properly Toshi Kani
2015-12-25 22:09   ` Toshi Kani
2015-12-25 22:09 ` [PATCH v2 03/16] resource: Add I/O resource descriptor Toshi Kani
2015-12-25 22:09   ` Toshi Kani
2015-12-25 22:09 ` [PATCH v2 04/16] x86/e820: Set System RAM type and descriptor Toshi Kani
2015-12-25 22:09   ` Toshi Kani
2015-12-25 22:09 ` [PATCH v2 05/16] ia64: " Toshi Kani
2015-12-25 22:09   ` Toshi Kani
2015-12-25 22:09   ` Toshi Kani
2015-12-25 22:09 ` [PATCH v2 06/16] arch: Set IORESOURCE_SYSTEM_RAM to System RAM Toshi Kani
2015-12-25 22:09   ` Toshi Kani
2015-12-25 22:09 ` [PATCH v2 07/16] kexec: " Toshi Kani
2015-12-25 22:09   ` Toshi Kani
2015-12-25 22:09 ` [PATCH v2 08/16] xen, mm: " Toshi Kani
2015-12-25 22:09   ` Toshi Kani
2016-01-04 11:41   ` [Xen-devel] " David Vrabel
2016-01-04 11:41     ` David Vrabel
2016-01-04 11:41     ` David Vrabel
2016-01-04 11:41   ` David Vrabel
2015-12-25 22:09 ` Toshi Kani
2015-12-25 22:09 ` [PATCH v2 09/16] drivers: Initialize resource entry to zero Toshi Kani
2015-12-25 22:09   ` Toshi Kani
2015-12-25 22:09   ` Toshi Kani
2015-12-28 21:37   ` Simon Horman
2015-12-28 21:37     ` Simon Horman
2015-12-28 21:37     ` Simon Horman
2015-12-25 22:09 ` [PATCH v2 10/16] resource: Change walk_system_ram to use System RAM type Toshi Kani
2015-12-25 22:09   ` Toshi Kani
2015-12-25 22:09 ` [PATCH v2 11/16] arm/samsung: Change s3c_pm_run_res() " Toshi Kani
2015-12-25 22:09   ` Toshi Kani
2015-12-25 22:09 ` [PATCH v2 12/16] memremap: Change region_intersects() to take @flags and @desc Toshi Kani
2015-12-25 22:09   ` Toshi Kani
2015-12-25 22:09 ` [PATCH v2 13/16] resource: Add walk_iomem_res_desc() Toshi Kani
2015-12-25 22:09   ` Toshi Kani
2015-12-25 22:09 ` [PATCH v2 14/16] x86,nvdimm,kexec: Use walk_iomem_res_desc() for iomem search Toshi Kani
2015-12-25 22:09   ` Toshi Kani
2015-12-25 22:09   ` Toshi Kani
2015-12-26 10:38   ` Borislav Petkov
2015-12-26 10:38     ` Borislav Petkov
2015-12-27  0:31     ` Toshi Kani
2015-12-27  0:31       ` [PATCH v2 14/16] x86, nvdimm, kexec: " Toshi Kani
2015-12-27  0:31       ` [PATCH v2 14/16] x86,nvdimm,kexec: " Toshi Kani
2015-12-27  0:31       ` Toshi Kani
2015-12-27  2:12       ` [PATCH v2 14/16] x86, nvdimm, kexec: " Minfei Huang
2015-12-27  2:12         ` Minfei Huang
2015-12-27  2:12         ` Minfei Huang
2015-12-27 10:24         ` Borislav Petkov
2015-12-27 10:24           ` Borislav Petkov
2015-12-27 10:24           ` Borislav Petkov
2016-01-04  9:29           ` Dave Young
2016-01-04  9:29             ` Dave Young
2016-01-04  9:29             ` Dave Young
2016-01-04 12:26             ` Borislav Petkov
2016-01-04 12:26               ` Borislav Petkov
2016-01-04 12:26               ` Borislav Petkov
2016-01-04 17:57               ` Toshi Kani
2016-01-04 17:57                 ` Toshi Kani
2016-01-04 17:57                 ` Toshi Kani
2016-01-04 19:41                 ` Borislav Petkov
2016-01-04 19:41                   ` Borislav Petkov
2016-01-04 19:45                   ` Toshi Kani
2016-01-04 19:45                     ` Toshi Kani
2016-01-04 19:45                     ` Toshi Kani
2016-01-05  5:20               ` Dave Young
2016-01-05  5:20                 ` Dave Young
2016-01-05  5:20                 ` Dave Young
2015-12-26 16:05   ` [PATCH v2 14/16] x86,nvdimm,kexec: " Minfei Huang
2015-12-26 16:05     ` [PATCH v2 14/16] x86, nvdimm, kexec: " Minfei Huang
2015-12-26 16:05     ` [PATCH v2 14/16] x86,nvdimm,kexec: " Minfei Huang
2015-12-27  0:39     ` Toshi Kani
2015-12-27  0:39       ` [PATCH v2 14/16] x86, nvdimm, kexec: " Toshi Kani
2015-12-27  0:39       ` [PATCH v2 14/16] x86,nvdimm,kexec: " Toshi Kani
2016-01-04  9:25   ` Dave Young
2016-01-04  9:25     ` [PATCH v2 14/16] x86, nvdimm, kexec: " Dave Young
2016-01-04  9:25     ` [PATCH v2 14/16] x86,nvdimm,kexec: " Dave Young
2016-01-04 11:04     ` Dave Young
2016-01-04 11:04       ` [PATCH v2 14/16] x86, nvdimm, kexec: " Dave Young
2016-01-04 11:04       ` [PATCH v2 14/16] x86,nvdimm,kexec: " Dave Young
2015-12-25 22:09 ` [PATCH v2 15/16] checkpatch: Add warning on deprecated walk_iomem_res Toshi Kani
2015-12-25 22:09   ` Toshi Kani
2015-12-26  0:05   ` Joe Perches
2015-12-26  0:05     ` Joe Perches
2015-12-26  0:05     ` Joe Perches
2015-12-27  0:52     ` Toshi Kani
2015-12-27  0:52       ` Toshi Kani
2015-12-25 22:09 ` [PATCH v2 16/16] ACPI/EINJ: Allow memory error injection to NVDIMM Toshi Kani
2015-12-25 22:09   ` Toshi Kani
2015-12-25 22:09   ` Toshi Kani

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.