* [PATCH] x86/kvm/hyper-v: tweak HYPERV_CPUID_ENLIGHTMENT_INFO
@ 2019-01-24 17:15 Vitaly Kuznetsov
2019-01-24 17:28 ` Liran Alon
0 siblings, 1 reply; 4+ messages in thread
From: Vitaly Kuznetsov @ 2019-01-24 17:15 UTC (permalink / raw)
To: kvm; +Cc: Paolo Bonzini, Radim Krčmář, Roman Kagan,
linux-kernel
We shouldn't probably be suggesting using Enlightened VMCS when it's not
enabled (not supported from guest's point of view). System reset through
synthetic MSR is not recommended neither by genuine Hyper-V nor my QEMU.
Windows seems to be fine either way but let's be consistent.
Fixes: 2bc39970e932 ("x86/kvm/hyper-v: Introduce KVM_GET_SUPPORTED_HV_CPUID")
Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
---
arch/x86/kvm/hyperv.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
index ac44a681f065..4730fcaa70cf 100644
--- a/arch/x86/kvm/hyperv.c
+++ b/arch/x86/kvm/hyperv.c
@@ -1847,11 +1847,11 @@ 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;
- ent->eax |= HV_X64_ENLIGHTENED_VMCS_RECOMMENDED;
+ if (evmcs_ver)
+ ent->eax |= HV_X64_ENLIGHTENED_VMCS_RECOMMENDED;
/*
* Default number of spinlock retry attempts, matches
--
2.20.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] x86/kvm/hyper-v: tweak HYPERV_CPUID_ENLIGHTMENT_INFO
2019-01-24 17:15 [PATCH] x86/kvm/hyper-v: tweak HYPERV_CPUID_ENLIGHTMENT_INFO Vitaly Kuznetsov
@ 2019-01-24 17:28 ` Liran Alon
2019-01-24 17:39 ` Vitaly Kuznetsov
0 siblings, 1 reply; 4+ messages in thread
From: Liran Alon @ 2019-01-24 17:28 UTC (permalink / raw)
To: Vitaly Kuznetsov
Cc: kvm, Paolo Bonzini, Radim Krčmář, Roman Kagan,
linux-kernel
> On 24 Jan 2019, at 19:15, Vitaly Kuznetsov <vkuznets@redhat.com> wrote:
>
> We shouldn't probably be suggesting using Enlightened VMCS when it's not
> enabled (not supported from guest's point of view). System reset through
> synthetic MSR is not recommended neither by genuine Hyper-V nor my QEMU.
>
> Windows seems to be fine either way but let's be consistent.
>
> Fixes: 2bc39970e932 ("x86/kvm/hyper-v: Introduce KVM_GET_SUPPORTED_HV_CPUID")
> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
> ---
> arch/x86/kvm/hyperv.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
> index ac44a681f065..4730fcaa70cf 100644
> --- a/arch/x86/kvm/hyperv.c
> +++ b/arch/x86/kvm/hyperv.c
> @@ -1847,11 +1847,11 @@ 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;
> - ent->eax |= HV_X64_ENLIGHTENED_VMCS_RECOMMENDED;
> + if (evmcs_ver)
> + ent->eax |= HV_X64_ENLIGHTENED_VMCS_RECOMMENDED;
>
> /*
> * Default number of spinlock retry attempts, matches
> --
> 2.20.1
>
Seems to me that there are 2 unrelated separated patches here. Why not split them?
For content itself: Reviewed-by: Liran Alon <liran.alon@oracle.com>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] x86/kvm/hyper-v: tweak HYPERV_CPUID_ENLIGHTMENT_INFO
2019-01-24 17:28 ` Liran Alon
@ 2019-01-24 17:39 ` Vitaly Kuznetsov
2019-01-24 17:41 ` Liran Alon
0 siblings, 1 reply; 4+ messages in thread
From: Vitaly Kuznetsov @ 2019-01-24 17:39 UTC (permalink / raw)
To: Liran Alon
Cc: kvm, Paolo Bonzini, Radim Krčmář, Roman Kagan,
linux-kernel
Liran Alon <liran.alon@oracle.com> writes:
>> On 24 Jan 2019, at 19:15, Vitaly Kuznetsov <vkuznets@redhat.com> wrote:
>>
>> We shouldn't probably be suggesting using Enlightened VMCS when it's not
>> enabled (not supported from guest's point of view). System reset through
>> synthetic MSR is not recommended neither by genuine Hyper-V nor my QEMU.
>>
>> Windows seems to be fine either way but let's be consistent.
>>
>> Fixes: 2bc39970e932 ("x86/kvm/hyper-v: Introduce KVM_GET_SUPPORTED_HV_CPUID")
>> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
>> ---
>> arch/x86/kvm/hyperv.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
>> index ac44a681f065..4730fcaa70cf 100644
>> --- a/arch/x86/kvm/hyperv.c
>> +++ b/arch/x86/kvm/hyperv.c
>> @@ -1847,11 +1847,11 @@ 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;
>> - ent->eax |= HV_X64_ENLIGHTENED_VMCS_RECOMMENDED;
>> + if (evmcs_ver)
>> + ent->eax |= HV_X64_ENLIGHTENED_VMCS_RECOMMENDED;
>>
>> /*
>> * Default number of spinlock retry attempts, matches
>> --
>> 2.20.1
>>
>
> Seems to me that there are 2 unrelated separated patches here. Why not
> split them?
They seem to be too small :-) No problem, I'll split them up in v2.
> For content itself: Reviewed-by: Liran Alon <liran.alon@oracle.com>
>
Thanks!
--
Vitaly
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH] x86/kvm/hyper-v: tweak HYPERV_CPUID_ENLIGHTMENT_INFO
2019-01-24 17:39 ` Vitaly Kuznetsov
@ 2019-01-24 17:41 ` Liran Alon
0 siblings, 0 replies; 4+ messages in thread
From: Liran Alon @ 2019-01-24 17:41 UTC (permalink / raw)
To: Vitaly Kuznetsov
Cc: kvm, Paolo Bonzini, Radim Krčmář, Roman Kagan,
linux-kernel
> On 24 Jan 2019, at 19:39, Vitaly Kuznetsov <vkuznets@redhat.com> wrote:
>
> Liran Alon <liran.alon@oracle.com> writes:
>
>>> On 24 Jan 2019, at 19:15, Vitaly Kuznetsov <vkuznets@redhat.com> wrote:
>>>
>>> We shouldn't probably be suggesting using Enlightened VMCS when it's not
>>> enabled (not supported from guest's point of view). System reset through
>>> synthetic MSR is not recommended neither by genuine Hyper-V nor my QEMU.
>>>
>>> Windows seems to be fine either way but let's be consistent.
>>>
>>> Fixes: 2bc39970e932 ("x86/kvm/hyper-v: Introduce KVM_GET_SUPPORTED_HV_CPUID")
>>> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
>>> ---
>>> arch/x86/kvm/hyperv.c | 4 ++--
>>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
>>> index ac44a681f065..4730fcaa70cf 100644
>>> --- a/arch/x86/kvm/hyperv.c
>>> +++ b/arch/x86/kvm/hyperv.c
>>> @@ -1847,11 +1847,11 @@ 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;
>>> - ent->eax |= HV_X64_ENLIGHTENED_VMCS_RECOMMENDED;
>>> + if (evmcs_ver)
>>> + ent->eax |= HV_X64_ENLIGHTENED_VMCS_RECOMMENDED;
>>>
>>> /*
>>> * Default number of spinlock retry attempts, matches
>>> --
>>> 2.20.1
>>>
>>
>> Seems to me that there are 2 unrelated separated patches here. Why not
>> split them?
>
> They seem to be too small :-) No problem, I'll split them up in v2.
I don’t think in general that it matters how small they are.
Separating to small logical patches allows better bisect, easier review and better revert resolution. So better overall. :)
>
>> For content itself: Reviewed-by: Liran Alon <liran.alon@oracle.com>
>>
>
> Thanks!
>
> --
> Vitaly
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-01-24 17:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-24 17:15 [PATCH] x86/kvm/hyper-v: tweak HYPERV_CPUID_ENLIGHTMENT_INFO Vitaly Kuznetsov
2019-01-24 17:28 ` Liran Alon
2019-01-24 17:39 ` Vitaly Kuznetsov
2019-01-24 17:41 ` Liran Alon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox