xen: arm: correct vfp save/restore asm constraints.
PATCH 1/1 xen: arm: correct vfp save/restore asm constraints.
Some versions of gcc complain:
Quoted 3 lines
vfp.c: In function 'vfp_restore_state':
vfp.c:45:27: error: memory input 0 is not directly addressable vfp.c:51:31: error: memory input 0 is not directly addressable
There is no way to express the constraint we want (which is the address of the array, clobbering the whole array). Therefore we have to fake it up by using two constraints.
--- xen/arch/arm/arm32/vfp.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
xen/arch/arm/arm32/vfp.c +9 -8
@@ -22,15 +22,15 @@ void vfp_save_state(struct vcpu *v) }/* Save {d0-d15} */ - asmvolatile ("stc p11, cr0, %0, #32*4" - :"=Q" (v->arch.vfp.fpregs1)); + asmvolatile ("stc p11, cr0, [%1], #32*4" + :"=Q" (*v->arch.vfp.fpregs1) :"r" (v->arch.vfp.fpregs1));/* 32 x 64 bits registers? */ if ( (READ_CP32 (MVFR0 ) &MVFR0_A_SIMD_MASK ) ==2 ) {/* Save {d16-d31} */ - asmvolatile ("stcl p11, cr0, %0, #32*4" - :"=Q" (v->arch.vfp.fpregs2)); + asmvolatile ("stcl p11, cr0, [%1], #32*4" + :"=Q" (*v->arch.vfp.fpregs2) :"r" (v->arch.vfp.fpregs2)); }WRITE_CP32 (v->arch.vfp.fpexc & ~(FPEXC_EN ),FPEXC );
@@ -38,17 +38,18 @@ void vfp_save_state(struct vcpu *v)void vfp_restore_state (struct vcpu *v) { +//uint64_t test[16]; WRITE_CP32 (READ_CP32 (FPEXC ) |FPEXC_EN ,FPEXC );/* Restore {d0-d15} */ - asmvolatile ("ldc p11, cr0, %0, #32*4" - : :"Q" (v->arch.vfp.fpregs1)); + asmvolatile ("ldc p11, cr0, [%1], #32*4" + : :"Q" (*v->arch.vfp.fpregs1),"r" (v->arch.vfp.fpregs1));/* 32 x 64 bits registers? */ if ( (READ_CP32 (MVFR0 ) &MVFR0_A_SIMD_MASK ) ==2 )/* 32 x 64 bits registers */ /* Restore {d16-d31} */ - asmvolatile ("ldcl p11, cr0, %0, #32*4" - : :"Q" (v->arch.vfp.fpregs2)); + asmvolatile ("ldcl p11, cr0, [%1], #32*4" + : :"Q" (*v->arch.vfp.fpregs2),"r" (v->arch.vfp.fpregs2));if ( v->arch.vfp.fpexc &FPEXC_EX ) {
Signature · 1 line
1.8.3.2
Quoted 10 lines · Ian Campbell
Some versions of gcc complain:
Quoted 3 lines
vfp.c: In function 'vfp_restore_state':
vfp.c:45:27: error: memory input 0 is not directly addressable vfp.c:51:31: error: memory input 0 is not directly addressableThere is no way to express the constraint we want (which is the address of the array, clobbering the whole array). Therefore we have to fake it up by using two constraints.
Signed-off-by Ian Campbell <[email protected]>
Ahem.
Quoted 52 lines
Acked-by [email protected]--- xen/arch/arm/arm32/vfp.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)xen/arch/arm/arm32/vfp.c +9
-8@@ -22,15 +22,15 @@ void vfp_save_state(struct vcpu *v) }/* Save {d0-d15} */ - asmvolatile ("stc p11, cr0, %0, #32*4" - :"=Q" (v->arch.vfp.fpregs1)); + asmvolatile ("stc p11, cr0, [%1], #32*4" + :"=Q" (*v->arch.vfp.fpregs1) :"r" (v->arch.vfp.fpregs1));/* 32 x 64 bits registers? */ if ( (READ_CP32 (MVFR0 ) &MVFR0_A_SIMD_MASK ) ==2 ) {/* Save {d16-d31} */ - asmvolatile ("stcl p11, cr0, %0, #32*4" - :"=Q" (v->arch.vfp.fpregs2)); + asmvolatile ("stcl p11, cr0, [%1], #32*4" + :"=Q" (*v->arch.vfp.fpregs2) :"r" (v->arch.vfp.fpregs2)); }WRITE_CP32 (v->arch.vfp.fpexc & ~(FPEXC_EN ),FPEXC );@@ -38,17 +38,18 @@ void vfp_save_state(struct vcpu *v)void vfp_restore_state (struct vcpu *v) { +//uint64_t test[16]; WRITE_CP32 (READ_CP32 (FPEXC ) |FPEXC_EN ,FPEXC );/* Restore {d0-d15} */ - asmvolatile ("ldc p11, cr0, %0, #32*4" - : :"Q" (v->arch.vfp.fpregs1)); + asmvolatile ("ldc p11, cr0, [%1], #32*4" + : :"Q" (*v->arch.vfp.fpregs1),"r" (v->arch.vfp.fpregs1));/* 32 x 64 bits registers? */ if ( (READ_CP32 (MVFR0 ) &MVFR0_A_SIMD_MASK ) ==2 )/* 32 x 64 bits registers */ /* Restore {d16-d31} */ - asmvolatile ("ldcl p11, cr0, %0, #32*4" - : :"Q" (v->arch.vfp.fpregs2)); + asmvolatile ("ldcl p11, cr0, [%1], #32*4" + : :"Q" (*v->arch.vfp.fpregs2),"r" (v->arch.vfp.fpregs2));if ( v->arch.vfp.fpexc &FPEXC_EX ) {
Quoted 11 lines · Ian Campbell
Some versions of gcc complain:
Quoted 3 lines
vfp.c: In function 'vfp_restore_state':
vfp.c:45:27: error: memory input 0 is not directly addressable vfp.c:51:31: error: memory input 0 is not directly addressableThere is no way to express the constraint we want (which is the address of the array, clobbering the whole array). Therefore we have to fake it up by using two constraints.
Signed-off-by Ian Campbell <[email protected]>Acked-by [email protected]
Quoted 59 lines
--- xen/arch/arm/arm32/vfp.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)xen/arch/arm/arm32/vfp.c +9
-9@@ -22,15 +22,15 @@ void vfp_save_state(struct vcpu *v) }/* Save {d0-d15} */ - asmvolatile ("stc p11, cr0, %0, #32*4" - :"=Q" (v->arch.vfp.fpregs1)); + asmvolatile ("stc p11, cr0, [%1], #32*4" + :"=Q" (*v->arch.vfp.fpregs1) :"r" (v->arch.vfp.fpregs1));/* 32 x 64 bits registers? */ if ( (READ_CP32 (MVFR0 ) &MVFR0_A_SIMD_MASK ) ==2 ) {/* Save {d16-d31} */ - asmvolatile ("stcl p11, cr0, %0, #32*4" - :"=Q" (v->arch.vfp.fpregs2)); + asmvolatile ("stcl p11, cr0, [%1], #32*4" + :"=Q" (*v->arch.vfp.fpregs2) :"r" (v->arch.vfp.fpregs2)); }WRITE_CP32 (v->arch.vfp.fpexc & ~(FPEXC_EN ),FPEXC );@@ -38,17 +38,18 @@ void vfp_save_state(struct vcpu *v)void vfp_restore_state (struct vcpu *v) { +//uint64_t test[16]; WRITE_CP32 (READ_CP32 (FPEXC ) |FPEXC_EN ,FPEXC );/* Restore {d0-d15} */ - asmvolatile ("ldc p11, cr0, %0, #32*4" - : :"Q" (v->arch.vfp.fpregs1)); + asmvolatile ("ldc p11, cr0, [%1], #32*4" + : :"Q" (*v->arch.vfp.fpregs1),"r" (v->arch.vfp.fpregs1));/* 32 x 64 bits registers? */ if ( (READ_CP32 (MVFR0 ) &MVFR0_A_SIMD_MASK ) ==2 )/* 32 x 64 bits registers */ /* Restore {d16-d31} */ - asmvolatile ("ldcl p11, cr0, %0, #32*4" - : :"Q" (v->arch.vfp.fpregs2)); + asmvolatile ("ldcl p11, cr0, [%1], #32*4" + : :"Q" (*v->arch.vfp.fpregs2),"r" (v->arch.vfp.fpregs2));if ( v->arch.vfp.fpexc &FPEXC_EX ) { --1.8.3.2
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 6 lines · Julien Grall
Quoted 5 lines · Ian Campbell
Some versions of gcc complain:
Quoted 3 lines
vfp.c: In function 'vfp_restore_state':
vfp.c:45:27: error: memory input 0 is not directly addressable vfp.c:51:31: error: memory input 0 is not directly addressable
Quoted 8 lines
Quoted 6 lines
There is no way to express the constraint we want (which is the address of the array, clobbering the whole array). Therefore we have to fake it up by using two constraints.
Signed-off-by Ian Campbell <[email protected]>Acked-by [email protected]Acked-by Julien Grall <[email protected]>
Thanks, I'd commit this ASAP since it has broken the push tests but unfortunately I'm travelling and the ssh gateway I would need to use is down. (which is also why this comes from my personal email).
If one of the other committers wants to throw this in in the meantime then please do so.
Ian.
Quoted 60 lines
Quoted 60 lines
--- xen/arch/arm/arm32/vfp.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)xen/arch/arm/arm32/vfp.c +9
-9@@ -22,15 +22,15 @@ void vfp_save_state(struct vcpu *v) }/* Save {d0-d15} */ - asmvolatile ("stc p11, cr0, %0, #32*4" - :"=Q" (v->arch.vfp.fpregs1)); + asmvolatile ("stc p11, cr0, [%1], #32*4" + :"=Q" (*v->arch.vfp.fpregs1) :"r" (v->arch.vfp.fpregs1));/* 32 x 64 bits registers? */ if ( (READ_CP32 (MVFR0 ) &MVFR0_A_SIMD_MASK ) ==2 ) {/* Save {d16-d31} */ - asmvolatile ("stcl p11, cr0, %0, #32*4" - :"=Q" (v->arch.vfp.fpregs2)); + asmvolatile ("stcl p11, cr0, [%1], #32*4" + :"=Q" (*v->arch.vfp.fpregs2) :"r" (v->arch.vfp.fpregs2)); }WRITE_CP32 (v->arch.vfp.fpexc & ~(FPEXC_EN ),FPEXC );@@ -38,17 +38,18 @@ void vfp_save_state(struct vcpu *v)void vfp_restore_state (struct vcpu *v) { +//uint64_t test[16]; WRITE_CP32 (READ_CP32 (FPEXC ) |FPEXC_EN ,FPEXC );/* Restore {d0-d15} */ - asmvolatile ("ldc p11, cr0, %0, #32*4" - : :"Q" (v->arch.vfp.fpregs1)); + asmvolatile ("ldc p11, cr0, [%1], #32*4" + : :"Q" (*v->arch.vfp.fpregs1),"r" (v->arch.vfp.fpregs1));/* 32 x 64 bits registers? */ if ( (READ_CP32 (MVFR0 ) &MVFR0_A_SIMD_MASK ) ==2 )/* 32 x 64 bits registers */ /* Restore {d16-d31} */ - asmvolatile ("ldcl p11, cr0, %0, #32*4" - : :"Q" (v->arch.vfp.fpregs2)); + asmvolatile ("ldcl p11, cr0, [%1], #32*4" + : :"Q" (*v->arch.vfp.fpregs2),"r" (v->arch.vfp.fpregs2));if ( v->arch.vfp.fpexc &FPEXC_EX ) { --1.8.3.2
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 17 lines
Quoted 1 line
Quoted 1 line · Ian Campbell
Quoted 7 lines · Julien Grall
Quoted 6 lines · Ian Campbell
Some versions of gcc complain:
Quoted 3 lines
vfp.c: In function 'vfp_restore_state':
vfp.c:45:27: error: memory input 0 is not directly addressable vfp.c:51:31: error: memory input 0 is not directly addressableThere is no way to express the constraint we want (which is the address of
the
Quoted 1 line
Quoted 1 line
array, clobbering the whole array). Therefore we have to fake it up by
using
Quoted 5 lines
Quoted 4 lines
two constraints.
Signed-off-by Ian Campbell <[email protected]>Acked-by [email protected]
Quoted 8 lines
Quoted 1 line
Acked-by Julien Grall <[email protected]>Thanks, I'd commit this ASAP since it has broken the push tests but unfortunately I'm travelling and the ssh gateway I would need to use is down. (which is also why this comes from my personal email).
If one of the other committers wants to throw this in in the meantime then please do so.
Done.
Jan
Quoted 19 lines · Jan Beulich
Quoted 19 lines
Quoted 1 line
Quoted 1 line · Ian Campbell
Quoted 7 lines · Julien Grall
Quoted 6 lines · Ian Campbell
Some versions of gcc complain:
Quoted 3 lines
vfp.c: In function 'vfp_restore_state':
vfp.c:45:27: error: memory input 0 is not directly addressable vfp.c:51:31: error: memory input 0 is not directly addressableThere is no way to express the constraint we want (which is the address of
the
Quoted 1 line
Quoted 1 line
array, clobbering the whole array). Therefore we have to fake it up by
using
Quoted 6 lines
Quoted 4 lines
two constraints.
Signed-off-by Ian Campbell <[email protected]>Acked-by [email protected]Acked-by Julien Grall <[email protected]>
Quoted 8 lines
Quoted 6 lines
Thanks, I'd commit this ASAP since it has broken the push tests but unfortunately I'm travelling and the ssh gateway I would need to use is down. (which is also why this comes from my personal email).
If one of the other committers wants to throw this in in the meantime then please do so.
Done.
Thanks.