From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:35145) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbBvJ-0004oo-12 for qemu-devel@nongnu.org; Wed, 21 Nov 2012 10:09:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TbBvD-00016y-96 for qemu-devel@nongnu.org; Wed, 21 Nov 2012 10:09:08 -0500 Received: from e06smtp10.uk.ibm.com ([195.75.94.106]:42285) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbBvD-00016o-0O for qemu-devel@nongnu.org; Wed, 21 Nov 2012 10:09:03 -0500 Received: from /spool/local by e06smtp10.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 21 Nov 2012 15:09:01 -0000 Received: from d06av05.portsmouth.uk.ibm.com (d06av05.portsmouth.uk.ibm.com [9.149.37.229]) by b06cxnps4075.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id qALF8pwK10485840 for ; Wed, 21 Nov 2012 15:08:51 GMT Received: from d06av05.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id qALF8wnT016120 for ; Wed, 21 Nov 2012 08:08:59 -0700 Message-ID: <50ACEE8A.8050302@de.ibm.com> Date: Wed, 21 Nov 2012 16:08:58 +0100 From: Christian Borntraeger MIME-Version: 1.0 References: <1353509165-26865-1-git-send-email-borntraeger@de.ibm.com> <1353509165-26865-2-git-send-email-borntraeger@de.ibm.com> <50ACEB95.7090300@suse.de> <50ACEC4F.4050109@de.ibm.com> <50ACECE9.4000004@suse.de> <50ACED48.3050308@de.ibm.com> <50ACEE12.4000800@suse.de> In-Reply-To: <50ACEE12.4000800@suse.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/3] s390/migration: Provide a cpu save for initial life migration work List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: Jan Kiszka , Jens Freimann , Heinz Graalfs , qemu-devel , "Jason J. herne" On 21/11/12 16:06, Alexander Graf wrote: [...] >>>>>> +static int cpu_post_load(void *opaque, int version_id) >>>>>> +{ >>>>>> + CPUS390XState *env = opaque; >>>>>> + struct kvm_fpu fpu; >>>>>> + int i, r; >>>>>> + >>>>>> + if (!kvm_enabled()) { >>>>>> + return 0; >>>>>> + } >>>>>> + >>>>>> + for (i = 0; i< 16; i++) { >>>>>> + fpu.fprs[i] = env->fregs[i].ll; >>>>>> + } >>>>>> + fpu.fpc = env->fpc; >>>>>> + >>>>>> + r = kvm_vcpu_ioctl(env, KVM_SET_FPU,&fpu); >>>>>> + assert(r == 0); >>>>>> + >>>>>> + return 0; >>>>>> +} >>>>> The kvm register sync needs to happen in the kvm register sync function :) >>>> That would eliminate the whole purpose of sync regs and forces us to have an >>>> expensive ioctl on lots of exits (again). I would prefer to sync the registers >>>> that we never need in qemu just here. >>> That's why the register sync has different stages. >> Not the get_register. Which is called on every synchronize_state. Which happen quite often >> on s390. > > Sounds like bad design then :). > > Maybe we should explicitly tell the register synchronization which register sets to sync, so that we don't waste time getting _all_ the state every time we sync registers? Yes, a level statement for kvm_arch_get_registers would be good.