OSDN Git Service

pseries: Move hash page table allocation to reset time
authorDavid Gibson <david@gibson.dropbear.id.au>
Tue, 9 Feb 2016 00:21:56 +0000 (10:21 +1000)
committerDavid Gibson <david@gibson.dropbear.id.au>
Tue, 16 Feb 2016 22:59:30 +0000 (09:59 +1100)
commitc5f54f3e31bf693f70a98d4d73ea5dbe05689857
treefb01e25c00c361cdaf3cbb85d7b66db704d48ac9
parent8dfe8e7f4facef400ef1c220f29196ae5cfc526c
pseries: Move hash page table allocation to reset time

At the moment the size of the hash page table (HPT) is fixed based on the
maximum memory allowed to the guest.  As such, we allocate the table during
machine construction, and just clear it at reset.

However, we're planning to implement a PAPR extension allowing the hash
page table to be resized at runtime.  This will mean that on reset we want
to revert it to the default size.  It also means that when migrating, we
need to make sure the destination allocates an HPT of size matching the
host, since the guest could have changed it before the migration.

This patch replaces the spapr_alloc_htab() and spapr_reset_htab() functions
with a new spapr_reallocate_hpt() function.  This is called at reset and
inbound migration only, not during machine init any more.

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