projects
/
sdk
/
emulator
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ced6c05
)
kvm: validate context for kvm cpu get/put operations
author
Jan Kiszka
<jan.kiszka@siemens.com>
Tue, 4 May 2010 12:45:26 +0000
(09:45 -0300)
committer
Marcelo Tosatti
<mtosatti@redhat.com>
Tue, 11 May 2010 17:02:22 +0000
(14:02 -0300)
Validate that KVM vcpu state is only read/written from cpu thread itself
or that cpu is stopped.
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
target-i386/kvm.c
patch
|
blob
|
history
diff --git
a/target-i386/kvm.c
b/target-i386/kvm.c
index f73b47b97c8d5b1fe6bf63d1dfda5699940212d1..c9ec72eee79fc5cce922e05b95a5ed13be9930d8 100644
(file)
--- a/
target-i386/kvm.c
+++ b/
target-i386/kvm.c
@@
-949,6
+949,8
@@
int kvm_arch_put_registers(CPUState *env, int level)
{
int ret;
+ assert(cpu_is_stopped(env) || qemu_cpu_self(env));
+
ret = kvm_getput_regs(env, 1);
if (ret < 0)
return ret;
@@
-991,6
+993,8
@@
int kvm_arch_get_registers(CPUState *env)
{
int ret;
+ assert(cpu_is_stopped(env) || qemu_cpu_self(env));
+
ret = kvm_getput_regs(env, 0);
if (ret < 0)
return ret;