KVM: PPC: BOOK3S: HV: CMA: Reserve cma region only in hypervisor mode
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Mon, 29 Sep 2014 08:02:38 +0000 (13:32 +0530)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 29 Sep 2014 13:36:33 +0000 (15:36 +0200)
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: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/powerpc/kvm/book3s_hv_builtin.c

index b9615ba5b083a6ddeea76b878925396561b5fb42..4fdc27c80f4c853d720aea438a88371dc378b950 100644 (file)
@@ -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.