From: Paul Mackerras Subject: Re: [PATCH] KVM: PPC: Book3S HV: Make the guest MMU hash table size configurable Date: Wed, 2 May 2012 07:49:44 +1000 Message-ID: <20120501214944.GA24311@bloggs.ozlabs.ibm.com> References: <20120427035545.GB1216@drongo> <4F9D441D.9050802@redhat.com> <20120430044014.GA5428@drongo> <4F9E4DEE.60104@redhat.com> <20120430115449.GA9933@bloggs.ozlabs.ibm.com> <4F9E94E9.9040500@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Alexander Graf , kvm-ppc@vger.kernel.org, kvm@vger.kernel.org To: Avi Kivity Return-path: Content-Disposition: inline In-Reply-To: <4F9E94E9.9040500@redhat.com> Sender: kvm-ppc-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On Mon, Apr 30, 2012 at 04:34:33PM +0300, Avi Kivity wrote: > Okay, sounds reasonable for the constraints you have. > > I guess you can still make the sizing automatic by deferring hash table > allocation until the first KVM_RUN (when you know the size of guest > memory) but that leads to awkward locking and doesn't mesh well with > memory hotplug. The trouble with waiting until the first KVM_RUN is that we have to tell the guest the size of the hash table via the device tree, which userspace has placed in guest memory. The kernel doesn't have any direct knowledge of the location or contents of the device tree. That's why I need an ioctl to enable the kernel and userspace to come to agreement about the size, so that userspace can then put the size in the device tree. Paul.