Bug 1530210

Summary: [VIOSTOR] virtio-block driver for Windows doesn't support iommu_platform=on device command line option
Product: Red Hat Enterprise Linux 7 Reporter: jingzhao <jinzhao>
Component: virtio-winAssignee: Yvugenfi <yvugenfi>
virtio-win sub component: virtio-win-prewhql QA Contact: lijin <lijin>
Status: CLOSED ERRATA Docs Contact:
Severity: high    
Priority: high CC: chayang, jasowang, jinzhao, juzhang, lijin, maxime.coquelin, michen, mst, mtessun, pezhang, phou, pingl, vrozenfe, yvugenfi
Version: 7.5Keywords: FutureFeature
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
NO_DOCS
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-30 16:21:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1549577, 1558351    
Attachments:
Description Flags
install pic none

Description jingzhao 2018-01-02 09:30:07 UTC
Created attachment 1375556 [details]
install pic

Description of problem:
virtio-win doesn't contain driver of iommu

Version-Release number of selected component (if applicable):
kernel-3.10.0-824.el7.x86_64
qemu-kvm-rhev-2.10.0-13.el7.x86_64
seabios-bin-1.11.0-1.el7.noarch
virtio-win-prewhql-0.1-145.iso

How reproducible:
3/3

Steps to Reproduce:
1. Install win2016 guest through qemu command line [1]


Actual results:
No drivers found

Expected results:
Install guest successfully

Additional info:
Hit the issue with virtio-win-1.9.3-1.el7.iso

[1]
/usr/libexec/qemu-kvm \
-M q35,accel=kvm,kernel-irqchip=split \
-device intel-iommu,intremap=on,caching-mode=on,eim=on,device-iotlb=on \
-cpu Haswell-noTSX \
-nodefaults -rtc base=utc \
-m 4G \
-smp 4,sockets=4,cores=1,threads=1 \
-enable-kvm \
-uuid 990ea161-6b67-47b2-b803-19fb01d30d12 \
-k en-us \
-nodefaults \
-serial unix:/tmp/serial0,server,nowait \
-debugcon file:/home/sriov/ovmf.log \
-global isa-debugcon.iobase=0x402 \
-boot menu=on \
-qmp tcp:0:6667,server,nowait \
-usb \
-device usb-tablet \
-vga qxl \
-global driver=cfi.pflash01,property=secure,value=on \
-device pcie-root-port,bus=pcie.0,id=root0,multifunction=on,chassis=1,addr=0xa.0 \
-drive file=/home/sriov/win2016-new.qcow2,if=none,id=drive-virtio-disk0,format=qcow2,cache=none,werror=stop,rerror=stop \
-device virtio-blk-pci,drive=drive-virtio-disk0,id=virtio-disk0,bus=root0,iommu_platform=on,ats=on \
-device pcie-root-port,bus=pcie.0,id=root1,chassis=11,addr=0xa.1 \
-device pcie-root-port,bus=pcie.0,id=root5,slot=5 \
-device x3130-upstream,bus=root5,id=upstream \
-device xio3130-downstream,bus=upstream,id=downstream0,chassis=2 \
-device x3130-upstream,bus=downstream0,id=upstream1 \
-device xio3130-downstream,bus=upstream,id=downstream1,chassis=3 \
-device pcie-root-port,bus=pcie.0,id=root6,chassis=15,addr=0xa.5 \
-device ahci,id=ahci1 \
-drive file=/home/sriov/virtio-win-prewhql-0.1-145.iso,if=none,id=drive-virtio-disk3,format=raw \
-device ide-cd,unit=0,drive=drive-virtio-disk3,id=virtio-disk3,bus=ahci1.0 \
-cdrom en_windows_server_2016_x64_dvd_9718492.iso \
-monitor stdio \
-vnc :1 \

Comment 3 CongLi 2018-01-31 06:52:51 UTC
*** Bug 1539256 has been marked as a duplicate of this bug. ***

