Re: [PATCH v3 01/11] KVM: x86: Get active PCID only when writing a CR3 value

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

 



On 27/10/20 22:23, Sean Christopherson wrote:

+static void svm_load_mmu_pgd(struct kvm_vcpu *vcpu, hpa_t root_hpa,
 			     int root_level)
 {
 	struct vcpu_svm *svm = to_svm(vcpu);
 	unsigned long cr3;
- cr3 = __sme_set(root);
+	cr3 = __sme_set(root_hpa) | kvm_get_active_pcid(vcpu);
 	if (npt_enabled) {
 		svm->vmcb->control.nested_cr3 = cr3;

SVM uses the name "nested CR3" so this variable actually could represent an NPT value that does not need the PCID.

Therefore, this change must be done in an else branch, which I've done on applying the patch.

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