Meaning of 'no-map' in reserved-memory, and accessing a memory region from two OSes using physical adderss

Chan Kim ckim at etri.re.kr
Tue Dec 27 01:48:32 EST 2022


Hello all,

In the device tree, I have declared a reserved-memory node and a child node
inside it.
And I have put 'no-map' property to that reserved memory and a device node
uses that reserved memory.
But in the driver for the device, when I use the memremap'ed virtual
address, the read/write runs ok.
But using physical memory, it crashes.

I thought with 'no-map' property, I could just use the physical address but
it turned out I can't.

The document on reserved-memory says this about the 'no-map' property. 
(in Documentation/devicetree/bindings/reserved-memory/reserved-memory.txt)

no-map (optional) - empty property
    - Indicates the operating system must not create a virtual mapping
      of the region as part of its standard mapping of system memory,
      nor permit speculative access to it under any circumstances other
      than under the control of the device driver using the region.

I can't understand what 'the OS must not create a virtual mapping of the
region as part of its standard mapping of system memory'.
Any reserved-memory is excluded from the usage of OS, then, what does this
'no-map' mean?
The memremap function just ran without error and I could use the region with
returned virtual address.

The thing I want to do is accessing the memory region with physical address,
and I hope another OS which connects to our board using PCIe link (our side
is endpoint) can also access the region with the PCIe mapped physical
address (by itself declaring the region as reserved-memory). Is this kind
things impossible?

Thank you for reading

Best regards,
Chan Kim







More information about the Kernelnewbies mailing list