qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Share host memory with a guest running no operating system


From: Jakob Bohm
Subject: Re: Share host memory with a guest running no operating system
Date: Tue, 21 Jun 2022 17:06:19 +0200
User-agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0

On 2022-06-21 03:38, John Ramsden wrote:
I'm attempting to share host memory with a guest running no operating system using `-object memory-backend-file,id=mem0,size=4G,mem-path=/dev/shm/qemu,share=on`. When I try this using a guest with an operating system such as Ubuntu, I see my object mem0 in `info mtree`, and I'm able to write to `/dev/shm/qemu` on the host and read the changed memory on the VM - similar to this blog post (I am not the author) https://blog.reds.ch/?p=1379. This doesn't seem to work when I have a guest without an operating system, there is no `mem0` device. In case it's relevant I am using an arm64 guest.

Do I need a guest operating system to use this feature?

It is important to understand the difference between the two qemu variants available
for each architecture:

In the qemu-variant named qemu-archname-system, your guest runs as bare metal program
(like memtest86) that can be run on a computer without booting an operating system,
there are no device or file names in the guest, only hardware addresses that access
the various devices.  Essentially, such programs are their own primitive OS.

In the qemu-variant named just qemu-archname, your guest is a Linux application
compiled for the wrong CPU, it sees exactly the same device names and files as
the host machine, as that qemu program only simulates the CPU instruction set,
not an entire machine, device simulation options make no sense for that
qemu variant.


--
Jakob Bohm, CIO, partner, WiseMo A/S. https://www.wisemo.com
Transformervej 29, 2860 Soborg, Denmark. direct: +45 31 13 16 10
This message is only for its intended recipient, delete if misaddressed.
WiseMo - Remote Service Management for PCs, Phones and Embedded

reply via email to

[Prev in Thread] Current Thread [Next in Thread]