]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: don't reset root in kvm_mmu_setup()
authorWei Yang <richard.weiyang@gmail.com>
Fri, 7 Sep 2018 11:59:47 +0000 (19:59 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 19 Sep 2018 22:26:44 +0000 (00:26 +0200)
commit57a3f6a07360aaa8448757b34b6c2937e9c20a1e
tree9816a94558bc4ae909a50bedd981e77f2ac61ff6
parent7a84de65613e7439e4e3b5a818f1ebc05e7693d6
KVM: x86: don't reset root in kvm_mmu_setup()

Here is the code path which shows kvm_mmu_setup() is invoked after
kvm_mmu_create(). Since kvm_mmu_setup() is only invoked in this code path,
this means the root_hpa and prev_roots are guaranteed to be invalid. And
it is not necessary to reset it again.

    kvm_vm_ioctl_create_vcpu()
        kvm_arch_vcpu_create()
            vmx_create_vcpu()
                kvm_vcpu_init()
                    kvm_arch_vcpu_init()
                        kvm_mmu_create()
        kvm_arch_vcpu_setup()
            kvm_mmu_setup()
                kvm_init_mmu()

This patch set reset_roots to false in kmv_mmu_setup().

Fixes: 7404887c0167615787a58183a2c85b2b59116045
Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
Reviewed-by: Liran Alon <liran.alon@oracle.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu.c