From: Stefano Stabellini Subject: Re: [PATCH 19/38] arm: context switch a bunch of guest state. Date: Tue, 5 Jun 2012 18:11:58 +0100 Message-ID: References: <1338565113.17466.141.camel@zakaz.uk.xensource.com> <1338565207-2888-1-git-send-email-ian.campbell@citrix.com> <1338565207-2888-19-git-send-email-ian.campbell@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1338565207-2888-19-git-send-email-ian.campbell@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Fri, 1 Jun 2012, Ian Campbell wrote: > diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c > index 1a2b95f..339c327 100644 > --- a/xen/arch/arm/gic.c > +++ b/xen/arch/arm/gic.c > @@ -61,6 +61,30 @@ static struct { > irq_desc_t irq_desc[NR_IRQS]; > unsigned nr_lrs; > > +void gic_save_state(struct vcpu *v) > +{ > + int i; > + > + for ( i=0; i + v->arch.gic_lr[i] = GICH[GICH_LR + i]; > + /* Disable until next VCPU scheduled */ > + GICH[GICH_HCR] = 0; > + isb(); > +} > + > +void gic_restore_state(struct vcpu *v) > +{ > + int i; > + > + if ( is_idle_vcpu(v) ) > + return; > + > + for ( i=0; i + GICH[GICH_LR + i] = v->arch.gic_lr[i]; > + GICH[GICH_HCR] = GICH_HCR_EN; > + isb(); > +} > + it is still missing a bunch of stuff from the gic state but it is a step in the right direction, so I'll send out patches to complete the gic context switch separately, based on this one.