[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 02/21] spapr: Abort when HTAB of requested size isn't a
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 02/21] spapr: Abort when HTAB of requested size isn't allocated |
Date: |
Fri, 23 Oct 2015 20:43:14 +1100 |
From: Bharata B Rao <address@hidden>
Terminate the guest when HTAB of requested size isn't allocated by
the host.
When memory hotplug is attempted on a guest that has booted with
less than requested HTAB size, the guest kernel will not be able
to gracefully fail the hotplug request. This patch will ensure that
we never end up in a situation where memory hotplug fails due to
less than requested HTAB size.
Signed-off-by: Bharata B Rao <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/ppc/spapr.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 998a77b..f90f592 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -992,6 +992,10 @@ static void spapr_alloc_htab(sPAPRMachineState *spapr)
if (shift > 0) {
/* Kernel handles htab, we don't need to allocate one */
+ if (shift != spapr->htab_shift) {
+ error_setg(&error_abort, "Failed to allocate HTAB of requested
size, try with smaller maxmem");
+ }
+
spapr->htab_shift = shift;
kvmppc_kern_htab = true;
} else {
@@ -1020,6 +1024,10 @@ static void spapr_reset_htab(sPAPRMachineState *spapr)
shift = kvmppc_reset_htab(spapr->htab_shift);
if (shift > 0) {
+ if (shift != spapr->htab_shift) {
+ error_setg(&error_abort, "Requested HTAB allocation failed during
reset");
+ }
+
/* Tell readers to update their file descriptor */
if (spapr->htab_fd >= 0) {
spapr->htab_fd_stale = true;
--
2.4.3
- [Qemu-ppc] [PULL 00/21] ppc-next-20151023 queue 20151023, David Gibson, 2015/10/23
- [Qemu-ppc] [PULL 00/21] ppc-next-20151023 queue 20151023, David Gibson, 2015/10/23
- [Qemu-ppc] [PULL 03/21] spapr: Add "slb-size" property to CPU device tree nodes, David Gibson, 2015/10/23
- [Qemu-ppc] [PULL 18/21] macio: add to bridge category, David Gibson, 2015/10/23
- [Qemu-ppc] [PULL 17/21] uninorth: add to bridge category, David Gibson, 2015/10/23
- [Qemu-ppc] [PULL 10/21] ppc/spapr: Add "ibm, pa-features" property to the device-tree, David Gibson, 2015/10/23
- [Qemu-ppc] [PULL 21/21] prep: do not use CPU_LOG_IOPORT, convert to tracepoints, David Gibson, 2015/10/23
- [Qemu-ppc] [PULL 02/21] spapr: Abort when HTAB of requested size isn't allocated,
David Gibson <=
- [Qemu-ppc] [PULL 13/21] escc: add to input category, David Gibson, 2015/10/23
- [Qemu-ppc] [PULL 07/21] spapr_pci: Allow VFIO devices to work on the normal PCI host bridge, David Gibson, 2015/10/23
- [Qemu-ppc] [PULL 12/21] cmd646: add to storage category, David Gibson, 2015/10/23
- [Qemu-ppc] [PULL 08/21] hw/scsi/spapr_vscsi: Remove superfluous memset, David Gibson, 2015/10/23
- [Qemu-ppc] [PULL 04/21] spapr_pci: Allow PCI host bridge DMA window to be configured, David Gibson, 2015/10/23
- [Qemu-ppc] [PULL 11/21] adb: add to input category, David Gibson, 2015/10/23
- [Qemu-ppc] [PULL 14/21] grackle: add to bridge category, David Gibson, 2015/10/23
- [Qemu-ppc] [PULL 06/21] spapr_iommu: Provide a function to switch a TCE table to allowing VFIO, David Gibson, 2015/10/23
- [Qemu-ppc] [PULL 20/21] openpic: add to misc category, David Gibson, 2015/10/23
- [Qemu-ppc] [PULL 19/21] macio-nvram: add to misc category, David Gibson, 2015/10/23