New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to use NEON at TA ?? #953

Closed
louisyang1977 opened this Issue Aug 1, 2016 · 7 comments

Comments

Projects
None yet
4 participants
@louisyang1977

louisyang1977 commented Aug 1, 2016

Dear All,
I try to compile the TA with NEON compile option and encounter the error at NEON instruction, is it possible to use the NEON at TA ??

[TA compile option]
arm32-platform-cflags += -mfloat-abi=soft
arm32-platform-aflags += -mfpu=neon

[Error Segment]
0026190c <RenderSetParameters_tee>:
RenderSetParameters_tee():
26190c: e92d4010 push {r4, lr}
261910: f2c00051 vmov.i32 q8, #1 ; 0x00000001
261914: e1a04000 mov r4, r0
261918: e2803ee9 add r3, r0, #3728 ; 0xe90

user TA undef-abort at address 0x40461910
esr 0x1fe00000 ttbr0 0x20000102b4280 ttbr1 0x00000000 cidr 0x0
cpu #0 cpsr 0x60000110
x0 0000000040600c20 x1 0000000000000008
x2 0000000000000001 x3 0000000040600040
x4 0000000040600c20 x5 0000000000000001
x6 0000000000000000 x7 0000000000000000
x8 00000000405db4d0 x9 00000000102b1d10
x10 0000000000000000 x11 0000000000000000
x12 0000000000000000 x13 0000000040000688
x14 0000000040460674 x15 0000000000000000
x16 00000000102146fc x17 0000000000000000
x18 0000000000000000 x19 00000000102b1e20
x20 0000000000000000 x21 0000000010279900
x22 0000000000000170 x23 0000000000000000
x24 0000000000000000 x25 0000000000000000
x26 0000000000000000 x27 0000000000000000
x28 0000000000000000 x29 00000000102b1ea0
x30 0000000010208d04 elr 0000000040461910
sp_el0 00000000400007b8
Status of TA 94bc9860-c400-11e5-85bd0002a5d5c51b (0x102a3660)

  • load addr : 0x40200000 ctx-idr: 2 (active)
  • code area : 0x10800000 4194304
  • stack: 0x10c00000 stack:2048
    ERR [-159909584] TEEC:TEEC_InvokeCommand:412: Function returns with [-53212]
    [MS WARN][ca_call_ta 213]:ERR ffff3024 @ ca_call_ta 213

Thanks !!

@jforissier

This comment has been minimized.

Contributor

jforissier commented Aug 1, 2016

Hello @louisyang1977,

Which version of OP-TEE are you using? TAs may use hard-float since commit 0de9a5f and if I'm not mistaken it also means NEON is allowed, isn't it?

@d3zd3z

This comment has been minimized.

Contributor

d3zd3z commented Aug 1, 2016

The VFP registers, although they share the same registers as the NEON registers, are smaller, so if the code only explicitly saves VFP registers, there will be NEON registers that are not saved.

@jforissier

This comment has been minimized.

Contributor

jforissier commented Aug 1, 2016

vfp_save_extension_regs() in core/arch/arm/kernel/vfp_a{32,64}.S saves d0-d31 in 32-bit mode and q0-q31 in 64-bit mode, I think (and hope!) it's the whole SIMD/FP state.

@vchong

This comment has been minimized.

Contributor

vchong commented Aug 1, 2016

Is the combination of -mfloat-abi=soft and -mfpu=neon intentional? If you want neon instructions, you'd normally use softfp or hard. Not sure that's the reason for your trouble though.

@d3zd3z

This comment has been minimized.

Contributor

d3zd3z commented Aug 1, 2016

vfp_save_extension_regs() in core/arch/arm/kernel/vfp_a{32,64}.S saves d0-d31 in 32-bit mode and q0-q31 in 64-bit mode, I think (and hope!) it's the whole SIMD/FP state.

Yeah, that should be it. So, it sounds like it just may be an issue of NEON not being enabled.

@louisyang1977

This comment has been minimized.

louisyang1977 commented Aug 2, 2016

@jforissier : i use TEE OS v1.1, if i change TEE OS to 2.x, does that mean the NEON at TA would be supported ?
@d3zd3z : You mention that NEON is not being enabled, how to enable ?? any suggestions ??
@vchong : i will try to use the softfp or hard instead of soft

@louisyang1977

This comment has been minimized.

louisyang1977 commented Aug 3, 2016

If we use TEE OS 2.x, TA can support the NEON instruction. Thanks and close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment