From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47981) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAMZB-0006ak-PR for qemu-devel@nongnu.org; Mon, 03 Feb 2014 11:40:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WAMZ4-0006dT-Cn for qemu-devel@nongnu.org; Mon, 03 Feb 2014 11:40:13 -0500 Received: from mail-ee0-f41.google.com ([74.125.83.41]:64151) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAMZ4-0006cK-7N for qemu-devel@nongnu.org; Mon, 03 Feb 2014 11:40:06 -0500 Received: by mail-ee0-f41.google.com with SMTP id e51so1660112eek.28 for ; Mon, 03 Feb 2014 08:39:30 -0800 (PST) Sender: Paolo Bonzini From: Paolo Bonzini Date: Mon, 3 Feb 2014 17:39:00 +0100 Message-Id: <1391445551-6561-6-git-send-email-pbonzini@redhat.com> In-Reply-To: <1391445551-6561-1-git-send-email-pbonzini@redhat.com> References: <1391445551-6561-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PULL 05/16] target-i386: kvm_cpu_fill_host(): Set all feature words at end of function List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Eduardo Habkost From: Eduardo Habkost Reorder the code so all the code that sets x86_cpu_def->features is at the end of the function. Signed-off-by: Eduardo Habkost Signed-off-by: Paolo Bonzini --- target-i386/cpu.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/target-i386/cpu.c b/target-i386/cpu.c index 5c3817c..237af97 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -1160,29 +1160,24 @@ static void kvm_cpu_fill_host(x86_def_t *x86_cpu_def) x86_cpu_def->stepping = eax & 0x0F; x86_cpu_def->level = kvm_arch_get_supported_cpuid(s, 0x0, 0, R_EAX); + x86_cpu_def->xlevel = kvm_arch_get_supported_cpuid(s, 0x80000000, 0, R_EAX); + x86_cpu_def->xlevel2 = + kvm_arch_get_supported_cpuid(s, 0xC0000000, 0, R_EAX); + + cpu_x86_fill_model_id(x86_cpu_def->model_id); + x86_cpu_def->features[FEAT_1_EDX] = kvm_arch_get_supported_cpuid(s, 0x1, 0, R_EDX); x86_cpu_def->features[FEAT_1_ECX] = kvm_arch_get_supported_cpuid(s, 0x1, 0, R_ECX); - x86_cpu_def->features[FEAT_7_0_EBX] = - kvm_arch_get_supported_cpuid(s, 0x7, 0, R_EBX); - - x86_cpu_def->xlevel = kvm_arch_get_supported_cpuid(s, 0x80000000, 0, R_EAX); + kvm_arch_get_supported_cpuid(s, 0x7, 0, R_EBX); x86_cpu_def->features[FEAT_8000_0001_EDX] = - kvm_arch_get_supported_cpuid(s, 0x80000001, 0, R_EDX); + kvm_arch_get_supported_cpuid(s, 0x80000001, 0, R_EDX); x86_cpu_def->features[FEAT_8000_0001_ECX] = - kvm_arch_get_supported_cpuid(s, 0x80000001, 0, R_ECX); - - cpu_x86_fill_model_id(x86_cpu_def->model_id); - - /* Call Centaur's CPUID instruction. */ - x86_cpu_def->xlevel2 = - kvm_arch_get_supported_cpuid(s, 0xC0000000, 0, R_EAX); + kvm_arch_get_supported_cpuid(s, 0x80000001, 0, R_ECX); x86_cpu_def->features[FEAT_C000_0001_EDX] = kvm_arch_get_supported_cpuid(s, 0xC0000001, 0, R_EDX); - - /* Other KVM-specific feature fields: */ x86_cpu_def->features[FEAT_SVM] = kvm_arch_get_supported_cpuid(s, 0x8000000A, 0, R_EDX); x86_cpu_def->features[FEAT_KVM] = -- 1.8.3.1