From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58312) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UiBUH-0000VK-Cd for qemu-devel@nongnu.org; Thu, 30 May 2013 18:38:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UiBUE-0008T6-OJ for qemu-devel@nongnu.org; Thu, 30 May 2013 18:38:25 -0400 Received: from mail-pd0-f169.google.com ([209.85.192.169]:58693) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UiBUE-0008St-Ht for qemu-devel@nongnu.org; Thu, 30 May 2013 18:38:22 -0400 Received: by mail-pd0-f169.google.com with SMTP id y11so1145211pdj.0 for ; Thu, 30 May 2013 15:38:21 -0700 (PDT) Date: Thu, 30 May 2013 15:38:19 -0700 From: Christoffer Dall Message-ID: <20130530223819.GA1553@ubuntu> References: <1368797037-26976-1-git-send-email-peter.maydell@linaro.org> <1368797037-26976-4-git-send-email-peter.maydell@linaro.org> <20130530221354.GA57588@ubuntu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH 3/7] target-arm: mark up cpregs for no-migrate or raw access List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: qemu-devel@nongnu.org, Juan Quintela , kvmarm@lists.cs.columbia.edu, patches@linaro.org On Thu, May 30, 2013 at 11:27:01PM +0100, Peter Maydell wrote: > On 30 May 2013 23:13, Christoffer Dall wrote: > > What happens with registers which don't have the raw_write function set > > (even though the write function imposes some access checks or has side > > effects) and also is not marked as ARM_CP_NO_MIGRATE, > > In the general case what happens is that we probably don't > sync (or migrate, for TCG) the register properly, because > we'll use the standard write function and get whatever it > does. (Note that mistakes in annotation don't affect KVM > migration because we always trust the kernel's register > list and values and work with them directly; we don't indirect > through the TCG CPUState structures to migrate the data.) > > The alternative would seem to be to require a raw_read/write > function to be explicitly specified if there's a read/write > function (even if it's specified to be the same thing), but > that seemed to me like it would add a lot of boilerplate for > most register descriptions. Do you think it would be better > anyway, or do you have a better idea? Depends on how many places you add the raw functions. I was thinking about whether the absence of such a function could substitute the need for the NO_MIGRATE flag, but, eh, there's probably other uses for having that flag so it's not really preferred. You probably did the best thing. > > > CONTEXTIDR seems to be such an example. ? > > In this specific case I decided it was safe to let the non-raw > write function do a tlb_flush(). Looking again that is kinda > expensive though, so we should probably mark these registers > up with raw_write functions. > Migration is sort of an expensive operation, so not sure if it's worth it. I am mostly worries about the case where we would miss raw read/write functions and that could be hard to track down in the case where migration fails, but I don't really have great suggestions on how to ensure this. -Christoffer