vfio: Correction in vfio_rom_read when attempting rom loading
commit e638073c56
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: Bandan Das <bsd@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
This commit is contained in:
parent
839a554757
commit
db01eedb6d
@ -1192,12 +1192,9 @@ static uint64_t vfio_rom_read(void *opaque, hwaddr addr, unsigned size)
|
|||||||
uint64_t val = ((uint64_t)1 << (size * 8)) - 1;
|
uint64_t val = ((uint64_t)1 << (size * 8)) - 1;
|
||||||
|
|
||||||
/* Load the ROM lazily when the guest tries to read it */
|
/* Load the ROM lazily when the guest tries to read it */
|
||||||
if (unlikely(!vdev->rom)) {
|
|
||||||
vfio_pci_load_rom(vdev);
|
|
||||||
if (unlikely(!vdev->rom && !vdev->rom_read_failed)) {
|
if (unlikely(!vdev->rom && !vdev->rom_read_failed)) {
|
||||||
vfio_pci_load_rom(vdev);
|
vfio_pci_load_rom(vdev);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
memcpy(&val, vdev->rom + addr,
|
memcpy(&val, vdev->rom + addr,
|
||||||
(addr < vdev->rom_size) ? MIN(size, vdev->rom_size - addr) : 0);
|
(addr < vdev->rom_size) ? MIN(size, vdev->rom_size - addr) : 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user