[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()


  • To: Kuan-Wei Chiu <visitorckw@xxxxxxxxx>
  • From: "Orzel, Michal" <michal.orzel@xxxxxxx>
  • Date: Mon, 2 Nov 2026 13:37:23 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=gmail.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wwsENutMZcZA6Xm4+m4gpEJa8/UogDlocvKWkkhzqkM=; b=OSt3SOguljgAhJ9f6Crkskf4bWrevsN4Vfo1NlJnfr2u6IvIK3wxW67jrb44QWLvZbABs7GH1wfy601ZiKbzX389+1wZMhX43i998Pd17nlQVtNGi9zPVKUUjoeiuNA+fFcWo2VjDDoYBm8kLeMqvSKHzLQxVmGwFuYIh3eEA0B/ch/B/nW6ceQo7UlOD+8er2fiHJktgNer6Hw5VOyGlKUxciKAzliZitsNzXWeNDKa0RfVzdg29y19VkE18tVqXw564tgjJHo98BLQhZKvIJtIRt72tJ4seph3EcJGNp4E0pNBvPfzumEWFX1J1ngpUKR/TEyTIFtlPaKpAH1I2A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NIdQIJuLMZWPVvUsg3m9tSVdEvFWvR8IDBBLq/2CVuAS8mwjYfY9CdbSevI7fHWJ4LwPqapEZpKvgAtyIiOIr/IAQthD35U7tfTBeiLrIHiylmG/klMOzlFyUm86vGuzco7D/BMrPX4zDIhgChYy1tZAO7IrOWN0/obUqbnN+wzVH7VrqyFCp5+2brO8NShJhQ1MyK7NWZbGgDKQ6I4RZNykEuCD7PIDXd1xWarI8xL39l0OHUS86kBIaGiPhcoF3QdbqXriXme6lU1y7cOl1X2gnvsDlGGWwJFazcAu/uPcrDFku6JX3ONZsvWGpgrf/ByPyIEbffaHFWv3XDXNtw==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Cc: <xen-devel@xxxxxxxxxxxxxxxxxxxx>, <sstabellini@xxxxxxxxxx>, <julien@xxxxxxx>, <bertrand.marquis@xxxxxxx>, <marscheng@xxxxxxxxxx>, <jserv@xxxxxxxxxxxxxxxx>, <eleanor15x@xxxxxxxxx>
  • Delivery-date: Mon, 02 Nov 2026 12:37:46 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


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




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.