]> www.infradead.org Git - users/willy/linux.git/commit
KVM: VMX: Process CR0.PG side effects after setting CR0 assets
authorSean Christopherson <seanjc@google.com>
Tue, 13 Jul 2021 16:33:05 +0000 (09:33 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 2 Aug 2021 15:01:55 +0000 (11:01 -0400)
commit32437c2aea428f9c3479904e342b02f5eee3a7f6
tree1ca275ef09566232864107634cdc2491196cb3f7
parent908b7d43c02c5f1f95beff66ce4ca30dfc3b134c
KVM: VMX: Process CR0.PG side effects after setting CR0 assets

Move the long mode and EPT w/o unrestricted guest side effect processing
down in vmx_set_cr0() so that the EPT && !URG case doesn't have to stuff
vcpu->arch.cr0 early.  This also fixes an oddity where CR0 might not be
marked available, i.e. the early vcpu->arch.cr0 write would appear to be
in danger of being overwritten, though that can't actually happen in the
current code since CR0.TS is the only guest-owned bit, and CR0.TS is not
read by vmx_set_cr4().

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20210713163324.627647-28-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/vmx.c