qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC PATCH v1 0/2] spapr: Abort when HTAB size requirement can't be met
@ 2015-09-24  8:22 Bharata B Rao
  2015-09-24  8:22 ` [Qemu-devel] [RFC PATCH v1 1/2] spapr: Allocate HTAB from machine init Bharata B Rao
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Bharata B Rao @ 2015-09-24  8:22 UTC (permalink / raw)
  To: qemu-devel; +Cc: nfont, Bharata B Rao, qemu-ppc, mdroth, david

HTAB size is a factor of maximum memory size that is specified by maxmem=
command line option. In cases where there is shortage of host memory, host
will not be able to allocate contiguous memory for guest HTAB and will
instead allocate a smaller HTAB. This usually is not a problem but when
user starts hotplugging memory to the guest, we can run out of HTAB entries
and hence memory hotplug fails. This failure should have been handled
gracefully by the guest kernel, but currently it leads to guest kernel OOPS.
This will eventually get fixed when the handling of memory hotplug is
completely moved to kernel for PowerKVM.

Prevent such kernel failure by refusing to boot the guest when requested
HTAB size can't be allocated. However HTAB allocation happens in the
reset path from where it is too late to abort. Hence this patchset
moves the HTAB allocation to machine init and aborts if HTAB size
requirement isn't met.

This patchset applies against David Gibson's spapr-next. With this
patchset, simple boot, reboot and migration tests pass with HV KVM guest.
For PR KVM guest, boot and reboot tests were done since migration already
appears broken for PR KVM.

Changes in v1
-------------
- Correctly handle HTAB for PR KVM guests that use QEMU allocated HTAB.
- Verbose error message when aborting.
- Check for returned shift value in reset path too and abort when
  there is mismatch in htab shift values.
- Move the marking of htab_fd as stale from spapr_alloc_htab() to
  spapr_reset_htab() where it originally belonged.

v0: http://lists.nongnu.org/archive/html/qemu-devel/2015-09/msg05491.html

Bharata B Rao (2):
  spapr: Allocate HTAB from machine init
  spapr: Abort when HTAB of requested size isn't allocated

 hw/ppc/spapr.c | 42 +++++++++++++++++++++++++++++++++++-------
 1 file changed, 35 insertions(+), 7 deletions(-)

-- 
2.1.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-09-29  6:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-24  8:22 [Qemu-devel] [RFC PATCH v1 0/2] spapr: Abort when HTAB size requirement can't be met Bharata B Rao
2015-09-24  8:22 ` [Qemu-devel] [RFC PATCH v1 1/2] spapr: Allocate HTAB from machine init Bharata B Rao
2015-09-24  8:22 ` [Qemu-devel] [RFC PATCH v1 2/2] spapr: Abort when HTAB of requested size isn't allocated Bharata B Rao
2015-09-29  5:22 ` [Qemu-devel] [RFC PATCH v1 0/2] spapr: Abort when HTAB size requirement can't be met David Gibson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).