* Oops after resume from suspend
@ 2007-01-24 22:01 Jeremy Katz
[not found] ` <1169676112.10817.13.camel-T9xAYgMuJli44ywRPIzf9A@public.gmane.org>
0 siblings, 1 reply; 7+ messages in thread
From: Jeremy Katz @ 2007-01-24 22:01 UTC (permalink / raw)
To: kvm-devel
When using kvm on my laptop, I get the following oops if I try using kvm
after a suspend (ACPI S3)/resume cycle. At first I thought it went away
if I unloaded the module before suspending and then reloading it
afterwards, but I can't reproduce that working now, so I might have just
been hallucinating. Thoughts of things to try?
invalid opcode: 0000 [#1]
SMP
last sysfs file: /class/net/lo/ifindex
Modules linked in: ipw3945 ieee80211 ieee80211_crypt rfcomm hidp l2cap
ohci1394 ieee1394 button kvm_intel tun kvm i915 drm autofs4 sunrpc
bridge dummy nf_conntrack_netbios_ns ipt_REJECT nf_conntrack_ipv4
xt_state nf_conntrack nfnetlink xt_tcpudp iptable_filter ip_tables
x_tables cpufreq_ondemand video sbs i2c_ec dock battery asus_acpi
backlight ac ipv6 parport_pc lp parport snd_hda_intel snd_hda_codec
snd_seq_dummy snd_seq_oss snd_seq_midi_event snd_seq snd_seq_device
snd_pcm_oss hci_usb snd_mixer_oss sr_mod snd_pcm cdrom sdhci e100
snd_timer bluetooth serio_raw mmc_core mii snd soundcore snd_page_alloc
iTCO_wdt iTCO_vendor_support ata_piix i2c_i801 i2c_core ata_generic
joydev sg dm_snapshot dm_zero dm_mirror dm_mod ahci libata sd_mod
scsi_mod ext3 jbd mbcache ehci_hcd ohci_hcd uhci_hcd
CPU: 0
EIP: 0060:[<f8fb814c>] Not tainted VLI
EFLAGS: 00010286 (2.6.19-1.2909.fc7 #1)
EIP is at vmcs_clear+0x1b/0x46 [kvm_intel]
eax: ef399d34 ebx: e6459000 ecx: e6459000 edx: 00000400
esi: f0efc47c edi: 00000000 ebp: ef399d3c esp: ef399d24
ds: 007b es: 007b ss: 0068
Process qemu-kvm (pid: 5834, ti=ef399000 task=f0712030 task.ti=ef399000)
Stack: f0efc47c 00000000 ef399d3c f8fb8c2f 26459000 00000000 ef399d4c
f8fb92e8
f0efc47c f0efc484 ef399f44 f8ee1f3c 00000000 00000000 f0efc000
00000000
f72bba84 f185ef90 00000000 ef399db0 c04cffbd c21c336c 000a0000
0000004c
Call Trace:
[<c04051c9>] show_trace_log_lvl+0x1a/0x2f
[<c0405279>] show_stack_log_lvl+0x9b/0xa3
[<c0405415>] show_registers+0x194/0x26a
[<c0405618>] die+0x12d/0x242
[<c0605197>] do_trap+0x79/0x91
[<c0405bbb>] do_invalid_op+0x97/0xa1
[<c0604f6c>] error_code+0x7c/0x84
[<f8fb92e8>] vmx_create_vcpu+0x54/0x97 [kvm_intel]
[<f8ee1f3c>] kvm_dev_ioctl+0x16a/0x1150 [kvm]
[<c0482e72>] do_ioctl+0x22/0x67
[<c0483109>] vfs_ioctl+0x252/0x265
[<c0483165>] sys_ioctl+0x49/0x64
[<c0404058>] syscall_call+0x7/0xb
=======================
Code: c0 ff 05 20 da ee f8 eb 05 b8 01 00 00 00 5d c3 55 89 c1 89 e5 83
ec 18 8d 80 00 00 00 40 89 45 f8 8d 45 f8 c7 45 fc 00 00 00 00 <66> 0f
c7 30 0f 96 c0 84 c0 74 1e 8b 45 f8 8b 55 fc 89 4c 24 04
EIP: [<f8fb814c>] vmcs_clear+0x1b/0x46 [kvm_intel] SS:ESP 0068:ef399d24
Jeremy
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Oops after resume from suspend
[not found] ` <1169676112.10817.13.camel-T9xAYgMuJli44ywRPIzf9A@public.gmane.org>
@ 2007-01-24 22:14 ` Dor Laor
2007-01-24 22:22 ` Anthony Liguori
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Dor Laor @ 2007-01-24 22:14 UTC (permalink / raw)
To: Jeremy Katz, kvm-devel
>When using kvm on my laptop, I get the following oops if I try using
kvm
>after a suspend (ACPI S3)/resume cycle. At first I thought it went
away
>if I unloaded the module before suspending and then reloading it
>afterwards, but I can't reproduce that working now, so I might have
just
>been hallucinating. Thoughts of things to try?
My guess is that the SMM (system management mode) got in the way of the
KVM.
Currently we do not handle it at all. That's also why it's hard to
reproduce it.
>
>invalid opcode: 0000 [#1]
>SMP
>last sysfs file: /class/net/lo/ifindex
>Modules linked in: ipw3945 ieee80211 ieee80211_crypt rfcomm hidp l2cap
>ohci1394 ieee1394 button kvm_intel tun kvm i915 drm autofs4 sunrpc
>bridge dummy nf_conntrack_netbios_ns ipt_REJECT nf_conntrack_ipv4
>xt_state nf_conntrack nfnetlink xt_tcpudp iptable_filter ip_tables
>x_tables cpufreq_ondemand video sbs i2c_ec dock battery asus_acpi
>backlight ac ipv6 parport_pc lp parport snd_hda_intel snd_hda_codec
>snd_seq_dummy snd_seq_oss snd_seq_midi_event snd_seq snd_seq_device
>snd_pcm_oss hci_usb snd_mixer_oss sr_mod snd_pcm cdrom sdhci e100
>snd_timer bluetooth serio_raw mmc_core mii snd soundcore snd_page_alloc
>iTCO_wdt iTCO_vendor_support ata_piix i2c_i801 i2c_core ata_generic
>joydev sg dm_snapshot dm_zero dm_mirror dm_mod ahci libata sd_mod
>scsi_mod ext3 jbd mbcache ehci_hcd ohci_hcd uhci_hcd
>CPU: 0
>EIP: 0060:[<f8fb814c>] Not tainted VLI
>EFLAGS: 00010286 (2.6.19-1.2909.fc7 #1)
>EIP is at vmcs_clear+0x1b/0x46 [kvm_intel]
>eax: ef399d34 ebx: e6459000 ecx: e6459000 edx: 00000400
>esi: f0efc47c edi: 00000000 ebp: ef399d3c esp: ef399d24
>ds: 007b es: 007b ss: 0068
>Process qemu-kvm (pid: 5834, ti=ef399000 task=f0712030
task.ti=ef399000)
>Stack: f0efc47c 00000000 ef399d3c f8fb8c2f 26459000 00000000 ef399d4c
>f8fb92e8
> f0efc47c f0efc484 ef399f44 f8ee1f3c 00000000 00000000 f0efc000
>00000000
> f72bba84 f185ef90 00000000 ef399db0 c04cffbd c21c336c 000a0000
>0000004c
>Call Trace:
> [<c04051c9>] show_trace_log_lvl+0x1a/0x2f
> [<c0405279>] show_stack_log_lvl+0x9b/0xa3
> [<c0405415>] show_registers+0x194/0x26a
> [<c0405618>] die+0x12d/0x242
> [<c0605197>] do_trap+0x79/0x91
> [<c0405bbb>] do_invalid_op+0x97/0xa1
> [<c0604f6c>] error_code+0x7c/0x84
> [<f8fb92e8>] vmx_create_vcpu+0x54/0x97 [kvm_intel]
> [<f8ee1f3c>] kvm_dev_ioctl+0x16a/0x1150 [kvm]
> [<c0482e72>] do_ioctl+0x22/0x67
> [<c0483109>] vfs_ioctl+0x252/0x265
> [<c0483165>] sys_ioctl+0x49/0x64
> [<c0404058>] syscall_call+0x7/0xb
> =======================
>Code: c0 ff 05 20 da ee f8 eb 05 b8 01 00 00 00 5d c3 55 89 c1 89 e5 83
>ec 18 8d 80 00 00 00 40 89 45 f8 8d 45 f8 c7 45 fc 00 00 00 00 <66> 0f
>c7 30 0f 96 c0 84 c0 74 1e 8b 45 f8 8b 55 fc 89 4c 24 04
>EIP: [<f8fb814c>] vmcs_clear+0x1b/0x46 [kvm_intel] SS:ESP 0068:ef399d24
>
>
>
>Jeremy
>
>
>-----------------------------------------------------------------------
--
>Take Surveys. Earn Cash. Influence the Future of IT
>Join SourceForge.net's Techsay panel and you'll get the chance to share
>your
>opinions on IT & business topics through brief surveys - and earn cash
>http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVD
EV
>_______________________________________________
>kvm-devel mailing list
>kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
>https://lists.sourceforge.net/lists/listinfo/kvm-devel
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Oops after resume from suspend
[not found] ` <1169676112.10817.13.camel-T9xAYgMuJli44ywRPIzf9A@public.gmane.org>
2007-01-24 22:14 ` Dor Laor
@ 2007-01-24 22:22 ` Anthony Liguori
2007-01-25 1:43 ` dormando
2007-01-25 7:58 ` Avi Kivity
3 siblings, 0 replies; 7+ messages in thread
From: Anthony Liguori @ 2007-01-24 22:22 UTC (permalink / raw)
To: Jeremy Katz, kvm-devel
Jeremy Katz wrote:
> When using kvm on my laptop, I get the following oops if I try using kvm
> after a suspend (ACPI S3)/resume cycle. At first I thought it went away
> if I unloaded the module before suspending and then reloading it
> afterwards, but I can't reproduce that working now, so I might have just
> been hallucinating. Thoughts of things to try?
>
> invalid opcode: 0000 [#1]
>
One would see a similar message if VT wasn't enabled and VT instructions
were executed.
Can you poke at the MSRs and eflags and see if see if VT is actually
enabled? Perhaps it's possible that suspend/resume triggers something
equivalent to a reboot which resets VT?
Regards,
Anthony Liguori
> SMP
> last sysfs file: /class/net/lo/ifindex
> Modules linked in: ipw3945 ieee80211 ieee80211_crypt rfcomm hidp l2cap
> ohci1394 ieee1394 button kvm_intel tun kvm i915 drm autofs4 sunrpc
> bridge dummy nf_conntrack_netbios_ns ipt_REJECT nf_conntrack_ipv4
> xt_state nf_conntrack nfnetlink xt_tcpudp iptable_filter ip_tables
> x_tables cpufreq_ondemand video sbs i2c_ec dock battery asus_acpi
> backlight ac ipv6 parport_pc lp parport snd_hda_intel snd_hda_codec
> snd_seq_dummy snd_seq_oss snd_seq_midi_event snd_seq snd_seq_device
> snd_pcm_oss hci_usb snd_mixer_oss sr_mod snd_pcm cdrom sdhci e100
> snd_timer bluetooth serio_raw mmc_core mii snd soundcore snd_page_alloc
> iTCO_wdt iTCO_vendor_support ata_piix i2c_i801 i2c_core ata_generic
> joydev sg dm_snapshot dm_zero dm_mirror dm_mod ahci libata sd_mod
> scsi_mod ext3 jbd mbcache ehci_hcd ohci_hcd uhci_hcd
> CPU: 0
> EIP: 0060:[<f8fb814c>] Not tainted VLI
> EFLAGS: 00010286 (2.6.19-1.2909.fc7 #1)
> EIP is at vmcs_clear+0x1b/0x46 [kvm_intel]
> eax: ef399d34 ebx: e6459000 ecx: e6459000 edx: 00000400
> esi: f0efc47c edi: 00000000 ebp: ef399d3c esp: ef399d24
> ds: 007b es: 007b ss: 0068
> Process qemu-kvm (pid: 5834, ti=ef399000 task=f0712030 task.ti=ef399000)
> Stack: f0efc47c 00000000 ef399d3c f8fb8c2f 26459000 00000000 ef399d4c
> f8fb92e8
> f0efc47c f0efc484 ef399f44 f8ee1f3c 00000000 00000000 f0efc000
> 00000000
> f72bba84 f185ef90 00000000 ef399db0 c04cffbd c21c336c 000a0000
> 0000004c
> Call Trace:
> [<c04051c9>] show_trace_log_lvl+0x1a/0x2f
> [<c0405279>] show_stack_log_lvl+0x9b/0xa3
> [<c0405415>] show_registers+0x194/0x26a
> [<c0405618>] die+0x12d/0x242
> [<c0605197>] do_trap+0x79/0x91
> [<c0405bbb>] do_invalid_op+0x97/0xa1
> [<c0604f6c>] error_code+0x7c/0x84
> [<f8fb92e8>] vmx_create_vcpu+0x54/0x97 [kvm_intel]
> [<f8ee1f3c>] kvm_dev_ioctl+0x16a/0x1150 [kvm]
> [<c0482e72>] do_ioctl+0x22/0x67
> [<c0483109>] vfs_ioctl+0x252/0x265
> [<c0483165>] sys_ioctl+0x49/0x64
> [<c0404058>] syscall_call+0x7/0xb
> =======================
> Code: c0 ff 05 20 da ee f8 eb 05 b8 01 00 00 00 5d c3 55 89 c1 89 e5 83
> ec 18 8d 80 00 00 00 40 89 45 f8 8d 45 f8 c7 45 fc 00 00 00 00 <66> 0f
> c7 30 0f 96 c0 84 c0 74 1e 8b 45 f8 8b 55 fc 89 4c 24 04
> EIP: [<f8fb814c>] vmcs_clear+0x1b/0x46 [kvm_intel] SS:ESP 0068:ef399d24
>
>
>
> Jeremy
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> kvm-devel mailing list
> kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/kvm-devel
>
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Oops after resume from suspend
[not found] ` <1169676112.10817.13.camel-T9xAYgMuJli44ywRPIzf9A@public.gmane.org>
2007-01-24 22:14 ` Dor Laor
2007-01-24 22:22 ` Anthony Liguori
@ 2007-01-25 1:43 ` dormando
2007-01-25 7:58 ` Avi Kivity
3 siblings, 0 replies; 7+ messages in thread
From: dormando @ 2007-01-25 1:43 UTC (permalink / raw)
To: Jeremy Katz; +Cc: kvm-devel
For what it's worth, I'm seeing this too. However instead of a kernel
panic usually the screen just locks, and the keyboard lights start
blinking on the laptop :)
I have had success unloading both kvm_intel and kvm within the suspend
scripts, then reloading after unsuspend.
Jeremy Katz wrote:
> When using kvm on my laptop, I get the following oops if I try using kvm
> after a suspend (ACPI S3)/resume cycle. At first I thought it went away
> if I unloaded the module before suspending and then reloading it
> afterwards, but I can't reproduce that working now, so I might have just
> been hallucinating. Thoughts of things to try?
>
> invalid opcode: 0000 [#1]
> SMP
> last sysfs file: /class/net/lo/ifindex
> Modules linked in: ipw3945 ieee80211 ieee80211_crypt rfcomm hidp l2cap
> ohci1394 ieee1394 button kvm_intel tun kvm i915 drm autofs4 sunrpc
> bridge dummy nf_conntrack_netbios_ns ipt_REJECT nf_conntrack_ipv4
> xt_state nf_conntrack nfnetlink xt_tcpudp iptable_filter ip_tables
> x_tables cpufreq_ondemand video sbs i2c_ec dock battery asus_acpi
> backlight ac ipv6 parport_pc lp parport snd_hda_intel snd_hda_codec
> snd_seq_dummy snd_seq_oss snd_seq_midi_event snd_seq snd_seq_device
> snd_pcm_oss hci_usb snd_mixer_oss sr_mod snd_pcm cdrom sdhci e100
> snd_timer bluetooth serio_raw mmc_core mii snd soundcore snd_page_alloc
> iTCO_wdt iTCO_vendor_support ata_piix i2c_i801 i2c_core ata_generic
> joydev sg dm_snapshot dm_zero dm_mirror dm_mod ahci libata sd_mod
> scsi_mod ext3 jbd mbcache ehci_hcd ohci_hcd uhci_hcd
> CPU: 0
> EIP: 0060:[<f8fb814c>] Not tainted VLI
> EFLAGS: 00010286 (2.6.19-1.2909.fc7 #1)
> EIP is at vmcs_clear+0x1b/0x46 [kvm_intel]
> eax: ef399d34 ebx: e6459000 ecx: e6459000 edx: 00000400
> esi: f0efc47c edi: 00000000 ebp: ef399d3c esp: ef399d24
> ds: 007b es: 007b ss: 0068
> Process qemu-kvm (pid: 5834, ti=ef399000 task=f0712030 task.ti=ef399000)
> Stack: f0efc47c 00000000 ef399d3c f8fb8c2f 26459000 00000000 ef399d4c
> f8fb92e8
> f0efc47c f0efc484 ef399f44 f8ee1f3c 00000000 00000000 f0efc000
> 00000000
> f72bba84 f185ef90 00000000 ef399db0 c04cffbd c21c336c 000a0000
> 0000004c
> Call Trace:
> [<c04051c9>] show_trace_log_lvl+0x1a/0x2f
> [<c0405279>] show_stack_log_lvl+0x9b/0xa3
> [<c0405415>] show_registers+0x194/0x26a
> [<c0405618>] die+0x12d/0x242
> [<c0605197>] do_trap+0x79/0x91
> [<c0405bbb>] do_invalid_op+0x97/0xa1
> [<c0604f6c>] error_code+0x7c/0x84
> [<f8fb92e8>] vmx_create_vcpu+0x54/0x97 [kvm_intel]
> [<f8ee1f3c>] kvm_dev_ioctl+0x16a/0x1150 [kvm]
> [<c0482e72>] do_ioctl+0x22/0x67
> [<c0483109>] vfs_ioctl+0x252/0x265
> [<c0483165>] sys_ioctl+0x49/0x64
> [<c0404058>] syscall_call+0x7/0xb
> =======================
> Code: c0 ff 05 20 da ee f8 eb 05 b8 01 00 00 00 5d c3 55 89 c1 89 e5 83
> ec 18 8d 80 00 00 00 40 89 45 f8 8d 45 f8 c7 45 fc 00 00 00 00 <66> 0f
> c7 30 0f 96 c0 84 c0 74 1e 8b 45 f8 8b 55 fc 89 4c 24 04
> EIP: [<f8fb814c>] vmcs_clear+0x1b/0x46 [kvm_intel] SS:ESP 0068:ef399d24
>
>
>
> Jeremy
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> kvm-devel mailing list
> kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/kvm-devel
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Oops after resume from suspend
[not found] ` <1169676112.10817.13.camel-T9xAYgMuJli44ywRPIzf9A@public.gmane.org>
` (2 preceding siblings ...)
2007-01-25 1:43 ` dormando
@ 2007-01-25 7:58 ` Avi Kivity
[not found] ` <45B86338.8050306-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
3 siblings, 1 reply; 7+ messages in thread
From: Avi Kivity @ 2007-01-25 7:58 UTC (permalink / raw)
To: Jeremy Katz; +Cc: kvm-devel
Jeremy Katz wrote:
> When using kvm on my laptop, I get the following oops if I try using kvm
> after a suspend (ACPI S3)/resume cycle. At first I thought it went away
> if I unloaded the module before suspending and then reloading it
> afterwards, but I can't reproduce that working now, so I might have just
> been hallucinating. Thoughts of things to try?
>
Module unload/reload should work. Can you try adding printks in
hardware_disable() and hardware_enable()?
For real suspend support, we need to flush any cached state on Intel
cpus (vmcs_clear), and to do the hardware_disable()/hardware_enable()
cycle. Should be easy.
--
error compiling committee.c: too many arguments to function
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Oops after resume from suspend
[not found] ` <45B86338.8050306-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
@ 2007-01-25 20:09 ` Jeremy Katz
[not found] ` <45B90E61.2090304-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 7+ messages in thread
From: Jeremy Katz @ 2007-01-25 20:09 UTC (permalink / raw)
To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
[-- Attachment #1: Type: text/plain, Size: 1082 bytes --]
Avi Kivity wrote:
> Jeremy Katz wrote:
>> When using kvm on my laptop, I get the following oops if I try using kvm
>> after a suspend (ACPI S3)/resume cycle. At first I thought it went away
>> if I unloaded the module before suspending and then reloading it
>> afterwards, but I can't reproduce that working now, so I might have just
>> been hallucinating. Thoughts of things to try?
>
> Module unload/reload should work. Can you try adding printks in
> hardware_disable() and hardware_enable()?
Okay, what was going wrong with reloading was the difference between -
and _ with module naming :-/ *sigh* Actually getting the module
unloaded then makes things work fine.
> For real suspend support, we need to flush any cached state on Intel
> cpus (vmcs_clear), and to do the hardware_disable()/hardware_enable()
> cycle. Should be easy.
The obvious approach (attached) fails to resume -- there may be console
output, but hard to tell on my laptop. I'll dig up a box with a serial
port to try there and see if I get something across serial console with it.
Jeremy
[-- Attachment #2: kvm-suspend.patch --]
[-- Type: text/x-patch, Size: 1646 bytes --]
Index: kvm_main.c
===================================================================
--- kvm_main.c (revision 4328)
+++ kvm_main.c (working copy)
@@ -26,6 +26,7 @@
#include <asm/msr.h>
#include <linux/mm.h>
#include <linux/miscdevice.h>
+#include <linux/sysdev.h>
#include <linux/vmalloc.h>
#include <asm/uaccess.h>
#include <linux/reboot.h>
@@ -2052,6 +2053,29 @@
.priority = 0,
};
+static int kvm_suspend(struct sys_device *dev, pm_message_t state)
+{
+ on_each_cpu(kvm_arch_ops->hardware_disable, 0, 0, 1);
+ return 0;
+}
+
+static int kvm_resume(struct sys_device *dev)
+{
+ on_each_cpu(kvm_arch_ops->hardware_enable, 0, 0, 1);
+ return 0;
+}
+
+static struct sysdev_class kvm_sysclass = {
+ .resume = kvm_resume,
+ .suspend = kvm_suspend,
+ set_kset_name("kvm"),
+};
+
+static struct sys_device kvm_sysdevice = {
+ .id = 0,
+ .cls = &kvm_sysclass,
+};
+
static __init void kvm_init_debug(void)
{
struct kvm_stats_debugfs_item *p;
@@ -2100,6 +2124,13 @@
on_each_cpu(kvm_arch_ops->hardware_enable, 0, 0, 1);
register_reboot_notifier(&kvm_reboot_notifier);
+ r = sysdev_class_register(&kvm_sysclass);
+ if (r)
+ return r;
+ r = sysdev_register(&kvm_sysdevice);
+ if (r)
+ return r;
+
kvm_chardev_ops.owner = module;
r = misc_register(&kvm_dev);
@@ -2121,6 +2152,9 @@
{
misc_deregister(&kvm_dev);
+ sysdev_unregister(&kvm_sysdevice);
+ sysdev_class_unregister(&kvm_sysclass);
+
unregister_reboot_notifier(&kvm_reboot_notifier);
on_each_cpu(kvm_arch_ops->hardware_disable, 0, 0, 1);
kvm_arch_ops->hardware_unsetup();
[-- Attachment #3: Type: text/plain, Size: 347 bytes --]
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
[-- Attachment #4: Type: text/plain, Size: 186 bytes --]
_______________________________________________
kvm-devel mailing list
kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/kvm-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Oops after resume from suspend
[not found] ` <45B90E61.2090304-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2007-01-26 18:12 ` Avi Kivity
0 siblings, 0 replies; 7+ messages in thread
From: Avi Kivity @ 2007-01-26 18:12 UTC (permalink / raw)
To: Jeremy Katz; +Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
Jeremy Katz wrote:
> Avi Kivity wrote:
>> Jeremy Katz wrote:
>>> When using kvm on my laptop, I get the following oops if I try using
>>> kvm
>>> after a suspend (ACPI S3)/resume cycle. At first I thought it went
>>> away
>>> if I unloaded the module before suspending and then reloading it
>>> afterwards, but I can't reproduce that working now, so I might have
>>> just
>>> been hallucinating. Thoughts of things to try?
>>
>> Module unload/reload should work. Can you try adding printks in
>> hardware_disable() and hardware_enable()?
>
> Okay, what was going wrong with reloading was the difference between -
> and _ with module naming :-/ *sigh* Actually getting the module
> unloaded then makes things work fine.
I was bitten by this too...
>
>> For real suspend support, we need to flush any cached state on Intel
>> cpus (vmcs_clear), and to do the hardware_disable()/hardware_enable()
>> cycle. Should be easy.
>
> The obvious approach (attached) fails to resume -- there may be
> console output, but hard to tell on my laptop. I'll dig up a box with
> a serial port to try there and see if I get something across serial
> console with it.
It also needs cpu hotplug support, and some work to decache the vmcs on
Intel hosts. I have this three-quarters working now.
--
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2007-01-26 18:12 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-24 22:01 Oops after resume from suspend Jeremy Katz
[not found] ` <1169676112.10817.13.camel-T9xAYgMuJli44ywRPIzf9A@public.gmane.org>
2007-01-24 22:14 ` Dor Laor
2007-01-24 22:22 ` Anthony Liguori
2007-01-25 1:43 ` dormando
2007-01-25 7:58 ` Avi Kivity
[not found] ` <45B86338.8050306-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-01-25 20:09 ` Jeremy Katz
[not found] ` <45B90E61.2090304-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2007-01-26 18:12 ` Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox