Dear KVM Developers, i have a strange problem with segfaults in a guest system while compiling a linux kernel. The basic setup (details below) is a ryzen cpu on a ab350 mainboard, the host running ubuntu linux and guests running also debian based linux. Now i am compiling a vanilla linux kernel in the guest. This will fail with random segfaults as soon as i enable a WLAN (USB RTL8187L) connection in the host system. Apart from this everything is working fine. As this WLAN is my default internet connection i did try different virtualization setups for almost a week until I could track down the problem. The details: CPU: Ryzen 7 2700X same result using a Ryzen 5 1600 Mainboard: GA-AB350M-Gaming 3 Bios: i tested with three versions: F31, F41d, F50a host system: i tested with the following systems as host all x86_64 ubuntu 19.10 kernel 5.3.0-26-generic ubuntu 19.10 kernel 5.3.0-29-generic ubuntu 20(development) kernel 5.4.0-14-generic kvm: 4.0 (ubutu 19.10) and 4.2.0 (ubuntu 19.10 installed from sources) 4.2.0 (ubuntu 20 dev) guest: ubuntu 18.10 kernel 4.18.0-10-generic debian 10 kernel 5.4.0-3-amd64 I use libvirt to launch the guests, so two example XML files are attached, also the hypervisor info. I tried a lot of different settings for cpu type and and cpu pinning without much difference. task: Compile linux kernel on guest using debian linuc sources 5.4.8 or vanilla 5.5.2 This works fine as long as I do not enable my WLAN internet connection on the host (USB stick: NetGear, Inc. WG111v2 54 Mbps Wireless [RealTek RTL8187L]) If I enable the WLAN (in the host) the guest starts producing random compiler errors like these; ./include/linux/mm.h:2041:1: internal compiler error: Segmentation fault static inline spinlock_t *pud_lockptr(struct mm_struct *mm, pud_t *pud) ^~~~~~ ./include/linux/quota.h:338:1: internal compiler error: in tree_to_uhwi, at tree.h:4278 }; ^ ./arch/x86/include/asm/pgtable.h:163:1: internal compiler error: Segmentation fault { ^ elf.c:685:1: internal compiler error: Segmentation fault } ^ As soon as I disable the USB WLAN connection on the host (the USB stick still inserted) I can compile the kernels without any problem. No valuable messages in the log files of the host and the guest system. So I tested removing all Network Interfaces from the guest systems, but this had no effect. Even without any networking a guest fails compiling as soon as I start the WLAN on the host system. I checked for electrical interference by - using a long USB cable to get the WLAN stick away from the PC -> compilation fails - using a laptop operating the USB WLAN stick right beside the PC -> compilation works fine I intensely tested the hosts RAM with memtest86+ stressed the host system with compile jobs, even did memtests on the guests. But everythings seems rock solid. Does anyone have a clue, whats going on here, or how i can debug this situation ? Thanks, Torsten
<domain type='kvm' id='7'> <name>ubuntu18.10</name> <uuid>6b2dc20e-350d-45da-bc52-a125ef9abc53</uuid> <metadata> <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0"> <libosinfo:os id="http://ubuntu.com/ubuntu/18.10"/> </libosinfo:libosinfo> </metadata> <memory unit='KiB'>4194304</memory> <currentMemory unit='KiB'>4194304</currentMemory> <vcpu placement='static'>3</vcpu> <resource> <partition>/machine</partition> </resource> <os> <type arch='x86_64' machine='pc-q35-4.2'>hvm</type> <boot dev='hd'/> <bootmenu enable='yes'/> </os> <features> <acpi/> <apic/> <vmport state='off'/> </features> <cpu mode='custom' match='exact' check='full'> <model fallback='forbid'>EPYC-IBPB</model> <vendor>AMD</vendor> <feature policy='require' name='x2apic'/> <feature policy='require' name='tsc-deadline'/> <feature policy='require' name='hypervisor'/> <feature policy='require' name='tsc_adjust'/> <feature policy='require' name='arch-capabilities'/> <feature policy='require' name='cmp_legacy'/> <feature policy='require' name='perfctr_core'/> <feature policy='require' name='clzero'/> <feature policy='require' name='virt-ssbd'/> <feature policy='require' name='rdctl-no'/> <feature policy='require' name='skip-l1dfl-vmentry'/> <feature policy='require' name='mds-no'/> <feature policy='disable' name='monitor'/> <feature policy='require' name='topoext'/> </cpu> <clock offset='utc'> <timer name='rtc' tickpolicy='catchup'/> <timer name='pit' tickpolicy='delay'/> <timer name='hpet' present='no'/> </clock> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>destroy</on_crash> <pm> <suspend-to-mem enabled='no'/> <suspend-to-disk enabled='no'/> </pm> <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <disk type='file' device='disk'> <driver name='qemu' type='qcow2' cache='writethrough' io='threads' discard='unmap' detect_zeroes='unmap'/> <source file='/data/qemu-vms/quadvtl04.qcow2' index='2'/> <backingStore/> <target dev='vda' bus='virtio'/> <alias name='virtio-disk0'/> <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/> </disk> <disk type='file' device='cdrom'> <driver name='qemu'/> <target dev='sda' bus='sata'/> <readonly/> <alias name='sata0-0-0'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> <controller type='usb' index='0' model='ich9-ehci1'> <alias name='usb'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x7'/> </controller> <controller type='usb' index='0' model='ich9-uhci1'> <alias name='usb'/> <master startport='0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x0' multifunction='on'/> </controller> <controller type='usb' index='0' model='ich9-uhci2'> <alias name='usb'/> <master startport='2'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x1'/> </controller> <controller type='usb' index='0' model='ich9-uhci3'> <alias name='usb'/> <master startport='4'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x2'/> </controller> <controller type='sata' index='0'> <alias name='ide'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> </controller> <controller type='pci' index='0' model='pcie-root'> <alias name='pcie.0'/> </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x10'/> <alias name='pci.1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0' multifunction='on'/> </controller> <controller type='pci' index='2' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='2' port='0x11'/> <alias name='pci.2'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x1'/> </controller> <controller type='pci' index='3' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='3' port='0x12'/> <alias name='pci.3'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x2'/> </controller> <controller type='pci' index='4' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='4' port='0x13'/> <alias name='pci.4'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x3'/> </controller> <controller type='pci' index='5' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='5' port='0x14'/> <alias name='pci.5'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x4'/> </controller> <controller type='pci' index='6' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='6' port='0x15'/> <alias name='pci.6'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x5'/> </controller> <controller type='pci' index='7' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='7' port='0x16'/> <alias name='pci.7'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x6'/> </controller> <controller type='virtio-serial' index='0'> <alias name='virtio-serial0'/> <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/> </controller> <interface type='network'> <mac address='52:54:00:97:b1:7e'/> <source network='network' portid='d1a1a895-177e-45a1-8a1c-734d0302223b' bridge='virbr1'/> <target dev='vnet0'/> <model type='virtio'/> <link state='up'/> <alias name='net0'/> <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/> </interface> <serial type='pty'> <source path='/dev/pts/1'/> <target type='isa-serial' port='0'> <model name='isa-serial'/> </target> <alias name='serial0'/> </serial> <console type='pty' tty='/dev/pts/1'> <source path='/dev/pts/1'/> <target type='serial' port='0'/> <alias name='serial0'/> </console> <channel type='unix'> <source mode='bind' path='/var/lib/libvirt/qemu/channel/target/domain-7-ubuntu18.10/org.qemu.guest_agent.0'/> <target type='virtio' name='org.qemu.guest_agent.0' state='disconnected'/> <alias name='channel0'/> <address type='virtio-serial' controller='0' bus='0' port='1'/> </channel> <channel type='spicevmc'> <target type='virtio' name='com.redhat.spice.0' state='disconnected'/> <alias name='channel1'/> <address type='virtio-serial' controller='0' bus='0' port='2'/> </channel> <input type='tablet' bus='usb'> <alias name='input0'/> <address type='usb' bus='0' port='1'/> </input> <input type='mouse' bus='ps2'> <alias name='input1'/> </input> <input type='keyboard' bus='ps2'> <alias name='input2'/> </input> <graphics type='spice' port='5901' autoport='yes' listen='127.0.0.1'> <listen type='address' address='127.0.0.1'/> <image compression='off'/> </graphics> <sound model='ich9'> <alias name='sound0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x1b' function='0x0'/> </sound> <video> <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/> <alias name='video0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> </video> <redirdev bus='usb' type='spicevmc'> <alias name='redir0'/> <address type='usb' bus='0' port='2'/> </redirdev> <redirdev bus='usb' type='spicevmc'> <alias name='redir1'/> <address type='usb' bus='0' port='3'/> </redirdev> <memballoon model='virtio'> <alias name='balloon0'/> <address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/> </memballoon> <rng model='virtio'> <backend model='random'>/dev/urandom</backend> <alias name='rng0'/> <address type='pci' domain='0x0000' bus='0x06' slot='0x00' function='0x0'/> </rng> </devices> <seclabel type='dynamic' model='apparmor' relabel='yes'> <label>libvirt-6b2dc20e-350d-45da-bc52-a125ef9abc53</label> <imagelabel>libvirt-6b2dc20e-350d-45da-bc52-a125ef9abc53</imagelabel> </seclabel> <seclabel type='dynamic' model='dac' relabel='yes'> <label>+64055:+108</label> <imagelabel>+64055:+108</imagelabel> </seclabel> </domain>
<domain type='kvm' id='6'> <name>quadvtl03</name> <uuid>52ed6b72-6a4c-446c-a151-251411180cc8</uuid> <metadata> <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0"> <libosinfo:os id="http://debian.org/debian/10"/> </libosinfo:libosinfo> </metadata> <memory unit='KiB'>8216576</memory> <currentMemory unit='KiB'>8216576</currentMemory> <vcpu placement='static'>4</vcpu> <resource> <partition>/machine</partition> </resource> <os> <type arch='x86_64' machine='pc-q35-4.2'>hvm</type> <bootmenu enable='no'/> </os> <features> <acpi/> <apic/> <vmport state='off'/> </features> <cpu mode='custom' match='exact' check='full'> <model fallback='forbid'>EPYC-IBPB</model> <vendor>AMD</vendor> <feature policy='require' name='x2apic'/> <feature policy='require' name='tsc-deadline'/> <feature policy='require' name='hypervisor'/> <feature policy='require' name='tsc_adjust'/> <feature policy='require' name='arch-capabilities'/> <feature policy='require' name='cmp_legacy'/> <feature policy='require' name='perfctr_core'/> <feature policy='require' name='clzero'/> <feature policy='require' name='virt-ssbd'/> <feature policy='require' name='rdctl-no'/> <feature policy='require' name='skip-l1dfl-vmentry'/> <feature policy='require' name='mds-no'/> <feature policy='disable' name='monitor'/> <feature policy='require' name='topoext'/> </cpu> <clock offset='utc'> <timer name='rtc' tickpolicy='catchup'/> <timer name='pit' tickpolicy='delay'/> <timer name='hpet' present='no'/> </clock> <on_poweroff>destroy</on_poweroff> <on_reboot>restart</on_reboot> <on_crash>destroy</on_crash> <pm> <suspend-to-mem enabled='no'/> <suspend-to-disk enabled='no'/> </pm> <devices> <emulator>/usr/bin/qemu-system-x86_64</emulator> <disk type='file' device='disk'> <driver name='qemu' type='qcow2'/> <source file='/data/qemu-vms/quadvtl03-temp.qcow2' index='2'/> <backingStore/> <target dev='vda' bus='virtio'/> <alias name='virtio-disk0'/> <address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/> </disk> <disk type='file' device='disk'> <driver name='qemu' type='qcow2'/> <source file='/data/qemu-vms/quadvtl03.qcow2' index='1'/> <backingStore/> <target dev='sda' bus='scsi'/> <boot order='1'/> <alias name='scsi0-0-0'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> <controller type='sata' index='0'> <alias name='ide'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/> </controller> <controller type='pci' index='0' model='pcie-root'> <alias name='pcie.0'/> </controller> <controller type='pci' index='1' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='1' port='0x10'/> <alias name='pci.1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0' multifunction='on'/> </controller> <controller type='pci' index='2' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='2' port='0x11'/> <alias name='pci.2'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x1'/> </controller> <controller type='pci' index='3' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='3' port='0x12'/> <alias name='pci.3'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x2'/> </controller> <controller type='pci' index='4' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='4' port='0x13'/> <alias name='pci.4'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x3'/> </controller> <controller type='pci' index='5' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='5' port='0x14'/> <alias name='pci.5'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x4'/> </controller> <controller type='pci' index='6' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='6' port='0x15'/> <alias name='pci.6'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x5'/> </controller> <controller type='pci' index='7' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='7' port='0x16'/> <alias name='pci.7'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x6'/> </controller> <controller type='pci' index='8' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='8' port='0x17'/> <alias name='pci.8'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x7'/> </controller> <controller type='pci' index='9' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='9' port='0x18'/> <alias name='pci.9'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0' multifunction='on'/> </controller> <controller type='pci' index='10' model='pcie-root-port'> <model name='pcie-root-port'/> <target chassis='10' port='0x19'/> <alias name='pci.10'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x1'/> </controller> <controller type='pci' index='11' model='pcie-to-pci-bridge'> <model name='pcie-pci-bridge'/> <alias name='pci.11'/> <address type='pci' domain='0x0000' bus='0x09' slot='0x00' function='0x0'/> </controller> <controller type='virtio-serial' index='0'> <alias name='virtio-serial0'/> <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/> </controller> <controller type='scsi' index='0' model='lsilogic'> <alias name='scsi0'/> <address type='pci' domain='0x0000' bus='0x0b' slot='0x01' function='0x0'/> </controller> <controller type='usb' index='0' model='ich9-ehci1'> <alias name='usb'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x7'/> </controller> <controller type='usb' index='0' model='ich9-uhci1'> <alias name='usb'/> <master startport='0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x0' multifunction='on'/> </controller> <controller type='usb' index='0' model='ich9-uhci2'> <alias name='usb'/> <master startport='2'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x1'/> </controller> <controller type='usb' index='0' model='ich9-uhci3'> <alias name='usb'/> <master startport='4'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x1d' function='0x2'/> </controller> <channel type='unix'> <source mode='bind' path='/var/lib/libvirt/qemu/channel/target/domain-6-quadvtl03/org.qemu.guest_agent.0'/> <target type='virtio' name='org.qemu.guest_agent.0' state='disconnected'/> <alias name='channel0'/> <address type='virtio-serial' controller='0' bus='0' port='1'/> </channel> <channel type='spicevmc'> <target type='virtio' name='com.redhat.spice.0' state='disconnected'/> <alias name='channel1'/> <address type='virtio-serial' controller='0' bus='0' port='2'/> </channel> <input type='tablet' bus='usb'> <alias name='input0'/> <address type='usb' bus='0' port='1'/> </input> <input type='mouse' bus='ps2'> <alias name='input1'/> </input> <input type='keyboard' bus='ps2'> <alias name='input2'/> </input> <graphics type='spice' port='5900' autoport='yes' listen='127.0.0.1'> <listen type='address' address='127.0.0.1'/> <image compression='off'/> </graphics> <video> <model type='vga' vram='16384' heads='1' primary='yes'/> <alias name='video0'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/> </video> <memballoon model='virtio'> <alias name='balloon0'/> <address type='pci' domain='0x0000' bus='0x07' slot='0x00' function='0x0'/> </memballoon> <rng model='virtio'> <backend model='random'>/dev/urandom</backend> <alias name='rng0'/> <address type='pci' domain='0x0000' bus='0x08' slot='0x00' function='0x0'/> </rng> </devices> <seclabel type='dynamic' model='apparmor' relabel='yes'> <label>libvirt-52ed6b72-6a4c-446c-a151-251411180cc8</label> <imagelabel>libvirt-52ed6b72-6a4c-446c-a151-251411180cc8</imagelabel> </seclabel> <seclabel type='dynamic' model='dac' relabel='yes'> <label>+64055:+108</label> <imagelabel>+64055:+108</imagelabel> </seclabel> </domain>
<sysinfo type='smbios'> <bios> <entry name='vendor'>American Megatrends Inc.</entry> <entry name='version'>F50a</entry> <entry name='date'>11/27/2019</entry> <entry name='release'>5.14</entry> </bios> <system> <entry name='manufacturer'>Gigabyte Technology Co., Ltd.</entry> <entry name='product'>AB350M-Gaming 3</entry> <entry name='version'>Default string</entry> <entry name='serial'>Default string</entry> <entry name='uuid'>031b021c-040d-05e1-1e06-a00700080009</entry> <entry name='sku'>Default string</entry> <entry name='family'>Default string</entry> </system> <baseBoard> <entry name='manufacturer'>Gigabyte Technology Co., Ltd.</entry> <entry name='product'>AB350M-Gaming 3-CF</entry> <entry name='version'>x.x</entry> <entry name='serial'>Default string</entry> <entry name='asset'>Default string</entry> <entry name='location'>Default string</entry> </baseBoard> <chassis> <entry name='manufacturer'>Default string</entry> <entry name='version'>Default string</entry> <entry name='serial'>Default string</entry> <entry name='asset'>Default string</entry> <entry name='sku'>Default string</entry> </chassis> <processor> <entry name='socket_destination'>AM4</entry> <entry name='type'>Central Processor</entry> <entry name='family'>Zen</entry> <entry name='manufacturer'>Advanced Micro Devices, Inc.</entry> <entry name='signature'>Family 23, Model 8, Stepping 2</entry> <entry name='version'>AMD Ryzen 7 2700X Eight-Core Processor</entry> <entry name='external_clock'>100 MHz</entry> <entry name='max_speed'>4350 MHz</entry> <entry name='status'>Populated, Enabled</entry> <entry name='serial_number'>Unknown</entry> <entry name='part_number'>Unknown</entry> </processor> <memory_device> <entry name='size'>16384 MB</entry> <entry name='form_factor'>DIMM</entry> <entry name='locator'>DIMM 0</entry> <entry name='bank_locator'>P0 CHANNEL A</entry> <entry name='type'>DDR4</entry> <entry name='type_detail'>Synchronous Unbuffered (Unregistered)</entry> <entry name='speed'>2400 MT/s</entry> <entry name='manufacturer'>Unknown</entry> <entry name='serial_number'>00000000</entry> <entry name='part_number'>CMK32GX4M2A2666C16</entry> </memory_device> <memory_device> <entry name='size'>8192 MB</entry> <entry name='form_factor'>DIMM</entry> <entry name='locator'>DIMM 1</entry> <entry name='bank_locator'>P0 CHANNEL A</entry> <entry name='type'>DDR4</entry> <entry name='type_detail'>Synchronous Unbuffered (Unregistered)</entry> <entry name='speed'>2400 MT/s</entry> <entry name='manufacturer'>A-DATA Technology</entry> <entry name='serial_number'>8F750000</entry> <entry name='part_number'>DDR4 2666 2OZ</entry> </memory_device> <memory_device> <entry name='size'>16384 MB</entry> <entry name='form_factor'>DIMM</entry> <entry name='locator'>DIMM 0</entry> <entry name='bank_locator'>P0 CHANNEL B</entry> <entry name='type'>DDR4</entry> <entry name='type_detail'>Synchronous Unbuffered (Unregistered)</entry> <entry name='speed'>2400 MT/s</entry> <entry name='manufacturer'>Unknown</entry> <entry name='serial_number'>00000000</entry> <entry name='part_number'>CMK32GX4M2A2666C16</entry> </memory_device> <memory_device> <entry name='size'>8192 MB</entry> <entry name='form_factor'>DIMM</entry> <entry name='locator'>DIMM 1</entry> <entry name='bank_locator'>P0 CHANNEL B</entry> <entry name='type'>DDR4</entry> <entry name='type_detail'>Synchronous Unbuffered (Unregistered)</entry> <entry name='speed'>2400 MT/s</entry> <entry name='manufacturer'>A-DATA Technology</entry> <entry name='serial_number'>8E750000</entry> <entry name='part_number'>DDR4 2666 2OZ</entry> </memory_device> </sysinfo>