All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Michael Roth <mdroth@linux.vnet.ibm.com>
Cc: qemu-devel@nongnu.org, nfont@linux.vnet.ibm.com,
	qemu-ppc@nongnu.org, jallen@linux.vnet.ibm.com,
	bharata@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [PATCH 04/10] spapr: improve ibm, architecture-vec-5 property handling
Date: Wed, 26 Oct 2016 12:34:47 +1100	[thread overview]
Message-ID: <20161026013447.GS11052@umbus.fritz.box> (raw)
In-Reply-To: <20161025235809.GI11052@umbus.fritz.box>

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

On Wed, Oct 26, 2016 at 10:58:09AM +1100, David Gibson wrote:
> On Mon, Oct 24, 2016 at 11:47:30PM -0500, Michael Roth wrote:
> > ibm,architecture-vec-5 is supposed to encode all option vector 5 bits
> > negotiated between platform/guest. Currently we hardcode this property
> > in the boot-time device tree to advertise a single negotiated
> > capability, "Form 1" NUMA Affinity, regardless of whether or not CAS
> > has been invoked or that capability has actually been negotiated.
> > 
> > Improve this by generating ibm,architecture-vec-5 based on the full
> > set of option vector 5 capabilities negotiated via CAS.
> > 
> > Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
> > ---
> >  hw/ppc/spapr.c              | 23 +++++++++++++++++------
> >  include/hw/ppc/spapr_ovec.h |  1 +
> >  2 files changed, 18 insertions(+), 6 deletions(-)
> > 
> > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> > index 3b64580..828072a 100644
> > --- a/hw/ppc/spapr.c
> > +++ b/hw/ppc/spapr.c
> > @@ -659,14 +659,28 @@ static int spapr_dt_cas_updates(sPAPRMachineState *spapr, void *fdt,
> >                                  sPAPROptionVector *ov5_updates)
> >  {
> >      sPAPRMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr);
> > -    int ret = 0;
> > +    int ret = 0, offset;
> >  
> >      /* Generate ibm,dynamic-reconfiguration-memory node if required */
> >      if (spapr_ovec_test(ov5_updates, OV5_DRCONF_MEMORY)) {
> >          g_assert(smc->dr_lmb_enabled);
> >          ret = spapr_populate_drconf_memory(spapr, fdt);
> > +        if (ret) {
> > +            goto out;
> > +        }
> >      }
> >  
> > +    offset = fdt_path_offset(fdt, "/chosen");
> > +    if (offset < 0) {
> > +        offset = fdt_add_subnode(fdt, 0, "chosen");
> > +        if (offset < 0) {
> > +            return offset;
> > +        }
> 
> Just asserting offset >= 0 would be fine here.  We always create a
> /chosen node.

Duh.  Realised during testing that of course this *is* necessary for
the case where we're just making a CAS patch to the tree, rather than
building the whole tree.  I've reverted my ill-considered change in my
tree back to your original patch.

> 
> > +    }
> > +    ret = spapr_ovec_populate_dt(fdt, offset, spapr->ov5_cas,
> > +                                 "ibm,architecture-vec-5");
> > +
> > +out:
> >      return ret;
> >  }
> >  
> > @@ -792,14 +806,9 @@ static void spapr_dt_chosen(sPAPRMachineState *spapr, void *fdt)
> >      char *stdout_path = spapr_vio_stdout_path(spapr->vio_bus);
> >      size_t cb = 0;
> >      char *bootlist = get_boot_devices_list(&cb, true);
> > -    unsigned char vec5[] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x80};
> >  
> >      _FDT(chosen = fdt_add_subnode(fdt, 0, "chosen"));
> >  
> > -    /* Set Form1_affinity */
> > -    _FDT(fdt_setprop(fdt, chosen, "ibm,architecture-vec-5",
> > -                     vec5, sizeof(vec5)));
> > -
> >      _FDT(fdt_setprop_string(fdt, chosen, "bootargs", machine->kernel_cmdline));
> >      _FDT(fdt_setprop_cell(fdt, chosen, "linux,initrd-start",
> >                            spapr->initrd_base));
> > @@ -1778,6 +1787,8 @@ static void ppc_spapr_init(MachineState *machine)
> >          spapr_validate_node_memory(machine, &error_fatal);
> >      }
> >  
> > +    spapr_ovec_set(spapr->ov5, OV5_FORM1_AFFINITY);
> > +
> >      /* init CPUs */
> >      if (machine->cpu_model == NULL) {
> >          machine->cpu_model = kvm_enabled() ? "host" : smc->tcg_default_cpu;
> > diff --git a/include/hw/ppc/spapr_ovec.h b/include/hw/ppc/spapr_ovec.h
> > index 09afd59..47fa04c 100644
> > --- a/include/hw/ppc/spapr_ovec.h
> > +++ b/include/hw/ppc/spapr_ovec.h
> > @@ -44,6 +44,7 @@ typedef struct sPAPROptionVector sPAPROptionVector;
> >  
> >  /* option vector 5 */
> >  #define OV5_DRCONF_MEMORY       OV_BIT(2, 2)
> > +#define OV5_FORM1_AFFINITY      OV_BIT(5, 0)
> >  
> >  /* interfaces */
> >  sPAPROptionVector *spapr_ovec_new(void);
> 



-- 
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:[~2016-10-26  1:38 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-25  4:47 [Qemu-devel] [PATCH 00/10] spapr: option vector re-work and memory unplug support Michael Roth
2016-10-25  4:47 ` [Qemu-devel] [PATCH 01/10] spapr_ovec: initial implementation of option vector helpers Michael Roth
2016-10-25 23:54   ` David Gibson
2016-10-25  4:47 ` [Qemu-devel] [PATCH 02/10] spapr_hcall: use spapr_ovec_* interfaces for CAS options Michael Roth
2016-10-25  4:47 ` [Qemu-devel] [PATCH 03/10] spapr: add option vector handling in CAS-generated resets Michael Roth
2016-10-25 23:56   ` David Gibson
2016-10-25  4:47 ` [Qemu-devel] [PATCH 04/10] spapr: improve ibm, architecture-vec-5 property handling Michael Roth
2016-10-25 23:58   ` David Gibson
2016-10-26  1:34     ` David Gibson [this message]
2016-10-25  4:47 ` [Qemu-devel] [PATCH 05/10] spapr: update spapr hotplug documentation Michael Roth
2016-10-25  4:47 ` [Qemu-devel] [PATCH 06/10] spapr: add hotplug interrupt machine options Michael Roth
2016-10-26  0:25   ` David Gibson
2016-10-25  4:47 ` [Qemu-devel] [PATCH 07/10] spapr_events: add support for dedicated hotplug event source Michael Roth
2016-10-26  0:42   ` David Gibson
2016-10-26 21:44     ` Michael Roth
2016-10-25  4:47 ` [Qemu-devel] [PATCH 08/10] spapr: Add DRC count indexed hotplug identifier type Michael Roth
2016-10-26  0:48   ` David Gibson
2016-10-25  4:47 ` [Qemu-devel] [PATCH 09/10] spapr: use count+index for memory hotplug Michael Roth
2016-10-26  0:49   ` David Gibson
2016-10-25  4:47 ` [Qemu-devel] [PATCH 10/10] spapr: Memory hot-unplug support Michael Roth
2016-10-26  0:57   ` David Gibson
2016-10-26  0:02 ` [Qemu-devel] [PATCH 00/10] spapr: option vector re-work and memory unplug support 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=20161026013447.GS11052@umbus.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=bharata@linux.vnet.ibm.com \
    --cc=jallen@linux.vnet.ibm.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.