Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cec26bc3 authored by Aneesh Kumar K.V's avatar Aneesh Kumar K.V Committed by Paolo Bonzini
Browse files

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.

Signed-off-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Reviewed-by: default avatarAlexander Graf <agraf@suse.de>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent e77d99d4
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -163,6 +163,12 @@ void __init kvm_cma_reserve(void)
	unsigned long align_size;
	unsigned long align_size;
	struct memblock_region *reg;
	struct memblock_region *reg;
	phys_addr_t selected_size = 0;
	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
	 * We cannot use memblock_phys_mem_size() here, because
	 * memblock_analyze() has not been called yet.
	 * memblock_analyze() has not been called yet.