Received: from eggs.gnu.org ([2001:4830:134:3::10]:58647) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmnZz-0006OH-BI for qemu-devel@nongnu.org; Wed, 21 Sep 2016 15:53:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bmnZw-0002kr-N9 for qemu-devel@nongnu.org; Wed, 21 Sep 2016 15:53:15 -0400 Received: from mail-yb0-x231.google.com ([2607:f8b0:4002:c09::231]:33796) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmnZw-0002kV-Is for qemu-devel@nongnu.org; Wed, 21 Sep 2016 15:53:12 -0400 Received: by mail-yb0-x231.google.com with SMTP id x93so41542997ybh.1 for ; Wed, 21 Sep 2016 12:53:12 -0700 (PDT) Sender: Richard Henderson References: <1474482404-15678-1-git-send-email-ehabkost@redhat.com> <1474482404-15678-6-git-send-email-ehabkost@redhat.com> From: Richard Henderson Message-ID: <9930bdaf-5f7e-ccf8-636a-78e56f21131c@twiddle.net> Date: Wed, 21 Sep 2016 12:53:08 -0700 MIME-Version: 1.0 In-Reply-To: <1474482404-15678-6-git-send-email-ehabkost@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit 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: Eduardo Habkost , qemu-devel@nongnu.org Cc: Brijesh Singh , Bandan Das , Paolo Bonzini , Igor Mammedov 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? > + /* 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. You're not considering adding a new one when cpuid[8].ebx is invented are you? r~