qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Bharata B Rao <bharata@linux.vnet.ibm.com>
To: qemu-devel@nongnu.org
Cc: nfont@linux.vnet.ibm.com,
	Bharata B Rao <bharata@linux.vnet.ibm.com>,
	qemu-ppc@nongnu.org, mdroth@linux.vnet.ibm.com,
	david@gibson.dropbear.id.au
Subject: [Qemu-devel] [RFC PATCH v0 2/2] spapr: Abort when HTAB of requested size isn't allocated
Date: Tue, 22 Sep 2015 09:09:49 +0530	[thread overview]
Message-ID: <1442893189-5680-3-git-send-email-bharata@linux.vnet.ibm.com> (raw)
In-Reply-To: <1442893189-5680-1-git-send-email-bharata@linux.vnet.ibm.com>

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 <bharata@linux.vnet.ibm.com>
---
 hw/ppc/spapr.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 4692122..66446af 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 allocated requested HTAB size");
+        }
+
         spapr->htab_shift = shift;
         kvmppc_kern_htab = true;
 
-- 
2.1.0

  parent reply	other threads:[~2015-09-22  3:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-22  3:39 [Qemu-devel] [RFC PATCH v0 0/2] spapr: Abort when HTAB size requirement can't be met Bharata B Rao
2015-09-22  3:39 ` [Qemu-devel] [RFC PATCH v0 1/2] spapr: Allocate HTAB from machine init Bharata B Rao
2015-09-23  3:28   ` David Gibson
2015-09-24  3:41     ` Bharata B Rao
2015-09-24  4:12       ` David Gibson
2015-09-22  3:39 ` Bharata B Rao [this message]
2015-09-23  3:29   ` [Qemu-devel] [RFC PATCH v0 2/2] spapr: Abort when HTAB of requested size isn't allocated David Gibson
2015-09-24  3:43     ` Bharata B Rao
2015-09-24  4:12       ` David Gibson

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=1442893189-5680-3-git-send-email-bharata@linux.vnet.ibm.com \
    --to=bharata@linux.vnet.ibm.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=nfont@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).