From: David Gibson <david@gibson.dropbear.id.au>
To: Greg Kurz <groug@kaod.org>
Cc: qemu-devel@nongnu.org,
Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>,
qemu-ppc@nongnu.org, Michael Roth <mdroth@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [PATCH] spapr/drc: don't migrate DRC of cold-plugged CPUs and LMBs
Date: Tue, 6 Jun 2017 09:23:09 +1000 [thread overview]
Message-ID: <20170605232309.GD13397@umbus.fritz.box> (raw)
In-Reply-To: <149639817593.15167.7338592152743589651.stgit@bahia.lan>
[-- Attachment #1: Type: text/plain, Size: 2424 bytes --]
On Fri, Jun 02, 2017 at 12:09:35PM +0200, Greg Kurz wrote:
> As explained in commit 5c0139a8c2f0 ("spapr: fix default DRC state for
> coldplugged LMBs"), guests expect cold-plugged LMBs to be pre-allocated
> and unisolated. The same goes for cold-plugged CPUs.
>
> While here, let's convert g_assert(false) to the better self documenting
> g_assert_not_reached().
>
> Signed-off-by: Greg Kurz <groug@kaod.org>
I've applied this to ppc-for-2.10. I'm a bit concerned that this is
just another bandaid thrown at the mess which is the DRC code. I'm
hoping to clean this up more thoroughly, which will obsolete this, but
in the meantime it shouldn't be any worse than what we have.
> ---
>
> FWIW
>
> $ git grep -i -E '(g_)?assert\((0|false)\)' | wc -l
> 100
> $ git grep g_assert_not_reached | wc -l
> 244
> ---
> hw/ppc/spapr_drc.c | 10 +++-------
> 1 file changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c
> index cc2400bcd57f..ab5f7cdf569c 100644
> --- a/hw/ppc/spapr_drc.c
> +++ b/hw/ppc/spapr_drc.c
> @@ -538,20 +538,16 @@ static bool spapr_drc_needed(void *opaque)
> */
> switch (drc->type) {
> case SPAPR_DR_CONNECTOR_TYPE_PCI:
> - rc = !((drc->isolation_state == SPAPR_DR_ISOLATION_STATE_UNISOLATED) &&
> - (drc->allocation_state == SPAPR_DR_ALLOCATION_STATE_USABLE) &&
> - drc->configured && drc->signalled && !drc->awaiting_release);
> - break;
> case SPAPR_DR_CONNECTOR_TYPE_CPU:
> case SPAPR_DR_CONNECTOR_TYPE_LMB:
> - rc = !((drc->isolation_state == SPAPR_DR_ISOLATION_STATE_ISOLATED) &&
> - (drc->allocation_state == SPAPR_DR_ALLOCATION_STATE_UNUSABLE) &&
> + rc = !((drc->isolation_state == SPAPR_DR_ISOLATION_STATE_UNISOLATED) &&
> + (drc->allocation_state == SPAPR_DR_ALLOCATION_STATE_USABLE) &&
> drc->configured && drc->signalled && !drc->awaiting_release);
> break;
> case SPAPR_DR_CONNECTOR_TYPE_PHB:
> case SPAPR_DR_CONNECTOR_TYPE_VIO:
> default:
> - g_assert(false);
> + g_assert_not_reached();
> }
> return rc;
> }
>
--
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 --]
prev parent reply other threads:[~2017-06-05 23:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-02 10:09 [Qemu-devel] [PATCH] spapr/drc: don't migrate DRC of cold-plugged CPUs and LMBs Greg Kurz
2017-06-05 23:23 ` 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=20170605232309.GD13397@umbus.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=danielhb@linux.vnet.ibm.com \
--cc=groug@kaod.org \
--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).