Received: from eggs.gnu.org ([140.186.70.92]:34743) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QzNOs-0007wi-EJ for qemu-devel@nongnu.org; Fri, 02 Sep 2011 02:38:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QzNOr-00011k-8b for qemu-devel@nongnu.org; Fri, 02 Sep 2011 02:38:50 -0400 Received: from ch1ehsobe003.messaging.microsoft.com ([216.32.181.183]:56284 helo=ch1outboundpool.messaging.microsoft.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QzNOr-00011e-53 for qemu-devel@nongnu.org; Fri, 02 Sep 2011 02:38:49 -0400 Received: from mail80-ch1 (localhost.localdomain [127.0.0.1]) by mail80-ch1-R.bigfish.com (Postfix) with ESMTP id 30DCE1A048B for ; Fri, 2 Sep 2011 06:08:42 +0000 (UTC) Received: from CH1EHSMHS008.bigfish.com (snatpool1.int.messaging.microsoft.com [10.43.68.254]) by mail80-ch1.bigfish.com (Postfix) with ESMTP id EBD74149804E for ; Fri, 2 Sep 2011 06:08:41 +0000 (UTC) From: "Sinha, Ani" Date: Fri, 2 Sep 2011 01:08:36 -0500 Message-ID: Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: [Qemu-devel] target_phys_addr_t vs ram_addr_t List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "qemu-devel@nongnu.org" Cc: "Sinha, Ani" Hi Folks : I am trying to write a virtio driver and towards this end I am looking at the qemu code. I am a little confused about a few things. Unfortunately, the few comments in the code does not make it clear for me. So I am wondering if any kind person on this mailing list would be able to help. First off, what is the difference between target_phys_addr_t and ram_addr_t? I believe the former is a virtual address within the guest but what is the later? The comment says "address in ram (different from physical address)" but is this the virtual address or the physical address? Is this for guest or for host? Secondly, in function cpu_physical_memory_map(), why is the length parameter an address? If I look at the function virtqueue_map_sg(), the sg.iov_len is defined as type size_t, which sounds like right. However, this value is assigned to variable len which is of type target_phys_addr_t. Is len an address or just a scalar value? Lastly, in qemu_ram_ptr_length(), what is the length value? What does it signify? One more thing. It would really help guys like me if someone can add comments regarding the various apis, what they do and what the parameters mean in the code. I thought I'd suggest. I am not in the mailing list. So please do a reply-all when responding. Thanks in advance for help, Ani =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any reproduction, dissemination or distribution of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. Thank you. Tellabs =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D