From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40914) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXM86-0003UL-8B for qemu-devel@nongnu.org; Thu, 03 Sep 2015 00:28:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXM84-0002XU-4W for qemu-devel@nongnu.org; Thu, 03 Sep 2015 00:28:06 -0400 From: David Gibson Date: Thu, 3 Sep 2015 14:27:57 +1000 Message-Id: <1441254496-16174-7-git-send-email-david@gibson.dropbear.id.au> In-Reply-To: <1441254496-16174-1-git-send-email-david@gibson.dropbear.id.au> References: <1441254496-16174-1-git-send-email-david@gibson.dropbear.id.au> Subject: [Qemu-devel] [PATCH 06/25] spapr: Make hash table size a factor of maxram_size List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: peter.maydell@linaro.org Cc: mdroth@linux.vnet.ibm.com, aik@ozlabs.ru, qemu-devel@nongnu.org, agraf@suse.de, qemu-ppc@nongnu.org, Bharata B Rao , David Gibson From: Bharata B Rao The hash table size is dependent on ram_size, but since with hotplug the memory can grow till maxram_size. Hence make hash table size dependent on maxram_size. This allows to hotplug huge amounts of memory to the guest. Signed-off-by: Bharata B Rao Reviewed-by: David Gibson Signed-off-by: David Gibson --- hw/ppc/spapr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 42fddb0..88bf8e3 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -1708,7 +1708,7 @@ static void ppc_spapr_init(MachineState *machine) * more than needed for the Linux guests we support. */ spapr->htab_shift = 18; /* Minimum architected size */ while (spapr->htab_shift <= 46) { - if ((1ULL << (spapr->htab_shift + 7)) >= machine->ram_size) { + if ((1ULL << (spapr->htab_shift + 7)) >= machine->maxram_size) { break; } spapr->htab_shift++; -- 2.4.3