[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] xlnx-zynqmp: Don't create rpu-cluster if there
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH] xlnx-zynqmp: Don't create rpu-cluster if there are no RPUs |
Date: |
Thu, 24 Jan 2019 14:12:41 +0000 |
On Mon, 21 Jan 2019 at 18:43, Peter Maydell <address@hidden> wrote:
>
> If we aren't going to create any RPUs, then don't create the
> rpu-cluster unit. This allows us to add an assertion to the
> cluster object that it contains at least one CPU, which helps
> to avoid bugs in creating clusters and putting CPUs in them.
>
> Signed-off-by: Peter Maydell <address@hidden>
> ---
> This is a preparatory patch that is necessary for the series
> "[PATCH v3 0/4] tcg: support heterogenous CPU clusters"
> (address@hidden)
> in order to avoid the xlnx-zcu102 board asserting if started with
> fewer than 5 CPUs.
>
> hw/arm/xlnx-zynqmp.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c
> index 370b0e44a38..16cba433cb7 100644
> --- a/hw/arm/xlnx-zynqmp.c
> +++ b/hw/arm/xlnx-zynqmp.c
> @@ -178,6 +178,11 @@ static void xlnx_zynqmp_create_rpu(XlnxZynqMPState *s,
> const char *boot_cpu,
> int i;
> int num_rpus = MIN(smp_cpus - XLNX_ZYNQMP_NUM_APU_CPUS,
> XLNX_ZYNQMP_NUM_RPU_CPUS);
>
> + if (num_rpus == 0) {
> + /* Don't create rpu-cluster object if there's nothing to put in it */
> + return;
> + }
Applied to target-arm.next with a fixup to test for "<= 0".
thanks
-- PMM