On Wed, Sep 25, 2019 at 8:31 PM Taeho Hwang <taeho1224(a)gmail.com> wrote:
This patch checks whether the specified memory (memmap) is
userable or not. This patch prevents non-existing memory
from being emulated as persistent memory.
If non-existing memory is specified by memmap without
this patch, struct nd_namespace_io and struct pmem_device
will have invalid values.
The whole point of the memmap= option is that the person specifying it
knows more about the memory map than either the kernel or the platform
BIOS. Validating the memmap= parameter against the very same memory
map that is trying to be overridden violates that assumption. So
memmap= is a dangerous interface on purpose. Now, if you want to
define a new option that requires the base type to be E820_RAM that
might be defensible, but at this point given the age of the
memmap=ss!nn option and the wikis available to picking a valid value,
I'd advocate leaving it as is.