From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anthony Liguori Subject: Re: help with understanding GPA/GVA issues Date: Fri, 10 Aug 2007 15:12:50 -0500 Message-ID: <46BCC6C2.1060002@codemonkey.ws> References: <1186718958.4866.15.camel@ghaskins-t60p.haskins.net> <46BC7709.4030807@codemonkey.ws> <1186756859.4866.31.camel@ghaskins-t60p.haskins.net> <46BC9978.3060801@qumranet.com> <1186775254.4866.52.camel@ghaskins-t60p.haskins.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Gregory Haskins Return-path: In-Reply-To: <1186775254.4866.52.camel-5CR4LY5GPkvLDviKLk5550HKjMygAv58XqFh9Ls21Oc@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org Gregory Haskins wrote: > On Fri, 2007-08-10 at 19:59 +0300, Avi Kivity wrote: > > >> Note that passing a virtual address is highly discouraged as its meaning >> can change from vcpu to vcpu, it might not be mapped, translation is >> slow, etc. Just let the guest do the translation. >> > > Yeah, Hollis and Anthony straighted me out via IRC. I will mostly be > dealing with kmalloc/skb buffers so we settled on the following as > optimal: > > guest-side > > gpa = __pa(ptr); > > host-side: > > gfn = gpa >> PAGE_SHIFT > page = gfn_to_page(gfn); > ptr = kmap(page); > > .. > > kunmap(ptr); > kmap can sleep so you often have to use kmap_atomic in KVM. Although, I'm not sure if the pre-emption notification means that no longer is the case. Regards, Anthony Liguori > >> We have something running at qumranet, will be sent out soon. I am >> somewhat discouraged in trying to get the thing to page -- Shaohua's >> approach is much simpler. >> >> > > Cool! Ill keep an eye out. > > -Greg > > > ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/