]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
hw/arm/zynq-devcfg: Prevent unintended unlock during initialization
authorYannickV <Y.Vossen@beckhoff.com>
Mon, 18 May 2026 07:33:47 +0000 (09:33 +0200)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 28 May 2026 13:18:23 +0000 (14:18 +0100)
During the emulation startup, all registers are reset, which triggers the
`r_unlock_post_write` function with a value of 0. This led to an
unintended memory access disable, making the devcfg unusable.

During startup, the memory space no longer gets locked.

Signed-off-by: YannickV <Y.Vossen@beckhoff.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@amd.com>
Message-id: 20260518073401.11279-3-corvin.koehne@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/dma/xlnx-zynq-devcfg.c

index 97082007600f1257647b7b9f5b221eea35fa6718..afe6ffd3260a0cf9d913e4ef8489aac2da704bfe 100644 (file)
@@ -221,7 +221,9 @@ static void r_unlock_post_write(RegisterInfo *reg, uint64_t val)
 {
     XlnxZynqDevcfg *s = XLNX_ZYNQ_DEVCFG(reg->opaque);
     const char *device_prefix = object_get_typename(OBJECT(s));
-
+    if (device_is_in_reset(DEVICE(s))) {
+        return;
+    }
     if (val == R_UNLOCK_MAGIC) {
         DB_PRINT("successful unlock\n");
         s->regs[R_CTRL] |= R_CTRL_PCAP_PR_MASK;