Skip to content

Flakey kvm/pci resource hangling behaviour from 4.11 branch #103

Closed

Description

@aenertia

Hi - has anyone else been experiencing flakey kvm and pci resource mapping.

I've noticed the 4.11.7 and the 4.11.9 patchsets as of last night against commit : 5fefbda

That I get quite a lot of kernel oops when running VM's that with vanilla are just fine.

I am also running thunderbolt3 networking patches (which have been stable for nearly a year but not accepted into mainline due to reliance on a userspace daemon) - but even compiling this out I have the same issues. After the oops's I loose the thunderbolt3 bridge/pci mappings which I why I noticed it in the first place so looks to be something to do with pci resource handling being broken.

Here is a typical dmesg output (running a kvm guest):

49889.618936] CPU: 0 PID: 24981 Comm: CPU 1/KVM Tainted: P O 4.11.9-zentb3+ #0
[49889.618937] BUG: using smp_processor_id() in preemptible [00000000] code: CPU 0/KVM/24980
[49889.618938] Hardware name: Gigabyte Technology Co., Ltd. Z270X-Gaming 7/Z270X-Gaming 7, BIOS F7d 07/04/2017
[49889.618938] caller is single_task_running+0x5/0x20
[49889.618938] Call Trace:
[49889.618939] ? dump_stack+0x5c/0x7a
[49889.618940] ? debug_smp_processor_id+0xdd/0xe0
[49889.618941] ? single_task_running+0x5/0x20
[49889.618945] ? kvm_vcpu_block+0x1fd/0x310 [kvm]
[49889.618950] ? kvm_arch_vcpu_ioctl_run+0x5cb/0x1940 [kvm]
[49889.618954] ? kvm_arch_vcpu_load+0x46/0x290 [kvm]
[49889.618956] ? vmx_vcpu_put+0x9f/0x1d0 [kvm_intel]
[49889.618960] ? kvm_arch_vcpu_load+0x61/0x290 [kvm]
[49889.618964] ? kvm_vcpu_ioctl+0x540/0x670 [kvm]
[49889.618967] ? kvm_vcpu_ioctl+0x540/0x670 [kvm]
[49889.618968] ? do_vfs_ioctl+0x8c/0x710
[49889.618969] ? user_return_notifier_unregister+0x3d/0x70
[49889.618970] ? SyS_ioctl+0x6f/0x80
[49889.618970] ? entry_SYSCALL_64_fastpath+0x1e/0xad
[49889.618971] CPU: 1 PID: 24980 Comm: CPU 0/KVM Tainted: P O 4.11.9-zentb3+ #0
[49889.618972] Hardware name: Gigabyte Technology Co., Ltd. Z270X-Gaming 7/Z270X-Gaming 7, BIOS F7d 07/04/2017
[49889.618972] Call Trace:
[49889.618973] ? dump_stack+0x5c/0x7a
[49889.618974] ? debug_smp_processor_id+0xdd/0xe0
[49889.618975] ? single_task_running+0x5/0x20
[49889.618979] ? kvm_vcpu_block+0x1fd/0x310 [kvm]
[49889.618984] ? kvm_arch_vcpu_ioctl_run+0x5cb/0x1940 [kvm]
[49889.618989] ? kvm_arch_vcpu_load+0x46/0x290 [kvm]
[49889.618990] ? vmx_vcpu_put+0x9f/0x1d0 [kvm_intel]
[49889.618995] ? kvm_arch_vcpu_load+0x61/0x290 [kvm]
[49889.618999] ? kvm_vcpu_ioctl+0x540/0x670 [kvm]
[49889.619003] ? kvm_vcpu_ioctl+0x540/0x670 [kvm]
[49889.619003] ? _raw_spin_unlock_irq+0x18/0x30
[49889.619004] ? eventfd_write+0xc6/0x240
[49889.619004] ? retint_kernel+0x1b/0x1d
[49889.619005] ? do_vfs_ioctl+0x8c/0x710
[49889.619009] ? kvm_vcpu_mmap+0x10/0x10 [kvm]
[49889.619010] ? user_return_notifier_unregister+0x3d/0x70
[49889.619010] ? SyS_ioctl+0x6f/0x80
[49889.619011] ? entry_SYSCALL_64_fastpath+0x1e/0xad
[49889.649885] BUG: using smp_processor_id() in preemptible [00000000] code: CPU 0/KVM/24980
[49889.649889] caller is single_task_running+0x5/0x20
[49889.649890] CPU: 1 PID: 24980 Comm: CPU 0/KVM Tainted: P O 4.11.9-zentb3+ #0
[49889.649890] Hardware name: Gigabyte Technology Co., Ltd. Z270X-Gaming 7/Z270X-Gaming 7, BIOS F7d 07/04/2017
[49889.649891] Call Trace:
[49889.649894] ? dump_stack+0x5c/0x7a
[49889.649895] ? debug_smp_processor_id+0xdd/0xe0
[49889.649896] ? single_task_running+0x5/0x20
[49889.649906] ? kvm_vcpu_block+0x1fd/0x310 [kvm]
[49889.649912] ? kvm_arch_vcpu_ioctl_run+0x5cb/0x1940 [kvm]
[49889.649918] ? kvm_arch_vcpu_load+0x46/0x290 [kvm]
[49889.649920] ? vmx_vcpu_put+0x9f/0x1d0 [kvm_intel]
[49889.649926] ? kvm_arch_vcpu_load+0x61/0x290 [kvm]
[49889.649930] ? kvm_vcpu_ioctl+0x540/0x670 [kvm]
[49889.649934] ? kvm_vcpu_ioctl+0x540/0x670 [kvm]
[49889.649935] ? _raw_spin_unlock_irq+0x18/0x30
[49889.649936] ? eventfd_write+0xc6/0x240
[49889.649937] ? retint_kernel+0x1b/0x1d
[49889.649938] ? do_vfs_ioctl+0x8c/0x710
[49889.649942] ? kvm_vcpu_mmap+0x10/0x10 [kvm]
[49889.649943] ? user_return_notifier_unregister+0x3d/0x70
[49889.649944] ? SyS_ioctl+0x6f/0x80
[49889.649945] ? entry_SYSCALL_64_fastpath+0x1e/0xad


