From: Hollis Blanchard Subject: RE: [PATCH] kvm: qemu: Sync idcache after emualted DMA operations for ia64 Date: Fri, 24 Apr 2009 10:15:26 -0500 Message-ID: <1240586126.6036.11.camel@slate.austin.ibm.com> References: <20090421100852.8B1EE250AE4@cleopatra.tlv.redhat.com> <1240330773.29455.3.camel@slate.austin.ibm.com> <49EE0089.2090908@redhat.com> <1240342120.29455.10.camel@slate.austin.ibm.com> <706158FABBBA044BAD4FE898A02E4BC2366DB4A3@pdsmsx503.ccr.corp.intel.com> <1240415882.3955.27.camel@slate.austin.ibm.com> <706158FABBBA044BAD4FE898A02E4BC236973F12@pdsmsx503.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: Avi Kivity , "kvm@vger.kernel.org" To: "Zhang, Xiantao" Return-path: Received: from e7.ny.us.ibm.com ([32.97.182.137]:56566 "EHLO e7.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750992AbZDXPPa (ORCPT ); Fri, 24 Apr 2009 11:15:30 -0400 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e7.ny.us.ibm.com (8.13.1/8.13.1) with ESMTP id n3OF54qL008589 for ; Fri, 24 Apr 2009 11:05:04 -0400 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n3OFFSBa046032 for ; Fri, 24 Apr 2009 11:15:28 -0400 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n3OFDeUq023928 for ; Fri, 24 Apr 2009 11:13:41 -0400 In-Reply-To: <706158FABBBA044BAD4FE898A02E4BC236973F12@pdsmsx503.ccr.corp.intel.com> Sender: kvm-owner@vger.kernel.org List-ID: On Fri, 2009-04-24 at 15:45 +0800, Zhang, Xiantao wrote: > > > As I said before, "synchronize instruction and data caches" is a > > meaningful and important operation on architectures other than IA64. > > *However*, that operation is not relevant on those architectures in > > this particular location. As far as I know, on architectures with > > non-coherent i/d caches, invalidating the icache during DMA writes > is > > unique to IA64. > > For ia64 in native system, processors depend on that platforms issue > snoop cycles to invalidate the cachable memory pages that are touched > by DMA to ensure the cache coherence from viewpoint of processors. > But for virtual machine, the DMA is emulated by memcpy in userspace, > so have to use explict instructions to emulate the snoop cycles to > invalidate icache after virtual DMAs, otherwise, processor may see old > icache and lead to disaster. That is exactly the sort of background that should have been in the commit message in the first place. Commit message aside, without comments in the code, an outside developer might very well wonder why other architectures (e.g. PowerPC) *don't* implement qemu_sync_idcache(). Are you starting to understand my objections to this patch? -- Hollis Blanchard IBM Linux Technology Center