From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55761) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKOxF-0007Oz-VY for qemu-devel@nongnu.org; Tue, 05 Jul 2016 07:55:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bKOxB-0007cH-3V for qemu-devel@nongnu.org; Tue, 05 Jul 2016 07:55:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33195) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKOxA-0007cA-Tv for qemu-devel@nongnu.org; Tue, 05 Jul 2016 07:55:49 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1492B8535A for ; Tue, 5 Jul 2016 11:55:48 +0000 (UTC) Date: Tue, 5 Jul 2016 12:55:43 +0100 From: "Daniel P. Berrange" Message-ID: <20160705115543.GK6553@redhat.com> Reply-To: "Daniel P. Berrange" References: <1467659769-15900-1-git-send-email-dgilbert@redhat.com> <1467659769-15900-6-git-send-email-dgilbert@redhat.com> <20160705094249.GG6553@redhat.com> <20160705112930.GJ2118@work-vm> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20160705112930.GJ2118@work-vm> Subject: Re: [Qemu-devel] [PATCH v2 5/6] x86: fix up 32 bit phys_bits case List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert" Cc: qemu-devel@nongnu.org, pbonzini@redhat.com, ehabkost@redhat.com, marcel@redhat.com, mst@redhat.com, kraxel@redhat.com On Tue, Jul 05, 2016 at 12:29:30PM +0100, Dr. David Alan Gilbert wrote: > * Daniel P. Berrange (berrange@redhat.com) wrote: > > On Mon, Jul 04, 2016 at 08:16:08PM +0100, Dr. David Alan Gilbert (git) wrote: > > > From: "Dr. David Alan Gilbert" > > > > > > On 32 bit systems fix up phys_bits to be consistent with what > > > we tell the guest; don't ever bother with using the phys_bits > > > property. > > > > > @@ -2990,6 +2986,15 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp) > > > cpu->phys_bits = host_phys_bits; > > > > > > } > > > + } else { > > > + /* For 32 bit systems don't use the user set value, but keep > > > + * phys_bits consistent with what we tell the guest. > > > + */ > > > + if (env->features[FEAT_1_EDX] & CPUID_PSE36) { > > > + cpu->phys_bits = 36; > > > + } else { > > > + cpu->phys_bits = 32; > > > + } > > > > I kind of feel like we should report an error and exit if the > > user/app has provided a phys_bits property value, rather than > > silently ignoring their provided value, on the basis that this > > is a user/app configuration error. > > Do we have an easy way to tell that the user has set the parameter > as opposed to it being the default? Not sure if there's an official way, but you could perhaps default phys_bits to -1, and treat -1 as being equivalent to 0 if set by the user. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|