Skip to contentSkip to conversation

KVM: x86: Skip pae_root shadow allocation if tdp enabled

PATCH Applied Liang Chen 2 participants 2 messages Jul 25, 2018 – Aug 2, 2018

Subsystems (3)
lore
Share & tools
lore

Liang Chen

author
#0 lore raw

PATCH 1/1 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.

---
 arch/x86/kvm/mmu.c | 3 +++
 1 file changed, 3 insertions(+)
arch/x86/kvm/mmu.c +3 -0
index d594690..af8cc1e 100644
@@ -5029,6 +5029,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
Signature · 1 line
1.8.3.1
maintainer Applied
#1 lore raw
Quoted 17 lines · Liang Chen

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.

---
 arch/x86/kvm/mmu.c | 3 +++
 1 file changed, 3 insertions(+)
arch/x86/kvm/mmu.c +0 -0
index d594690..af8cc1e 100644

arch/x86/kvm/mmu.c static int alloc_mmu_pages(struct kvm_vcpu *vcpu) · line 5037

Quoted 9 lines
arch/x86/kvm/mmu.c +3 -0
@@ -5029,6 +5029,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

Queued, thanks.

Paolo