]> git.ipfire.org Git - thirdparty/qemu.git/commit
spapr: Include "pre-plugged" DIMMS in ram size calculation at reset
authorDavid Gibson <david@gibson.dropbear.id.au>
Fri, 1 Dec 2017 05:05:33 +0000 (16:05 +1100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Mon, 4 Dec 2017 00:31:22 +0000 (11:31 +1100)
commit768a20f3a491ed4afce73ebb65347d55251c0ebd
tree729e7a3ef8a86ae3fbaddddad8afdb566350c6e0
parentbe1b21e885743c08c921846c7201ff59fe82b8b0
spapr: Include "pre-plugged" DIMMS in ram size calculation at reset

At guest reset time, we allocate a hash page table (HPT) for the guest
based on the guest's RAM size.  If dynamic HPT resizing is not available we
use the maximum RAM size, if it is we use the current RAM size.

But the "current RAM size" calculation is incorrect - we just use the
"base" ram_size from the machine structure.  This doesn't include any
pluggable DIMMs that are already plugged at reset time.

This means that if you try to start a 'pseries' machine with a DIMM
specified on the command line that's much larger than the "base" RAM size,
then the guest will get a woefully inadequate HPT.  This can lead to a
guest freeze during boot as it runs out of HPT space during initial MMU
setup.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Greg Kurz <groug@kaod.org>
Tested-by: Greg Kurz <groug@kaod.org>
hw/ppc/spapr.c