diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2015-11-11 09:34:18 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2015-11-11 09:34:18 +0000 |
commit | 3c07587d49458341510360557c849e93e9afaf59 (patch) | |
tree | aa382e652f5561dea2d7c724313e0710cdee86fd /hw | |
parent | d93ae5b69621b7ec6ecfa405ec656d5b5f5e4770 (diff) | |
parent | b41d320fef705289d2b73f4949731eb2e189161d (diff) |
Merge remote-tracking branch 'remotes/dgibson/tags/ppc-next-20151111' into staging
ppc patch queue - 2015-11-11
Highlights:
- Updated SLOF version for "pseries machine
- Bugfix / cleanup for KVM hash page table allocation
# gpg: Signature made Wed 11 Nov 2015 02:30:51 GMT using RSA key ID 20D9B392
# gpg: Good signature from "David Gibson <david@gibson.dropbear.id.au>"
# gpg: aka "David Gibson (Red Hat) <dgibson@redhat.com>"
# gpg: aka "David Gibson (ozlabs.org) <dgibson@ozlabs.org>"
# gpg: WARNING: This key is not certified with sufficiently trusted signatures!
# gpg: It is not certain that the signature belongs to the owner.
# Primary key fingerprint: 75F4 6586 AE61 A66C C44E 87DC 6C38 CACA 20D9 B392
* remotes/dgibson/tags/ppc-next-20151111:
spapr: Handle failure of KVM_PPC_ALLOCATE_HTAB ioctl
ppc: Let kvmppc_reset_htab() return 0 for !CONFIG_KVM
pseries: Update SLOF firmware image to qemu-slof-20151103
ppc: Add/Re-introduce MMU model definitions needed by PR KVM
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/ppc/spapr.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 37d071e4d4..030ee3554a 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -1021,9 +1021,19 @@ static void spapr_alloc_htab(sPAPRMachineState *spapr) * RAM */ shift = kvmppc_reset_htab(spapr->htab_shift); - - if (shift > 0) { - /* Kernel handles htab, we don't need to allocate one */ + if (shift < 0) { + /* + * For HV KVM, host kernel will return -ENOMEM when requested + * HTAB size can't be allocated. + */ + error_setg(&error_abort, "Failed to allocate HTAB of requested size, try with smaller maxmem"); + } else if (shift > 0) { + /* + * Kernel handles htab, we don't need to allocate one + * + * Older kernels can fall back to lower HTAB shift values, + * but we don't allow booting of such guests. + */ if (shift != spapr->htab_shift) { error_setg(&error_abort, "Failed to allocate HTAB of requested size, try with smaller maxmem"); } @@ -1055,7 +1065,9 @@ static void spapr_reset_htab(sPAPRMachineState *spapr) int index; shift = kvmppc_reset_htab(spapr->htab_shift); - if (shift > 0) { + if (shift < 0) { + error_setg(&error_abort, "Failed to reset HTAB"); + } else if (shift > 0) { if (shift != spapr->htab_shift) { error_setg(&error_abort, "Requested HTAB allocation failed during reset"); } |