From: Ian Campbell Subject: Re: [RFC v3 2/6] xen/arm: Add save/restore support for ARM GIC V2 Date: Wed, 14 May 2014 14:24:59 +0100 Message-ID: <1400073899.29366.115.camel@kazak.uk.xensource.com> References: <1399583908-21755-1-git-send-email-w1.huang@samsung.com> <1399583908-21755-3-git-send-email-w1.huang@samsung.com> <1400065670.29366.27.camel@kazak.uk.xensource.com> <53735C21.2080104@linaro.org> <20140514122300.GA61309@deinos.phlegethon.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20140514122300.GA61309@deinos.phlegethon.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Tim Deegan Cc: Wei Huang , keir@xen.org, stefano.stabellini@eu.citrix.com, andrew.cooper3@citrix.com, Julien Grall , ian.jackson@eu.citrix.com, jaeyong.yoo@samsung.com, xen-devel@lists.xen.org, jbeulich@suse.com, yjhyun.yoo@samsung.com List-Id: xen-devel@lists.xenproject.org On Wed, 2014-05-14 at 14:23 +0200, Tim Deegan wrote: > > >> + > > >> +/* Info for hypervisor to manage guests (per-vcpu) > > >> + * - Based on GICv2 > > >> + * - Mainly store registers of GICH_* > > >> + */ > > >> +struct hvm_arm_gich_v2 > > >> +{ > > >> + uint32_t gic_hcr; > > >> + uint32_t gic_vmcr; > > >> + uint32_t gic_apr; > > >> + uint32_t gic_lr[64]; > > >> + uint64_t event_mask; > > >> + uint64_t lr_mask; > > > > > > I don't think you should be saving any GICH state at all. What should be > > > saved is the corresponding GICC state, i.e. "architectural state" that > > > is observed by the guest. This might mean pickling stuff from the GICH > > > state into a GICC form. (I said this wrt the LRs in a previous round of > > > review) > > > > What are the advantage to save the GICC state rather than GICH? > > > > IIRC, the GICH state gives you a representation of the important bits of > > the GICC. Most of GICC can't be restore without any translation and > > writing in GICH (see gic_vmcr that is a collection of multiple GICC > > registers). It seems easier to use GICH state during migration. > > The GICC state is the architectural state of the virtual machine; > the GICH state is an implementation detail of how that's achieved by Xen. > We prefer always to put clean architectural state into the save record. > That way if we for any reason change how the VMM is implemented, the > save record format won't be affected by that. Ack. > > Tim.