[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT PATCHv6 08/37] arch/arm64: Avoid using the floating-point and Advanced SIMD registers


  • To: <minios-devel@xxxxxxxxxxxxxxxxxxxx>, <simon.kuenzer@xxxxxxxxx>
  • From: Wei Chen <wei.chen@xxxxxxx>
  • Date: Fri, 14 Sep 2018 07:56:41 +0000
  • Authentication-results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; lists.xenproject.org; dkim=none (message not signed) header.d=none;lists.xenproject.org; dmarc=bestguesspass action=none header.from=arm.com;
  • Cc: Kaly.Xin@xxxxxxx, nd@xxxxxxx, wei.chen@xxxxxxx
  • Delivery-date: Fri, 14 Sep 2018 07:57:43 +0000
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>
  • Nodisclaimer: True
  • Spamdiagnosticmetadata: NSPM
  • Spamdiagnosticoutput: 1:99

From: Wei Chen <Wei.Chen@xxxxxxx>

On Arm64, sometimes, the GCC will use floating-point and Advanced
SIMD registers to pass parameters. For example, the va_list will
use the SIMD&FP registers (like q0, q1) to store parameters, no
matter you are using floating-point or not.

But before we include the FP & SIMD registers in context switch,
we should not enable the FP & SIMD access for kernel. So, we use
the GCC -mgeneral-regs-only flag to force GCC to use generic
registers only util the floating-point and Advanced SIMD registers
are required actually.

Signed-off-by: Wei Chen <Wei.Chen@xxxxxxx>
---
 arch/arm/arm64/Makefile.uk | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/arch/arm/arm64/Makefile.uk b/arch/arm/arm64/Makefile.uk
index d4ba7e3..54b1b01 100644
--- a/arch/arm/arm64/Makefile.uk
+++ b/arch/arm/arm64/Makefile.uk
@@ -1,6 +1,11 @@
-ASFLAGS  += -D__ARM_64__
-CFLAGS   += -D__ARM_64__ -fms-extensions
-CXXFLAGS += -D__ARM_64__ -fms-extensions
+# TODO:
+# Before we include the FP & SIMD registers in context switch,
+# we should not enable the FP & SIMD access for kernel. As GCC will
+# the FP & SIMD registers to pass parameters, we use -mgeneral-regs-only
+# flag to force GCC to use generic registers
+ASFLAGS  += -D__ARM_64__ -mgeneral-regs-only
+CFLAGS   += -D__ARM_64__ -fms-extensions -mgeneral-regs-only
+CXXFLAGS += -D__ARM_64__ -fms-extensions -mgeneral-regs-only
 
 # GCC support -mcpu=native for arm64 from 6.0
 ifeq ($(CONFIG_MARCH_ARM64_NATIVE),y)
-- 
2.17.1


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.