qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Michael Roth <mdroth@linux.vnet.ibm.com>
Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org,
	Bharata B Rao <bharata@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [PATCH v1 2/2] spapr: Handle failure of KVM_PPC_ALLOCATE_HTAB ioctl
Date: Wed, 11 Nov 2015 11:07:52 +1100	[thread overview]
Message-ID: <20151111000752.GJ18558@voom.redhat.com> (raw)
In-Reply-To: <20151110143857.25378.51227@loki>

[-- Attachment #1: Type: text/plain, Size: 2353 bytes --]

On Tue, Nov 10, 2015 at 08:38:57AM -0600, Michael Roth wrote:
> Quoting Bharata B Rao (2015-11-09 23:24:54)
> > 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>
> > ---
> >  hw/ppc/spapr.c | 20 ++++++++++++++++----
> >  1 file changed, 16 insertions(+), 4 deletions(-)
> > 
> > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> > index e1202ce..a64a1b5 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");
> 
> Wording is appropriate, but maybe just "Failed to allocate HTAB, try with
> smaller maxmem" to distinguish it from the error below where the call succeeds
> but there's a size mismatch?

Possibly the message could be a little better, but I'm not going to
hold up the patches just for that.  I've applied tentatively to
spapr-next, and I hope to send a pull req with it soon, assuming it
survives my tests.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

      reply	other threads:[~2015-11-11  0:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-10  5:24 [Qemu-devel] [PATCH v1 0/2] Handle KVM_PPC_ALLOCATE_HTAB ioctl failure Bharata B Rao
2015-11-10  5:24 ` [Qemu-devel] [PATCH v1 1/2] ppc: Let kvmppc_reset_htab() return 0 for !CONFIG_KVM Bharata B Rao
2015-11-10  5:24 ` [Qemu-devel] [PATCH v1 2/2] spapr: Handle failure of KVM_PPC_ALLOCATE_HTAB ioctl Bharata B Rao
2015-11-10 14:38   ` Michael Roth
2015-11-11  0:07     ` David Gibson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151111000752.GJ18558@voom.redhat.com \
    --to=david@gibson.dropbear.id.au \
    --cc=bharata@linux.vnet.ibm.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).