From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NaFcB-0005C0-3Y for qemu-devel@nongnu.org; Wed, 27 Jan 2010 16:39:55 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NaFc5-00059u-GH for qemu-devel@nongnu.org; Wed, 27 Jan 2010 16:39:53 -0500 Received: from [199.232.76.173] (port=44684 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NaFc5-00059q-7C for qemu-devel@nongnu.org; Wed, 27 Jan 2010 16:39:49 -0500 Received: from e33.co.us.ibm.com ([32.97.110.151]:49944) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NaFc4-0000Ed-Cr for qemu-devel@nongnu.org; Wed, 27 Jan 2010 16:39:48 -0500 Received: from d03relay01.boulder.ibm.com (d03relay01.boulder.ibm.com [9.17.195.226]) by e33.co.us.ibm.com (8.14.3/8.13.1) with ESMTP id o0RLaKQU001211 for ; Wed, 27 Jan 2010 14:36:20 -0700 Received: from d03av05.boulder.ibm.com (d03av05.boulder.ibm.com [9.17.195.85]) by d03relay01.boulder.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o0RLdONn088574 for ; Wed, 27 Jan 2010 14:39:25 -0700 Received: from d03av05.boulder.ibm.com (loopback [127.0.0.1]) by d03av05.boulder.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id o0RLdNxC015729 for ; Wed, 27 Jan 2010 14:39:24 -0700 Message-ID: <4B60B28A.40400@linux.vnet.ibm.com> Date: Wed, 27 Jan 2010 15:39:22 -0600 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [Patch] Support translating Guest physical address to Host virtual address. References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Zheng, Jiajia" Cc: "lmr@redhat.com" , "Li, Haicheng" , Max Asbock , "qemu-devel@nongnu.org" , "You, Yongkang" , "avi@redhat.com" , "Kleen, Andi" On 01/26/2010 09:25 PM, Zheng, Jiajia wrote: > Add command p2v to translate Guest physical address to Host virtual address. > For what purpose? > Signed-off-by: Max Asbock > Jiajia Zheng > --- > diff --git a/monitor.c b/monitor.c > index b33b01f..83d9ac7 100644 > --- a/monitor.c > +++ b/monitor.c > @@ -668,6 +668,11 @@ static void do_info_uuid(Monitor *mon, QObject **ret_data) > *ret_data = qobject_from_jsonf("{ 'UUID': %s }", uuid); > } > > +static void do_info_p2v(Monitor *mon) > +{ > + monitor_printf(mon, "p2v implemented\n"); > +} > These should be implemented as QMP commands. > /* get the current CPU defined by the user */ > static int mon_set_cpu(int cpu_index) > { > @@ -2283,6 +2288,14 @@ static void do_inject_mce(Monitor *mon, const QDict *qdict) > break; > } > } > +static void do_p2v(Monitor *mon, const QDict *qdict) > +{ > + target_long size = 4096; > + target_long addr = qdict_get_int(qdict, "addr"); > + > + monitor_printf(mon, "Guest physical address %p is mapped at host virtual address %p\n", (void *)addr, cpu_physical_memory_map( (target_phys_addr_t)addr, (target_phys_addr_t *)&size, 0)); > This isn't quite right. It assumes TARGET_PAGE_SIZE is 4k which is certainly not always true. It also assumes that cpu_physical_memory_map() something that has some meaning which isn't necessarily the case. It could be a pointer to a bounce buffer. Could you give an end-to-end description of how you expect this mechanism to be used so we can work out a more appropriate set of interfaces. I assume this is MCE related. Regards, Anthony Liguori