From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH v3] uq/master: Expose CPUID leaf 7 only for -cpu host Date: Fri, 25 May 2012 11:42:00 -0300 Message-ID: <4FBF9A38.1080001@siemens.com> References: <20120525141205.GE8832@otherpad.lan.raisama.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , Avi Kivity , kvm@vger.kernel.org, qemu-devel@nongnu.org To: Eduardo Habkost Return-path: Received: from thoth.sbs.de ([192.35.17.2]:20970 "EHLO thoth.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754474Ab2EYOmJ (ORCPT ); Fri, 25 May 2012 10:42:09 -0400 In-Reply-To: <20120525141205.GE8832@otherpad.lan.raisama.net> Sender: kvm-owner@vger.kernel.org List-ID: On 2012-05-25 11:12, Eduardo Habkost wrote: > diff --git a/target-i386/cpu.c b/target-i386/cpu.c > index 65d9af6..91a657a 100644 > --- a/target-i386/cpu.c > +++ b/target-i386/cpu.c > @@ -238,6 +238,8 @@ typedef struct x86_def_t { > /* Store the results of Centaur's CPUID instructions */ > uint32_t ext4_features; > uint32_t xlevel2; > + /* The feature bits on CPUID[EAX=7,ECX=0].EBX */ > + uint32_t cpuid_7_0_ebx_features; > } x86_def_t; > > #define I486_FEATURES (CPUID_FP87 | CPUID_VME | CPUID_PSE) > @@ -521,6 +523,12 @@ static int cpu_x86_fill_host(x86_def_t *x86_cpu_def) > x86_cpu_def->ext_features = ecx; > x86_cpu_def->features = edx; > > + if (kvm_enabled() && x86_cpu_def->level >= 7) { > + x86_cpu_def->cpuid_7_0_ebx_features = kvm_arch_get_supported_cpuid(kvm_state, 0x7, 0, R_EBX); checkpatch.pl? Jan -- Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux