On 3/12/24 14:18, Shameer Kolothum wrote:
On arm/virt platform, Chen Xiang reported a Guest crash while
attempting the below steps,

1. Launch the Guest with nvdimm=on
2. Hot-add a NVDIMM dev
3. Reboot
4. Guest boots fine.
5. Reboot again.
6. Guest boot fails.

QEMU_EFI reports the below error:
ProcessCmdAddPointer: invalid pointer value in "etc/acpi/tables"
OnRootBridgesConnected: InstallAcpiTables: Protocol Error

Debugging shows that on first reboot(after hot adding NVDIMM),
Qemu updates the etc/table-loader len,

qemu_ram_resize()
   fw_cfg_modify_file()
      fw_cfg_modify_bytes_read()

And in fw_cfg_modify_bytes_read() we set the "callback_opaque" for
the key entry to NULL. Because of this, on the second reboot,
virt_acpi_build_update() is called with a NULL "build_state" and
returns without updating the ACPI tables. This seems to be
upsetting the firmware.

To fix this, don't change the callback_opaque in fw_cfg_modify_bytes_read().

Fixes: bdbb5b1706d165 ("fw_cfg: add fw_cfg_machine_reset function")
Reported-by: chenxiang <[email protected]>
Acked-by: Igor Mammedov <[email protected]>
Acked-by: Gerd Hoffmann <[email protected]>
Signed-off-by: Shameer Kolothum <[email protected]>
---
Hi,

I forgot to follow-up on the v2 and it never got picked up.
Thanks to Wangzhou who recently re-run the tests and found that
the problem mentioned above still exists. Hence resending the v2.

v2-->v3:
  -Just rebase.

v2: 
https://lore.kernel.org/qemu-devel/[email protected]/
v1: 
https://lore.kernel.org/all/[email protected]/

Thanks,
Shameer
---
  hw/nvram/fw_cfg.c | 1 -
  1 file changed, 1 deletion(-)

Patch queued, thanks!

Reply via email to