Skip to contentSkip to conversation

xen: arm: make sure gcc doesn't use floating-point registers on arm64

PATCH In review Ian Campbell 3 participants 4 messages Jun 26, 2014 – Jun 27, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen: arm: make sure gcc doesn't use floating-point registers on arm64

By using -mgeneral-regs-only which is the Aarch64 equivalent to -msoft-float.

Otherwise gcc will corrupt the d* registers, which we don't save/restore when trapping to/from the hypervisor.

---
Needless to say I consider this important for 4.4 backport...

---
 xen/arch/arm/Rules.mk |    1 +
 1 file changed, 1 insertion(+)
xen/arch/arm/Rules.mk +1 -0
index 76b35d9..b5bf5cb 100644
@@ -28,6 +28,7 @@ endif
 
 ifeq ($(TARGET_SUBARCH),arm64)
 CFLAGS += -mcpu=generic
+CFLAGS += -mgeneral-regs-only # No fp registers etc
 arm32 := n
 arm64 := y
 endif
Signature · 1 line
1.7.10.4
Acked-by on v1 1/1
#1 lore raw

Hi Ian,

Quoted 7 lines · Ian Campbell

By using -mgeneral-regs-only which is the Aarch64 equivalent to -msoft-float.

Otherwise gcc will corrupt the d* registers, which we don't save/restore when trapping to/from the hypervisor.

Quoted 2 lines

---
Needless to say I consider this important for 4.4 backport...

+1. I'm a bit surprised that it doesn't happen often.

Regards,

Signature · 1 line
Julien Grall
#2 lore raw
In reply to Ian Campbell
Quoted 11 lines
Quoted 1 line
Quoted 1 line · On 26.06.14 at 18:30, <[email protected]> wrote:

By using -mgeneral-regs-only which is the Aarch64 equivalent to -msoft-float.

Otherwise gcc will corrupt the d* registers, which we don't save/restore when
trapping to/from the hypervisor.

---
Needless to say I consider this important for 4.4 backport...

Agreed - for a fix like this I'm not even certain you'd need to wait for it to make it through the master push gate.

Jan

#3 lore raw
Quoted 8 lines · Jan Beulich
Quoted 8 lines
Quoted 1 line
Quoted 1 line · On 26.06.14 at 18:30, <[email protected]> wrote:

By using -mgeneral-regs-only which is the Aarch64 equivalent to -msoft-float.

Otherwise gcc will corrupt the d* registers, which we don't save/restore when
trapping to/from the hypervisor.

Quoted 6 lines
Quoted 3 lines

---
Needless to say I consider this important for 4.4 backport...

Agreed - for a fix like this I'm not even certain you'd need to wait for it to make it through the master push gate.

Since the push gate doesn't even test arm64 at the moment I was certainly planning to skip that delay, yes. (and I would have considered it even if it was being tested...)

Ian.