Received: from eggs.gnu.org ([2001:4830:134:3::10]:33818) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b82ox-0002lu-0b for qemu-devel@nongnu.org; Wed, 01 Jun 2016 05:52:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b82op-0000VE-Bw for qemu-devel@nongnu.org; Wed, 01 Jun 2016 05:52:14 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:62637) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b82op-0000Uv-4D for qemu-devel@nongnu.org; Wed, 01 Jun 2016 05:52:07 -0400 Received: from pps.filterd (m0082756.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u519nAxn023737 for ; Wed, 1 Jun 2016 05:52:06 -0400 Message-Id: <201606010952.u519nAxn023737@mx0a-001b2d01.pphosted.com> Received: from e28smtp06.in.ibm.com (e28smtp06.in.ibm.com [125.16.236.6]) by mx0a-001b2d01.pphosted.com with ESMTP id 239u054hbg-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 01 Jun 2016 05:52:06 -0400 Received: from localhost by e28smtp06.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 1 Jun 2016 15:22:03 +0530 From: Bharata B Rao Date: Wed, 1 Jun 2016 15:21:25 +0530 In-Reply-To: <1464774685-7885-1-git-send-email-bharata@linux.vnet.ibm.com> References: <1464774685-7885-1-git-send-email-bharata@linux.vnet.ibm.com> Subject: [Qemu-devel] [RFC PATCH v0 2/2] spapr: Increase max memslots to 512 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, david@gibson.dropbear.id.au, thuth@redhat.com, imammedo@redhat.com, pbonzini@redhat.com, Bharata B Rao KVM now supports 512 memslots on PowerPC (earlier it was 32). Hence allow user to specify a max of 512 hotpluggable memory slots. Instead of hard coding the max value, use the KVM supplied value if KVM is enabled. Otherwise resort to the default value of 32. Signed-off-by: Bharata B Rao --- hw/ppc/spapr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 44e401a..3de426e 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -1816,11 +1816,13 @@ static void ppc_spapr_init(MachineState *machine) /* initialize hotplug memory address space */ if (machine->ram_size < machine->maxram_size) { ram_addr_t hotplug_mem_size = machine->maxram_size - machine->ram_size; + int max_memslots = kvm_enabled() ? kvm_get_max_memslots() : + SPAPR_MAX_RAM_SLOTS; - if (machine->ram_slots > SPAPR_MAX_RAM_SLOTS) { + if (machine->ram_slots > max_memslots) { error_report("Specified number of memory slots %" PRIu64" exceeds max supported %d", - machine->ram_slots, SPAPR_MAX_RAM_SLOTS); + machine->ram_slots, max_memslots); exit(1); } -- 2.1.0