Commit becfc3904194e76436ad0a60c2dde148e1927e4c

Authored by aliguori
1 parent 57951c27

KVM: simplify kvm_cpu_exec hook

We don't need to use cpu_loop_exit() because we never use the 
condition codes so everything can be folded into a single case.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>



git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5669 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 2 changed files with 7 additions and 10 deletions
cpu-exec.c
... ... @@ -369,16 +369,8 @@ int cpu_exec(CPUState *env1)
369 369 #endif
370 370  
371 371 if (kvm_enabled()) {
372   - int ret;
373   - ret = kvm_cpu_exec(env);
374   - if ((env->interrupt_request & CPU_INTERRUPT_EXIT)) {
375   - env->interrupt_request &= ~CPU_INTERRUPT_EXIT;
376   - env->exception_index = EXCP_INTERRUPT;
377   - cpu_loop_exit();
378   - } else if (env->halted) {
379   - cpu_loop_exit();
380   - } else
381   - longjmp(env->jmp_env, 1);
  372 + kvm_cpu_exec(env);
  373 + longjmp(env->jmp_env, 1);
382 374 }
383 375  
384 376 next_tb = 0; /* force lookup of first TB */
... ...
kvm-all.c
... ... @@ -298,6 +298,11 @@ int kvm_cpu_exec(CPUState *env)
298 298 }
299 299 } while (ret > 0);
300 300  
  301 + if ((env->interrupt_request & CPU_INTERRUPT_EXIT)) {
  302 + env->interrupt_request &= ~CPU_INTERRUPT_EXIT;
  303 + env->exception_index = EXCP_INTERRUPT;
  304 + }
  305 +
301 306 return ret;
302 307 }
303 308  
... ...