Bug 1026550 - QEMU VFIO update ROM loading code
QEMU VFIO update ROM loading code
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
7.0
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Alex Williamson
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-04 18:18 EST by Alex Williamson
Modified: 2014-06-17 23:40 EDT (History)
8 users (show)

See Also:
Fixed In Version: qemu-kvm-1.5.3-17.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-06-13 06:48:03 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Alex Williamson 2013-11-04 18:18:29 EST
Description of problem:
Device ROM loading has been a bit of a nuisance in the past.  Previous versions of vfio will attempt to read the device ROM regardless of whether the romfile= option is provided.  For devices with broken ROMs, this leads to kernel messages about an invalid ROM file regardless of whether it's being used.  vfio also attempted to read the ROM during the QEMU initialization of the device, not being careful whether the device was configured for access.

Upstream changes fix this to not attempt to read the device ROM if romfile= is specified and if it's not, size the ROM based on the ROM BAR size and not attempt to read the actual ROM until the guest does.

In doing this, we can also switch the memory region for the ROM to not consume a memory slots from KVM, adding some scalability.

This bz is opened primarily as an indication to QE to make a special effort to verify there are no regressions in things like PXE boot with this code update.  Please re-validate any portions of the test plan making use of device ROMs with this update.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:
Comment 2 Miroslav Rezanina 2013-11-07 10:56:31 EST
Fix included in qemu-kvm-1.5.3-17.el7
Comment 4 Xu Han 2013-11-19 00:38:33 EST
Reproduce this bug with components:
qemu-kvm-rhev-1.5.3-16.el7.x86_64

Scenario 1, without specify rom file.
Steps:
1. boot guest with vfio assigned device and stop vm.
# /usr/libexec/qemu-kvm -nodefaults -M q35 -m 4G -cpu Opteron_G3 -smp 4,cores=2,threads=2,sockets=1 -boot menu=on -monitor stdio -rtc base=localtime,clock=host,driftfix=slew -qmp tcp:0:5555,server,nowait -vga qxl -drive file=/home/pxe-install.qcow2_v3,format=qcow2,id=guest-img,if=none,werror=stop,rerror=stop -device virtio-blk-pci,scsi=off,drive=guest-img,id=os-disk -spice disable-ticketing,port=5931 -device virtio-balloon,id=balloon -global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0 -monitor unix:/tmp/guest-sock,server,nowait \
-device vfio-pci,host=01:00.0,id=pf0 -S

Results:
After step1,
(qemu) info status
VM status: paused (prelaunch)

Could found such a message below in host dmesg.
[83317.280796] vfio-pci 0000:01:00.0: Invalid ROM contents

Scenario 2, specify rom file.
Steps:
1. boot guest with vfio assigned device and stop vm.
# /usr/libexec/qemu-kvm -nodefaults -M q35 -m 4G -cpu Opteron_G3 -smp 4,cores=2,threads=2,sockets=1 -boot menu=on -monitor stdio -rtc base=localtime,clock=host,driftfix=slew -qmp tcp:0:5555,server,nowait -vga qxl -drive file=/home/pxe-install.qcow2_v3,format=qcow2,id=guest-img,if=none,werror=stop,rerror=stop -device virtio-blk-pci,scsi=off,drive=guest-img,id=os-disk -spice disable-ticketing,port=5931 -device virtio-balloon,id=balloon -global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0 -monitor unix:/tmp/guest-sock,server,nowait \
-device vfio-pci,host=01:00.0,id=pf0,romfile=/home/82576PF.rom -S

Results:
After step1,
(qemu) info status
VM status: paused (prelaunch)

Could found such a message below in host dmesg.
[83608.927952] vfio-pci 0000:01:00.0: Invalid ROM contents


Verify this bug with component:
qemu-kvm-rhev-1.5.3-19.el7.x86_64

Same steps as above.

Scenario 1
Results:
After step1,
(qemu) info status
VM status: paused (prelaunch)

Could not found a kernel messages about invalid ROM file.
Then continue guest. While seabios loaded, would found that message.
[84875.784916] vfio-pci 0000:01:00.0: Invalid ROM contents

Scenario 2
Results:
After step1,
(qemu) info status
VM status: paused (prelaunch)

Could not found a kernel messages about invalid ROM file.
Then continue guest. While seabios loaded, could not found that message as well, and guest boot from that vfio assigned device.


Base on these test results above, can we confirm if this bug has been fixed? Thanks.
Comment 5 juzhang 2013-11-25 03:32:02 EST
Hi Alex,

Would you pleas have a look comment4? Does QE testing can make this issue as verified?

Best Regards,
Junyi
Comment 6 Alex Williamson 2013-12-02 11:33:17 EST
(In reply to juzhang from comment #5)
> Hi Alex,
> 
> Would you pleas have a look comment4? Does QE testing can make this issue as
> verified?

Yes, this looks like the expected results.  In Scenario 1, the ROM was only accessed when seabios attempted to scan it, resulting in the invalid ROM contents message.  In scenario 2, we never touch the device ROM, so we never get the message.  Thanks.
Comment 8 Ludek Smid 2014-06-13 06:48:03 EDT
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.

Note You need to log in before you can comment on or make changes to this bug.