[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH RFC XEN v1 07/14] xen: arm: Save and restore basic per-VCPU state.



On Wed, 2015-12-16 at 14:55 +0000, Stefano Stabellini wrote:
> On Wed, 9 Dec 2015, Ian Campbell wrote:
> > XXX TBD No support for arm64 (or even 32-bit guest on arm64).
> > XXX In particular the handling of save/restore of VFP state doesn't
> > XXX even compile for arm32. I need to investigate the best way to
> > XXX reflect the differing possible VFB states in the save record.
> > 
> > Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
> > ---
> > Âxen/arch/arm/hvm.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| 167
> > +++++++++++++++++++++++++++++++++
> > Âxen/include/public/arch-arm/hvm/save.h |ÂÂ38 +++++++-
> > Â2 files changed, 204 insertions(+), 1 deletion(-)
> > 
> > diff --git a/xen/arch/arm/hvm.c b/xen/arch/arm/hvm.c
> > index 5fd0753..3c59e63 100644
> > --- a/xen/arch/arm/hvm.c
> > +++ b/xen/arch/arm/hvm.c
> > @@ -7,6 +7,7 @@
> > Â
> > Â#include <xsm/xsm.h>
> > Â
> > +#include <xen/hvm/save.h>
> > Â#include <public/xen.h>
> > Â#include <public/hvm/params.h>
> > Â#include <public/hvm/hvm_op.h>
> > @@ -65,3 +66,169 @@ long do_hvm_op(unsigned long op,
> > XEN_GUEST_HANDLE_PARAM(void) arg)
> > Â
> > ÂÂÂÂÂreturn rc;
> > Â}
> > +
> > +static int cpu_save(struct domain *d, hvm_domain_context_t *h)
> > +{
> > +ÂÂÂÂstruct hvm_hw_cpu ctxt;
> > +ÂÂÂÂstruct vcpu *v;
> 
> I wonder whether we could refactor the code to share the same underlying
> function between cpu_save and ctxt_switch_from.

One is writing to a public ABI struct (or at least a semi-public ABI) while
the other is completely internal. Other than exposing the internal struct
or use of MACROS I'm not sure it would be possible.



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.