[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] xen/arm: Restricted access to IFSR32_EL2 and FPEXC32_EL2
Hi Julien, On Tue, May 27, 2014 at 4:51 PM, Julien Grall <julien.grall@xxxxxxxxxx> wrote: > Hi Vijaya, > > On 05/27/2014 11:37 AM, vijay.kilari@xxxxxxxxx wrote: >> From: Vijaya Kumar K <Vijaya.Kumar@xxxxxxxxxxxxxxxxxx> >> >> Some platforms does not support aarch32 mode. So access only if >> platform supports it. Accessing these registers will >> raise exception >> >> Signed-off-by: Vijaya Kumar K <Vijaya.Kumar@xxxxxxxxxxxxxxxxxx> >> --- >> xen/arch/arm/arm64/vfp.c | 6 ++++-- >> xen/arch/arm/traps.c | 7 +++++-- >> 2 files changed, 9 insertions(+), 4 deletions(-) >> >> diff --git a/xen/arch/arm/arm64/vfp.c b/xen/arch/arm/arm64/vfp.c >> index 3cd2b1b..c550a68 100644 >> --- a/xen/arch/arm/arm64/vfp.c >> +++ b/xen/arch/arm/arm64/vfp.c >> @@ -28,7 +28,8 @@ void vfp_save_state(struct vcpu *v) >> >> v->arch.vfp.fpsr = READ_SYSREG32(FPSR); >> v->arch.vfp.fpcr = READ_SYSREG32(FPCR); >> - v->arch.vfp.fpexc32_el2 = READ_SYSREG32(FPEXC32_EL2); >> + if ( cpu_has_el2_32 ) > > You should use is_32bit_domain here. If your platform doesn't support > aarch32 mode, then we should not create 32bit domain. I agree as per ARM Spec, it says if aarch32 mode is supported and so if the domain is 32-bit then only these registers are allowed "The following registers are defined to allow access from AArch64 state to registers that are only used in AArch32 state SDER32_EL3 If EL1 cannot use AArch32, this register is UNDEFINED. DACR32_EL2 If EL1 cannot use AArch32, this register is UNDEFINED. IFSR32_EL2 If EL1 cannot use AArch32, this register is UNDEFINED. FPEXC32_EL2 If EL1 cannot use AArch32, this register is UNDEFINED." > > I think you will have to deny somewhere the domain creation in this case. Here I found that for dom0 a check is made in construct_dom0() where domain type is being set to allow only 64-bit domains if platform supports only aarch64 bit mode. However for domU, arch.type is being set using hypercall "XEN_DOMCTL_set_address_size:" defined in arch/arm/arm64/domctl.c in subarch_do_domctl() So questions are : 1) Is this the hypercall where domain type is set?. If so, can we return error for this hypercall if domU type is not supported by Xen? 2) Can xl tool allow to load domU that platform supports?. May be it require hardware info here which may not be right way to do. Regards Vijay _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |