Skip to contentSkip to conversation

tweak HYPERV_CPUID_ENLIGHTMENT_INFO

PATCH Applied Vitaly Kuznetsov 2 participants 6 messages Jan 25, 2019

Subsystems (4)
lore
Share & tools
lore

Vitaly Kuznetsov

author maintainer
#0 lore raw

v2 cover tweak HYPERV_CPUID_ENLIGHTMENT_INFO

Be more consistent with genuine Hyper-V: don't recommend using Enlightened VMCS when it wasn't enabled, don't advertise reset via synthetic MSR.

Vitaly Kuznetsov (2):
x86/kvm/hyper-v: don't recommend doing reset via synthetic MSR x86/kvm/hyper-v: recommend using eVMCS only when it is enabled

 arch/x86/kvm/hyperv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
2.20.1
author maintainer
#1 lore raw

PATCH v2 1/2 x86/kvm/hyper-v: don't recommend doing reset via synthetic MSR

System reset through synthetic MSR is not recommended neither by genuine Hyper-V nor my QEMU.

Fixes 2bc39970e932 ("x86/kvm/hyper-v: Introduce KVM_GET_SUPPORTED_HV_CPUID")
---
 arch/x86/kvm/hyperv.c | 1 -
 1 file changed, 1 deletion(-)
arch/x86/kvm/hyperv.c +0 -1
index ac44a681f065..4840f5b3c88f 100644
@@ -1847,7 +1847,6 @@ int kvm_vcpu_ioctl_get_hv_cpuid(struct kvm_vcpu *vcpu, struct kvm_cpuid2 *cpuid,
 		case HYPERV_CPUID_ENLIGHTMENT_INFO:
 			ent->eax |= HV_X64_REMOTE_TLB_FLUSH_RECOMMENDED;
 			ent->eax |= HV_X64_APIC_ACCESS_RECOMMENDED;
-			ent->eax |= HV_X64_SYSTEM_RESET_RECOMMENDED;
 			ent->eax |= HV_X64_RELAXED_TIMING_RECOMMENDED;
 			ent->eax |= HV_X64_CLUSTER_IPI_RECOMMENDED;
 			ent->eax |= HV_X64_EX_PROCESSOR_MASKS_RECOMMENDED;
Signature · 1 line
2.20.1
author maintainer
#2 lore raw

PATCH v2 2/2 x86/kvm/hyper-v: recommend using eVMCS only when it is enabled

In reply to Vitaly Kuznetsov

We shouldn't probably be suggesting using Enlightened VMCS when it's not enabled (not supported from guest's point of view). Hyper-V on KVM seems to be fine either way but let's be consistent.

---
 arch/x86/kvm/hyperv.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/x86/kvm/hyperv.c +2 -1
index 4840f5b3c88f..4730fcaa70cf 100644
@@ -1850,7 +1850,8 @@ int kvm_vcpu_ioctl_get_hv_cpuid(struct kvm_vcpu *vcpu, struct kvm_cpuid2 *cpuid,
 			ent->eax |= HV_X64_RELAXED_TIMING_RECOMMENDED;
 			ent->eax |= HV_X64_CLUSTER_IPI_RECOMMENDED;
 			ent->eax |= HV_X64_EX_PROCESSOR_MASKS_RECOMMENDED;
-			ent->eax |= HV_X64_ENLIGHTENED_VMCS_RECOMMENDED;
+			if (evmcs_ver)
+				ent->eax |= HV_X64_ENLIGHTENED_VMCS_RECOMMENDED;
 
 			/*
 			 * Default number of spinlock retry attempts, matches
Signature · 1 line
2.20.1
author maintainer
#3 lore raw

Re: [PATCH v2 2/2] x86/kvm/hyper-v: recommend using eVMCS only when it is enabled

Quoted 4 lines · Vitaly Kuznetsov

We shouldn't probably be suggesting using Enlightened VMCS when it's not enabled (not supported from guest's point of view). Hyper-V on KVM seems to be fine either way but let's be consistent.

Fixes 2bc39970e932 ("x86/kvm/hyper-v: Introduce KVM_GET_SUPPORTED_HV_CPUID")

is missing here. Hope it can be added upon commit.

Quoted 20 lines
---
 arch/x86/kvm/hyperv.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/x86/kvm/hyperv.c +2 -1
index 4840f5b3c88f..4730fcaa70cf 100644
@@ -1850,7 +1850,8 @@ int kvm_vcpu_ioctl_get_hv_cpuid(struct kvm_vcpu *vcpu, struct kvm_cpuid2 *cpuid,
 			ent->eax |= HV_X64_RELAXED_TIMING_RECOMMENDED;
 			ent->eax |= HV_X64_CLUSTER_IPI_RECOMMENDED;
 			ent->eax |= HV_X64_EX_PROCESSOR_MASKS_RECOMMENDED;
-			ent->eax |= HV_X64_ENLIGHTENED_VMCS_RECOMMENDED;
+			if (evmcs_ver)
+				ent->eax |= HV_X64_ENLIGHTENED_VMCS_RECOMMENDED;
 
 			/*
 			 * Default number of spinlock retry attempts, matches
Signature · 1 line
Vitaly
maintainer
#4 lore raw

Re: [PATCH v2 2/2] x86/kvm/hyper-v: recommend using eVMCS only when it is enabled

Quoted 1 line · Vitaly Kuznetsov
Fixes 2bc39970e932 ("x86/kvm/hyper-v: Introduce KVM_GET_SUPPORTED_HV_CPUID")

Added, thanks.

Paolo

maintainer Applied
#5 lore raw
In reply to Vitaly Kuznetsov
Quoted 10 lines · Vitaly Kuznetsov

Be more consistent with genuine Hyper-V: don't recommend using Enlightened VMCS when it wasn't enabled, don't advertise reset via synthetic MSR.

Vitaly Kuznetsov (2):
x86/kvm/hyper-v: don't recommend doing reset via synthetic MSR x86/kvm/hyper-v: recommend using eVMCS only when it is enabled

 arch/x86/kvm/hyperv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Queued, thanks.

Paolo