Received: from eggs.gnu.org ([208.118.235.92]:34595) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJlvZ-00027y-Iy for qemu-devel@nongnu.org; Thu, 04 Oct 2012 09:57:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TJlvO-00065C-0Y for qemu-devel@nongnu.org; Thu, 04 Oct 2012 09:57:23 -0400 From: Alexander Graf Date: Thu, 4 Oct 2012 15:56:39 +0200 Message-Id: <1349359016-13107-18-git-send-email-agraf@suse.de> In-Reply-To: <1349359016-13107-1-git-send-email-agraf@suse.de> References: <1349359016-13107-1-git-send-email-agraf@suse.de> Subject: [Qemu-devel] [PATCH 17/34] pseries: Small cleanup to H_CEDE implementation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel qemu-devel Cc: Blue Swirl , "qemu-ppc@nongnu.org List" , Aurelien Jarno , David Gibson From: 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 Signed-off-by: Alexander Graf --- hw/spapr_hcall.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/hw/spapr_hcall.c b/hw/spapr_hcall.c index abd847f..2df94d1 100644 --- a/hw/spapr_hcall.c +++ b/hw/spapr_hcall.c @@ -544,6 +544,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.6.0.2