<div dir="ltr">Hi Cole,<div>    Greate ! Thanks for your help.</div><div>    </div><div class="gmail_extra"><br><div class="gmail_quote">On 17 August 2016 at 21:18, Cole Robinson <span dir="ltr"><<a href="mailto:crobinso@redhat.com" target="_blank">crobinso@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="">On 08/17/2016 07:49 AM, Kevin Zhao wrote:<br>
> Hi Cole,<br>
>      Long time no see~<br>
>      Thanks for giving help me about AArch64 of virtio-pci. You have rich<br>
> experience about this,<br>
> I am green hand and seeking for your help again :-)<br>
><br>
<br>
</span>Hello again, happy to help :)<br>
<span class=""><br>
> On 13 June 2016 at 06:21, Cole Robinson <<a href="mailto:crobinso@redhat.com">crobinso@redhat.com</a><br>
</span><div><div class="h5">> <mailto:<a href="mailto:crobinso@redhat.com">crobinso@redhat.com</a>>> wrote:<br>
><br>
>     On 06/12/2016 10:29 AM, Kevin Zhao wrote:<br>
>     > Hi Cole && All,<br>
>     >      Nice meeting you in the libvirt mail-list. Greetings from Linaro !!!<br>
>     >      I am Kevin Zhao from Linaro and working for OpenStack on Aarch64.<br>
>     > Nowadays I find that the default "virtio" bus is "virtio-mmio" , not<br>
>     > "virtio-pci". Since virtio-mmio do not has the host plugged function ,<br>
>     > something is wrong with the function in OpenStack Nova.<br>
>     ><br>
>     >       Then I search and find some mail information as belows by Cole :-)<br>
>     >       1) <a href="https://www.redhat.com/archives/libvir-list/2015-December/msg00217.html" rel="noreferrer" target="_blank">https://www.redhat.com/<wbr>archives/libvir-list/2015-<wbr>December/msg00217.html</a><br>
>     <<a href="https://www.redhat.com/archives/libvir-list/2015-December/msg00217.html" rel="noreferrer" target="_blank">https://www.redhat.com/<wbr>archives/libvir-list/2015-<wbr>December/msg00217.html</a>><br>
>     >       2) <a href="https://www.redhat.com/archives/libvir-list/2016-March/msg00167.html" rel="noreferrer" target="_blank">https://www.redhat.com/<wbr>archives/libvir-list/2016-<wbr>March/msg00167.html</a><br>
>     <<a href="https://www.redhat.com/archives/libvir-list/2016-March/msg00167.html" rel="noreferrer" target="_blank">https://www.redhat.com/<wbr>archives/libvir-list/2016-<wbr>March/msg00167.html</a>><br>
>     ><br>
>     >        I see some efforts have been doing by you. Really thanks for your<br>
>     > efforts for Aarch64. And I have some small questions.<br>
>     >       1. Is Libvirt planning to replace the default virtio-mmio to virtio-pci<br>
>     > for Aarch64?<br>
><br>
>     We have vague plans to maybe change the virtio-mmio default to virtio-pci at<br>
>     some future point, based on some new enough qemu machine type. But the main<br>
>     blocker is that most linux distributions currently don't work out of the box<br>
>     with virtio-pci, at least Fedora doesn't as far as I know. So changing the<br>
>     default now is pre-mature<br>
><br>
>     >       2. If not , how can I change the xml file(generated by Virsh) for<br>
>     > virtio-pci  so that Qemu can recognize it ?<br>
>     ><br>
><br>
>     The latest libvirt-1.3.5 release accepts device XML containing <address<br>
>     type='pci'/> . The address block is an explicit request to libvirt to<br>
>     'allocate a PCI address' rather than the default virtio-mmio. So for example<br>
>     if you want to specify a virtio nic, but have it use virtio-pci rather than<br>
>     virtio-mmio, you can do something like:<br>
><br>
>         <interface type='network'><br>
>           <source network='default'/><br>
>           <model type='virtio'/><br>
>           <address type='pci'/><br>
>         </interface><br>
><br>
><br>
> I have changed the libvirt to 1.3.5 now, also add the pci to net-device xml like:<br>
>  <address type='pci'/>,then use the virsh to boot the VM,the total xml file is:<br>
>  <a href="https://paste.fedoraproject.org/409534/71434141/" rel="noreferrer" target="_blank">https://paste.fedoraproject.<wbr>org/409534/71434141/</a><br>
><br>
> After booting, the eth0 device disappear(eth0 occur when the address is<br>
> virtio-mmio),<br>
> but I can find another net-device, also it can't work for dhcp:<br>
> 2: enp2s1: <BROADCAST,MULTICAST,UP,LOWER_<wbr>UP> mtu 1500 qdisc pfifo_fast state<br>
> UP group default qlen 1000<br>
>     link/ether 52:54:00:0d:25:26 brd ff:ff:ff:ff:ff:ff<br>
>     inet6 fe80::5054:ff:fe0d:2526/64 scope link<br>
>        valid_lft forever preferred_lft forever<br>
> Running lspci:<br>
> 02:01.0 Ethernet controller: Red Hat, Inc Virtio network device<br>
><br>
> My question is:<br>
> 1. I use Debian 8 AArch64 as the Guest OS, do you think the virtio-pci for<br>
> net-device works is OK ?<br>
><br>
<br>
</div></div>My guess is that the support isn't complete. Last I checked Fedora doesn't<br>
even work with aarch64 virtio-pci + uefi, because it requires some kernel<br>
changes that haven't been fully upstreamed yet. But that was several months<br>
ago... There may be a way to work around it nowadays but I don't personally<br>
know. You may want to test with either RHELSA if you have a copy, or linaro<br>
images.<br></blockquote><div>You are right !  Today I happen to receive a RHEL7.3 for AArch64. I have been </div><div>using this as Guest OS. It has virtio-pci driver. </div><div>In Libvirt 1.3.5, I use the xml : <a href="https://paste.fedoraproject.org/410158/21672147/">https://paste.fedoraproject.org/410158/21672147/</a></div><div>Virtio-pci disk works fine(RHEL73+UEFI). But using virsh attach-device to attach</div><div> a device:</div><div><div><disk type="file" device="disk"></div><div>      <driver name="qemu" type="qcow2"/></div><div>      <source file="/var/lib/libvirt/images/rhel2.qcow2"/></div><div>      <target dev="vdb" bus="virtio"/></div><div>   <address type='pci'/></div><div></disk></div></div><div>After adding, I can't find vdb in the Guest OS. I need to rescan the pci by: </div><div>echo 1 > /sys/bus/pci/rescan<br></div><div>Then vdb appear. Do you have the same problem?</div><div><br></div><div>Another question, when changing to Libvirt 2.1.0, I add the : <address type='pci'/></div><div>to a disk device or net device, it can't work, it seems that user need to assign</div><div>the PCI manually ?  It means that I should assign the slots and bus all by myself?</div><div><br></div><div>Thanks~</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span class=""><br>
> 2. If I change the disk address-type to pci(Libvirt pass the virtio pci<br>
> parameters to Qemu for disk device), but I can't boot<br>
> the VM. Does Qemu not support virtio pci for  disk device in AArch64?<br>
><br>
<br>
</span>That should work fine in my testing with RHELSA, so I don't think it's a<br>
libvirt or qemu limitation. Probably the guest OS + UEFI.<br>
<span class=""><font color="#888888"><br>
- Cole<br>
</font></span><div class=""><div class="h5"><br>
> Big Big Thanks~<br>
><br>
><br>
>     But there isn't currently any switch to say 'always give me virtio-pci instead<br>
>     of virtio-mmio'<br>
><br>
>     - Cole<br>
><br>
><br>
<br>
</div></div></blockquote></div><br></div></div>