inxi output

aenertia@kiorewha:~/build$ inxi -Pbdi
System: Host: kiorewha Kernel: 4.11.9-zentb3+ x86_64 (64 bit) Desktop: Gnome 3.24.2 Distro: Ubuntu 17.04
Machine: Device: desktop System: Gigabyte product: Z270X-Gaming 7 v: Default string
Mobo: Gigabyte model: Z270X-Gaming 7 v: x.x UEFI: American Megatrends v: F7d date: 07/04/2017
CPU: Quad core Intel Core i7-7700K (-HT-MCP-) speed/max: 3187/4900 MHz
Graphics: Card: NVIDIA GP102 [GeForce GTX 1080 Ti]
Display Server: X.Org 1.19.3 drivers: nvidia (unloaded: modesetting,fbdev,vesa,nouveau)
Resolution: [email protected]
GLX Renderer: GeForce GTX 1080 Ti/PCIe/SSE2 GLX Version: 4.5.0 NVIDIA 384.47
Network: Card-1: Intel Ethernet Connection (2) I219-V driver: e1000e
IF: enp0s31f6 state: down mac: 1c:1b:0d:97:63:bc
Card-2: Qualcomm Atheros Device e0b1 driver: alx
IF: enp7s0 state: up speed: 1000 Mbps duplex: full mac: 1c:1b:0d:97:63:be
WAN IP: IF: enp0s31f6 ip-v4: N/A
IF: enp7s0 ip-v4: 172.16.254.10 IF: virbr0-nic ip-v4: N/A IF: vnet0 ip-v4: N/A IF: vnet1 ip-v4: N/A
IF: virbr0 ip-v4: 192.168.122.1
Drives: HDD Total Size: 8001.6GB (57.4% used)
ID-1: /dev/nvme0n1 model: N/A size: 512.1GB
ID-2: /dev/sda model: WDC_WD80EFZX size: 8001.6GB
Optical: No optical drives detected.
Partition: ID-1: / size: 246G used: 160G (69%) fs: ext4 dev: /dev/nvme0n1p2
Info: Processes: 346 Uptime: 13:52 Memory: 20548.3/48205.1MB Client: Shell (bash) inxi: 2.3.8

Activity

  1. damentz commented on Jul 11, 2017

    @damentz
    Member

    Wow, well that was quick. Checking your output, you're also running a recent BIOS update for your motherboard.

    I'll revert this change for now since it needs to be implemented as a Kconfig option so you can opt-in if you know the hardware you're building your kernel for has known good x2apic support that's reporting opt-out.

  2. added a commit that references this issue on Jul 11, 2017
    915f33c
  3. aenertia commented on Jul 11, 2017

    @aenertia
    Author

    Yup - it's a beta that rolls in the kabylake microcode for that nasty hyperthreading bug. I was surprised gigabyte actually had a bios for me in less than a week.

  4. added a commit that references this issue on Jul 12, 2017
    a7e2631
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions