From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rusty Russell Subject: Re: [PATCH] [v2] linux: virtio: Standardize virtio's concept of "page size" Date: Thu, 13 Nov 2008 08:44:57 +1030 Message-ID: <200811130844.57749.rusty@rustcorp.com.au> References: <200811122251.14159.rusty@rustcorp.com.au> <1226506591.19156.10.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Cc: aliguori@us.ibm.com, markmc@redhat.com, xiantao.zhang@intel.com, kvm@vger.kernel.org, kvm-ppc@vger.kernel.org To: Hollis Blanchard Return-path: Received: from ozlabs.org ([203.10.76.45]:58743 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751331AbYKLWPE (ORCPT ); Wed, 12 Nov 2008 17:15:04 -0500 In-Reply-To: <1226506591.19156.10.camel@localhost.localdomain> Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: On Thursday 13 November 2008 02:46:31 Hollis Blanchard wrote: > On Wed, 2008-11-12 at 22:51 +1030, Rusty Russell wrote: > > On Tuesday 11 November 2008 10:07:09 Hollis Blanchard wrote: > > > Both sides of the virtio interface must agree about how big a pfn > > > really is. This is particularly an issue on architectures where the > > > page size is configurable (e.g. PowerPC, IA64) -- the interface must be > > > independent of PAGE_SHIFT. > > > > > > Currently there are three distinct problems: > > > * The shift count used when passing the physical address of the ring to > > > a PCI-based back end. > > > * The ring layout itself is padded to span at least two "pages". > > > * The balloon driver operates in units of "pages". > > > > Hi Hollis, > > > > The more I thought about this, the more I think we're not solving this > > as neatly as we could. The trigger was noting that we're breaking the > > userspace API (vring_size and vring_init are exposed to userspace): I > > know that qemu cut & pastes, but that's no excuse. > > > > So instead, I've introduced separate constants for each use. Yes, > > all these constants are 12/4096. But just to be contrary, at the end > > is a patch to change lguest to 128. And there's no reason this > > couldn't change in future using some guest detection scheme. > > OK. I thought it was simpler to just say "4KB everywhere" in all aspects > of the virtio interface, but I'm happy as long as we solve the problem > somehow. :) It is simpler, yes, but we can take this opportunity to deconflate them and make things clearer and better than the current code, not just "fix" it. Note that I still don't have a balloon patch: want to send me one? Thanks, Rusty.