|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH] xen/dt: Skip non-RAM reserved-memory regions in make_memory_node()
On 30-Oct-26 22:58, Kuan-Wei Chiu wrote: > Hi Michal, > > On Fri, Oct 30, 2026 at 12:04:58PM +0100, Orzel, Michal wrote: >> >> >> On 28-Oct-26 22:17, Kuan-Wei Chiu wrote: >>> Xen creates a second /memory node for Dom0 from >>> bootinfo_get_reserved_mem() without checking whether those regions >>> belong to host RAM. However, /reserved-memory can also describe >>> on-chip SRAM or firmware regions outside system RAM. Listing them in a >>> /memory node causes Dom0 to register non-RAM addresses as system RAM, >>> conflicting with device MMIO mappings. >> Hmm, I always thought that /reserved-memory is to exclude regions from memory >> described under /memory. That's what Xen assumes too. map_range_to_domain() >> for >> example does not call iomem_permit_access() for such regions because we >> assume >> it's RAM. Can you provide more details of your board e.g. the device tree? Is >> there any documentation I could use to confirm that "reserved-memory can also >> describe on-chip SRAM or firmware regions outside system RAM"? >> > Hmm, your reply initially made me wonder if this was caused by a > non-compliant downstream device tree on our side, so I checked the > DT spec and upstream Linux. > > The devicetree spec does not seem to explicitly mention whether > /reserved-memory regions must fall within the range described by > /memory. From a quick look at early_init_dt_reserve_memory() in Linux, > the comment there also mentions not worrying if a no-map region is not > memory as it will not be mapped. > > In upstream Linux device trees, there are cases like > arch/mips/boot/dts/mobileye/eyeq5.dtsi and eyeq5-epm5.dts, where > /memory starts at 0x40000000 and 0x802000000, while /reserved-memory > defines an on-chip sram region nvram@461fe00 with "nvmem-rmem" outside > /memory. > > Our board's device tree is not upstream yet, but it follows a similar > pattern where /reserved-memory defines "nvmem-rmem" and dma pool > sub-regions inside on-chip sram outside the dram range described by > /memory. Thanks for confirmation. I can now see: https://elixir.bootlin.com/linux/v7.3/source/Documentation/devicetree/bindings/nvmem/rmem.yaml so indeed /reserved-memory may describe non-RAM regions. I'll get back to your patch then. ~Michal
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |