Re: [PATCH v2 07/10] KVM: x86: Always populate L1 GPA for KVM_MAP_MEMORY

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

 



On Wed, 2024-04-10 at 15:07 -0700, isaku.yamahata@xxxxxxxxx wrote:
> @@ -5882,18 +5884,40 @@ int kvm_arch_vcpu_map_memory(struct kvm_vcpu *vcpu,
>         if (!tdp_enabled)
>                 return -EOPNOTSUPP;
>  
> +       /* Force to use L1 GPA despite of vcpu MMU mode. */
> +       is_smm = !!(vcpu->arch.hflags & HF_SMM_MASK);
> +       if (is_smm ||
> +           vcpu->arch.mmu != &vcpu->arch.root_mmu ||
> +           vcpu->arch.walk_mmu != &vcpu->arch.root_mmu) {
> +               vcpu->arch.hflags &= ~HF_SMM_MASK;
> +               mmu = vcpu->arch.mmu;
> +               walk_mmu = vcpu->arch.walk_mmu;
> +               vcpu->arch.mmu = &vcpu->arch.root_mmu;
> +               vcpu->arch.walk_mmu = &vcpu->arch.root_mmu;
> +               kvm_mmu_reset_context(vcpu);
> +       }
> +
>         /* reload is optimized for repeated call. */

After the kvm_mmu_reset_context(), what benefit is there to the operation? And
it happening for every call of kvm_arch_vcpu_map_memory()?

>         kvm_mmu_reload(vcpu);





[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