From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60712) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5FFf-0004rD-1Q for qemu-devel@nongnu.org; Tue, 24 May 2016 12:32:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b5FFY-0005ES-Us for qemu-devel@nongnu.org; Tue, 24 May 2016 12:32:13 -0400 Date: Tue, 24 May 2016 18:32:04 +0200 From: "Edgar E. Iglesias" Message-ID: <20160524163204.GV16305@toto> References: <1463698459-31312-1-git-send-email-edgar.iglesias@gmail.com> <1463698459-31312-4-git-send-email-edgar.iglesias@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH v1 3/5] xlnx-zynqmp: Make the RPU subsystem optional List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: QEMU Developers , Alistair Francis , Peter Crosthwaite , Edgar Iglesias , qemu-arm On Tue, May 24, 2016 at 05:26:54PM +0100, Peter Maydell wrote: > On 19 May 2016 at 23:54, Edgar E. Iglesias wrote: > > From: "Edgar E. Iglesias" > > > > 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 > > --- > > 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