From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M1Dbz-0006Ay-Q1 for qemu-devel@nongnu.org; Tue, 05 May 2009 01:54:40 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M1Dbt-0006AU-Vd for qemu-devel@nongnu.org; Tue, 05 May 2009 01:54:38 -0400 Received: from [199.232.76.173] (port=43846 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M1Dbt-0006AQ-Md for qemu-devel@nongnu.org; Tue, 05 May 2009 01:54:33 -0400 Received: from mail-fx0-f219.google.com ([209.85.220.219]:49198) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M1Dbs-0000hC-BT for qemu-devel@nongnu.org; Tue, 05 May 2009 01:54:32 -0400 Received: by fxm19 with SMTP id 19so3944761fxm.34 for ; Mon, 04 May 2009 22:54:30 -0700 (PDT) Message-ID: <49FFD4E0.5080104@gmail.com> Date: Tue, 05 May 2009 09:55:44 +0400 From: Alexander MIME-Version: 1.0 Subject: Re: [Qemu-devel] Get virtual memory value References: <20090428123909.GA5606@amd.home.annexia.org> In-Reply-To: <20090428123909.GA5606@amd.home.annexia.org> Content-Type: multipart/alternative; boundary="------------080908040805000704080104" Reply-To: coopht@gmail.com List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Richard W.M. Jones" Cc: qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------080908040805000704080104 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 28.04.2009 16:39, Richard W.M. Jones ?????: > On Tue, Apr 28, 2009 at 10:26:52AM +0400, Alexander Basov wrote: > >> Hello. >> I'm new in qemu internals, and I'd like to know, how can I get >> a value, which is stored in virtual memory address, allocated by guest OS. >> > > It's possible using the 'memsave' command in the console. > > We expose this through libvirt: > > http://libvirt.org/html/libvirt-libvirt.html#virDomainMemoryPeek > > Rich. > > It is not exactly what i need. I have some virtual memory address inside qemu. I need to get value, which is stored in this address. I'm trying to do as follow 1. Get phys address of given virtual address into tmp_addr get_phys_addr (env, address, access_type, is_user, &tmp_addr, &tmp_prot); 2. read value of which is stored in physical address (tmp_addr) cpu_physical_memory_read (tmp_addr, &result, 1); Is it correct way? --------------080908040805000704080104 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 28.04.2009 16:39, Richard W.M. Jones пишет:
On Tue, Apr 28, 2009 at 10:26:52AM +0400, Alexander Basov wrote:
  
Hello.
I'm new in qemu internals, and I'd like to know, how can I get
a value, which is stored in virtual memory address, allocated by guest OS.
    

It's possible using the 'memsave' command in the console.

We expose this through libvirt:

http://libvirt.org/html/libvirt-libvirt.html#virDomainMemoryPeek

Rich.

  
It is not exactly what i need.
I have some virtual memory address inside qemu.
I need to get value, which is stored in this address.

I'm trying to do as follow
1. Get phys address of given virtual address into tmp_addr
    get_phys_addr (env, address, access_type, is_user, &tmp_addr, &tmp_prot);

2. read value of which is stored in physical address (tmp_addr)
  cpu_physical_memory_read (tmp_addr, &result, 1);

Is it correct way?
--------------080908040805000704080104--