When EPT is used for nested guest we need to re-init MMU as shadow
EPT MMU (nested_ept_init_mmu_context() does that). When we return back
from L2 to L1 kvm_mmu_reset_context() in nested_vmx_load_cr3() resets
MMU back to normal TDP mode. Add a special 'guest_mmu' so we can use
separate root caches; the improved hit rate is not very important for
single vCPU performance, but it avoids contention on the mmu_lock for
many vCPUs.
It seems to me this is some timing issue. If a L2 vm fails to start I can get it running with a few hard reboots.
Also changing the L2 config helps, -net none, -nodefaults and -vga cirrus let the vm start most of the time.
I have bisected the kernel and ended with first bad commit:
commit 14c07ad89f4d728 a468caaea6a769c 018c2b8dd6
Author: Vitaly Kuznetsov <email address hidden>
Date: Mon Oct 8 21:28:08 2018 +0200
x86/kvm/mmu: introduce guest_mmu
When EPT is used for nested guest we need to re-init MMU as shadow ept_init_ mmu_context( ) does that). When we return back reset_context( ) in nested_ vmx_load_ cr3() resets
EPT MMU (nested_
from L2 to L1 kvm_mmu_
MMU back to normal TDP mode. Add a special 'guest_mmu' so we can use
separate root caches; the improved hit rate is not very important for
single vCPU performance, but it avoids contention on the mmu_lock for
many vCPUs.
It seems to me this is some timing issue. If a L2 vm fails to start I can get it running with a few hard reboots.
Also changing the L2 config helps, -net none, -nodefaults and -vga cirrus let the vm start most of the time.