* [PATCH v1 0/1] hyperv: Enable SCONTROL if SYNIC is enabled
@ 2020-07-17 12:56 Jon Doron
2020-07-17 12:56 ` [PATCH v1 1/1] " Jon Doron
0 siblings, 1 reply; 4+ messages in thread
From: Jon Doron @ 2020-07-17 12:56 UTC (permalink / raw)
To: qemu-devel; +Cc: pbonzini, vkuznets, 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):
hyperv: Enable SCONTROL if SYNIC is enabled
target/i386/kvm.c | 2 ++
1 file changed, 2 insertions(+)
--
2.24.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v1 1/1] hyperv: Enable SCONTROL if SYNIC is enabled
2020-07-17 12:56 [PATCH v1 0/1] hyperv: Enable SCONTROL if SYNIC is enabled Jon Doron
@ 2020-07-17 12:56 ` Jon Doron
2020-08-10 17:27 ` Paolo Bonzini
0 siblings, 1 reply; 4+ messages in thread
From: Jon Doron @ 2020-07-17 12:56 UTC (permalink / raw)
To: qemu-devel; +Cc: pbonzini, vkuznets, 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>
---
target/i386/kvm.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/target/i386/kvm.c b/target/i386/kvm.c
index b8455c89ed..6a62e8ae94 100644
--- a/target/i386/kvm.c
+++ b/target/i386/kvm.c
@@ -1904,6 +1904,8 @@ void kvm_arch_reset_vcpu(X86CPU *cpu)
if (hyperv_feat_enabled(cpu, HYPERV_FEAT_SYNIC)) {
int i;
+
+ env->msr_hv_synic_control = HV_SYNIC_ENABLE;
for (i = 0; i < ARRAY_SIZE(env->msr_hv_synic_sint); i++) {
env->msr_hv_synic_sint[i] = HV_SINT_MASKED;
}
--
2.24.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v1 1/1] hyperv: Enable SCONTROL if SYNIC is enabled
2020-07-17 12:56 ` [PATCH v1 1/1] " Jon Doron
@ 2020-08-10 17:27 ` Paolo Bonzini
2020-08-10 17:40 ` Jon Doron
0 siblings, 1 reply; 4+ messages in thread
From: Paolo Bonzini @ 2020-08-10 17:27 UTC (permalink / raw)
To: Jon Doron, qemu-devel; +Cc: vkuznets
On 17/07/20 14:56, 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>
> ---
> target/i386/kvm.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/target/i386/kvm.c b/target/i386/kvm.c
> index b8455c89ed..6a62e8ae94 100644
> --- a/target/i386/kvm.c
> +++ b/target/i386/kvm.c
> @@ -1904,6 +1904,8 @@ void kvm_arch_reset_vcpu(X86CPU *cpu)
>
> if (hyperv_feat_enabled(cpu, HYPERV_FEAT_SYNIC)) {
> int i;
> +
> + env->msr_hv_synic_control = HV_SYNIC_ENABLE;
> for (i = 0; i < ARRAY_SIZE(env->msr_hv_synic_sint); i++) {
> env->msr_hv_synic_sint[i] = HV_SINT_MASKED;
> }
>
Are both patches needed or only the Hyper-V one?
Paolo
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v1 1/1] hyperv: Enable SCONTROL if SYNIC is enabled
2020-08-10 17:27 ` Paolo Bonzini
@ 2020-08-10 17:40 ` Jon Doron
0 siblings, 0 replies; 4+ messages in thread
From: Jon Doron @ 2020-08-10 17:40 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: Vitaly Kuznetsov, QEMU
[-- Attachment #1: Type: text/plain, Size: 1328 bytes --]
I think both patches are
On Mon, Aug 10, 2020, 20:27 Paolo Bonzini <pbonzini@redhat.com> wrote:
> On 17/07/20 14:56, 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>
> > ---
> > target/i386/kvm.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/target/i386/kvm.c b/target/i386/kvm.c
> > index b8455c89ed..6a62e8ae94 100644
> > --- a/target/i386/kvm.c
> > +++ b/target/i386/kvm.c
> > @@ -1904,6 +1904,8 @@ void kvm_arch_reset_vcpu(X86CPU *cpu)
> >
> > if (hyperv_feat_enabled(cpu, HYPERV_FEAT_SYNIC)) {
> > int i;
> > +
> > + env->msr_hv_synic_control = HV_SYNIC_ENABLE;
> > for (i = 0; i < ARRAY_SIZE(env->msr_hv_synic_sint); i++) {
> > env->msr_hv_synic_sint[i] = HV_SINT_MASKED;
> > }
> >
>
> Are both patches needed or only the Hyper-V one?
>
> Paolo
>
>
[-- Attachment #2: Type: text/html, Size: 1922 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-08-10 18:23 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:56 [PATCH v1 0/1] hyperv: Enable SCONTROL if SYNIC is enabled Jon Doron
2020-07-17 12:56 ` [PATCH v1 1/1] " Jon Doron
2020-08-10 17:27 ` Paolo Bonzini
2020-08-10 17:40 ` 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).