[lkml]   [2020]   [Mar]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 4/5] resource: Report parent to walk_iomem_res_desc() callback
In support of detecting whether a resource might have been been claimed,
report the parent to the walk_iomem_res_desc() callback. For example,
the ACPI HMAT parser publishes "hmem" platform devices per target range.
However, if the HMAT is disabled / missing a fallback driver can attach
devices to the raw memory ranges as a fallback if it sees unclaimed /
orphan "Soft Reserved" resources in the resource tree.

Otherwise, find_next_iomem_res() returns a resource with garbage data
from the stack allocation in __walk_iomem_res_desc() for the res->parent

Cc: Jason Gunthorpe <>
Cc: Dave Hansen <>
Cc: Wei Yang <>
Cc: Tom Lendacky <>
Signed-off-by: Dan Williams <>
kernel/resource.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/kernel/resource.c b/kernel/resource.c
index 76036a41143b..6e22e312fd55 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -386,6 +386,7 @@ static int find_next_iomem_res(resource_size_t start, resource_size_t end,
res->end = min(end, p->end);
res->flags = p->flags;
res->desc = p->desc;
+ res->parent = p->parent;

 \ /
  Last update: 2020-03-02 23:37    [W:0.158 / U:4.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site