On 28.06.19 17:46, Jan Kiszka wrote:
> On 28.06.19 16:37, Vitaly Andrianov wrote:
>> On 06/28/2019 10:07 AM, Jan Kiszka wrote:
>>> On 28.06.19 15:50, Vitaly Andrianov wrote:
>>>> Jan,
>>>> I was able to get almost everything working on AM572 IDK, but had to move
>>>> to
>>>> a new compiler:
>>>>
>>>> arm-linux-gnueabihf-gcc (GNU Toolchain for the A-profile Architecture
>>>> 8.3-2019.03 (arm-rel-8.36)) 8.3.0
>>>> Copyright (C) 2018 Free Software Foundation, Inc.
>>>> This is free software; see the source for copying conditions. There is NO
>>>> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>>>>
>>>> Now I'm getting errors:
>>>>
>>>> CC
>>>> /home/<username>/GIT_REPS/jailhouse/hypervisor/arch/arm/../arm-common/setup.o
>>>> CC
>>>> /home/<username>/GIT_REPS/jailhouse/hypervisor/arch/arm/../arm-common/smccc.o
>>>> /tmp/ccm9f2Kw.s: Assembler messages:
>>>> /tmp/ccm9f2Kw.s:52: Error: selected processor does not support `smc #0' in
>>>> ARM mode
>>>> /tmp/ccm9f2Kw.s:82: Error: selected processor does not support `smc #0' in
>>>> ARM mode
>>>> /tmp/ccm9f2Kw.s:109: Error: selected processor does not support `smc #0' in
>>>> ARM mode
>>>> /tmp/ccm9f2Kw.s:140: Error: selected processor does not support `smc #0' in
>>>> ARM mode
>>>> /tmp/ccm9f2Kw.s:170: Error: selected processor does not support `smc #0' in
>>>> ARM mode
>>>> scripts/Makefile.build:303: recipe for target
>>>> '/home/a0794637/GIT_REPS/jailhouse/hypervisor/arch/arm/../arm-common/smccc.o'
>>>> failed
>>>>
>>>> make[4]: ***
>>>> [/home/<username>/GIT_REPS/jailhouse/hypervisor/arch/arm/../arm-common/smccc.o]
>>>> Error 1
>>>> scripts/Makefile.build:544: recipe for target
>>>> '/home/<username>/GIT_REPS/jailhouse/hypervisor/arch/arm' failed
>>>>
>>>> I guess the new toolchain requires to pass additional "arch_extension"
>>>> options to assembler.
>>>> If I add asm(".arch_extension sec\n"); before each asm line in the smccc.c
>>>> that works, but I'm getting errors at other places missing "virt"
>>>> extension.
>>>>
>>>> I don't believe I need to edit each source file, It must be a way to add
>>>> the
>>>> required options to makefiles.
>>>> Do you know how to fix that issue?
>>>>
>>>
>>> The original idea was to have that extension enabled by just including
>>> hypervisor/arch/arm/include/asm/smc.h which contains that statement. Seems
>>> we
>>> lose that with this compiler version. Or we rather need it in the asm blocks
>>> that define smc() and smc_arg1().
>>
>> Yes adding the extension to each block helped. After that we have errors for
>> each macro in the sysregs.h
>>
>
> OK, this doesn't scale. I guess we need to study how the kernel does that...
>
Oh, this one was forgotten to fix for 0.11. Just ran into it myself due
to Debian Buster coming with gcc-8 as well. Looks like this fixes the
issue:
diff --git a/hypervisor/arch/arm/Makefile b/hypervisor/arch/arm/Makefile
index 2f930cf3..a170b593 100644
--- a/hypervisor/arch/arm/Makefile
+++ b/hypervisor/arch/arm/Makefile
@@ -12,4 +12,4 @@
LINUXINCLUDE += -I$(src)/arch/arm-common/include
-KBUILD_CFLAGS += -marm
+KBUILD_CFLAGS += -marm -march=armv7ve
diff --git a/hypervisor/arch/arm/include/asm/smc.h
b/hypervisor/arch/arm/include/asm/smc.h
index 34944a2d..5cde3d8b 100644
--- a/hypervisor/arch/arm/include/asm/smc.h
+++ b/hypervisor/arch/arm/include/asm/smc.h
@@ -10,6 +10,7 @@
* the COPYING file in the top-level directory.
*/
+/* for gcc < 5 */
asm (".arch_extension sec\n");
static inline int smc(unsigned long id)
diff --git a/hypervisor/arch/arm/include/asm/sysregs.h
b/hypervisor/arch/arm/include/asm/sysregs.h
index 76dd5b55..b7eaccf6 100644
--- a/hypervisor/arch/arm/include/asm/sysregs.h
+++ b/hypervisor/arch/arm/include/asm/sysregs.h
@@ -283,6 +283,7 @@
#define arm_read_sysreg(...) _arm_read_sysreg(__VA_ARGS__)
#ifndef __ASSEMBLY__
+/* for gcc < 5 */
asm(".arch_extension virt\n");
#define arm_write_sysreg_32(op1, crn, crm, op2, val) \
Jan
--
You received this message because you are subscribed to the Google Groups
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jailhouse-dev/00738f6d-ff7f-3afc-89e8-c29d2883ec74%40web.de.
For more options, visit https://groups.google.com/d/optout.