From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:40065) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbCDM-0006h1-IS for qemu-devel@nongnu.org; Wed, 21 Nov 2012 10:27:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TbCDE-0006xP-E8 for qemu-devel@nongnu.org; Wed, 21 Nov 2012 10:27:48 -0500 Received: from e06smtp18.uk.ibm.com ([195.75.94.114]:42881) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TbCDE-0006wr-5m for qemu-devel@nongnu.org; Wed, 21 Nov 2012 10:27:40 -0500 Received: from /spool/local by e06smtp18.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 21 Nov 2012 15:27:38 -0000 Received: from d06av09.portsmouth.uk.ibm.com (d06av09.portsmouth.uk.ibm.com [9.149.37.250]) by b06cxnps4074.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id qALFRRqh57278564 for ; Wed, 21 Nov 2012 15:27:27 GMT Received: from d06av09.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id qALFRY2x010518 for ; Wed, 21 Nov 2012 08:27:35 -0700 Message-ID: <50ACF2E6.8000304@de.ibm.com> Date: Wed, 21 Nov 2012 16:27:34 +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> <50ACEE8A.8050302@de.ibm.com> <50ACF1B1.6050904@siemens.com> In-Reply-To: <50ACF1B1.6050904@siemens.com> 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: Jan Kiszka Cc: Jens Freimann , Heinz Graalfs , "Jason J. herne" , Alexander Graf , qemu-devel On 21/11/12 16:22, Jan Kiszka wrote: > On 2012-11-21 16:08, Christian Borntraeger wrote: >> 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. >> > > The challenge is defining those levels generically - as it is also > generic code that calls cpu_synchronize_state. What levels do you have > in mind? And where would they be applied? I think that RUNTIME_STATE and FULL_STATE would be sufficient for the needs that I have. The registers that I need during runtime can be accessed quite fast, but for life migration I also need those registers that are accessed via ONE_REG or other ioctls. Christian