qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* QEMU virt (arm64) does not honor reserved-memory set in device tree
@ 2023-06-10  0:01 Mohd Yusuf Abdul Hamid
  2023-06-10  3:36 ` Gavin Shan
  0 siblings, 1 reply; 3+ messages in thread
From: Mohd Yusuf Abdul Hamid @ 2023-06-10  0:01 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 591 bytes --]

Hi,
I am trying to reserve a portion of the system memory in QEMU (arm64 virt),
v7.2.1 - but the kernel never honors the reserved memory area and keeps
using the area.

Say, I dumped out DTB and added:

reserved-memory {
  #address-cells = <0x02>;
  #size-cells = <0x02>;

  rsvdram@50000000 {
  no-map;
  reg = <0x00 0x50000000 0x00 0x20000000>;
  };
};

When booted, /proc/iomem still shows the kernel is using the entire space -
eg 2GB.

Is this a supported feature or I would need to modify the virt.c and define
scratch area for some device driver scratch area.

Mohd Yusuf Abdul Hamid

[-- Attachment #2: Type: text/html, Size: 888 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: QEMU virt (arm64) does not honor reserved-memory set in device tree
  2023-06-10  0:01 QEMU virt (arm64) does not honor reserved-memory set in device tree Mohd Yusuf Abdul Hamid
@ 2023-06-10  3:36 ` Gavin Shan
  2023-06-15 20:59   ` Mohd Yusuf Abdul Hamid
  0 siblings, 1 reply; 3+ messages in thread
From: Gavin Shan @ 2023-06-10  3:36 UTC (permalink / raw)
  To: Mohd Yusuf Abdul Hamid, qemu-devel

Hi Mohd,

On 6/10/23 10:01 AM, Mohd Yusuf Abdul Hamid wrote:
> I am trying to reserve a portion of the system memory in QEMU (arm64 virt), v7.2.1 - but the kernel never honors the reserved memory area and keeps using the area.
> 
> Say, I dumped out DTB and added:
> 
> reserved-memory {
>    #address-cells = <0x02>;
>    #size-cells = <0x02>;
> 
>    rsvdram@50000000 {
>    no-map;
>    reg = <0x00 0x50000000 0x00 0x20000000>;
>    };
> };
> 
> When booted, /proc/iomem still shows the kernel is using the entire space - eg 2GB.
> 
> Is this a supported feature or I would need to modify the virt.c and define scratch area for some device driver scratch area.
> 

It relies on the guest kernel to handle the device-tree and the device-tree node
for the reserved map. I doubt if you had ACPI over device-tree in the guest kernel's
configuration. In this case, the reserved memory regions need to be specified in
ACPI tables instead of device-tree.

Thanks,
Gavin



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: QEMU virt (arm64) does not honor reserved-memory set in device tree
  2023-06-10  3:36 ` Gavin Shan
@ 2023-06-15 20:59   ` Mohd Yusuf Abdul Hamid
  0 siblings, 0 replies; 3+ messages in thread
From: Mohd Yusuf Abdul Hamid @ 2023-06-15 20:59 UTC (permalink / raw)
  To: Gavin Shan; +Cc: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1293 bytes --]

Hi Gavin,
Thanks for the reply. I am new to Linux dev in general and not familiar
with the ACPI table, but I will research in the area and give it a try.

Sorry for the late response.

-Yusuf

On Fri, Jun 9, 2023, 8:36 PM Gavin Shan <gshan@redhat.com> wrote:

> Hi Mohd,
>
> On 6/10/23 10:01 AM, Mohd Yusuf Abdul Hamid wrote:
> > I am trying to reserve a portion of the system memory in QEMU (arm64
> virt), v7.2.1 - but the kernel never honors the reserved memory area and
> keeps using the area.
> >
> > Say, I dumped out DTB and added:
> >
> > reserved-memory {
> >    #address-cells = <0x02>;
> >    #size-cells = <0x02>;
> >
> >    rsvdram@50000000 {
> >    no-map;
> >    reg = <0x00 0x50000000 0x00 0x20000000>;
> >    };
> > };
> >
> > When booted, /proc/iomem still shows the kernel is using the entire
> space - eg 2GB.
> >
> > Is this a supported feature or I would need to modify the virt.c and
> define scratch area for some device driver scratch area.
> >
>
> It relies on the guest kernel to handle the device-tree and the
> device-tree node
> for the reserved map. I doubt if you had ACPI over device-tree in the
> guest kernel's
> configuration. In this case, the reserved memory regions need to be
> specified in
> ACPI tables instead of device-tree.
>
> Thanks,
> Gavin
>
>

[-- Attachment #2: Type: text/html, Size: 1901 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-06-15 21:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-10  0:01 QEMU virt (arm64) does not honor reserved-memory set in device tree Mohd Yusuf Abdul Hamid
2023-06-10  3:36 ` Gavin Shan
2023-06-15 20:59   ` Mohd Yusuf Abdul Hamid

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).