]> git.ipfire.org Git - thirdparty/qemu.git/commit
spapr: Handle failure of KVM_PPC_ALLOCATE_HTAB ioctl
authorBharata B Rao <bharata@linux.vnet.ibm.com>
Tue, 10 Nov 2015 05:24:54 +0000 (10:54 +0530)
committerDavid Gibson <david@gibson.dropbear.id.au>
Wed, 11 Nov 2015 02:29:04 +0000 (13:29 +1100)
commitb41d320fef705289d2b73f4949731eb2e189161d
treeb22b5e2f107606273f84b99f128e6625478d3e9b
parenta3166f8f6e9d3928d0b863c7f0dac1cf24b6c004
spapr: Handle failure of KVM_PPC_ALLOCATE_HTAB ioctl

KVM_PPC_ALLOCATE_HTAB ioctl can return -ENOMEM for KVM guests and QEMU
never handled this correctly. But this didn't cause any problems till
now as KVM_PPC_ALLOCATE_HTAB ioctl returned with smaller than requested
HTAB when enough contiguous memory wasn't available in the host.
After the proposed kernel change: https://patchwork.ozlabs.org/patch/530501/,
KVM_PPC_ALLOCATE_HTAB ioctl will not fallback to lower sized HTAB
allocation and will fail if requested HTAB size can't be met.

Check for such failures in QEMU and abort appropriately. This will
prevent guest kernel from hanging/freezing during early boot by doing
graceful exit when host is unable to allocate requested HTAB.

Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/ppc/spapr.c