diff mbox

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

Message ID 1403800214-28416-1-git-send-email-ian.campbell@citrix.com
State Accepted
Commit c0726c18e8135f87a5a5793d993d6bea1e3fa925
Headers show

Commit Message

Ian Campbell June 26, 2014, 4:30 p.m. UTC
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.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
Needless to say I consider this important for 4.4 backport...
---
 xen/arch/arm/Rules.mk |    1 +
 1 file changed, 1 insertion(+)

Comments

Julien Grall June 26, 2014, 5:01 p.m. UTC | #1
Hi Ian,

On 06/26/2014 05:30 PM, Ian Campbell 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.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>

Acked-by: Julien Grall <julien.grall@linaro.org>

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

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

Regards,
Jan Beulich June 27, 2014, 8:07 a.m. UTC | #2
>>> On 26.06.14 at 18:30, <ian.campbell@citrix.com> 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.
> 
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> ---
> 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
Ian Campbell June 27, 2014, 9:32 a.m. UTC | #3
On Fri, 2014-06-27 at 09:07 +0100, Jan Beulich wrote:
> >>> On 26.06.14 at 18:30, <ian.campbell@citrix.com> 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.
> > 
> > Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> > ---
> > 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.
diff mbox

Patch

diff --git a/xen/arch/arm/Rules.mk b/xen/arch/arm/Rules.mk
index 76b35d9..b5bf5cb 100644
--- a/xen/arch/arm/Rules.mk
+++ b/xen/arch/arm/Rules.mk
@@ -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