[PATCH for-5.1] i386: hvf: Explicitly set CR4 guest/host mask

Roman Bolshakov posted 1 patch 3 years, 9 months ago
Test checkpatch passed
Test docker-mingw@fedora passed
Test FreeBSD passed
Test docker-quick@centos7 passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20200714090726.41082-1-r.bolshakov@yadro.com
Maintainers: Eduardo Habkost <ehabkost@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Cameron Esfahani <dirty@apple.com>, Roman Bolshakov <r.bolshakov@yadro.com>, Richard Henderson <rth@twiddle.net>
target/i386/hvf/vmx.h | 1 +
1 file changed, 1 insertion(+)
[PATCH for-5.1] i386: hvf: Explicitly set CR4 guest/host mask
Posted by Roman Bolshakov 3 years, 9 months ago
Removal of register reset omitted initialization of CR4 guest/host mask.
x86_64 guests aren't booting without it.

Fixes: 5009ef22c6bb2 ("i386: hvf: Don't duplicate register reset")
Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
---
 target/i386/hvf/vmx.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/i386/hvf/vmx.h b/target/i386/hvf/vmx.h
index 75ba1e2a5f..587b1b8375 100644
--- a/target/i386/hvf/vmx.h
+++ b/target/i386/hvf/vmx.h
@@ -166,6 +166,7 @@ static inline void macvm_set_cr4(hv_vcpuid_t vcpu, uint64_t cr4)
 
     wvmcs(vcpu, VMCS_GUEST_CR4, guest_cr4);
     wvmcs(vcpu, VMCS_CR4_SHADOW, cr4);
+    wvmcs(vcpu, VMCS_CR4_MASK, CR4_VMXE);
 
     hv_vcpu_invalidate_tlb(vcpu);
     hv_vcpu_flush(vcpu);
-- 
2.26.1


Re: [PATCH for-5.1] i386: hvf: Explicitly set CR4 guest/host mask
Posted by Roman Bolshakov 3 years, 9 months ago
On Tue, Jul 14, 2020 at 12:07:27PM +0300, Roman Bolshakov wrote:
> Removal of register reset omitted initialization of CR4 guest/host mask.
> x86_64 guests aren't booting without it.
> 
> Fixes: 5009ef22c6bb2 ("i386: hvf: Don't duplicate register reset")
> Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
> 

If one has a chance to test or review it, it'd be very helpful. That'd
allow to include it in RC0.

Thanks,
Roman

Re: [PATCH for-5.1] i386: hvf: Explicitly set CR4 guest/host mask
Posted by Paolo Bonzini 3 years, 9 months ago
Hi Roman, please ask Peter to apply it directly because I won't be able to
send a pull request in the next couple of weeks.

Paolo

Il mar 14 lug 2020, 12:39 Roman Bolshakov <r.bolshakov@yadro.com> ha
scritto:

> On Tue, Jul 14, 2020 at 12:07:27PM +0300, Roman Bolshakov wrote:
> > Removal of register reset omitted initialization of CR4 guest/host mask.
> > x86_64 guests aren't booting without it.
> >
> > Fixes: 5009ef22c6bb2 ("i386: hvf: Don't duplicate register reset")
> > Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
> >
>
> If one has a chance to test or review it, it'd be very helpful. That'd
> allow to include it in RC0.
>
> Thanks,
> Roman
>
>
Re: [PATCH for-5.1] i386: hvf: Explicitly set CR4 guest/host mask
Posted by Eduardo Habkost 3 years, 9 months ago
On Tue, Jul 14, 2020 at 08:20:04PM +0200, Paolo Bonzini wrote:
> Hi Roman, please ask Peter to apply it directly because I won't be able to
> send a pull request in the next couple of weeks.
> 
> Paolo
> 
> Il mar 14 lug 2020, 12:39 Roman Bolshakov <r.bolshakov@yadro.com> ha
> scritto:
> 
> > On Tue, Jul 14, 2020 at 12:07:27PM +0300, Roman Bolshakov wrote:
> > > Removal of register reset omitted initialization of CR4 guest/host mask.
> > > x86_64 guests aren't booting without it.
> > >
> > > Fixes: 5009ef22c6bb2 ("i386: hvf: Don't duplicate register reset")
> > > Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
> > >
> >
> > If one has a chance to test or review it, it'd be very helpful. That'd
> > allow to include it in RC0.
> >

I'll queue it for my -rc1 pull request.

-- 
Eduardo


Re: [PATCH for-5.1] i386: hvf: Explicitly set CR4 guest/host mask
Posted by Roman Bolshakov 3 years, 9 months ago
On Thu, Jul 16, 2020 at 02:14:57PM -0400, Eduardo Habkost wrote:
> On Tue, Jul 14, 2020 at 08:20:04PM +0200, Paolo Bonzini wrote:
> > Hi Roman, please ask Peter to apply it directly because I won't be able to
> > send a pull request in the next couple of weeks.
> > 
> > Paolo
> > 
> > Il mar 14 lug 2020, 12:39 Roman Bolshakov <r.bolshakov@yadro.com> ha
> > scritto:
> > 
> > > On Tue, Jul 14, 2020 at 12:07:27PM +0300, Roman Bolshakov wrote:
> > > > Removal of register reset omitted initialization of CR4 guest/host mask.
> > > > x86_64 guests aren't booting without it.
> > > >
> > > > Fixes: 5009ef22c6bb2 ("i386: hvf: Don't duplicate register reset")
> > > > Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
> > > >
> > >
> > > If one has a chance to test or review it, it'd be very helpful. That'd
> > > allow to include it in RC0.
> > >
> 
> I'll queue it for my -rc1 pull request.
> 

Thanks!

-Roman