Skip to contentSkip to conversation

Problems on AMD laptops

DISCUSSION Avi Kivity 2 participants 4 messages Jun 29, 2009 KVM

lore
Share & tools
lore

Avi Kivity

author
#0 lore raw

kerneloops.org shows tons of oopses on amd, see http://www.kerneloops.org/oops.php?number=79008. I suspect this has to do with resuming a laptop while a guest is running. Can anyone confirm or deny?

Signature · 1 line
error compiling committee.c: too many arguments to function
author
#2 lore raw
In reply to Joerg Roedel
Quoted 10 lines · Joerg Roedel
Quoted 5 lines · Avi Kivity

kerneloops.org shows tons of oopses on amd, see
http://www.kerneloops.org/oops.php?number=79008. I suspect this has to do with resuming a laptop while a guest is running. Can anyone confirm or deny?

I havn't verified this yet but it may have to do with dirty caches that are not written back to memory in suspend-to-ram and are thus lost.

Wouldn't that kill resume generally, not just kvm on amd?

Quoted 5 lines

The
resume code-path looks otherwise sane to me. The only thing I can imagine is that a bit in the cpu_hardware_enabled cpumask is wrong after resume.

I saw some of these oopses on cpu 0, which had better be plugged in.

Quoted 4 lines

Btw. it is guaranteed that with cpu-hotplug the cpu isn't already executing processes when the CPU_ONLINE event call chain is called? At least the CPU is marked online and active at that point in time.

Yes:

static struct notifier_block kvm_cpu_notifier = {
.notifier_call = kvm_cpu_hotplug, .priority = 20, /* must be > scheduler priority */
};

One thing I think is missing is a call to svm_cpu_init() on real hotplug.

Signature · 1 line
error compiling committee.c: too many arguments to function
#1 lore raw
In reply to Avi Kivity
Quoted 4 lines · Avi Kivity

kerneloops.org shows tons of oopses on amd, see
http://www.kerneloops.org/oops.php?number=79008. I suspect this has to do with resuming a laptop while a guest is running. Can anyone confirm or deny?

I havn't verified this yet but it may have to do with dirty caches that are not written back to memory in suspend-to-ram and are thus lost. The resume code-path looks otherwise sane to me. The only thing I can imagine is that a bit in the cpu_hardware_enabled cpumask is wrong after resume.
Btw. it is guaranteed that with cpu-hotplug the cpu isn't already executing processes when the CPU_ONLINE event call chain is called? At least the CPU is marked online and active at that point in time.

Joerg

#3 lore raw
In reply to Avi Kivity
Quoted 9 lines · Avi Kivity
Quoted 8 lines · Joerg Roedel
Quoted 5 lines · Avi Kivity

kerneloops.org shows tons of oopses on amd, see
http://www.kerneloops.org/oops.php?number=79008. I suspect this has to do with resuming a laptop while a guest is running. Can anyone confirm or deny?

Quoted 4 lines
Quoted 2 lines

I havn't verified this yet but it may have to do with dirty caches that are not written back to memory in suspend-to-ram and are thus lost.

Wouldn't that kill resume generally, not just kvm on amd?

Its a race condition which may be more likely on one hardware than on another. I remember similar bugs fixed by Mark in the past.

Quoted 7 lines
Quoted 5 lines

The
resume code-path looks otherwise sane to me. The only thing I can imagine is that a bit in the cpu_hardware_enabled cpumask is wrong after resume.

I saw some of these oopses on cpu 0, which had better be plugged in.

Yeah, but if this bit is set to 0 on suspend and this change does not make it from cache to main memory it can still be 1 on resume. And virtualization hardware will not be re-enabled then.
Anyway, this was only a guess from me. I think we should reproduce this oops and find out what is really going on.

Quoted 11 lines
Quoted 4 lines

Btw. it is guaranteed that with cpu-hotplug the cpu isn't already executing processes when the CPU_ONLINE event call chain is called? At least the CPU is marked online and active at that point in time.

Yes:

static struct notifier_block kvm_cpu_notifier = {
.notifier_call = kvm_cpu_hotplug, .priority = 20, /* must be > scheduler priority */
};

Ok.

Quoted 1 line

One thing I think is missing is a call to svm_cpu_init() on real hotplug.

Yes, true. There is no svm_data allocated for cpus not online on module load.

Joerg