Skip to content

Commit

Permalink
kexec_file: don't place kexec images on IORESOURCE_MEM_DRIVER_MANAGED
Browse files Browse the repository at this point in the history
Memory flagged with IORESOURCE_MEM_DRIVER_MANAGED is special - it won't be
part of the initial memmap of the kexec kernel and not all memory might be
accessible.  Don't place any kexec images onto it.

Signed-off-by: David Hildenbrand <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Pankaj Gupta <[email protected]>
Cc: Wei Yang <[email protected]>
Cc: Baoquan He <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: Eric Biederman <[email protected]>
Cc: Pavel Tatashin <[email protected]>
Cc: Dan Williams <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
davidhildenbrand authored and torvalds committed Jun 5, 2020
1 parent 7b7b272 commit 3fe4f49
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions kernel/kexec_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,11 @@ static int locate_mem_hole_callback(struct resource *res, void *arg)
unsigned long sz = end - start + 1;

/* Returning 0 will take to next memory range */

/* Don't use memory that will be detected and handled by a driver. */
if (res->flags & IORESOURCE_MEM_DRIVER_MANAGED)
return 0;

if (sz < kbuf->memsz)
return 0;

Expand Down

0 comments on commit 3fe4f49

Please sign in to comment.