From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Subject: Re: [PATCH] KVM: PPC: Save/Restore CR over vcpu_run Date: Mon, 5 Mar 2012 16:54:52 -0600 Message-ID: <4F55443C.1080406@freescale.com> References: <1330963334-5717-1-git-send-email-agraf@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: , To: Alexander Graf Return-path: Received: from am1ehsobe004.messaging.microsoft.com ([213.199.154.207]:9772 "EHLO am1outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757382Ab2CEWy5 (ORCPT ); Mon, 5 Mar 2012 17:54:57 -0500 In-Reply-To: <1330963334-5717-1-git-send-email-agraf@suse.de> Sender: kvm-owner@vger.kernel.org List-ID: On 03/05/2012 10:02 AM, Alexander Graf wrote: > @@ -442,6 +444,7 @@ heavyweight_exit: > > /* Return to kvm_vcpu_run(). */ > mtlr r5 > + mtcr r6 > addi r1, r1, HOST_STACK_SIZE > /* r3 still contains the return code from kvmppc_handle_exit(). */ > blr > @@ -459,6 +462,9 @@ _GLOBAL(__kvmppc_vcpu_run) > mflr r3 > PPC_STL r3, HOST_STACK_LR(r1) > > + mfcr r5 > + stw r5, HOST_CR(r1) If you move the mfcr before the PPC_STL they should be able to run in parallel. Otherwise on e500mc mfcr will wait for PPC_STL to take its 3 cycles and then mfcr will take 5 cyles before the stw of HOST_CR. Alternatively, consider using mcrf/mtocrf three times. Similar issues in booke_interrupts.S (except we can't assume mtocrf exists there), but I'm less worried about that one as it still needs an optimization pass in general. -Scott