* and it may also clear KVM_REQ_TLB_FLUSH_GPA pending bit
*/
kvm_late_check_requests(vcpu);
- vcpu->arch.host_eentry = csr_read64(LOONGARCH_CSR_EENTRY);
/* Clear KVM_LARCH_SWCSR_LATEST as CSR will change when enter guest */
vcpu->arch.aux_inuse &= ~KVM_LARCH_SWCSR_LATEST;
* If not, any old guest state from this vCPU will have been clobbered.
*/
context = per_cpu_ptr(vcpu->kvm->arch.vmcs, cpu);
- if (migrated || (context->last_vcpu != vcpu))
+ if (migrated || (context->last_vcpu != vcpu)) {
+ context->last_vcpu = vcpu;
vcpu->arch.aux_inuse &= ~KVM_LARCH_HWCSR_USABLE;
- context->last_vcpu = vcpu;
+ vcpu->arch.host_eentry = csr_read64(LOONGARCH_CSR_EENTRY);
+ }
/* Restore timer state regardless */
kvm_restore_timer(vcpu);