Comment 4 Yvugenfi@redhat.com 2018-02-14 16:01:10 UTC
Are you sure the problem is with iommu driver? It looks from the screenshot that Windows is looking for the storage driver. Did you try to install the virtio-block driver from CD?

Comment 5 Yvugenfi@redhat.com 2018-02-21 14:18:12 UTC
The failure is due to iommu_platform=on command line flag that enables the usage of VIRTIO_F_IOMMU_PLATFORM virtio device flag. virtio-win drivers don't acknowledge VIRTIO_F_IOMMU_PLATFORM.

Comment 6 Maxime Coquelin 2018-02-21 14:43:40 UTC
(In reply to Yan Vugenfirer from comment #5)
> The failure is due to iommu_platform=on command line flag that enables the
> usage of VIRTIO_F_IOMMU_PLATFORM virtio device flag. virtio-win drivers
> don't acknowledge VIRTIO_F_IOMMU_PLATFORM.

I think it fails because of below check in virtio_validate_features:

static int virtio_validate_features(VirtIODevice *vdev)
{
    VirtioDeviceClass *k = VIRTIO_DEVICE_GET_CLASS(vdev);

    if (virtio_host_has_feature(vdev, VIRTIO_F_IOMMU_PLATFORM) &&
        !virtio_vdev_has_feature(vdev, VIRTIO_F_IOMMU_PLATFORM)) {
        return -EFAULT;
    }

    if (k->validate_features) {
        return k->validate_features(vdev);
    } else {
        return 0;
    }
}

This check was added by Jason:

commit 8607f5c3072caeebbe0217df28651fffd3a79fd9
Author: Jason Wang <jasowang>
Date:   Fri Dec 30 18:09:10 2016 +0800

    virtio: convert to use DMA api
    
    Currently, all virtio devices bypass IOMMU completely. This is because
    address_space_memory is assumed and used during DMA emulation. This
    patch converts the virtio core API to use DMA API. This idea is
    
    - introducing a new transport specific helper to query the dma address
      space. (only pci version is implemented).
    - query and use this address space during virtio device guest memory
      accessing when iommu platform (VIRTIO_F_IOMMU_PLATFORM) was enabled
      for this device.
    
    Cc: Michael S. Tsirkin <mst>
    Cc: Stefan Hajnoczi <stefanha>
    Cc: Kevin Wolf <kwolf>
    Cc: Amit Shah <amit.shah>
    Cc: Paolo Bonzini <pbonzini>
    Cc: qemu-block
    Signed-off-by: Jason Wang <jasowang>
    Reviewed-by: Michael S. Tsirkin <mst>
    Signed-off-by: Michael S. Tsirkin <mst>


Adding Michael & Jason in cc:

Regards,
Maxime

Comment 8 Peixiu Hou 2018-04-17 10:01:15 UTC
Hi Yan,

Similar confuse with the bug 1539256(for vioscsi), I tested this issue(for viostor) with virtio-win-prewhql-150 on win2012-r2 and win2016.

on win2016, cannot reproduce this issue.
on win2012-r2, can reproduce this issue.

Could please help to confirm if the virtio-win for iommu feature only supported on win2016 and win10~ 


Thanks a lot~

Comment 9 Yvugenfi@redhat.com 2018-04-17 10:58:10 UTC
(In reply to Peixiu Hou from comment #8)
> Hi Yan,
> 
> Similar confuse with the bug 1539256(for vioscsi), I tested this issue(for
> viostor) with virtio-win-prewhql-150 on win2012-r2 and win2016.
> 
> on win2016, cannot reproduce this issue.
> on win2012-r2, can reproduce this issue.
> 
> Could please help to confirm if the virtio-win for iommu feature only
> supported on win2016 and win10~ 
> 
> 
> Thanks a lot~


Hi,

Yes - it is supported only for Windows 10, Windows 2016 and up.

Best regards.

Comment 10 Peixiu Hou 2018-04-18 08:23:34 UTC
Thanks for confirm~
Thus this issue is fixed on virtio-win-prewhql-150, change this bug to verified, thanks a lot~

Comment 13 errata-xmlrpc 2018-10-30 16:21:49 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:3413