From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:60358) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBzc1-0000hb-K5 for qemu-devel@nongnu.org; Wed, 12 Sep 2012 22:57:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TBzc0-00006Q-14 for qemu-devel@nongnu.org; Wed, 12 Sep 2012 22:57:05 -0400 From: David Gibson Date: Thu, 13 Sep 2012 12:57:16 +1000 Message-Id: <1347505041-27411-9-git-send-email-david@gibson.dropbear.id.au> In-Reply-To: <1347505041-27411-1-git-send-email-david@gibson.dropbear.id.au> References: <1347505041-27411-1-git-send-email-david@gibson.dropbear.id.au> Subject: [Qemu-devel] [PATCH 08/13] pseries: Small cleanup to H_CEDE implementation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: agraf@suse.de Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, David Gibson The H_CEDE hypercall implementation for the pseries machine doesn't trigger quite the right path in the main cpu exec loop. We should set exit_request to pop up one extra level and recheck state, and we should set the exception_index to EXCP_HLT (H_CEDE is roughly equivalent to the hlt instruction on x86). In practice, this doesn't really matter except for KVM, and KVM implements H_CEDE internally so we never hit this code path. But we might as well get it right, just in case it matters some day. Signed-off-by: David Gibson --- hw/spapr_hcall.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/spapr_hcall.c b/hw/spapr_hcall.c index a5990a9..407791d 100644 --- a/hw/spapr_hcall.c +++ b/hw/spapr_hcall.c @@ -545,6 +545,8 @@ static target_ulong h_cede(CPUPPCState *env, sPAPREnvironment *spapr, hreg_compute_hflags(env); if (!cpu_has_work(env)) { env->halted = 1; + env->exception_index = EXCP_HLT; + env->exit_request = 1; } return H_SUCCESS; } -- 1.7.10.4