pseries: Add helper to calculate recommended hash page table size
authorDavid Gibson <david@gibson.dropbear.id.au>
Tue, 9 Feb 2016 00:15:12 +0000 (10:15 +1000)
committerDavid Gibson <david@gibson.dropbear.id.au>
Tue, 16 Feb 2016 22:59:30 +0000 (09:59 +1100)
commit8dfe8e7f4facef400ef1c220f29196ae5cfc526c
treec9f6ffa2005dc259fab2730cf40d2e719b09118b
parent715c54071a43ab978dc12b9da22a5016203ed284
pseries: Add helper to calculate recommended hash page table size

At present we calculate the recommended hash page table (HPT) size for a
pseries guest just once in ppc_spapr_init() before allocating the HPT.
In future patches we're going to want this calculation in other places, so
this splits it out into a helper function.  While we're at it, change the
calculation to use ctz() instead of an explicit loop.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
hw/ppc/spapr.c