Bug 190529 - [kvm] [panic] Kernel panic in KVM after recent Linux host upgrade [regression]
Summary: [kvm] [panic] Kernel panic in KVM after recent Linux host upgrade [regression]
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: Unspecified
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords: crash
Depends on:
Blocks:
 
Reported: 2014-06-02 19:04 UTC by andrej
Modified: 2023-11-05 15:54 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description andrej 2014-06-02 19:04:38 UTC
After a regular weekly update of the Linux host, all FreeBSD KVM machines panic on boot, despite the fact that

* the same FreeBSD KVM machines worked perfectly fine before one of the recent host updates.
* all other KVM machines (OpenIndiana, 3 Linux distributions) still work fine as usual.

The FreeBSD machines are installed on and boot from ZFS. (Not sure if that's relevant to the problem -- all the ZFS modules get loaded as usual, the crash occurs much later.)


Kernel panic message:

fault code              = supervisor write data, page not present
instruction pointer     = 0x20:0xffffffff80cfb869
stack pointer           = 0x28:0xffffffff81a4a6a0
frame pointer           = 0x28:0xffffffff81a4a8e0
code segment            = base rx0, limit 0xfffff, type 0x1b
                        = DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags        = resume, IOPL = 0
current process         = 0 (swapper)
trap number             = 12
panic: page fault
cpuid = 0
KDB: stack backtrace:
#0 0xffffffff808e7e70 at kdb_backtrace+0x60
#1 0xffffffff808af955 at panic+0x155
#2 0xffffffff80c8e732 at trap_fatal+0x3a2
#3 0xffffffff80c8ea09 at trap_pfault+0x2c9
#4 0xffffffff80c8e196 at trap+0x5e6
#5 0xffffffff80c75432 at calltrap+0x8
#6 0xffffffff80cfa7e6 at vesa_mod_event+0x166
#7 0xffffffff8089b2bb at module_register_init+0xfb
#8 0xffffffff808612d8 at mi_startup+0x118
#9 0xffffffff802d3e0c at btext+0x2c
Uptime: 1s
Automatic reboot in 15 seconds - press a key on the console to abort


Configuration of the KVM machine:

<!--
WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:
  virsh edit maple
or other application using the libvirt API.
-->

<domain type='kvm'>
  <name>maple</name>
  <uuid>0a266182-b840-ac74-af2f-73d6c18daf60</uuid>
  <description>FreeBSD</description>
  <memory unit='KiB'>10485760</memory>
  <currentMemory unit='KiB'>10485760</currentMemory>
  <vcpu placement='static'>4</vcpu>
  <os>
    <type arch='x86_64' machine='pc-i440fx-1.7'>hvm</type>
    <boot dev='hd'/>
    <bootmenu enable='no'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <cpu mode='custom' match='exact'>
    <model fallback='allow'>Westmere</model>
    <vendor>Intel</vendor>
    <feature policy='require' name='pbe'/>
    <feature policy='require' name='rdtscp'/>
    <feature policy='require' name='est'/>                                                                                                                                                   
    <feature policy='require' name='vmx'/>                                                                                                                                                   
    <feature policy='require' name='ds'/>                                                                                                                                                    
    <feature policy='require' name='smx'/>                                                                                                                                                   
    <feature policy='require' name='ss'/>                                                                                                                                                    
    <feature policy='require' name='vme'/>                                                                                                                                                   
    <feature policy='require' name='dtes64'/>                                                                                                                                                
    <feature policy='require' name='tm2'/>                                                                                                                                                   
    <feature policy='require' name='ht'/>                                                                                                                                                    
    <feature policy='require' name='dca'/>                                                                                                                                                   
    <feature policy='require' name='pcid'/>                                                                                                                                                  
    <feature policy='require' name='tm'/>                                                                                                                                                    
    <feature policy='require' name='pdcm'/>                                                                                                                                                  
    <feature policy='require' name='pdpe1gb'/>                                                                                                                                               
    <feature policy='require' name='ds_cpl'/>                                                                                                                                                
    <feature policy='require' name='pclmuldq'/>                                                                                                                                              
    <feature policy='require' name='xtpr'/>                                                                                                                                                  
    <feature policy='require' name='acpi'/>
    <feature policy='require' name='monitor'/>
  </cpu>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='writeback'/>
      <source file='/var/lib/libvirt/images/maple.img'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </disk>
    <disk type='block' device='cdrom'>
      <driver name='qemu' type='raw' cache='none'/>
      <target dev='hdc' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
    </disk>
    <controller type='usb' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
    <controller type='ide' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </controller>
    <controller type='sata' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'/>
    <interface type='bridge'>
      <mac address='52:54:00:6d:f0:30'/>
      <source bridge='kvmbr0'/>
      <model type='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <serial type='pty'>
      <target port='0'/>
    </serial>
    <console type='pty'>
      <target type='serial' port='0'/>
    </console>
    <channel type='spicevmc'>
      <target type='virtio' name='com.redhat.spice.0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='spice' autoport='yes'/>
    <video>
      <model type='vga' vram='9216' heads='1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </memballoon>
  </devices>
</domain>

Environment:
Not really possible at the moment ... the machine panics.
On the KVM host:
$ uname -a
Linux dustbin 3.14.4-1-ARCH #1 SMP PREEMPT Tue May 13 16:41:39 CEST 2014 x86_64 GNU/Linux

How-To-Repeat:
Try to boot a FreeBSD KVM machine.

Fix:
None thus far. Tried to downgrade the virtual machine from its usual 4 CPUs to a uniprocessor, but that didn't help.
Comment 1 Rogier Slag 2014-07-14 15:29:02 UTC
We are encountering the same issue with FreeBSD (both 10.0 as well as 9.2) on our testing platform for Qemu 2.0

Below I've attached the XML config we are using 

<domain type='kvm' id='207'>
  <name>rslag-vps11</name>
  <uuid>487d6901-66ff-0c28-b3f0-00007bce14c0</uuid>
  <memory unit='KiB'>1048576</memory>
  <currentMemory unit='KiB'>1048576</currentMemory>
  <vcpu placement='static'>1</vcpu>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-i440fx-2.0'>hvm</type>
    <boot dev='hd'/>
    <boot dev='cdrom'/>
    <boot dev='network'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <clock offset='localtime'>
    <timer name='hpet' present='yes'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/bin/kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='none'/>
      <source file='...'/>
      <backingStore/>
      <target dev='hda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <backingStore/>
      <target dev='hdc' bus='ide'/>
      <readonly/>
      <alias name='ide0-1-0'/>
      <address type='drive' controller='0' bus='1' target='0' unit='0'/>
    </disk>
    <controller type='usb' index='0'>
      <alias name='usb0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'>
      <alias name='pci.0'/>
    </controller>
    <controller type='ide' index='0'>
      <alias name='ide0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:b7:8c:a7'/>
      <source bridge='custvpsbr'/>
      <bandwidth>
        <inbound average='131072'/>
        <outbound average='131072'/>
      </bandwidth>
      <target dev='vpsif1810150'/>
      <model type='virtio'/>
      <filterref filter='...'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <graphics type='vnc' port='5901' autoport='yes' listen='0.0.0.0' keymap='en-us'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <sound model='es1370'>
      <alias name='sound0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </sound>
    <video>
      <model type='vga' vram='9216' heads='1'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </memballoon>
  </devices>
  <seclabel type='none'/>
</domain>
Comment 2 Vasiliy Tolstov 2014-10-27 14:26:14 UTC
What seabios version do you have? As i know seabios 1.7.4 have bugs, i'm confirm this bug under 1.7.4 , but in seabios 1.7.5 i'm succeseful run freebsd under packer.
Comment 3 Bryan Drewery freebsd_committer freebsd_triage 2014-10-28 00:10:16 UTC
I've gotten this with a VMWare guest. sys/dev/fb/vesa.c:822 (vmbuf = x86bios_alloc) is returning NULL.
Comment 4 Bryan Drewery freebsd_committer freebsd_triage 2014-10-28 00:33:30 UTC
(In reply to Bryan Drewery from comment #3)
> I've gotten this with a VMWare guest. sys/dev/fb/vesa.c:822 (vmbuf =
> x86bios_alloc) is returning NULL.

The issue here was having VMware configured for 8 CPU while it claimed only 2 were supported. Lowering to the 2 maximum allowed it to boot.
Comment 5 Bryan Drewery freebsd_committer freebsd_triage 2014-10-28 00:36:50 UTC
(In reply to Bryan Drewery from comment #4)
> (In reply to Bryan Drewery from comment #3)
> > I've gotten this with a VMWare guest. sys/dev/fb/vesa.c:822 (vmbuf =
> > x86bios_alloc) is returning NULL.
> 
> The issue here was having VMware configured for 8 CPU while it claimed only
> 2 were supported. Lowering to the 2 maximum allowed it to boot.

For further reference the guest did claim to have 8 CPU in this invalid configuration.
Comment 6 Vasiliy Tolstov 2014-10-28 10:39:35 UTC
In my case seabios upgrade solve issue
Comment 7 Ed Maste freebsd_committer freebsd_triage 2017-07-26 17:54:53 UTC
Can you still reproduce this issue?
Comment 8 Graham Perrin freebsd_committer freebsd_triage 2022-10-17 12:19:21 UTC
Keyword: 

    crash

– in lieu of summary line prefix: 

    [panic]

* bulk change for the keyword
* summary lines may be edited manually (not in bulk). 

Keyword descriptions and search interface: 

    <https://bugs.freebsd.org/bugzilla/describekeywords.cgi>
Comment 9 Ed Maste freebsd_committer freebsd_triage 2023-11-05 15:54:00 UTC
This issue is from a long time ago, with some comments that it has not recurred after updating software involved.