memory dump

Abhay Amala amalaabhay at ...9...
Thu Dec 3 17:00:48 CET 2015


Sorry in my previous email, I forgot to mention that I used SMC call in VM
before doing a VMM call and added a flush_cache_all(); before "smc  #0" to
flush the cache in the non-secure side.


On Thu, Dec 3, 2015 at 4:44 PM, Abhay Amala <amalaabhay at ...9...> wrote:

> Thank you Martin for your detailed explanation. It helps me a lot.
> I could put the RAM data into a file using the following snippet and get a
> file with size 268.4 MB. But when i tried to make some kind memory analysis
> on the file, i get something which is different from what i expect. Is this
> snippet the right one to do memory imaging? thanks in advance for answers.
>          size_t size = Vm_base::ram()->size();
>          void* addr = (void*)Vm_base::ram()->local();
>          FILE *fd = fopen("memdump.dd", "w+b");
>          if(fd != NULL)
>                  fwrite(addr, 1, size, fd);
> Thanks,
> Abhay
> On Thu, Dec 3, 2015 at 11:35 AM, Martin Stein <
> martin.stein at ...1...> wrote:
>> Hey Abhay,
>> First of all, sorry for the late feedback, last week, I couldn't find
>> the time to answer your mail.
>> Am 27.11.2015 um 00:19 schrieb Abhay Amala:
>> > I am running tz_vmm on imx53qsb and thinking about taking a snapshot of
>> > the normal world memory inside the tz_vmm app and put into a file as a
>> > raw data. I appreciate if anyone give me a hint.
>> Inside the tz_vmm the guest RAM is already mapped. You can get its local
>> base address via Vm_base::ram()->local(). Its size can be read via
>> Vm_base::ram()->size().
>> However, be aware that the state you read from the guest RAM in tz_vmm
>> is most probably not up-to-date as the non-secure world uses separate
>> caches that do not synchronize with the caches of the secure world. As
>> far as I know, there is no way to cause a non-secure cache flush from
>> within the secure world. But I might be wrong as I haven't read the
>> manual [1] in depth regarding this topic. Maybe it's a solution to
>> implement a simple protocol between VMM and VM, using interrupt
>> injection and SMCs to requests the guest OS to flush its caches for you.
>> Regarding the file you want to create from the read RAM data: It might
>> be a good idea to use the SD card as storage medium as an appropriate
>> driver [2] already exists. However, the driver provides a Block session
>> while you want to use a File_system session in tz_vmm. Assuming, that
>> you have formatted your SD partition with FAT32, you can create a
>> File_system session out of a Block session by using use ffat_fs. You may
>> have a look at the test scripts [3] to receive an impression on how
>> ffat_fs is used.
>> If you have further questions, don't hesitate to ask ;)
>> Cheers,
>> Martin
>> [1]
>> [2] repos/os/src/drivers/sd_card/spec/imx53
>> [3]
>> repos/libports/run/
>> repos/libports/run/
>> ------------------------------------------------------------------------------
>> Go from Idea to Many App Stores Faster with Intel(R) XDK
>> Give your users amazing mobile app experiences with Intel(R) XDK.
>> Use one codebase in this all-in-one HTML5 development environment.
>> Design, debug & build mobile apps & 2D/3D high-impact games for multiple
>> OSs.
>> _______________________________________________
>> genode-main mailing list
>> genode-main at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the users mailing list