PCI/GPU Passthrough with xen

Jim Fehlig jfehlig at suse.com
Fri Feb 14 21:30:28 UTC 2020


On 2/14/20 3:37 AM, Christoph wrote:
> Hi
> 
> the machine starts now but the config between libvirt (xml) and xen
> seems to be different, because with xen cfg it starts as it should and
> with libvirt conf it hangs at the boot process of win10...
> 
> does someone see a difference what is responsible for the problem?
> 
> Thats the xen config (working):
> 
> name = "marax.chao5.int"
> uuid = "e0de3cb7-3937-417d-8d63-b0993b377b6a"
> maxmem = 32768
> memory = 32768
> kernel = '/usr/lib64/xen/boot/hvmloader'
> vcpus = 16
> rtc_timeoffset = 0
> localtime = 1
> on_poweroff = "destroy"
> on_reboot = "restart"
> on_crash = "restart"
> vif = [
> "mac=00:16:3e:05:01:10,bridge=xenbr5,script=vif-bridge,model=e1000" ]
> parallel = "none"
> serial = "none"
> type = "hvm"
> loader = "/usr/lib64/xen/boot/hvmloader"
> disk = [ "phy:/dev/mapper/marax_c,hda,rw",
> "phy:/dev/vg_lilith/lv_marax_d,hdb,rw" ]
> max_grant_frames = "128"

You increase max_grant_frames in the xen config...

> pci = [ "01:00.0", "01:00.1", "01:00.2", "01:00.3" ]
> pci_permissive  = 1
> keymap = "de"
> vnclisten="0.0.0.0"
> pci_power_mgmt=1
> xen_platform_pci=1
> pci_msitranslate=1
> viridian=1
> hpet=1
> acpi=1
> apic=1
> pae=1
> 
> thats the libvirt config (starting but win10 'hangs'):
> 
> <domain type='xen'>
>    <name>marax.chao5.int</name>
>    <uuid>e0de3cb7-3937-417d-8d63-b0993b377b6a</uuid>
>    <memory unit='KiB'>33554432</memory>
>    <currentMemory unit='KiB'>33554432</currentMemory>
>    <vcpu placement='static'>16</vcpu>
>    <os>
>      <type arch='x86_64' machine='xenfv'>hvm</type>
>      <loader type='rom'>/usr/lib64/xen/boot/hvmloader</loader>
>      <boot dev='hd'/>
>    </os>
>    <features>
>      <acpi/>
>      <apic/>
>      <pae/>
>      <viridian/>
>    </features>
>    <clock offset='variable' adjustment='0' basis='localtime'>
>      <timer name='hpet' present='yes'/>
>    </clock>
>    <on_poweroff>destroy</on_poweroff>
>    <on_reboot>restart</on_reboot>
>    <on_crash>restart</on_crash>
>    <devices>
>      <disk type='block' device='disk'>
>        <driver name='phy' type='raw'/>
>        <source dev='/dev/mapper/marax_c'/>
>        <target dev='hda' bus='ide'/>
>        <address type='drive' controller='0' bus='0' target='0' unit='0'/>
>      </disk>
>      <disk type='block' device='disk'>
>        <driver name='phy' type='raw'/>
>        <source dev='/dev/vg_lilith/lv_marax_d'/>
>        <target dev='hdb' bus='ide'/>
>        <address type='drive' controller='0' bus='0' target='0' unit='1'/>
>      </disk>
>      <controller type='xenbus' index='0'/>

but not in the libvirt config. It is an attribute of the xenbus controller and 
can be defined like this

<controller type='xenbus' maxGrantFrames='128'/>

For more info search for 'maxGrantFrames' in the libvirt domXML documentation

https://libvirt.org/formatdomain.html

Regards,
Jim

>      <controller type='ide' index='0'/>
>      <interface type='bridge'>
>        <mac address='00:16:3e:05:01:10'/>
>        <source bridge='xenbr5'/>
>        <script path='vif-bridge'/>
>        <model type='e1000'/>
>      </interface>
>      <input type='mouse' bus='ps2'/>
>      <input type='keyboard' bus='ps2'/>
>      <graphics type='vnc' port='6000' autoport='no' listen='0.0.0.0'
> keymap='de'>
>        <listen type='address' address='0.0.0.0'/>
>      </graphics>
>      <hostdev mode='subsystem' type='pci' managed='yes'>
>        <driver name='xen'/>
>        <source>
>          <address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
>        </source>
>      </hostdev>
>      <hostdev mode='subsystem' type='pci' managed='yes'>
>        <driver name='xen'/>
>        <source>
>          <address domain='0x0000' bus='0x01' slot='0x00' function='0x1'/>
>        </source>
>      </hostdev>
>      <hostdev mode='subsystem' type='pci' managed='yes'>
>        <driver name='xen'/>
>        <source>
>          <address domain='0x0000' bus='0x01' slot='0x00' function='0x2'/>
>        </source>
>      </hostdev>
>      <hostdev mode='subsystem' type='pci' managed='yes'>
>        <driver name='xen'/>
>        <source>
>          <address domain='0x0000' bus='0x01' slot='0x00' function='0x3'/>
>        </source>
>      </hostdev>
>      <memballoon model='xen'/>
>    </devices>
> </domain>
> 
> ---
> ------
> Greetz
> 
> 





More information about the libvirt-users mailing list