Skip to contentSkip to conversation

error while loading state for instance 0x0 of device 'kvmclock'

DISCUSSION Jan Kiszka 5 participants 6 messages Nov 2, 2009 – Nov 3, 2009 KVM

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

Hi,

current qemu-kvm.git gives me the message "qemu: warning: error while loading state for instance 0x0 of device 'kvmclock'" when I run a simple "savevm" followed by a "loadvm 1". What's broken here?

Jan

#1 lore raw
Quoted 5 lines · Jan Kiszka

Hi,

current qemu-kvm.git gives me the message "qemu: warning: error while loading state for instance 0x0 of device 'kvmclock'" when I run a simple "savevm" followed by a "loadvm 1". What's broken here?

OK, this is due to "KVM: add flags to kvm_clock_data" (958b0c5497): the flags field is not cleared on KVM_SET_CLOCK. Will post a fix.

But the above kernel commit is also broken: KVM_GET_CLOCK checks uninitialized user_ns.flags (probably instead of the user's value). This raises the question if the caller of KVM_GET_CLOCK is also supposed to pass kvm_clock_data with flags cleared down to the kernel. Could someone clarify this so I could fix it accordingly?

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
#2 lore raw
Quoted 8 lines · Jan Kiszka
Quoted 6 lines · Jan Kiszka

Hi,

current qemu-kvm.git gives me the message "qemu: warning: error while loading state for instance 0x0 of device 'kvmclock'" when I run a simple "savevm" followed by a "loadvm 1". What's broken here?

Quoted 9 lines

OK, this is due to "KVM: add flags to kvm_clock_data" (958b0c5497): the flags field is not cleared on KVM_SET_CLOCK. Will post a fix.

But the above kernel commit is also broken: KVM_GET_CLOCK checks uninitialized user_ns.flags (probably instead of the user's value). This raises the question if the caller of KVM_GET_CLOCK is also supposed to pass kvm_clock_data with flags cleared down to the kernel. Could someone clarify this so I could fix it accordingly?

I'd make KVM_GET_CLOCK set the flags, not get them. So if we add new fields, we just set a new bit and userspace can read it.

Signature · 1 line
error compiling committee.c: too many arguments to function
#3 lore raw
Quoted 19 lines · Avi Kivity
Quoted 8 lines · Jan Kiszka
Quoted 6 lines · Jan Kiszka

Hi,

current qemu-kvm.git gives me the message "qemu: warning: error while loading state for instance 0x0 of device 'kvmclock'" when I run a simple "savevm" followed by a "loadvm 1". What's broken here?

Quoted 9 lines

OK, this is due to "KVM: add flags to kvm_clock_data" (958b0c5497): the flags field is not cleared on KVM_SET_CLOCK. Will post a fix.

But the above kernel commit is also broken: KVM_GET_CLOCK checks uninitialized user_ns.flags (probably instead of the user's value). This raises the question if the caller of KVM_GET_CLOCK is also supposed to pass kvm_clock_data with flags cleared down to the kernel. Could someone clarify this so I could fix it accordingly?

Quoted 2 lines

I'd make KVM_GET_CLOCK set the flags, not get them. So if we add new fields, we just set a new bit and userspace can read it.

This makes sense and actually fixes the issue completely. Patch on its way...

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
#4 lore raw
Quoted 20 lines · Jan Kiszka
Quoted 19 lines · Avi Kivity
Quoted 17 lines · Jan Kiszka
Quoted 6 lines · Jan Kiszka

Hi,

current qemu-kvm.git gives me the message "qemu: warning: error while loading state for instance 0x0 of device 'kvmclock'" when I run a simple "savevm" followed by a "loadvm 1". What's broken here?

OK, this is due to "KVM: add flags to kvm_clock_data" (958b0c5497): the flags field is not cleared on KVM_SET_CLOCK. Will post a fix.

But the above kernel commit is also broken: KVM_GET_CLOCK checks uninitialized user_ns.flags (probably instead of the user's value). This raises the question if the caller of KVM_GET_CLOCK is also supposed to pass kvm_clock_data with flags cleared down to the kernel. Could someone clarify this so I could fix it accordingly?

Quoted 5 lines
Quoted 2 lines

I'd make KVM_GET_CLOCK set the flags, not get them. So if we add new fields, we just set a new bit and userspace can read it.

This makes sense and actually fixes the issue completely. Patch on its way...

agreed. This is the best behaviour I can devise, indeed.

#5 lore raw
In reply to Jan Kiszka
Quoted 7 lines · Jan Kiszka
Quoted 5 lines · Jan Kiszka

Hi,

current qemu-kvm.git gives me the message "qemu: warning: error while loading state for instance 0x0 of device 'kvmclock'" when I run a simple "savevm" followed by a "loadvm 1". What's broken here?

Quoted 8 lines

OK, this is due to "KVM: add flags to kvm_clock_data" (958b0c5497): the flags field is not cleared on KVM_SET_CLOCK. Will post a fix.

But the above kernel commit is also broken: KVM_GET_CLOCK checks uninitialized user_ns.flags (probably instead of the user's value). This raises the question if the caller of KVM_GET_CLOCK is also supposed to pass kvm_clock_data with flags cleared down to the kernel. Could someone clarify this so I could fix it accordingly?

Yes userspace is supposed to clear flags. My bad.