qemu-irix/target-ppc
David Gibson 08e642c00e ppc: Fix bug in handling of PAPR hypercall exits
Currently for powerpc, kvm_arch_handle_exit() always returns 1, meaning
that its caller - kvm_cpu_exec() - will always exit immediately afterwards
to the loop in qemu_kvm_cpu_thread_fn().

There's no need to do this.  Once we've handled the hypercall there's no
reason we can't go straight around and KVM_RUN again, which is what ret = 0
will signal.  The only exception might be for hypercalls which affect the
state of cpu_can_run(), however the only one that might do this is H_CEDE
and for kvm that is always handled in the kernel, not qemu.

Furtherm setting ret = 0 means that when exit_requested is set from a
hypercall, we will enter KVM_RUN once more with a signal which lets the
the kernel do its internal logic to complete the hypercall with out
actually executing any more guest code.  This is important if our hypercall
also triggered a reset, which previously would re-initialize everything
without completing the hypercall.  This caused the kernel to get confused
because it thought the guest was still in the middle of a hypercall when
it has actually been reset.

This patch therefore changes to ret = 0, which is both a bugfix and a small
optimization.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
(cherry picked from commit 78e8fde26c)

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2012-08-21 15:36:34 -05:00
..
STATUS Fix typos in comments (chek -> check) 2011-05-22 22:31:45 +01:00
cpu-qom.h target-ppc: QOM'ify CPU 2012-04-15 17:10:30 +02:00
cpu.h target-ppc: QOM'ify CPU 2012-04-15 17:10:30 +02:00
helper.c target-ppc: Some support for dumping TLB_EMB TLBs 2012-05-01 21:47:01 +02:00
helper.h PPC: E500: Implement msgsnd 2012-02-02 02:47:47 +01:00
helper_regs.h
kvm.c ppc: Fix bug in handling of PAPR hypercall exits 2012-08-21 15:36:34 -05:00
kvm_ppc.c Replace Qemu by QEMU in comments 2012-04-07 14:00:45 +00:00
kvm_ppc.h target-ppc: Add hooks for handling tcg and kvm limitations 2012-04-15 17:09:54 +02:00
machine.c target-ppc/machine.c: Drop unnecessary ifdefs 2012-04-15 18:23:47 +02:00
mfrom_table.c
mfrom_table_gen.c fix spelling in target sub directory 2011-12-02 10:50:57 +00:00
op_helper.c Use uintptr_t for various op related functions 2012-04-14 14:23:37 +00:00
translate.c target-ppc: QOM'ify CPU reset 2012-04-15 17:12:09 +02:00
translate_init.c PPC: Fix up e500 cache size setting 2012-05-01 21:47:00 +02:00