From: David Gibson <david@gibson.dropbear.id.au>
To: Bharata B Rao <bharata@linux.vnet.ibm.com>
Cc: peter.maydell@linaro.org, agraf@suse.de,
mdroth@linux.vnet.ibm.com, groug@kaod.org, lvivier@redhat.com,
aik@ozlabs.ru, surajjs@au1.ibm.com, sbobroff@au1.ibm.com,
qemu-ppc@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PULL 09/17] spapr: Remove unnecessary differences between hotplug and coldplug paths
Date: Wed, 12 Jul 2017 19:40:05 +1000 [thread overview]
Message-ID: <20170712094005.GM4083@umbus.fritz.box> (raw)
In-Reply-To: <20170712082637.GA5377@in.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 3014 bytes --]
On Wed, Jul 12, 2017 at 01:56:37PM +0530, Bharata B Rao wrote:
> On Tue, Jul 11, 2017 at 02:39:09PM +1000, David Gibson wrote:
> > spapr_drc_attach() has a 'coldplug' parameter which sets the DRC into
> > configured state initially, instead of the usual ISOLATED/UNUSABLE state.
> > It turns out this is unnecessary: although coldplugged devices do need to
> > be in CONFIGURED state once the guest starts, that will already be
> > accomplished by the reset code which will move DRCs for already plugged
> > devices into a coldplug equivalent state.
> >
> > Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
> > Reviewed-by: Laurent Vivier <lvivier@redhat.com>
> > Reviewed-by: Greg Kurz <groug@kaod.org>
> > ---
> > hw/ppc/spapr.c | 13 +++----------
> > hw/ppc/spapr_drc.c | 5 ++---
> > hw/ppc/spapr_pci.c | 3 +--
> > include/hw/ppc/spapr_drc.h | 2 +-
> > 4 files changed, 7 insertions(+), 16 deletions(-)
> >
> > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> > index 4fa982d..70b3fd3 100644
> > --- a/hw/ppc/spapr.c
> > +++ b/hw/ppc/spapr.c
> > @@ -2611,7 +2611,7 @@ static void spapr_add_lmbs(DeviceState *dev, uint64_t addr_start, uint64_t size,
> > fdt_offset = spapr_populate_memory_node(fdt, node, addr,
> > SPAPR_MEMORY_BLOCK_SIZE);
> >
> > - spapr_drc_attach(drc, dev, fdt, fdt_offset, !dev->hotplugged, errp);
> > + spapr_drc_attach(drc, dev, fdt, fdt_offset, errp);
> > addr += SPAPR_MEMORY_BLOCK_SIZE;
> > }
> > /* send hotplug notification to the
> > @@ -2956,17 +2956,10 @@ static void spapr_core_plug(HotplugHandler *hotplug_dev, DeviceState *dev,
> >
> > g_assert(drc || !mc->has_hotpluggable_cpus);
> >
> > - /*
> > - * Setup CPU DT entries only for hotplugged CPUs. For boot time or
> > - * coldplugged CPUs DT entries are setup in spapr_build_fdt().
> > - */
> > - if (dev->hotplugged) {
> > - fdt = spapr_populate_hotplug_cpu_dt(cs, &fdt_offset, spapr);
> > - }
> > + fdt = spapr_populate_hotplug_cpu_dt(cs, &fdt_offset, spapr);
>
> A harmless (but still good to get rid of) side effect of this change is
> that we are now building the CPU device tree for boot time and cold-plugged
> CPUs twice:
>
> first from spapr_core_plug() -> spapr_populate_hotplug_cpu_dt()
> second from spapr_build_fdt() -> spapr_populate_cpus_dt_node()
>
> The first one is not used while the 2nd one acutally ends up building
> the CPUs DT entries for the boot time and cold-plugged CPUs.
Yeah, I know. I think simpler code is more important than the handful
of wasted cycles. We might be able to avoid this with some of the DT
generation cleanups I have on the long term radar.
--
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 --]
next prev parent reply other threads:[~2017-07-12 9:40 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-11 4:39 [Qemu-devel] [PULL 00/17] ppc-for-2.10 queue 20170711 David Gibson
2017-07-11 4:39 ` [Qemu-devel] [PULL 01/17] spapr: make spapr_populate_hotplug_cpu_dt() static David Gibson
2017-07-11 4:39 ` [Qemu-devel] [PULL 02/17] spapr: refresh "platform-specific" hcalls comment David Gibson
2017-07-11 4:39 ` [Qemu-devel] [PULL 03/17] spapr: fix bogus function name in comment David Gibson
2017-07-11 4:39 ` [Qemu-devel] [PULL 04/17] spapr: fix migration to pseries machine < 2.8 David Gibson
2017-07-11 4:39 ` [Qemu-devel] [PULL 05/17] target-ppc: SPR_BOOKE_ESR not set on FP exceptions David Gibson
2017-07-11 4:39 ` [Qemu-devel] [PULL 06/17] spapr: Leave DR-indicator management to the guest David Gibson
2017-07-11 4:39 ` [Qemu-devel] [PULL 07/17] spapr: Uniform DRC reset paths David Gibson
2017-07-11 4:39 ` [Qemu-devel] [PULL 08/17] spapr: Add DRC release method David Gibson
2017-07-11 4:39 ` [Qemu-devel] [PULL 09/17] spapr: Remove unnecessary differences between hotplug and coldplug paths David Gibson
2017-07-12 8:26 ` Bharata B Rao
2017-07-12 9:29 ` Greg Kurz
2017-07-12 9:40 ` David Gibson [this message]
2017-07-11 4:39 ` [Qemu-devel] [PULL 10/17] spapr: Use unplug_request for PCI hot unplug David Gibson
2017-07-11 4:39 ` [Qemu-devel] [PULL 11/17] target/ppc: Refactor tcg radix mmu code David Gibson
2017-07-11 4:39 ` [Qemu-devel] [PULL 12/17] target/ppc: Add debug function for radix mmu translation David Gibson
2017-07-11 4:39 ` [Qemu-devel] [PULL 13/17] spapr: fix memory hotplug error path David Gibson
2017-07-11 4:39 ` [Qemu-devel] [PULL 14/17] spapr: Only report host/guest IOMMU page size mismatches on KVM David Gibson
2017-07-11 4:39 ` [Qemu-devel] [PULL 15/17] ppc/kvm: have the "family" CPU alias to point to TYPE_HOST_POWERPC_CPU David Gibson
2017-07-11 4:39 ` [Qemu-devel] [PULL 16/17] spapr: introduce the XIVE_EXPLOIT option in CAS David Gibson
2017-07-11 4:39 ` [Qemu-devel] [PULL 17/17] spapr: populate device tree depending on XIVE_EXPLOIT option David Gibson
2017-07-11 16:13 ` [Qemu-devel] [PULL 00/17] ppc-for-2.10 queue 20170711 Peter Maydell
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=20170712094005.GM4083@umbus.fritz.box \
--to=david@gibson.dropbear.id.au \
--cc=agraf@suse.de \
--cc=aik@ozlabs.ru \
--cc=bharata@linux.vnet.ibm.com \
--cc=groug@kaod.org \
--cc=lvivier@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=sbobroff@au1.ibm.com \
--cc=surajjs@au1.ibm.com \
/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).