On Thu, May 30, 2013 at 11:27:01PM +0100, Peter Maydell wrote: > On 30 May 2013 23:13, Christoffer Dall <christoffer.dall@xxxxxxxxxx> 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 _______________________________________________ kvmarm mailing list kvmarm@xxxxxxxxxxxxxxxxxxxxx https://lists.cs.columbia.edu/cucslists/listinfo/kvmarm