From: Liang Chen Date: Wed, 25 Jul 2018 08:32:14 +0000 (+0800) Subject: KVM: x86: Skip pae_root shadow allocation if tdp enabled X-Git-Tag: v4.19-rc1~87^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ee6268ba3a6861b2806e569bff7fe91fbdf846dd;p=thirdparty%2Fkernel%2Flinux.git KVM: x86: Skip pae_root shadow allocation if tdp enabled Considering the fact that the pae_root shadow is not needed when tdp is in use, skip the pae_root shadow page allocation to allow mmu creation even not being able to obtain memory from DMA32 zone when particular cgroup cpuset.mems or mempolicy control is applied. Signed-off-by: Liang Chen Signed-off-by: Paolo Bonzini --- diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 8f216321d33b2..f5aef52b148bf 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -5341,6 +5341,9 @@ static int alloc_mmu_pages(struct kvm_vcpu *vcpu) struct page *page; int i; + if (tdp_enabled) + return 0; + /* * When emulating 32-bit mode, cr3 is only 32 bits even on x86_64. * Therefore we need to allocate shadow page tables in the first