From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J36YI-0000KO-Nk for qemu-devel@nongnu.org; Fri, 14 Dec 2007 04:09:50 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J36YE-0000Iv-TD for qemu-devel@nongnu.org; Fri, 14 Dec 2007 04:09:49 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J36YE-0000IU-BD for qemu-devel@nongnu.org; Fri, 14 Dec 2007 04:09:46 -0500 Received: from mtagate1.de.ibm.com ([195.212.29.150]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1J36YD-0002x8-Hk for qemu-devel@nongnu.org; Fri, 14 Dec 2007 04:09:45 -0500 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate1.de.ibm.com (8.13.8/8.13.8) with ESMTP id lBE980AB243712 for ; Fri, 14 Dec 2007 09:08:00 GMT Received: from d12av01.megacenter.de.ibm.com (d12av01.megacenter.de.ibm.com [9.149.165.212]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v8.7) with ESMTP id lBE980hS2367678 for ; Fri, 14 Dec 2007 10:08:00 +0100 Received: from d12av01.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av01.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id lBE97xMt003812 for ; Fri, 14 Dec 2007 10:08:00 +0100 Message-ID: <476247EB.9040003@linux.vnet.ibm.com> Date: Fri, 14 Dec 2007 10:07:55 +0100 From: Christian Ehrhardt MIME-Version: 1.0 References: <11975745782686-git-send-email-ehrhardt@linux.vnet.ibm.com> <42DFA526FC41B1429CE7279EF83C6BDCAD01E3@pdsmsx415.ccr.corp.intel.com> In-Reply-To: <42DFA526FC41B1429CE7279EF83C6BDCAD01E3@pdsmsx415.ccr.corp.intel.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] Re: [kvm-devel] [PATCH][UPDATE] kvm-userspace: sync icache for morearchitectures Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Zhang, Xiantao" Cc: kvm-devel@lists.sourceforge.net, kvm-ppc-devel@lists.sourceforge.net, hollisb@us.ibm.com, qemu-devel@nongnu.org Zhang, Xiantao wrote: >Christian Ehrhardt wrote: <[...] >> @@ -2600,8 +2601,8 @@ void cpu_physical_memory_rw(target_phys_addr_t >> addr, uint8_t *buf, phys_ram_dirty[addr1 >> >> TARGET_PAGE_BITS] |=3D (0xff & >> ~CODE_DIRTY_FLAG); } >> -#ifdef __ia64__ >> - kvm_sync_icache((unsigned long)ptr, l); >> +#ifdef USE_KVM >> + flush_icache_range((unsigned long)ptr, ((unsigned > long)ptr)+l); >=20 > Are you sure ia64 implement this function for applications ? I didn't > find it at my side, so I write it.=20 What do you mean with "implement it for applications" ? Take a look at dyngen.h - it starts with the comment "dyngen helpers"=20 and contains a lot of static functions to use them where you need. I don't see anything obvious that would prevent these functions from being built and the file has no own include statements which may=20 change that. Therefor the include "dyngen.h" in the USE_KVM case should be enough to have this function available for cpu_physical_memory_rw in exec.c where we need it. [...] > Xiantao --- Hollis Blanchard wrote: > A comment to explain why the icache needs flushing only in the KVM case > would be useful. Other than that I'm fine with it. >=20 > Signed-off-by: Hollis Blanchard AFAIK Plain qemu does not directly execute guest code on the processor, so the icache is not an issue for it. Qemu itself has the flush_icache_range function only as helper for the dynamic code generation. But we may now write executable guest code with our intercepted mmio handling that is directly executed when switching back to the guest context, therefore we need that invalidation in the kvm case. For the case that I'm overlooking something in plain qemu, so that it might need it too I add qemu-devel@nongnu.org for comments from there, but currently I think to have it in #ifdef USE_KVM is the right way. P.S. Hollis did you mean you would like to see a comment in the code where that call takes place? --=20 Gr=FCsse / regards,=20 Christian Ehrhardt IBM Linux Technology Center, Open Virtualization +49 7031/16-3385 Ehrhardt@linux.vnet.ibm.com Ehrhardt@de.ibm.com IBM Deutschland Entwicklung GmbH Vorsitzender des Aufsichtsrats: Johann Weihen=20 Gesch=E4ftsf=FChrung: Herbert Kircher=20 Sitz der Gesellschaft: B=F6blingen Registergericht: Amtsgericht Stuttgart, HRB 243294