Skip to contentSkip to conversation

KVM: PPC: BOOK3S: HV: CMA: Reserve cma region only in hypervisor mode

PATCH Applied Aneesh Kumar K.V 3 participants 5 messages Sep 29, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KVM: PPC: BOOK3S: HV: CMA: Reserve cma region only in hypervisor mode

We use cma reserved area for creating guest hash page table. Don't do the reservation in non-hypervisor mode. This avoids unnecessary CMA reservation when booting with limited memory configs like fadump and kdump.

---
 arch/powerpc/kvm/book3s_hv_builtin.c | 6 ++++++
 1 file changed, 6 insertions(+)
arch/powerpc/kvm/book3s_hv_builtin.c +6 -0
index b9615ba5b083..4fdc27c80f4c 100644
@@ -163,6 +163,12 @@ void __init kvm_cma_reserve(void)
 	unsigned long align_size;
 	struct memblock_region *reg;
 	phys_addr_t selected_size = 0;
+
+	/*
+	 * We need CMA reservation only when we are in HV mode
+	 */
+	if (!cpu_has_feature(CPU_FTR_HVMODE))
+		return;
 	/*
 	 * We cannot use memblock_phys_mem_size() here, because
 	 * memblock_analyze() has not been called yet.
Signature · 1 line
1.9.1
#1 lore raw
Quoted 6 lines · Aneesh Kumar K.V

We use cma reserved area for creating guest hash page table. Don't do the reservation in non-hypervisor mode. This avoids unnecessary CMA reservation when booting with limited memory configs like fadump and kdump.

Thanks, applied to kvm-ppc-queue.

Alex

maintainer
#2 lore raw

Il 29/09/2014 10:28, Alexander Graf ha scritto:

Quoted 11 lines · Aneesh Kumar K.V
Quoted 6 lines

We use cma reserved area for creating guest hash page table. Don't do the reservation in non-hypervisor mode. This avoids unnecessary CMA reservation when booting with limited memory configs like fadump and kdump.

Thanks, applied to kvm-ppc-queue.

Would you like this in 3.18?

Paolo

#3 lore raw
Quoted 9 lines · Paolo Bonzini

Il 29/09/2014 10:28, Alexander Graf ha scritto:

Quoted 8 lines · Aneesh Kumar K.V
Quoted 5 lines

We use cma reserved area for creating guest hash page table. Don't do the reservation in non-hypervisor mode. This avoids unnecessary CMA reservation when booting with limited memory configs like fadump and kdump.

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Thanks, applied to kvm-ppc-queue.

Would you like this in 3.18?

Yes, can you please directly apply it with my SoB (or Reviewed-by if you prefer)?

Alex

maintainer
#4 lore raw

Il 29/09/2014 13:57, Alexander Graf ha scritto:

Quoted 12 lines · Paolo Bonzini
Quoted 9 lines

Il 29/09/2014 10:28, Alexander Graf ha scritto:

Quoted 8 lines · Aneesh Kumar K.V
Quoted 5 lines

We use cma reserved area for creating guest hash page table. Don't do the reservation in non-hypervisor mode. This avoids unnecessary CMA reservation when booting with limited memory configs like fadump and kdump.

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Thanks, applied to kvm-ppc-queue.

Would you like this in 3.18?

Yes, can you please directly apply it with my SoB (or Reviewed-by if you prefer)?

Ok, will do.

Paolo