kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/1] Synic default SCONTROL MSR needs to be enabled
@ 2020-07-17 12:52 Jon Doron
  2020-07-17 12:52 ` [PATCH v1 1/1] x86/kvm/hyper-v: " Jon Doron
  2020-08-05  7:35 ` [PATCH v1 0/1] " Jon Doron
  0 siblings, 2 replies; 4+ messages in thread
From: Jon Doron @ 2020-07-17 12:52 UTC (permalink / raw)
  To: kvm; +Cc: vkuznets, pbonzini, rvkagan, Jon Doron

Based on an analysis of the HyperV firmwares (Gen1 and Gen2) it seems
like the SCONTROL is not being set to the ENABLED state as like we have
thought.

Also from a test done by Vitaly Kuznetsov, running a nested HyperV it
was concluded that the first access to the SCONTROL MSR with a read
resulted with the value of 0x1, aka HV_SYNIC_CONTROL_ENABLE.

It's important to note that this diverges from the value states in the
HyperV TLFS of 0.

Jon Doron (1):
  x86/kvm/hyper-v: Synic default SCONTROL MSR needs to be enabled

 arch/x86/kvm/hyperv.c | 1 +
 1 file changed, 1 insertion(+)

-- 
2.24.1


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

* [PATCH v1 1/1] x86/kvm/hyper-v: Synic default SCONTROL MSR needs to be enabled
  2020-07-17 12:52 [PATCH v1 0/1] Synic default SCONTROL MSR needs to be enabled Jon Doron
@ 2020-07-17 12:52 ` Jon Doron
  2020-08-10 17:22   ` Paolo Bonzini
  2020-08-05  7:35 ` [PATCH v1 0/1] " Jon Doron
  1 sibling, 1 reply; 4+ messages in thread
From: Jon Doron @ 2020-07-17 12:52 UTC (permalink / raw)
  To: kvm; +Cc: vkuznets, pbonzini, rvkagan, Jon Doron

Based on an analysis of the HyperV firmwares (Gen1 and Gen2) it seems
like the SCONTROL is not being set to the ENABLED state as like we have
thought.

Also from a test done by Vitaly Kuznetsov, running a nested HyperV it
was concluded that the first access to the SCONTROL MSR with a read
resulted with the value of 0x1, aka HV_SYNIC_CONTROL_ENABLE.

It's important to note that this diverges from the value states in the
HyperV TLFS of 0.

Signed-off-by: Jon Doron <arilou@gmail.com>
---
 arch/x86/kvm/hyperv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
index af9cdb426dd2..814d3aee5cef 100644
--- a/arch/x86/kvm/hyperv.c
+++ b/arch/x86/kvm/hyperv.c
@@ -900,6 +900,7 @@ int kvm_hv_activate_synic(struct kvm_vcpu *vcpu, bool dont_zero_synic_pages)
 	kvm_request_apicv_update(vcpu->kvm, false, APICV_INHIBIT_REASON_HYPERV);
 	synic->active = true;
 	synic->dont_zero_synic_pages = dont_zero_synic_pages;
+	synic->control = HV_SYNIC_CONTROL_ENABLE;
 	return 0;
 }
 
-- 
2.24.1


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

* Re: [PATCH v1 0/1] Synic default SCONTROL MSR needs to be enabled
  2020-07-17 12:52 [PATCH v1 0/1] Synic default SCONTROL MSR needs to be enabled Jon Doron
  2020-07-17 12:52 ` [PATCH v1 1/1] x86/kvm/hyper-v: " Jon Doron
@ 2020-08-05  7:35 ` Jon Doron
  1 sibling, 0 replies; 4+ messages in thread
From: Jon Doron @ 2020-08-05  7:35 UTC (permalink / raw)
  To: kvm; +Cc: Vitaly Kuznetsov, Paolo Bonzini, Roman Kagan

Ping, can this patch please be queued to 5.9?

Thanks,
-- Jon.

On Fri, Jul 17, 2020 at 3:52 PM Jon Doron <arilou@gmail.com> wrote:
>
> Based on an analysis of the HyperV firmwares (Gen1 and Gen2) it seems
> like the SCONTROL is not being set to the ENABLED state as like we have
> thought.
>
> Also from a test done by Vitaly Kuznetsov, running a nested HyperV it
> was concluded that the first access to the SCONTROL MSR with a read
> resulted with the value of 0x1, aka HV_SYNIC_CONTROL_ENABLE.
>
> It's important to note that this diverges from the value states in the
> HyperV TLFS of 0.
>
> Jon Doron (1):
>   x86/kvm/hyper-v: Synic default SCONTROL MSR needs to be enabled
>
>  arch/x86/kvm/hyperv.c | 1 +
>  1 file changed, 1 insertion(+)
>
> --
> 2.24.1
>

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

* Re: [PATCH v1 1/1] x86/kvm/hyper-v: Synic default SCONTROL MSR needs to be enabled
  2020-07-17 12:52 ` [PATCH v1 1/1] x86/kvm/hyper-v: " Jon Doron
@ 2020-08-10 17:22   ` Paolo Bonzini
  0 siblings, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2020-08-10 17:22 UTC (permalink / raw)
  To: Jon Doron, kvm; +Cc: vkuznets, rvkagan

On 17/07/20 14:52, Jon Doron wrote:
> Based on an analysis of the HyperV firmwares (Gen1 and Gen2) it seems
> like the SCONTROL is not being set to the ENABLED state as like we have
> thought.
> 
> Also from a test done by Vitaly Kuznetsov, running a nested HyperV it
> was concluded that the first access to the SCONTROL MSR with a read
> resulted with the value of 0x1, aka HV_SYNIC_CONTROL_ENABLE.
> 
> It's important to note that this diverges from the value states in the
> HyperV TLFS of 0.
> 
> Signed-off-by: Jon Doron <arilou@gmail.com>
> ---
>  arch/x86/kvm/hyperv.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
> index af9cdb426dd2..814d3aee5cef 100644
> --- a/arch/x86/kvm/hyperv.c
> +++ b/arch/x86/kvm/hyperv.c
> @@ -900,6 +900,7 @@ int kvm_hv_activate_synic(struct kvm_vcpu *vcpu, bool dont_zero_synic_pages)
>  	kvm_request_apicv_update(vcpu->kvm, false, APICV_INHIBIT_REASON_HYPERV);
>  	synic->active = true;
>  	synic->dont_zero_synic_pages = dont_zero_synic_pages;
> +	synic->control = HV_SYNIC_CONTROL_ENABLE;
>  	return 0;
>  }
>  
> 

Applied, thanks!

Paolo


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

end of thread, other threads:[~2020-08-10 17:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-17 12:52 [PATCH v1 0/1] Synic default SCONTROL MSR needs to be enabled Jon Doron
2020-07-17 12:52 ` [PATCH v1 1/1] x86/kvm/hyper-v: " Jon Doron
2020-08-10 17:22   ` Paolo Bonzini
2020-08-05  7:35 ` [PATCH v1 0/1] " Jon Doron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).