Received: from eggs.gnu.org ([208.118.235.92]:44686) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZSGL-0007Wl-Pp for qemu-devel@nongnu.org; Mon, 06 May 2013 16:44:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UZSG7-0005BU-OA for qemu-devel@nongnu.org; Mon, 06 May 2013 16:43:57 -0400 Received: from cantor2.suse.de ([195.135.220.15]:48359 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZSG7-0005BD-G3 for qemu-devel@nongnu.org; Mon, 06 May 2013 16:43:43 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Mon, 6 May 2013 22:43:24 +0200 Message-Id: <1367873011-7402-5-git-send-email-afaerber@suse.de> In-Reply-To: <1367873011-7402-1-git-send-email-afaerber@suse.de> References: <1367873011-7402-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 04/11] target-i386: Introduce X86CPU::filtered_features field List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Eduardo Habkost , =?UTF-8?q?Andreas=20F=C3=A4rber?= From: Eduardo Habkost This field will contain the feature bits that were filtered out because of missing host support. Signed-off-by: Eduardo Habkost Reviewed-by: Eric Blake Signed-off-by: Andreas F=C3=A4rber --- target-i386/cpu-qom.h | 3 +++ target-i386/cpu.c | 9 ++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/target-i386/cpu-qom.h b/target-i386/cpu-qom.h index f890f1c..849cedf 100644 --- a/target-i386/cpu-qom.h +++ b/target-i386/cpu-qom.h @@ -65,6 +65,9 @@ typedef struct X86CPU { /*< public >*/ =20 CPUX86State env; + + /* Features that were filtered out because of missing host capabilit= ies */ + uint32_t filtered_features[FEATURE_WORDS]; } X86CPU; =20 static inline X86CPU *x86_env_get_cpu(CPUX86State *env) diff --git a/target-i386/cpu.c b/target-i386/cpu.c index 3857514..38793bc 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -1698,9 +1698,12 @@ static void filter_features_for_kvm(X86CPU *cpu) =20 for (w =3D 0; w < FEATURE_WORDS; w++) { FeatureWordInfo *wi =3D &feature_word_info[w]; - env->features[w] &=3D kvm_arch_get_supported_cpuid(s, wi->cpuid_= eax, - wi->cpuid_ec= x, - wi->cpuid_re= g); + uint32_t host_feat =3D kvm_arch_get_supported_cpuid(s, wi->cpuid= _eax, + wi->cpuid_e= cx, + wi->cpuid_r= eg); + uint32_t requested_features =3D env->features[w]; + env->features[w] &=3D host_feat; + cpu->filtered_features[w] =3D requested_features & ~env->feature= s[w]; } } #endif --=20 1.8.1.4