Re: [PATCH v2 01/29] LoongArch: KVM: Add kvm related header files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2/21/23 03:56, Tianrui Zhao wrote:

In _kvm_check_vmid(), you already have

+    if (migrated || (ver != old)) {
+        _kvm_update_vpid(vcpu, cpu);
+        trace_kvm_vpid_change(vcpu, vcpu->arch.vpid[cpu]);
+    }

so a vpid will never be recycled if a vCPU migrates from physical CPU A to B and back to A.

So please keep the current VPID in the per-cpu struct vmcs, and you can just copy it from there in _kvm_check_vmid().

Thanks,  that is to say we should remove the vpid[NR_CPUS] array and it is enough to use only one vpid variable?

Yes, you need a vpid variable here and one in struct kvm_context.

Paolo




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux