Skip to contentSkip to conversation

Synic default SCONTROL MSR needs to be enabled

PATCH Applied Jon Doron 2 participants 4 messages Jul 17, 2020 – Aug 10, 2020

Subsystems (4)
lore
Share & tools
lore

Jon Doron

author
#0 lore raw

cover Synic default SCONTROL MSR needs to be enabled

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(+)
Signature · 1 line
2.24.1
author
#1 lore raw

PATCH 1/1 x86/kvm/hyper-v: Synic default SCONTROL MSR needs to be enabled

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.

---
 arch/x86/kvm/hyperv.c | 1 +
 1 file changed, 1 insertion(+)
arch/x86/kvm/hyperv.c +1 -0
index af9cdb426dd2..814d3aee5cef 100644
@@ -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;
 }
 
Signature · 1 line
2.24.1
maintainer Applied
#2 lore raw

Re: [PATCH v1 1/1] x86/kvm/hyper-v: Synic default SCONTROL MSR needs to be enabled

Quoted 22 lines · 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.

---
 arch/x86/kvm/hyperv.c | 1 +
 1 file changed, 1 insertion(+)
arch/x86/kvm/hyperv.c +0 -0
index af9cdb426dd2..814d3aee5cef 100644

arch/x86/kvm/hyperv.c int kvm_hv_activate_synic(struct kvm_vcpu *vcpu, bool dont_zero_synic_pages) · line 906

Quoted 7 lines
arch/x86/kvm/hyperv.c +1 -0
@@ -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

author
#3 lore raw
In reply to Jon Doron

Ping, can this patch please be queued to 5.9?

Thanks,
-- Jon.

Quoted 21 lines · 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