diff options
-rw-r--r-- | arch/x86/kvm/x86.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 33a40c544c7a..d65e481c5fa4 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -4171,9 +4171,13 @@ int cpuid_maxphyaddr(struct kvm_vcpu *vcpu) | |||
4171 | { | 4171 | { |
4172 | struct kvm_cpuid_entry2 *best; | 4172 | struct kvm_cpuid_entry2 *best; |
4173 | 4173 | ||
4174 | best = kvm_find_cpuid_entry(vcpu, 0x80000000, 0); | ||
4175 | if (!best || best->eax < 0x80000008) | ||
4176 | goto not_found; | ||
4174 | best = kvm_find_cpuid_entry(vcpu, 0x80000008, 0); | 4177 | best = kvm_find_cpuid_entry(vcpu, 0x80000008, 0); |
4175 | if (best) | 4178 | if (best) |
4176 | return best->eax & 0xff; | 4179 | return best->eax & 0xff; |
4180 | not_found: | ||
4177 | return 36; | 4181 | return 36; |
4178 | } | 4182 | } |
4179 | 4183 | ||