All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] target-i386: fix losing XCR0 processor state component bits
@ 2016-09-28  5:31 ` Wanpeng Li
  0 siblings, 0 replies; 22+ messages in thread
From: Wanpeng Li @ 2016-09-28  5:31 UTC (permalink / raw)
  To: kvm, qemu-devel
  Cc: Wanpeng Li, Paolo Bonzini, Richard Henderson, Eduardo Habkost,
	Michael S. Tsirkin

From: Wanpeng Li <wanpeng.li@hotmail.com>

Commit 96193c22a "target-i386: Move xsave component mask to features array"
leverages features array to handle XCR0 processor state component bits, 
however, it introduces a regression:

warning: host doesn't support requested feature: CPUID.0DH:EAX [bit 0]
warning: host doesn't support requested feature: CPUID.0DH:EAX [bit 1]
warning: host doesn't support requested feature: CPUID.0DH:EAX [bit 2]

My desktop doesn't have enough advance features, so just X87,SSE,AVX 
warnings are splat when I boot a guest.

The get migratable flags logic in x86_cpu_filter_features() path will 
filter out the feature flags which are unsupported and unmigratable. 
However, the bits of XCR0 processor state component featureword don't 
have feat_names, and some features like SSE/AVX etc have feat_names in 
CPUID.01H:EDX, CPUID.01H:ECX, so they are treated as unsupported.

This patch fix it by don't filter out XCR0 processor state components 
bits though they don't have feat_names just as before commit 96193c22ab3.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com>
---
 target-i386/cpu.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index ad09246..9d24eff 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -2156,6 +2156,10 @@ static uint32_t x86_cpu_get_supported_feature_word(FeatureWord w,
         r = kvm_arch_get_supported_cpuid(kvm_state, wi->cpuid_eax,
                                                     wi->cpuid_ecx,
                                                     wi->cpuid_reg);
+        if ((w == FEAT_XSAVE_COMP_LO) ||
+            (w == FEAT_XSAVE_COMP_HI)) {
+            return r;
+        }
     } else if (tcg_enabled()) {
         r = wi->tcg_features;
     } else {
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2016-09-28 16:29 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-28  5:31 [PATCH] target-i386: fix losing XCR0 processor state component bits Wanpeng Li
2016-09-28  5:31 ` [Qemu-devel] " Wanpeng Li
2016-09-28  7:54 ` Paolo Bonzini
2016-09-28  7:54   ` [Qemu-devel] " Paolo Bonzini
2016-09-28  8:38   ` Wanpeng Li
2016-09-28  8:38     ` [Qemu-devel] " Wanpeng Li
2016-09-28 14:57   ` Eduardo Habkost
2016-09-28 14:57     ` [Qemu-devel] " Eduardo Habkost
2016-09-28 15:01     ` Paolo Bonzini
2016-09-28 15:01       ` [Qemu-devel] " Paolo Bonzini
2016-09-28 15:05       ` Eduardo Habkost
2016-09-28 15:05         ` [Qemu-devel] " Eduardo Habkost
2016-09-28 15:09         ` Paolo Bonzini
2016-09-28 15:09           ` [Qemu-devel] " Paolo Bonzini
2016-09-28 15:59           ` Eduardo Habkost
2016-09-28 15:59             ` [Qemu-devel] " Eduardo Habkost
2016-09-28 16:07             ` Paolo Bonzini
2016-09-28 16:07               ` [Qemu-devel] " Paolo Bonzini
2016-09-28 16:13               ` Eduardo Habkost
2016-09-28 16:13                 ` [Qemu-devel] " Eduardo Habkost
2016-09-28 16:29                 ` Eduardo Habkost
2016-09-28 16:29                   ` [Qemu-devel] " Eduardo Habkost

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.