xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@linaro.org>
To: Ian Campbell <Ian.Campbell@citrix.com>, Wei Huang <w1.huang@samsung.com>
Cc: keir@xen.org, stefano.stabellini@eu.citrix.com,
	andrew.cooper3@citrix.com, tim@xen.org, jaeyong.yoo@samsung.com,
	xen-devel@lists.xen.org, jbeulich@suse.com,
	ian.jackson@eu.citrix.com, yjhyun.yoo@samsung.com
Subject: Re: [RFC v3 2/6] xen/arm: Add save/restore support for ARM GIC V2
Date: Wed, 14 May 2014 13:05:53 +0100	[thread overview]
Message-ID: <53735C21.2080104@linaro.org> (raw)
In-Reply-To: <1400065670.29366.27.camel@kazak.uk.xensource.com>

On 05/14/2014 12:07 PM, Ian Campbell wrote:
> On Thu, 2014-05-08 at 16:18 -0500, Wei Huang wrote:
>> diff --git a/xen/include/public/arch-arm/hvm/save.h b/xen/include/public/arch-arm/hvm/save.h
>> index 8312e7b..421a6f6 100644
>> --- a/xen/include/public/arch-arm/hvm/save.h
>> +++ b/xen/include/public/arch-arm/hvm/save.h
>> @@ -40,10 +40,42 @@ struct hvm_save_header
>>  };
>>  DECLARE_HVM_SAVE_TYPE(HEADER, 1, struct hvm_save_header);
>>  
>> +/* Guest's view of GIC distributor (per-vcpu)
>> + *   - Based on GICv2 (see "struct vgic_irq_rank")
>> + *   - Store guest's view of GIC distributor
>> + *   - Only support SGI and PPI for DomU (DomU doesn't handle SPI)
>> + */
>> +struct hvm_arm_vgicd_v2
>> +{
>> +    uint32_t ienable;
>> +    uint32_t iactive;
>> +    uint32_t ipend;
>> +    uint32_t pendsgi;
>> +    uint32_t icfg[2];
>> +    uint32_t ipriority[8];
>> +    uint32_t itargets[8];
>> +};
>> +DECLARE_HVM_SAVE_TYPE(VGICD_V2, 2, struct hvm_arm_vgicd_v2);
> 
> This is the state of 32 interrupts. How do you propose to handle more
> interrupts than that?
> 
> I think it would be sensible to split the domain global state, the
> distributor and cpu interface base addresses and sizes and the states of
> any SPIs in here and have a separate per-vpcu set of state for the
> per-cpu GICD state (SPIs and PPIs mainly).
> 
> For the SPI I think you either want to put the above set of state into
> an array of size NR_GUEST_INTERRUPTS/32 or better make each of the above
> an array based on NR_GUEST_INTERRUPTS.
> 
>> +
>> +/* 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.

Regards,

-- 
Julien Grall

  reply	other threads:[~2014-05-14 12:05 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-08 21:18 [RFC v3 0/6] xen/arm: ARM save/restore/migration support Wei Huang
2014-05-08 21:18 ` [RFC v3 1/6] xen/arm: Add basic save/restore support for ARM Wei Huang
2014-05-08 22:11   ` Andrew Cooper
2014-05-08 22:20     ` Wei Huang
2014-05-09  8:56       ` Julien Grall
2014-05-14 10:27         ` Ian Campbell
2014-05-14 10:25     ` Ian Campbell
2014-05-14 10:46       ` Andrew Cooper
2014-05-14 13:22         ` Ian Campbell
2014-05-09  9:06   ` Julien Grall
2014-05-09  9:42   ` Jan Beulich
2014-05-14 10:37   ` Ian Campbell
2014-05-14 18:54     ` Wei Huang
2014-05-08 21:18 ` [RFC v3 2/6] xen/arm: Add save/restore support for ARM GIC V2 Wei Huang
2014-05-08 22:47   ` Andrew Cooper
2014-05-09 14:12     ` Wei Huang
2014-05-09 14:24       ` Ian Campbell
2014-05-11 16:15         ` Julien Grall
2014-05-13 14:53     ` Wei Huang
2014-05-09  9:17   ` Julien Grall
2014-05-14 11:07   ` Ian Campbell
2014-05-14 12:05     ` Julien Grall [this message]
2014-05-14 12:23       ` Tim Deegan
2014-05-14 13:24         ` Ian Campbell
2014-05-15 17:15   ` Julien Grall
2014-05-16  7:36     ` Ian Campbell
2014-05-08 21:18 ` [RFC v3 3/6] xen/arm: Add save/restore support for ARM arch timer Wei Huang
2014-05-08 23:02   ` Andrew Cooper
2014-05-11  9:01     ` Julien Grall
2014-05-11  8:58   ` Julien Grall
2014-05-12  8:35     ` Ian Campbell
2014-05-12 11:42       ` Julien Grall
2014-05-14 11:14   ` Ian Campbell
2014-05-14 12:13     ` Julien Grall
2014-05-14 13:23       ` Ian Campbell
2014-05-14 19:04     ` Wei Huang
2014-05-08 21:18 ` [RFC v3 4/6] xen/arm: Add save/restore support for guest core registers Wei Huang
2014-05-08 23:10   ` Andrew Cooper
2014-05-09 16:35     ` Wei Huang
2014-05-09 16:52       ` Ian Campbell
2014-05-11  9:06   ` Julien Grall
2014-05-14 11:16     ` Ian Campbell
2014-05-14 12:23       ` Julien Grall
2014-05-14 13:25         ` Ian Campbell
2014-05-14 13:31           ` Julien Grall
2014-05-14 11:37   ` Ian Campbell
2014-05-08 21:18 ` [RFC v3 5/6] xen/arm: Add log_dirty support for ARM Wei Huang
2014-05-08 23:46   ` Andrew Cooper
2014-05-14 11:51     ` Ian Campbell
2014-05-11 15:28   ` Julien Grall
2014-05-12 14:00     ` Wei Huang
2014-05-12 14:11       ` Julien Grall
2014-05-14 12:04         ` Ian Campbell
2014-05-14 11:57     ` Ian Campbell
2014-05-14 12:20       ` Julien Grall
2014-05-14 13:24         ` Ian Campbell
2014-05-14 13:18   ` Ian Campbell
2014-05-16 10:59   ` Julien Grall
2014-05-08 21:18 ` [RFC v3 6/6] xen/arm: Implement toolstack for xl restore/save/migration Wei Huang
2014-05-14 13:20   ` Ian Campbell
2014-05-14 13:24     ` Andrew Cooper
2014-05-11  9:23 ` [RFC v3 0/6] xen/arm: ARM save/restore/migration support Julien Grall
2014-05-12 14:37   ` Wei Huang
2014-05-13 14:41     ` Julien Grall
2014-05-12 14:17 ` Julien Grall
2014-05-12 14:52   ` Wei Huang
2014-05-12 15:01     ` Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53735C21.2080104@linaro.org \
    --to=julien.grall@linaro.org \
    --cc=Ian.Campbell@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jaeyong.yoo@samsung.com \
    --cc=jbeulich@suse.com \
    --cc=keir@xen.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=tim@xen.org \
    --cc=w1.huang@samsung.com \
    --cc=xen-devel@lists.xen.org \
    --cc=yjhyun.yoo@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).