qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
	Alistair Francis <alistair.francis@xilinx.com>,
	Peter Crosthwaite <crosthwaite.peter@gmail.com>,
	Edgar Iglesias <edgar.iglesias@xilinx.com>,
	qemu-arm <qemu-arm@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v1 3/5] xlnx-zynqmp: Make the RPU subsystem optional
Date: Tue, 24 May 2016 18:32:04 +0200	[thread overview]
Message-ID: <20160524163204.GV16305@toto> (raw)
In-Reply-To: <CAFEAcA9+ow6BAhqk5hUeoR50gUhX0TJy75r1ViUZJ-vEbLawJw@mail.gmail.com>

On Tue, May 24, 2016 at 05:26:54PM +0100, Peter Maydell wrote:
> On 19 May 2016 at 23:54, Edgar E. Iglesias <edgar.iglesias@gmail.com> wrote:
> > From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>
> >
> > The way we currently model the RPU subsystem is of quite
> > limited use. In addition to that, it causes problems for
> > KVM and for GDB debugging.
> >
> > Make the RPU optional by adding a has_rpu property and
> > default to having it disabled.
> >
> > Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
> > ---
> >  hw/arm/xlnx-zynqmp.c         | 50 +++++++++++++++++++++++++++++++++++++-------
> >  include/hw/arm/xlnx-zynqmp.h |  2 ++
> >  2 files changed, 44 insertions(+), 8 deletions(-)
> >
> > diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c
> > index 250ecc4..c180206 100644
> > --- a/hw/arm/xlnx-zynqmp.c
> > +++ b/hw/arm/xlnx-zynqmp.c
> > @@ -83,6 +83,40 @@ static inline int arm_gic_ppi_index(int cpu_nr, int ppi_index)
> >      return GIC_NUM_SPI_INTR + cpu_nr * GIC_INTERNAL + ppi_index;
> >  }
> >
> > +static bool xlnx_zynqmp_get_has_rpu(Object *obj, Error **errp)
> > +{
> > +    XlnxZynqMPState *s = XLNX_ZYNQMP(obj);
> > +
> > +    return s->has_rpu;
> > +}
> > +
> > +static void xlnx_zynqmp_set_has_rpu(Object *obj, bool value, Error **errp)
> > +{
> > +    XlnxZynqMPState *s = XLNX_ZYNQMP(obj);
> > +    int i;
> > +
> > +    if (s->has_rpu == value) {
> > +        /* Nothing to do.  */
> > +        return;
> > +    }
> > +
> > +    /* We don't support clearing the flag.  */
> > +    if (s->has_rpu) {
> > +        error_setg(errp, "has_rpu is already set to %u",
> > +                   s->has_rpu);
> > +        return;
> > +    }
> > +
> > +    /* Create the Cortex R5s.  */
> > +    for (i = 0; i < XLNX_ZYNQMP_NUM_RPU_CPUS; i++) {
> > +        object_initialize(&s->rpu_cpu[i], sizeof(s->rpu_cpu[i]),
> > +                          "cortex-r5-" TYPE_ARM_CPU);
> > +        object_property_add_child(obj, "rpu-cpu[*]", OBJECT(&s->rpu_cpu[i]),
> > +                                  &error_abort);
> > +    }
> 
> Do we have to create them in the set function so we can
> set properties before realize, or could this be deferred
> to realize time?

Yes, I thought it was recommended to avoid object creation
in realize. But creating the PRU in realize works too.

Cheers,
Edgar

  reply	other threads:[~2016-05-24 16:32 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-19 22:54 [Qemu-devel] [PATCH v1 0/5] xlnx-zynqmp: Fix various issues with KVM runs Edgar E. Iglesias
2016-05-19 22:54 ` [Qemu-devel] [PATCH v1 1/5] xlnx-zynqmp: Add a secure prop to en/disable ARM Security Extensions Edgar E. Iglesias
2016-05-24 16:30   ` Peter Maydell
2016-05-24 16:57     ` Edgar E. Iglesias
2016-05-24 17:29       ` Peter Maydell
2016-05-19 22:54 ` [Qemu-devel] [PATCH v1 2/5] xlnx-zynqmp: Break out RPU setup into a separate function Edgar E. Iglesias
2016-05-24 16:23   ` Peter Maydell
2016-05-19 22:54 ` [Qemu-devel] [PATCH v1 3/5] xlnx-zynqmp: Make the RPU subsystem optional Edgar E. Iglesias
2016-05-24 16:26   ` Peter Maydell
2016-05-24 16:32     ` Edgar E. Iglesias [this message]
2016-05-24 16:37       ` Peter Maydell
2016-05-24 16:52         ` Edgar E. Iglesias
2016-05-19 22:54 ` [Qemu-devel] [PATCH v1 4/5] xlnx-zynqmp: Delay realization of GIC until post CPU realization Edgar E. Iglesias
2016-05-24 16:28   ` Peter Maydell
2016-05-19 22:54 ` [Qemu-devel] [PATCH v1 5/5] xlnx-zynqmp: Use the in kernel GIC model for KVM runs Edgar E. Iglesias
2016-05-24 16:29   ` Peter Maydell
  -- strict thread matches above, loose matches on Subject: below --
2016-05-19 22:48 [Qemu-devel] [PATCH v1 0/5] xlnx-zynqmp: Fix various issues with " Edgar E. Iglesias
2016-05-19 22:48 ` [Qemu-devel] [PATCH v1 3/5] xlnx-zynqmp: Make the RPU subsystem optional Edgar E. Iglesias

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=20160524163204.GV16305@toto \
    --to=edgar.iglesias@gmail.com \
    --cc=alistair.francis@xilinx.com \
    --cc=crosthwaite.peter@gmail.com \
    --cc=edgar.iglesias@xilinx.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@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).