Op Thu, 22 Feb 2018 22:51:12 +0100 schreef Mark Kettenis <mark.kette...@xs4all.nl>:
I hate to loose yet another strict-alignment canary, but the reality
is that the rest of the world assumes that armv7 supports unaligned
access which means that compilers generate code that assumes this
works when compiling code for armv7 and later (e.g. NEON code) and
that hand-written assembler code assumes this works as well.

Both gcc and clang have -munaligned-access in effect by default on ARMv7.

So if CPU_CONTROL_AFLT_ENABLE is turned on, then all code should be compiled with -mno-unaligned-access. I cannot find any use of this option in the source tree. Am I missing something?

I hit
yet another case of this while playing around with softfp.

The diff below stops the kernel from generating alignment faults as a
first step.


Index: arch/arm/arm/cpufunc.c
RCS file: /cvs/src/sys/arch/arm/arm/cpufunc.c,v
retrieving revision 1.52
diff -u -p -r1.52 cpufunc.c
--- arch/arm/arm/cpufunc.c      8 Sep 2017 05:36:51 -0000       1.52
+++ arch/arm/arm/cpufunc.c      22 Feb 2018 21:42:35 -0000
@@ -395,7 +395,6 @@ armv7_setup()
            | CPU_CONTROL_AFE;
        cpuctrl = CPU_CONTROL_MMU_ENABLE

Gemaakt met Opera's e-mailprogramma: http://www.opera.com/mail/

Reply via email to