[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 13/21] hw/arm/xlnx-zynqmp: fix unsigned error when checking the RP
|
From: |
Peter Maydell |
|
Subject: |
[PULL 13/21] hw/arm/xlnx-zynqmp: fix unsigned error when checking the RPUs number |
|
Date: |
Tue, 30 May 2023 14:26:12 +0100 |
From: Clément Chigot <chigot@adacore.com>
When passing --smp with a number lower than XLNX_ZYNQMP_NUM_APU_CPUS,
the expression (ms->smp.cpus - XLNX_ZYNQMP_NUM_APU_CPUS) will result
in a positive number as ms->smp.cpus is a unsigned int.
This will raise the following error afterwards, as Qemu will try to
instantiate some additional RPUs.
| $ qemu-system-aarch64 --smp 1 -M xlnx-zcu102
| **
| ERROR:../src/tcg/tcg.c:777:tcg_register_thread:
| assertion failed: (n < tcg_max_ctxs)
Signed-off-by: Clément Chigot <chigot@adacore.com>
Reviewed-by: Francisco Iglesias <frasse.iglesias@gmail.com>
Tested-by: Francisco Iglesias <frasse.iglesias@gmail.com>
Message-id: 20230524143714.565792-1-chigot@adacore.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
hw/arm/xlnx-zynqmp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/arm/xlnx-zynqmp.c b/hw/arm/xlnx-zynqmp.c
index 335cfc417d7..5905a330151 100644
--- a/hw/arm/xlnx-zynqmp.c
+++ b/hw/arm/xlnx-zynqmp.c
@@ -213,7 +213,7 @@ static void xlnx_zynqmp_create_rpu(MachineState *ms,
XlnxZynqMPState *s,
const char *boot_cpu, Error **errp)
{
int i;
- int num_rpus = MIN(ms->smp.cpus - XLNX_ZYNQMP_NUM_APU_CPUS,
+ int num_rpus = MIN((int)(ms->smp.cpus - XLNX_ZYNQMP_NUM_APU_CPUS),
XLNX_ZYNQMP_NUM_RPU_CPUS);
if (num_rpus <= 0) {
--
2.34.1
- [PULL 00/21] target-arm queue, Peter Maydell, 2023/05/30
- [PULL 04/21] hw/arm/smmuv3: Refactor stage-1 PTW, Peter Maydell, 2023/05/30
- [PULL 15/21] target/arm: Explicitly select short-format FSR for M-profile, Peter Maydell, 2023/05/30
- [PULL 18/21] arm/Kconfig: Make TCG dependence explicit, Peter Maydell, 2023/05/30
- [PULL 03/21] hw/arm/smmuv3: Update translation config to hold stage-2, Peter Maydell, 2023/05/30
- [PULL 08/21] hw/arm/smmuv3: Add VMID to TLB tagging, Peter Maydell, 2023/05/30
- [PULL 10/21] hw/arm/smmuv3: Add stage-2 support in iova notifier, Peter Maydell, 2023/05/30
- [PULL 11/21] hw/arm/smmuv3: Add knob to choose translation stage and enable stage-2, Peter Maydell, 2023/05/30
- [PULL 17/21] arm/Kconfig: Keep Kconfig default entries in default.mak as documentation, Peter Maydell, 2023/05/30
- [PULL 13/21] hw/arm/xlnx-zynqmp: fix unsigned error when checking the RPUs number,
Peter Maydell <=
- [PULL 02/21] hw/arm/smmuv3: Add missing fields for IDR0, Peter Maydell, 2023/05/30
- [PULL 12/21] hw/dma/xilinx_axidma: Check DMASR.HALTED to prevent infinite loop., Peter Maydell, 2023/05/30
- [PULL 01/21] fsl-imx6: Add SNVS support for i.MX6 boards, Peter Maydell, 2023/05/30
- [PULL 09/21] hw/arm/smmuv3: Add CMDs related to stage-2, Peter Maydell, 2023/05/30
- [PULL 19/21] Update copyright dates to 2023, Peter Maydell, 2023/05/30
- [PULL 06/21] hw/arm/smmuv3: Parse STE config for stage-2, Peter Maydell, 2023/05/30
- [PULL 05/21] hw/arm/smmuv3: Add page table walk for stage-2, Peter Maydell, 2023/05/30
- [PULL 14/21] tests/qtest: Run arm-specific tests only if the required machine is available, Peter Maydell, 2023/05/30
- [PULL 20/21] hw/arm/sbsa-ref: add GIC node into DT, Peter Maydell, 2023/05/30
- [PULL 21/21] docs: sbsa: correct graphics card name, Peter Maydell, 2023/05/30