Received: from eggs.gnu.org ([2001:4830:134:3::10]:35405) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmnuh-0005Ea-MK for qemu-devel@nongnu.org; Wed, 21 Sep 2016 16:14:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bmnud-0002di-Er for qemu-devel@nongnu.org; Wed, 21 Sep 2016 16:14:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41162) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmnud-0002dZ-8e for qemu-devel@nongnu.org; Wed, 21 Sep 2016 16:14:35 -0400 Date: Wed, 21 Sep 2016 17:14:32 -0300 From: Eduardo Habkost Message-ID: <20160921201432.GQ3233@thinpad.lan.raisama.net> References: <1474482404-15678-1-git-send-email-ehabkost@redhat.com> <1474482404-15678-6-git-send-email-ehabkost@redhat.com> <9930bdaf-5f7e-ccf8-636a-78e56f21131c@twiddle.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9930bdaf-5f7e-ccf8-636a-78e56f21131c@twiddle.net> Subject: Re: [Qemu-devel] [PATCH 5/6] target-i386: Automatically set level/xlevel/xlevel2 when needed List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: qemu-devel@nongnu.org, Brijesh Singh , Bandan Das , Paolo Bonzini , Igor Mammedov On Wed, Sep 21, 2016 at 12:53:08PM -0700, Richard Henderson wrote: > On 09/21/2016 11:26 AM, Eduardo Habkost wrote: > > + /* Set cpuid_*level* based on cpuid_min_*level, if not explicitly set */ > > + if (!env->cpuid_level) { > > + env->cpuid_level = env->cpuid_min_level; > > + } > > + if (!env->cpuid_xlevel) { > > + env->cpuid_xlevel = env->cpuid_min_xlevel; > > + } > > + if (!env->cpuid_xlevel2) { > > + env->cpuid_xlevel2 = env->cpuid_min_xlevel2; > > } > > Why are we not bounding them by MIN, if it's really a minimum? Not sure I understand what you mean. Do you mean silently changing the value even if it was explicitly set by the user? In those cases, I don't see what's the benefit of doing something different from what the user explicitly asked for (considering that it would require adding more compat code to keep the pc-2.7 behavior). > > > + /* Enable auto level-increase for CPUID[7].ECX features */ > > + bool cpuid_auto_level_7_0_ecx; > > + > > + /* Enable auto level-increase for CPUID[6] features */ > > + bool cpuid_auto_level_6; > > Why two variables? Seems like only one is needed for backward > compatibility. It's true that we don't really need two variables to implement pc-2.7 compatibility. I just implemented it this way because having two separate variables looks clearer to me. I wouldn't know how I would name the variable if it controlled both CPUID[7].ECX and CPUID[6] at the same time (any suggestions?). > You're not considering adding a new one when cpuid[8].ebx is > invented are you? I'm not. Those were added only to allow us to implement pc-2.7 compatibility. -- Eduardo