i386: rewrite way CPUID index is validated
commit4ed3d478c63dc65a02eba774c35116618ea5ff10
authorDaniel P. Berrange <berrange@redhat.com>
Tue, 9 May 2017 13:27:35 +0000 (9 14:27 +0100)
committerEduardo Habkost <ehabkost@redhat.com>
Thu, 11 May 2017 13:54:04 +0000 (11 10:54 -0300)
tree79441f5428a795b00e8836bf7969b36f8361848c
parent76d20ea0f1b26ebd5da2f5fb2fdf3250cde887bb
i386: rewrite way CPUID index is validated

Change the nested if statements into a flat format, to make
it clearer what validation / capping is being performed on
different CPUID index values.

NB this changes behaviour when "index > env->cpuid_xlevel2".
This won't have any guest-visible effect because no there is
no CPUID[0xC0000001] feature supported by TCG, and KVM code
will never call cpu_x86_cpuid() with such an index value.

Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Message-Id: <20170509132736.10071-2-berrange@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
target/i386/cpu.c