Subject: [RFC PATCH 1/1] KVM: ARM: add vgic state save and restore support

From: [email-masked] (Rusty Russell)
Date: Tue, 04 Dec 2012 11:44:11 +1030

Peter Maydell <[email-masked]> writes:
> On 3 December 2012 10:36, Dong Aisheng <[email-masked]> wrote:
>> and via current ONE_REG interface we do not know which CPU
>> is performing the register access, so the banked registers are not
>> suppported well,
>
> Actually you do, because it's a vcpu ioctl. That does raise a
> different question, though. ONE_REG is currently aimed as a vcpu
> ioctl for CPU state save/restore -- how does it need to change
> to handle device state save/restore where the device is not per-cpu?

Good question.  I'd prefer to stretch the existing interface, than
create an identical one for non-per-cpu resources, but I could be swayed
if there were many other cases.

The simplest method is to give it a new type and mirror the non-per-cpu
regs on all vcpus.  Then a completely naive implementation save/restore
will Just Work, with redundant data.  Or we could pick a CPU, but that
means your discovery logic becomes more complex unless you know which
CPU it is (lowest number?).

Cheers,
Rusty.