@samitouri / QOSamiQemu / commits / fb147007d1

hw/arm/smmuv3: Fix CFGI_CD handling when stage-1 is unsupported

Add a STAGE1_SUPPORTED check in the CMD_CFGI_CD and CMD_CFGI_CD_ALL path and return CERROR_ILL when stage-1 translation is not implemented, matching the architecture requirement (IHI 0070G.b, page 176). Fixes: 32cfd7f39e08 ("hw/arm/smmuv3: Cache/invalidate config data") Signed-off-by: Tao Tang <tangtao1634@phytium.com.cn> Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Reviewed-by: Mostafa Saleh <smostafa@google.com> Reviewed-by: Eric Auger <eric.auger@redhat.com> Message-id: 20260304142344.3341444-4-tangtao1634@phytium.com.cn Links: https://lore.kernel.org/qemu-devel/20260221101733.2995020-1-tangtao1634@phytium.com.cn/ Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Tao Tang committed Mar 4, 2026 at 22:23 UTC fb147007d145866775b0cd5a794c9fa8efdb8c3d
1 file changed +9
hw/arm/smmuv3.c
+9
@@ -1407,6 +1407,15 @@ static int smmuv3_cmdq_consume(SMMUv3State *s, Error **errp)
1407 break;
1408 }
1409
1410 + /*
1411 + * This command raises CERROR_ILL when stage 1 is not implemented
1412 + * according to (IHI 0070G.b) Page 176.
1413 + */
1414 + if (!STAGE1_SUPPORTED(s)) {
1415 + cmd_error = SMMU_CERROR_ILL;
1416 + break;
1417 + }
1418 +
1419 trace_smmuv3_cmdq_cfgi_cd(sid);
1420 smmuv3_flush_config(sdev);
1421 if (!smmuv3_accel_issue_inv_cmd(s, &cmd, sdev, errp)) {