[Bug 203327] New: qemu kvm acceleration broken on 5.0.6 and 5.0.7

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



https://bugzilla.kernel.org/show_bug.cgi?id=203327

            Bug ID: 203327
           Summary: qemu kvm acceleration broken on 5.0.6 and 5.0.7
           Product: Virtualization
           Version: unspecified
    Kernel Version: 5.0.6  5.0.7
          Hardware: x86-64
                OS: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: kvm
          Assignee: virtualization_kvm@xxxxxxxxxxxxxxxxxxxx
          Reporter: balducci@xxxxxxxx
        Regression: No

hello

running on AMD Athlon(tm) X4 860K Quad Core Processor
(complete specs enclosed below)

5.0.6 and 5.0.7 break kvm acceleration for qemu on my machines: an old
windows XP guest, which has worked for 4 years without problems,
suddenly doesn't boot any more.

I'm running qemu like this:

    /usr/bin/qemu -m 2G /opt/windog  \
              -accel kvm,thread=multi \
              -netdev user,id=net0,smb=/home/balducci \
              -device rtl8139,netdev=net0


Facts

```
=>  If I run without kvm acceleration: no problems
    (but then the guest is so slow to be utterly unusable)
=>  problem happens with 5.0.6 and 5.0.7: previous kernels are fine:
            GOOD      BAD
            4.20.14   5.0.6
            5.0.2     5.0.7
            5.0.3     
            5.0.4
            5.0.5
=>  #> zcat /proc/config.gz|egrep KVM
    CONFIG_HAVE_KVM=y
    CONFIG_HAVE_KVM_IRQCHIP=y
    CONFIG_HAVE_KVM_IRQFD=y
    CONFIG_HAVE_KVM_IRQ_ROUTING=y
    CONFIG_HAVE_KVM_EVENTFD=y
    CONFIG_KVM_MMIO=y
    CONFIG_KVM_ASYNC_PF=y
    CONFIG_HAVE_KVM_MSI=y
    CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT=y
    CONFIG_KVM_VFIO=y
    CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT=y
    CONFIG_KVM_COMPAT=y
    CONFIG_HAVE_KVM_IRQ_BYPASS=y
    CONFIG_KVM=y
    # CONFIG_KVM_INTEL is not set
    CONFIG_KVM_AMD=y

    (I can send the whole .config file, if needed)

=>  #> dmesg|egrep -i kvm
    [    0.297108] kvm: Nested Virtualization enabled
    [    0.297149] kvm: Nested Paging enabled

=>  #> strace -o strace.out /usr/bin/qemu -m 2G /opt/windog  \
              -accel kvm,thread=multi \
              -netdev user,id=net0,smb=/home/balducci \
              -device rtl8139,netdev=net0
    #> egrep -i kvm strace.out|uniq
    execve("/usr/bin/qemu", ["/usr/bin/qemu", "-m", "2G", "/opt/windog",
"-accel", "kvm,thread=multi", "-netdev", "user,id=net0,smb=/home/balducci",
"-device", "rtl8139,netdev=net0"], 0x7ffe38ab37d8 /* 112 vars */) = 0
    openat(AT_FDCWD, "/dev/kvm", O_RDWR|O_CLOEXEC) = 16
    ioctl(16, KVM_GET_API_VERSION, 0)       = 12
    ioctl(16, KVM_CHECK_EXTENSION, KVM_CAP_IMMEDIATE_EXIT) = 1
    ioctl(16, KVM_CHECK_EXTENSION, KVM_CAP_NR_MEMSLOTS) = 509
    ioctl(16, KVM_CREATE_VM, 0)             = 18
    ioctl(18, KVM_CHECK_EXTENSION, KVM_CAP_NR_VCPUS) = 240
    ioctl(16, KVM_CHECK_EXTENSION, KVM_CAP_MAX_VCPUS) = 288
    ioctl(16, KVM_CHECK_EXTENSION, KVM_CAP_USER_MEMORY) = 1
    ioctl(16, KVM_CHECK_EXTENSION, KVM_CAP_DESTROY_MEMORY_REGION_WORKS) = 1
    ioctl(16, KVM_CHECK_EXTENSION, KVM_CAP_JOIN_MEMORY_REGIONS_WORKS) = 1
    ioctl(16, KVM_CHECK_EXTENSION, KVM_CAP_SET_TSS_ADDR) = 1
    ioctl(16, KVM_CHECK_EXTENSION, KVM_CAP_EXT_CPUID) = 1
    ioctl(16, KVM_CHECK_EXTENSION, KVM_CAP_MP_STATE) = 1
    ioctl(16, KVM_CHECK_EXTENSION, KVM_CAP_COALESCED_MMIO) = 2
    ioctl(16, KVM_CHECK_EXTENSION, KVM_CAP_COALESCED_PIO) = 1
    ioctl(16, KVM_CHECK_EXTENSION, KVM_CAP_VCPU_EVENTS) = 1
    ioctl(16, KVM_CHECK_EXTENSION, KVM_CAP_X86_ROBUST_SINGLESTEP) = 1
    ioctl(16, KVM_CHECK_EXTENSION, KVM_CAP_DEBUGREGS) = 1
    ioctl(16, KVM_CHECK_EXTENSION, KVM_CAP_SIGNAL_MSI) = 1
    ioctl(16, KVM_CHECK_EXTENSION, KVM_CAP_PCI_2_3) = 0
    ioctl(16, KVM_CHECK_EXTENSION, KVM_CAP_IRQ_INJECT_STATUS) = 1
    ioctl(16, KVM_CHECK_EXTENSION, KVM_CAP_READONLY_MEM) = 1
    ioctl(16, KVM_CHECK_EXTENSION, KVM_CAP_IOEVENTFD) = 1
    ioctl(16, KVM_CHECK_EXTENSION, KVM_CAP_IRQFD) = 1
    ioctl(16, KVM_CHECK_EXTENSION, KVM_CAP_IRQFD_RESAMPLE) = 1
    ioctl(16, KVM_CHECK_EXTENSION, KVM_CAP_VM_ATTRIBUTES) = 0
    ioctl(16, KVM_CHECK_EXTENSION, KVM_CAP_IOEVENTFD_ANY_LENGTH) = 1
    ioctl(16, KVM_CHECK_EXTENSION, KVM_CAP_XSAVE) = 1
    ioctl(16, KVM_CHECK_EXTENSION, KVM_CAP_XCRS) = 1
    ioctl(16, KVM_CHECK_EXTENSION, KVM_CAP_PIT_STATE2) = 1
    ioctl(16, KVM_CHECK_EXTENSION, KVM_CAP_HYPERV_VP_INDEX) = 1
    ioctl(16, KVM_GET_MSR_INDEX_LIST, 0x7fff07b89a40) = -1 E2BIG (Argument list
too long)
    ioctl(16, KVM_GET_MSR_INDEX_LIST, 0x5570914ab630) = 0
    ioctl(16, KVM_CHECK_EXTENSION, KVM_CAP_GET_MSR_FEATURES) = 1
    ioctl(16, KVM_GET_MSR_FEATURE_INDEX_LIST, 0x7fff07b89a40) = -1 E2BIG
(Argument list too long)
    ioctl(16, KVM_GET_MSR_FEATURE_INDEX_LIST, 0x5570914a76e0) = 0
    ioctl(16, KVM_CHECK_EXTENSION, KVM_CAP_SET_IDENTITY_MAP_ADDR) = 1
    ioctl(18, KVM_SET_IDENTITY_MAP_ADDR, 0x7fff07b899c8) = 0
    ioctl(18, KVM_SET_TSS_ADDR, 0xfeffd000) = 0
    ioctl(16, KVM_CHECK_EXTENSION, KVM_CAP_X86_SMM) = 1
    ioctl(16, KVM_CHECK_EXTENSION, KVM_CAP_IRQCHIP) = 1
    ioctl(18, KVM_CREATE_IRQCHIP, 0)        = 0
    ioctl(16, KVM_CHECK_EXTENSION, KVM_CAP_IRQ_ROUTING) = 4096
    ioctl(18, KVM_IOEVENTFD, 0x7fff07b89b80) = 0
    ioctl(18, KVM_CHECK_EXTENSION, KVM_CAP_SYNC_MMU) = 1
    ioctl(16, KVM_GET_SUPPORTED_CPUID, 0x55709151f140) = -1 E2BIG (Argument
list too long)
    ioctl(16, KVM_GET_SUPPORTED_CPUID, 0x55709151f180) = -1 E2BIG (Argument
list too long)
    ioctl(16, KVM_GET_SUPPORTED_CPUID, 0x55709151f1e0) = -1 E2BIG (Argument
list too long)
    ioctl(16, KVM_GET_SUPPORTED_CPUID, 0x55709151f140) = -1 E2BIG (Argument
list too long)
    ioctl(16, KVM_GET_SUPPORTED_CPUID, 0x55709151f290) = -1 E2BIG (Argument
list too long)
    ioctl(16, KVM_GET_SUPPORTED_CPUID, 0x55709151f520) = -1 E2BIG (Argument
list too long)
    ioctl(16, KVM_GET_SUPPORTED_CPUID, {nent=49, entries=[...]}) = 0
    ioctl(16, KVM_CHECK_EXTENSION, KVM_CAP_TSC_DEADLINE_TIMER) = 1
    ioctl(16, KVM_GET_MSRS, 0x7fff07b89950) = 1
    ioctl(16, KVM_CHECK_EXTENSION, KVM_CAP_IRQ_ROUTING) = 4096
    ioctl(18, KVM_GET_CLOCK, 0x7fff07b899c0) = 0
    ioctl(16, KVM_CHECK_EXTENSION, KVM_CAP_ADJUST_CLOCK) = 2
    ioctl(16, KVM_CHECK_EXTENSION, KVM_CAP_IRQ_ROUTING) = 4096
    ioctl(18, KVM_SET_USER_MEMORY_REGION, {slot=0, flags=0, guest_phys_addr=0,
memory_size=2147483648, userspace_addr=0x7f070fe00000}) = 0
    ioctl(16, KVM_CHECK_EXTENSION, KVM_CAP_IRQ_ROUTING) = 4096
    access("kvmvapic.bin", R_OK)            = -1 ENOENT (No such file or
directory)
   
access("/opt/stow.d/versions/qemu-4.0.0-rc3/usr/share/qemu-firmware/kvmvapic.bin",
R_OK) = -1 ENOENT (No such file or directory)
    access("/opt/stow.d/versions/qemu-4.0.0-rc3/usr/share/qemu/kvmvapic.bin",
R_OK) = 0
    openat(AT_FDCWD,
"/opt/stow.d/versions/qemu-4.0.0-rc3/usr/share/qemu/kvmvapic.bin", O_RDONLY) =
20
    ioctl(16, KVM_CHECK_EXTENSION, KVM_CAP_IRQ_ROUTING) = 4096
    ioctl(18, KVM_SET_GSI_ROUTING, 0x55709174d6d0) = 0
    ioctl(18, KVM_REGISTER_COALESCED_MMIO, 0x7fff07b898d0) = 0
    ioctl(18, KVM_SET_USER_MEMORY_REGION, {slot=1, flags=KVM_MEM_READONLY,
guest_phys_addr=0xfffc0000, memory_size=262144, userspace_addr=0x7f07a4c00000})
= 0
    ioctl(18, KVM_REGISTER_COALESCED_MMIO, 0x7fff07b896e0) = 0
    ioctl(18, KVM_SET_USER_MEMORY_REGION, {slot=0, flags=0, guest_phys_addr=0,
memory_size=0, userspace_addr=0x7f070fe00000}) = 0
    ioctl(18, KVM_SET_USER_MEMORY_REGION, {slot=0, flags=0, guest_phys_addr=0,
memory_size=786432, userspace_addr=0x7f070fe00000}) = 0
    ioctl(18, KVM_SET_USER_MEMORY_REGION, {slot=2, flags=KVM_MEM_READONLY,
guest_phys_addr=0xc0000, memory_size=131072, userspace_addr=0x7f07a4a00000}) =
0
    ioctl(18, KVM_SET_USER_MEMORY_REGION, {slot=3, flags=KVM_MEM_READONLY,
guest_phys_addr=0xe0000, memory_size=131072, userspace_addr=0x7f07a4c20000}) =
0
    ioctl(18, KVM_SET_USER_MEMORY_REGION, {slot=4, flags=0,
guest_phys_addr=0x100000, memory_size=2146435072,
userspace_addr=0x7f070ff00000}) = 0
    ioctl(18, KVM_SET_USER_MEMORY_REGION, {slot=0, flags=0, guest_phys_addr=0,
memory_size=0, userspace_addr=0x7f070fe00000}) = 0
    ioctl(18, KVM_SET_USER_MEMORY_REGION, {slot=0, flags=0, guest_phys_addr=0,
memory_size=655360, userspace_addr=0x7f070fe00000}) = 0
    ioctl(18, KVM_REGISTER_COALESCED_MMIO, 0x7fff07b897f0) = 0
    ioctl(18, KVM_REGISTER_COALESCED_MMIO, 0x7fff07b89870) = 0
    ioctl(16, KVM_CHECK_EXTENSION, KVM_CAP_PIT2) = 1
    ioctl(18, KVM_CREATE_PIT2, 0x7fff07b899a0) = 0
    ioctl(18, KVM_IRQ_LINE_STATUS, 0x7fff07b89960) = 0
    ioctl(16, KVM_CHECK_EXTENSION, KVM_CAP_X86_SMM) = 1
    ioctl(18, KVM_SET_USER_MEMORY_REGION, {slot=65536, flags=0,
guest_phys_addr=0, memory_size=786432, userspace_addr=0x7f070fe00000}) = 0
    ioctl(18, KVM_SET_USER_MEMORY_REGION, {slot=65537, flags=KVM_MEM_READONLY,
guest_phys_addr=0xc0000, memory_size=131072, userspace_addr=0x7f07a4a00000}) =
0
    ioctl(18, KVM_SET_USER_MEMORY_REGION, {slot=65538, flags=KVM_MEM_READONLY,
guest_phys_addr=0xe0000, memory_size=131072, userspace_addr=0x7f07a4c20000}) =
0
    ioctl(18, KVM_SET_USER_MEMORY_REGION, {slot=65539, flags=0,
guest_phys_addr=0x100000, memory_size=2146435072,
userspace_addr=0x7f070ff00000}) = 0
    ioctl(18, KVM_SET_USER_MEMORY_REGION, {slot=65540, flags=KVM_MEM_READONLY,
guest_phys_addr=0xfffc0000, memory_size=262144, userspace_addr=0x7f07a4c00000})
= 0
    ioctl(18, KVM_IRQ_LINE_STATUS, 0x7fff07b89cb0) = 0
    ioctl(18, KVM_IRQ_LINE_STATUS, 0x7fff07b89c60) = 0
    ioctl(18, KVM_IRQ_LINE_STATUS, 0x7fff07b89c80) = 0
    ioctl(18, KVM_IRQ_LINE_STATUS, 0x7fff07b89c60) = 0
    ioctl(18, KVM_IRQ_LINE_STATUS, 0x7fff07b89c80) = 0
    ioctl(18, KVM_IRQ_LINE_STATUS, 0x7fff07b89c30) = 0
    ioctl(18, KVM_GET_PIT2, 0x7fff07b89bb0) = 0
    ioctl(18, KVM_SET_PIT2, 0x7fff07b89bd0) = 0
    ioctl(18, KVM_SET_IRQCHIP, 0x7fff07b89a80) = 0
    ioctl(18, KVM_SET_PIT2, 0x7fff07b89ac0) = 0
    ioctl(18, KVM_SET_IRQCHIP, 0x7fff07b89940) = 0
    ioctl(19, KVM_SET_VAPIC_ADDR, 0x7fff07b89c80) = 0
    ioctl(18, KVM_SET_PIT2, 0x7fff07b89c20) = 0
    ioctl(16, KVM_CHECK_EXTENSION, KVM_CAP_KVMCLOCK_CTRL) = 1
    ioctl(18, KVM_SET_CLOCK, 0x7fff07b89c60) = 0
    ioctl(18, KVM_GET_DIRTY_LOG, 0x7fff07b899b0) = 0
    ioctl(18, KVM_GET_PIT2, 0x7fff07b89c30) = 0
    ioctl(16, KVM_CHECK_EXTENSION, KVM_CAP_KVMCLOCK_CTRL) = 1
    ioctl(18, KVM_GET_CLOCK, 0x7fff07b89bf0) = 0
    ioctl(16, KVM_CHECK_EXTENSION, KVM_CAP_ADJUST_CLOCK) = 2


This problem might be related to 202189, but for me 4.20.14 and 5.0.[2-5]
all work fine

I'm sorry not being able to go deeper than this into the issue...

Thanks
ciao
-gabriele

=====================================================================
                               My specs
=====================================================================

#> uname -sr
Linux 5.0.7

#> cat /proc/cpuinfo
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 21
model           : 16
model name      : AMD Athlon(tm) X4 740 Quad Core Processor
stepping        : 1
microcode       : 0x6001116
cpu MHz         : 3500.044
cache size      : 2048 KB
physical id     : 0
siblings        : 4
core id         : 0
cpu cores       : 2
apicid          : 16
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb
rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf
pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 popcnt aes xsave avx f16c
lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch
osvw ibs xop skinit wdt lwp fma4 tce nodeid_msr tbm topoext perfctr_core
perfctr_nb cpb hw_pstate ssbd vmmcall bmi1 arat npt lbrv svm_lock nrip_save
tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold
bugs            : fxsave_leak sysret_ss_attrs null_seg spectre_v1 spectre_v2
spec_store_bypass
bogomips        : 6400.08
TLB size        : 1536 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 48 bits physical, 48 bits virtual
power management: ts ttp tm 100mhzsteps hwpstate cpb eff_freq_ro

[...cpus 1 2 3 omitted...]
```

-- 
You are receiving this mail because:
You are watching the assignee of the bug.



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux