From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rusty Russell Subject: Re: [PATCH 1/5] vring: Replace mmap() interface with ioctl() Date: Sat, 14 Jun 2008 19:02:53 +1000 Message-ID: <200806141902.54119.rusty@rustcorp.com.au> References: <1213365481-23460-1-git-send-email-markmc@redhat.com> <1213365481-23460-2-git-send-email-markmc@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Cc: Anthony Liguori , Avi Kivity , kvm@vger.kernel.org To: Mark McLoughlin Return-path: Received: from ozlabs.org ([203.10.76.45]:50623 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753938AbYFNJDI (ORCPT ); Sat, 14 Jun 2008 05:03:08 -0400 In-Reply-To: <1213365481-23460-2-git-send-email-markmc@redhat.com> Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: On Friday 13 June 2008 23:57:57 Mark McLoughlin wrote: > /dev/vring's mmap() interface is a strange creature. It > serves as a way for userland to supply the address of the > already allocated ring descriptors, but causes those pages > to be re-maped as a natural side effect of the mmap() > > This is not an issue for lguest because it does the mmap() > before even starting the guest. However, in the case of kvm, > the guest allocates the ring and informs the host of its > addresss. If we then mmap() it, we cause it to be remapped > to new pages which the vring driver will then use. Yeah, ugly, huh? I didn't like it either, but my ioctl aversion forced me to consider mmap. Then my aversion to rewriting the mmap code lead me to this "simply replace the user pages" hack :) Fix the couple of minor issues reported here and I'll happily apply it. BTW, including base and limit makes sense. I didn't do this to start since Avi doesn't want to guarentee kvm's guest mapping linear (of course he's only doing this so he can fix it later). Cheers, Rusty.