From: Ian Campbell <ian.campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: julien.grall@citrix.com, wei.liu2@citrix.com,
andrew.cooper3@citrix.com, ian.jackson@eu.citrix.com,
xen-devel@lists.xen.org
Subject: Re: [PATCH RFC XEN v1 06/14] xen: arm: Add some basic platform info to save header
Date: Wed, 16 Dec 2015 10:20:19 +0000 [thread overview]
Message-ID: <1450261219.16856.241.camel@citrix.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1512151802010.17516@kaball.uk.xensource.com>
On Tue, 2015-12-15 at 18:37 +0000, Stefano Stabellini wrote:
> On Wed, 9 Dec 2015, Ian Campbell wrote:
> > These correspond to the content of struct xen_arch_domainconfig.
> >
> > On restore various things are checked, mostly to ensure they match the
> > hardcoded things of the restoring Xen.
> >
> > Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> > ---
> > xen/arch/arm/save.c | 44
> > ++++++++++++++++++++++++++++++++++
> > xen/include/public/arch-arm/hvm/save.h | 6 +++++
> > 2 files changed, 50 insertions(+)
> >
> > diff --git a/xen/arch/arm/save.c b/xen/arch/arm/save.c
> > index 6a1934b..7b34782 100644
> > --- a/xen/arch/arm/save.c
> > +++ b/xen/arch/arm/save.c
> > @@ -21,6 +21,17 @@
> >
> > void arch_hvm_save(struct domain *d, struct hvm_save_header *hdr)
> > {
> > + switch ( d->arch.vgic.version )
> > + {
> > + case GIC_V2: hdr->gic_version = XEN_DOMCTL_CONFIG_GIC_V2; break;
> > + case GIC_V3: hdr->gic_version = XEN_DOMCTL_CONFIG_GIC_V3; break;
> > + default: BUG();
> > + }
> > +
> > + hdr->nr_spis = d->arch.vgic.nr_spis;
> > + hdr->clock_frequency = cpu_khz;
> > +
> > + hdr->evtchn_irq = GUEST_EVTCHN_PPI;
> > }
> >
> > int arch_hvm_load(struct domain *d, struct hvm_save_header *hdr)
> > @@ -39,6 +50,39 @@ int arch_hvm_load(struct domain *d, struct
> > hvm_save_header *hdr)
> > return -1;
> > }
> >
> > + switch ( hdr->gic_version )
> > + {
> > + case XEN_DOMCTL_CONFIG_GIC_V2: d->arch.vgic.version = GIC_V2;
> > break;
> > + case XEN_DOMCTL_CONFIG_GIC_V3: d->arch.vgic.version = GIC_V3;
> > break;
> > + default:
> > + printk(XENLOG_G_ERR "HVM%d restore: unsupported gic version
> > %u\n",
> > + d->domain_id, hdr->gic_version);
> > + return -1;
> > + }
> > +
> > + if ( hdr->nr_spis )
> > + {
> > + printk(XENLOG_G_ERR "HVM%d restore: cannot support nr_spis !=
> > 0, %u\n",
> > + d->domain_id, hdr->nr_spis);
> > + return -1;
> > + }
> > +
> > + if ( hdr->clock_frequency != cpu_khz )
> > + {
> > + printk(XENLOG_G_ERR
> > + "HVM%d restore: unsupported guest clock %"PRId32"kHz on
> > host @ %ldkHz\n",
> > + d->domain_id, hdr->clock_frequency, cpu_khz);
> > + return -1;
> > + }
> > +
> > + if ( hdr->evtchn_irq != GUEST_EVTCHN_PPI )
> > + {
> > + printk(XENLOG_G_ERR
> > + "HVM%d restore: unsupported guest evtchn IRQ%u host uses
> > IRQ%u\n",
> > + d->domain_id, hdr->evtchn_irq, GUEST_EVTCHN_PPI);
> > + return -1;
> > + }
> > +
> > return 0;
> > }
> >
> > diff --git a/xen/include/public/arch-arm/hvm/save.h
> > b/xen/include/public/arch-arm/hvm/save.h
> > index 5f4de94..6f1be37 100644
> > --- a/xen/include/public/arch-arm/hvm/save.h
> > +++ b/xen/include/public/arch-arm/hvm/save.h
> > @@ -34,6 +34,12 @@ struct hvm_save_header
> > uint32_t magic; /* Must be HVM_FILE_MAGIC */
> > uint32_t version; /* File format version */
> > uint64_t changeset; /* Version of Xen that saved this file
> > */
> > +
> > + uint8_t gic_version; /* XEN_DOMCTL_CONFIG_GIC_v* (_NOT_
> > _NATIVE) */
> > + uint32_t nr_spis; /* Currently must be 0 */
> > + uint32_t clock_frequency; /* kHz */
> > +
> > + uint32_t evtchn_irq;
>
> I would prefer if you added these in the previous patch, or maybe
> better, you introduced HVM_FILE_VERSION only with the last patch.
> Otherwise theoretically you would have to bump HVM_FILE_VERSION with
> this patch.
I'm not terribly concerned with save file versioning in the midst of the
series which implements save/restore, it's ludicrous to suggest we might be
required to support save/restore with this series half applied, but I'll
fold it in anyway.
> The rest looks good.
Thanks.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2015-12-16 10:20 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-09 14:31 [PATCH RFC v1 00/14] xen: arm: support for save restore and dead migration Ian Campbell
2015-12-09 14:32 ` [PATCH RFC XEN v1 01/14] xen: arm: Add gic_hw_desc Ian Campbell
2015-12-15 16:15 ` Stefano Stabellini
2015-12-15 16:21 ` Ian Campbell
2015-12-15 16:35 ` Andrew Cooper
2015-12-15 16:56 ` Ian Campbell
2015-12-09 14:32 ` [PATCH RFC XEN v1 02/14] xen: arm: Provide a mechanism to read (and decode) an LR from a saved VCPU Ian Campbell
2015-12-15 16:22 ` Stefano Stabellini
2015-12-09 14:32 ` [PATCH RFC XEN v1 03/14] xen: arm: switch arch_do_domctl to a common exit path Ian Campbell
2015-12-15 16:34 ` Stefano Stabellini
2015-12-15 16:57 ` Ian Campbell
2015-12-15 17:07 ` Andrew Cooper
2015-12-15 17:11 ` Jan Beulich
2015-12-09 14:32 ` [PATCH RFC XEN v1 04/14] xen: arm: Implement XEN_DOMCTL_getpageframeinfo3 Ian Campbell
2015-12-15 16:44 ` Stefano Stabellini
2015-12-09 14:32 ` [PATCH RFC XEN v1 05/14] xen: arm: Implement basic XEN_DOMCTL_{set, get}hvmcontext support Ian Campbell
2015-12-15 18:00 ` Stefano Stabellini
2015-12-16 10:18 ` Ian Campbell
2015-12-09 14:32 ` [PATCH RFC XEN v1 06/14] xen: arm: Add some basic platform info to save header Ian Campbell
2015-12-15 18:37 ` Stefano Stabellini
2015-12-16 10:20 ` Ian Campbell [this message]
2015-12-09 14:32 ` [PATCH RFC XEN v1 07/14] xen: arm: Save and restore basic per-VCPU state Ian Campbell
2015-12-16 14:55 ` Stefano Stabellini
2015-12-16 15:04 ` Ian Campbell
2015-12-09 14:32 ` [PATCH RFC XEN v1 08/14] xen: arm: Save and restore arch timer state Ian Campbell
2015-12-16 15:53 ` Stefano Stabellini
2015-12-16 16:02 ` Ian Campbell
2015-12-16 16:17 ` Julien Grall
2015-12-16 16:37 ` Ian Campbell
2015-12-16 18:05 ` Stefano Stabellini
2015-12-17 9:33 ` Ian Campbell
2015-12-09 14:32 ` [PATCH RFC XEN v1 09/14] xen: arm: Save and restore GIC state Ian Campbell
2015-12-16 18:30 ` Stefano Stabellini
2015-12-17 9:54 ` Ian Campbell
2015-12-22 16:44 ` Stefano Stabellini
2015-12-09 14:32 ` [PATCH RFC XEN v1 10/14] tools: Switch a few CONFIG_MIGRATE features to CONFIG_X86 Ian Campbell
2015-12-09 15:16 ` Andrew Cooper
2015-12-09 14:32 ` [PATCH RFC XEN v1 11/14] tools: migrate: refactor selection of save/restore ops to be arch specific Ian Campbell
2015-12-09 15:26 ` Andrew Cooper
2015-12-09 15:33 ` Ian Campbell
2015-12-09 14:32 ` [PATCH RFC XEN v1 12/14] tools: libxc: implement modify_returncode for ARM Ian Campbell
2015-12-16 16:22 ` Stefano Stabellini
2015-12-16 16:36 ` Ian Campbell
2015-12-09 14:32 ` [PATCH RFC XEN v1 13/14] tools: libxc: wire up migration " Ian Campbell
2015-12-09 15:48 ` Andrew Cooper
2015-12-09 14:32 ` [PATCH RFC XEN v1 14/14] tools/libxl: BODGE ARM save/restore and (dead) migration Ian Campbell
2015-12-09 14:33 ` [PATCH RFC LINUX v1] xen: arm: enable migration on ARM Ian Campbell
2016-01-06 17:47 ` Stefano Stabellini
2016-01-06 17:57 ` Stefano Stabellini
2016-01-07 9:47 ` Ian Campbell
2016-01-07 9:43 ` Ian Campbell
2016-01-06 17:55 ` Stefano Stabellini
2016-01-07 9:47 ` Ian Campbell
2016-01-07 11:32 ` Stefano Stabellini
2015-12-09 15:51 ` [PATCH RFC v1 00/14] xen: arm: support for save restore and dead migration Andrew Cooper
2015-12-09 16:09 ` 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=1450261219.16856.241.camel@citrix.com \
--to=ian.campbell@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=julien.grall@citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.