save->cr3 = 0;
                save->cr4 = 0;
        }
-       svm->asid_generation = 0;
+       svm->current_vmcb->asid_generation = 0;
        svm->asid = 0;
 
        svm->nested.vmcb12_gpa = 0;
        svm->vmcb = target_vmcb->ptr;
        svm->vmcb_pa = target_vmcb->pa;
 
-       /*
-       * Workaround: we don't yet track the ASID generation
-       * that was active the last time target_vmcb was run.
-       */
-
-       svm->asid_generation = 0;
-
        /*
        * Track the physical CPU the target_vmcb is running on
        * in order to mark the VMCB dirty if the cpu changes at
        if (vmsa_page)
                svm->vmsa = page_address(vmsa_page);
 
-       svm->asid_generation = 0;
        svm->guest_state_loaded = false;
 
        svm_switch_vmcb(svm, &svm->vmcb01);
                vmcb_mark_dirty(svm->vmcb, VMCB_ASID);
        }
 
-       svm->asid_generation = sd->asid_generation;
+       svm->current_vmcb->asid_generation = sd->asid_generation;
        svm->asid = sd->next_asid++;
 }
 
        /*
         * If the previous vmrun of the vmcb occurred on
         * a different physical cpu then we must mark the vmcb dirty.
-        */
+        * and assign a new asid.
+       */
 
         if (unlikely(svm->current_vmcb->cpu != svm->vcpu.cpu)) {
-               svm->asid_generation = 0;
+               svm->current_vmcb->asid_generation = 0;
                vmcb_mark_all_dirty(svm->vmcb);
                svm->current_vmcb->cpu = svm->vcpu.cpu;
         }
                return pre_sev_run(svm, svm->vcpu.cpu);
 
        /* FIXME: handle wraparound of asid_generation */
-       if (svm->asid_generation != sd->asid_generation)
+       if (svm->current_vmcb->asid_generation != sd->asid_generation)
                new_asid(svm, sd);
 }
 
        if (static_cpu_has(X86_FEATURE_FLUSHBYASID))
                svm->vmcb->control.tlb_ctl = TLB_CONTROL_FLUSH_ASID;
        else
-               svm->asid_generation--;
+               svm->current_vmcb->asid_generation--;
 }
 
 static void svm_flush_tlb_gva(struct kvm_vcpu *vcpu, gva_t gva)