[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH RFC 04/04] xen: arm64: save/restore domain type
On arm64 VM uses d->arch.type to indicate if the domain is 32-bit or 64-bit. This value is set while parsing kernel image. while restoring VCPU state, it will use this value to decide the VCPU type. I can not find a proper place to save/restore this value in state file, this is surely not a good implementation. Signed-off-by: Chenxiao Zhao <chenxiao.zhao@xxxxxxxxx> diff --git a/xen/arch/arm/hvm.c b/xen/arch/arm/hvm.c index 3073b17..4702f60 100644 --- a/xen/arch/arm/hvm.c +++ b/xen/arch/arm/hvm.c@@ -108,6 +108,7 @@ static int cpu_save(struct domain *d, hvm_domain_context_t *h) continue; memset(&ctxt, 0, sizeof(ctxt)); + ctxt.is_64bit = is_64bit_domain(d); ctxt.sctlr = v->arch.sctlr; ctxt.ttbr0 = v->arch.ttbr0; ctxt.ttbr1 = v->arch.ttbr1;@@ -188,6 +189,9 @@ static int cpu_load(struct domain *d, hvm_domain_context_t *h) if ( hvm_load_entry(VCPU, h, &ctxt) != 0 ) return -EINVAL; + if(ctxt.is_64bit) + v->domain->arch.type = DOMAIN_64BIT; + v->arch.sctlr = ctxt.sctlr; v->arch.ttbr0 = ctxt.ttbr0; v->arch.ttbr1 = ctxt.ttbr1;diff --git a/xen/include/public/arch-arm/hvm/save.h b/xen/include/public/arch-arm/hvm/save.h index 80330dc..68b6136 100644 --- a/xen/include/public/arch-arm/hvm/save.h +++ b/xen/include/public/arch-arm/hvm/save.h @@ -53,6 +53,10 @@ struct hvm_hw_cpu uint64_t vfp[66]; #endif +#ifdef CONFIG_ARM_64 + uint32_t is_64bit; +#endif + /* Guest core registers */ struct vcpu_guest_core_regs core_regs; _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |