提交 db01eedb 编写于 作者: B Bandan Das 提交者: Alex Williamson

vfio: Correction in vfio_rom_read when attempting rom loading

commit e638073c added a flag to track whether
a previous rom read had failed. Accidentally, the code
ended up adding vfio_load_option_rom twice. (Thanks to Alex
for spotting it)
Signed-off-by: NBandan Das <bsd@redhat.com>
Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
上级 839a5547
......@@ -1192,11 +1192,8 @@ static uint64_t vfio_rom_read(void *opaque, hwaddr addr, unsigned size)
uint64_t val = ((uint64_t)1 << (size * 8)) - 1;
/* Load the ROM lazily when the guest tries to read it */
if (unlikely(!vdev->rom)) {
if (unlikely(!vdev->rom && !vdev->rom_read_failed)) {
vfio_pci_load_rom(vdev);
if (unlikely(!vdev->rom && !vdev->rom_read_failed)) {
vfio_pci_load_rom(vdev);
}
}
memcpy(&val, vdev->rom + addr,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册