@samitouri / QOSamiQemu / commits / 9e0de45d41

hw/net/xilinx_axienet: Prevent writes to PHY Identification registers

There are other registers in the PHY model which should be partially or entirely read-only, but this solves the immediate issue. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3297 Signed-off-by: Jim MacArthur <jim.macarthur@linaro.org> Reviewed-by: Edgar E. Iglesias <edgar.iglesias@amd.com> Message-ID: <20260305-xilinx-phy-protection-v1-1-ffc9edd84e58@linaro.org> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Jim MacArthur committed Mar 5, 2026 at 12:13 UTC 9e0de45d41e0c9c0cf5ad94f8429cf104713d940
1 file changed +4
hw/net/xilinx_axienet.c
+4
@@ -141,6 +141,10 @@ tdk_write(struct PHY *phy, unsigned int req, unsigned int data)
141 regnum = req & 0x1f;
142 DPHY(qemu_log("%s reg[%d] = %x\n", __func__, regnum, data));
143 switch (regnum) {
144 + case 2:
145 + case 3:
146 + /* Writes to PHY Identification registers are disallowed */
147 + break;
148 default:
149 phy->regs[regnum] = data;
150 break;