|
From: | Binh Pham |
Subject: | Re: [Qemu-discuss] Backing Guest RAM by a file |
Date: | Tue, 14 Jul 2015 15:10:43 -0400 |
On 10 July 2015 at 21:57, Binh Pham <address@hidden> wrote:
> Hi folks,
> I am working on a task that requires replicating the page table walk process
> in QEMU to a timing model, which is plugged in QEMU. In order to do so, I
> want to back guest RAM by a file on my host system, so that I can perform
> the walk off the mapped file. I am playing with mem-path option in QEMU, and
> here is what I did:
> 1. Create a file big enough to back the guest RAM:
>
> dd if=guest.img bs=4k count=1000000 guest.img
>
> 2. Run qemu with mem-path
> %>qemu-system-aarch64 -mem-path=/path/to/guest.img
>
> I got this warning:
>
> Warning: path not on HugeTLBFS:
> /prj/crdral/usr01/binhp/miramar/guest-ram/guest.img
>
> qemu-system-aarch64: unable to create backing store for hugepages: Not a
> directory
As the error message suggests, -mem-path wants
a directory, not a file: QEMU will create-and-unlink
a temporary file within the directory for each
RAM area.
I don't think there's a way to do what you want without
hacking QEMU a bit. You could probably change the
board init code for the board you're interested in to
manually mmap the file and then call
memory_region_init_ram_from_ptr() instead of
memory_region_init_ram() when it allocates the main RAM.
-- PMM
[Prev in Thread] | Current Thread | [Next in Thread] |