You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
qemu/hw/nvram
Shameer Kolothum 5a7b6029c1 fw_cfg: Don't set callback_opaque NULL in fw_cfg_modify_bytes_read()
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: bdbb5b1706 ("fw_cfg: add fw_cfg_machine_reset function")
Reported-by: chenxiang <chenxiang66@hisilicon.com>
Acked-by: Igor Mammedov <imammedo@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
Message-ID: <20241203131806.37548-1-shameerali.kolothum.thodi@huawei.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
3 weeks ago
..
Kconfig hw/nvram: Introduce Xilinx battery-backed ram 3 years ago
bcm2835_otp.c hw/nvram: Add BCM2835 OTP device 7 months ago
chrp_nvram.c include: Rename sysemu/ -> system/ 1 month ago
ds1225y.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 1 month ago
eeprom93xx.c hw/nvram: Constify VMState 1 year ago
eeprom_at24c.c Accel & Exec patch queue 1 month ago
fw_cfg-acpi.c license: Update deprecated SPDX tag GPL-2.0+ to GPL-2.0-or-later 4 months ago
fw_cfg-interface.c hw/nvram: Always register FW_CFG_DATA_GENERATOR_INTERFACE 4 years ago
fw_cfg.c fw_cfg: Don't set callback_opaque NULL in fw_cfg_modify_bytes_read() 3 weeks ago
mac_nvram.c Accel & Exec patch queue 1 month ago
meson.build hw/nvram: Add BCM2835 OTP device 7 months ago
npcm7xx_otp.c hw/nvram: Constify VMState 1 year ago
nrf51_nvm.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 1 month ago
spapr_nvram.c Accel & Exec patch queue 1 month ago
trace-events docs: fix references to docs/devel/tracing.rst 4 years ago
trace.h trace: switch position of headers to what Meson requires 4 years ago
xlnx-bbram.c Accel & Exec patch queue 1 month ago
xlnx-efuse-crc.c hw/nvram: Introduce Xilinx eFuse QOM 3 years ago
xlnx-efuse.c Accel & Exec patch queue 1 month ago
xlnx-versal-efuse-cache.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 1 month ago
xlnx-versal-efuse-ctrl.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 1 month ago
xlnx-zynqmp-efuse.c include/hw/qdev-properties: Remove DEFINE_PROP_END_OF_LIST 1 month ago