From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44952) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YipnQ-0005fh-Fo for qemu-devel@nongnu.org; Thu, 16 Apr 2015 15:49:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YipnL-0003lR-FE for qemu-devel@nongnu.org; Thu, 16 Apr 2015 15:49:56 -0400 Received: from e18.ny.us.ibm.com ([129.33.205.208]:33935) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YipnL-0003lL-Bf for qemu-devel@nongnu.org; Thu, 16 Apr 2015 15:49:51 -0400 Received: from /spool/local by e18.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 16 Apr 2015 15:49:50 -0400 Message-ID: <5530125A.8030408@linux.vnet.ibm.com> Date: Thu, 16 Apr 2015 15:49:46 -0400 From: Stefan Berger MIME-Version: 1.0 References: <552FE6C8.106@linux.vnet.ibm.com> <5530108F.9000607@ilande.co.uk> In-Reply-To: <5530108F.9000607@ilande.co.uk> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] ppc64 not resuming with v2.3.0-rc3 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mark Cave-Ayland , agraf@suse.de, qemu-devel , qemu-ppc@nongnu.org On 04/16/2015 03:42 PM, Mark Cave-Ayland wrote: > On 16/04/15 17:43, Stefan Berger wrote: > >> The culprit patch seems to be the following commit. If I remove these >> changes from the tip of the tree it works again (on SLOF level): >> >> commit 2360b6e84f78d41fa0f76555a947148b73645259 >> Author: Mark Cave-Ayland >> Date: Mon Feb 9 22:40:48 2015 +0000 >> >> target-ppc: force update of msr bits in cpu_post_load >> >> Since env->msr has already been restored by the time cpu_post_load >> is called, >> make sure that ppc_store_msr() is explicitly called with all msr >> bits except >> MSR_TGPR marked as invalid. >> >> This solves the issue where MSR flags aren't set correctly when >> restoring a VM >> snapshot, in particular the internal env->excp_prefix value when >> MSR_EP has >> been altered by a guest. >> >> Signed-off-by: Mark Cave-Ayland >> Signed-off-by: Alexander Graf >> >> diff --git a/target-ppc/machine.c b/target-ppc/machine.c >> index c801b82..3921012 100644 >> --- a/target-ppc/machine.c >> +++ b/target-ppc/machine.c >> @@ -159,6 +159,7 @@ static int cpu_post_load(void *opaque, int version_id) >> PowerPCCPU *cpu = opaque; >> CPUPPCState *env = &cpu->env; >> int i; >> + target_ulong msr; >> >> /* >> * We always ignore the source PVR. The user or management >> @@ -190,7 +191,12 @@ static int cpu_post_load(void *opaque, int version_id) >> /* Restore htab_base and htab_mask variables */ >> ppc_store_sdr1(env, env->spr[SPR_SDR1]); >> } >> - hreg_compute_hflags(env); >> + >> + /* Mark msr bits except MSR_TGPR invalid before restoring */ >> + msr = env->msr; >> + env->msr ^= ~(1ULL << MSR_TGPR); >> + ppc_store_msr(env, msr); >> + >> hreg_compute_mem_idx(env); >> >> return 0; >> >> >> Stefan >> >> PS: Sorry for the late notice (-rc3), but I only started doing things >> with ppc64 a few days ago. > Hmmmm the fix is correct in that internal MSR variables need to be > updated post-restore (as noted in the message above it was the exception > prefix variables that weren't updated by having MSR_EP set). > > Maybe on ppc64 there is another bit similar to MSR_TGPR that needs to be > excluded? Alex, any thoughts? I want to add that I am running QEMU for ppc64 in emulation mode on a x86_64 host. The suspend/resume problem, while in SLOF, did not exist in QEMU v2.2, so I anticipate that this is a regression would also be visible on QEMU on kvm, though a simple test on such a machine may show different... Removing the patch solves the problem while in SLOF. Once booting into Linux suspend/resume does not work - with qemu-system-ppc64 on x86_64 host. Timestamps shown by Linux actually make a jump backwards and ultimately Linux hangs. Stefan > > ATB, > > Mark. > >