From patchwork Tue Dec 16 23:19:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris J Arges X-Patchwork-Id: 422132 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 0AAAC1400D2; Wed, 17 Dec 2014 10:19:49 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1Y11P6-0005t1-Ip; Tue, 16 Dec 2014 23:19:44 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1Y11P2-0005rt-2L for kernel-team@lists.ubuntu.com; Tue, 16 Dec 2014 23:19:40 +0000 Received: from 1.general.arges.us.vpn ([10.172.65.250] helo=localhost.localdomain) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1Y11P1-0008WV-Lw for kernel-team@lists.ubuntu.com; Tue, 16 Dec 2014 23:19:40 +0000 From: Chris J Arges To: kernel-team@lists.ubuntu.com Subject: [Utopic/Trusty][SRU][PATCH] KVM: PPC: BOOK3S: HV: CMA: Reserve cma region only in hypervisor mode Date: Tue, 16 Dec 2014 17:19:36 -0600 Message-Id: <1418771976-30080-1-git-send-email-chris.j.arges@canonical.com> X-Mailer: git-send-email 1.9.1 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com From: "Aneesh Kumar K.V" BugLink: http://bugs.launchpad.net/bugs/1400209 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 Reviewed-by: Alexander Graf Signed-off-by: Paolo Bonzini (cherry picked from commit cec26bc3c125b5dd12a02f04133cd91eae3f1622) Signed-off-by: Chris J Arges Acked-by: Andy Whitcroft --- arch/powerpc/kvm/book3s_hv_builtin.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/powerpc/kvm/book3s_hv_builtin.c b/arch/powerpc/kvm/book3s_hv_builtin.c index 7cde8a6..73f19fb 100644 --- a/arch/powerpc/kvm/book3s_hv_builtin.c +++ b/arch/powerpc/kvm/book3s_hv_builtin.c @@ -157,6 +157,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.