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

Re: [Minios-devel] [Unikraft] Support for KVM on ARM



Hey,

On 30.04.2018 11:39, Ajay Garg wrote:
Thanks Simon for the help.


I did the following on my x86_64 laptop :

###############################################################################
ajay@latitude-3480:~/unikraft/apps/helloworld$ arm-linux-gnueabihf-gcc --version arm-linux-gnueabihf-gcc (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
Copyright (C) 2015 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.

ajay@latitude-3480:~/unikraft/apps/helloworld$ CROSS_COMPILE=arm-linux-gnueabihf-gcc make clean
make[1]: Entering directory '/home/ajay/unikraft/unikraft'
   CLEAN   libxenplat
   CLEAN   libxenbus
   CLEAN   libkvmplat
   CLEAN   liblinuxuplat
   CLEAN   apphelloworld
   CLEAN   libukboot
   CLEAN   libukdebug
   CLEAN   libukargparse
   CLEAN   libnolibc
   CLEAN   libukalloc
   CLEAN   libukallocbbuddy
   CLEAN   libfdt
   CLEAN   build/
make[1]: Leaving directory '/home/ajay/unikraft/unikraft'

ajay@latitude-3480:~/unikraft/apps/helloworld$ CROSS_COMPILE=arm-linux-gnueabihf-gcc make menuconfig
###############################################################################

But I still do not see any arm-options :(

I am wondering which options did you expect to see?

I think you saw already what is currently available in the menu: You select and configure ARM under "Architecture Selection". Afterwards you select your target platforms under "Platform Configuration".

Did you try compiling the image?



On Mon, Apr 30, 2018 at 2:56 PM, Simon Kuenzer <simon.kuenzer@xxxxxxxxx <mailto:simon.kuenzer@xxxxxxxxx>> wrote:

    On 30.04.2018 11:24, Simon Kuenzer wrote:

        Hay Ajay,

        you can actually do both - natively compile on ARM or doing a
        cross compilation. Unikraft's main makefile is able to detect
        this. This happens transparently. You can only influence it by
        setting the CROSS_COMPILE environment variable before calling
        make. You should need to remove the -mtune=cortex-a7 and
        -mcpu=cortex-a7 flags from
        unikraft/unikraft/arch/arm/Makefile.uk <http://efile.uk>.


    Sorry, a "no" was missing here: Keep the -mtune=cortex-a7 and
    -mcpu=cortex-a7 flags.


        In fact, your GCC version might be too old. Unfortunately
        Unikraft is not warning you yet but ARM published a patch series
        that is going to warn you in the future.

        On ARM, I just tested the native compile with
        gcc (Debian 6.3.0-18) 6.3.0 20170516

        I use the same for the cross compilation from x86:
        arm-linux-gnueabihf-gcc (Debian 6.3.0-18) 6.3.0 20170516

        For debugging, you can have a look what is getting called with
        the verbose option:
        make V=1


        Thanks,

        Simon

        On 30.04.2018 10:27, Ajay Garg wrote:

            https://github.com/nim-lang/Nim/issues/2620
            <https://github.com/nim-lang/Nim/issues/2620> suggests it
            might be due to (old) gcc version.

            Any chance we can get the following via cross-compilation :

                        * arm-options in menuconfig screen?
                        * actually cross-compile for arm32 in unikraft
            ecosystem?

            On Mon, Apr 30, 2018 at 12:25 PM, Ajay Garg
            <ajaygargnsit@xxxxxxxxx <mailto:ajaygargnsit@xxxxxxxxx>
            <mailto:ajaygargnsit@xxxxxxxxx
            <mailto:ajaygargnsit@xxxxxxxxx>>> wrote:

                 Hi Simon.




                     Right now, you can test Unikraft with Xen on arm32.
            Be aware
                     that there is a open bug on the memory allocator
            for arm
(see:https://wiki.xenproject.org/wiki/Category:Unikraft_Users <https://wiki.xenproject.org/wiki/Category:Unikraft_Users> <https://wiki.xenproject.org/wiki/Category:Unikraft_Users
            <https://wiki.xenproject.org/wiki/Category:Unikraft_Users>>).
                     arm64 with Xen is currently not supported but we
            working on it.
                     Same for KVM and baremetal.

                     We use cubieboard2/3 for arm32 tests. These boards
            are even
                     officially supported by Debian and can run Xen.



                 So we bought a cubieboard2 :)

                 Brought the board up without xen.
                 Then brought the board up with xen.

                 At this point, "sudo xl list" lists "Domain-0" fine.


                 Now, we are wanting to run the
            helloworld-unikraft-unikernel.

                 To keep aside any cross-compilation issues, we are
            compiling on
                 cubieboard2 itself.
                 Following is the .config file (majorly containing the
            "ukdebug" and
                 "ukboot" changes  required for arm32) :

#################################################################################

                 #
                 # Automatically generated file; DO NOT EDIT.
                 # Unikraft/0.2~8b94640 Configuration
                 #

                 #
                 # Architecture Selection
                 #
                 # ARCH_X86_64 is not set
                 ARCH_ARM_32=y
                 # MARCH_CORTEXA7 is not set
                 MARCH_A20NEON=y

                 #
                 # Platform Support
                 #
                 PLAT_XEN=y
                 XEN_DBGEMERGENCY=y
                 PLAT_LINUXU=y
                 LINUXU_DEFAULT_HEAPMB=4

                 #
                 # Library Configuration
                 #
                 HAVE_BOOTENTRY=y
                 # HAVE_LIBC is not set
                 # HAVE_SCHED is not set
                 LIBUKBOOT=y
                 LIBUKBOOT_BANNER=y
                 LIBUKBOOT_MAXNBARGS=60
                 # LIBUKBOOT_INITALLOC is not set
                 LIBUKDEBUG=y
                 LIBUKDEBUG_PRINTK=y
                 LIBUKDEBUG_PRINTD=y
                 # LIBUKDEBUG_PRINTD_EXTRA is not set
                 # LIBUKDEBUG_PRINTD_INFO is not set
                 # LIBUKDEBUG_PRINTD_WARN is not set
                 LIBUKDEBUG_PRINTD_ERR=y
                 # LIBUKDEBUG_PRINTD_CRIT is not set
                 # LIBUKDEBUG_NOREDIR is not set
                 # LIBUKDEBUG_REDIR_PRINTD is not set
                 LIBUKDEBUG_REDIR_PRINTK=y
                 LIBUKDEBUG_ENABLE_ASSERT=y
                 LIBUKARGPARSE=y
                 LIBNOLIBC=y
                 LIBUKALLOC=y
                 # LIBUKALLOC_IFPAGES is not set
                 # LIBUKALLOC_IFSTATS is not set
                 # LIBUKALLOCBBUDDY is not set
                 # LIBUKSCHED is not set
                 # LIBUKSCHEDCOOP is not set
                 LIBFDT=y

                 #
                 # Build Options
                 #
                 # OPTIMIZE_NONE is not set
                 OPTIMIZE_PERF=y
                 # OPTIMIZE_SIZE is not set
                 # OPTIMIZE_DEADELIM is not set
                 # DEBUG_SYMBOLS is not set
                 OPTIMIZE_STRIP=y
                 # RECORD_BUILDTIME is not set
                 CROSS_COMPILE=""

                 #
                 # Application Options
                 #
                 APPHELLOWORLD_DEPENDENCIES=y
                 APPHELLOWORLD_PRINTARGS=y
                 UK_NAME="helloworld"
#################################################################################



                 However, upon compilation, following is observed :

#################################################################################

                 debian@debian-armhf:~/unikraft/apps/helloworld$ make
                 make[1]: Entering directory
            '/home/debian/unikraft/unikraft'
                    CP      config
                    CC      libxenplat: hypervisor.o
                 cc1: error: bad value (cortex-a7) for -mcpu switch
                 cc1: error: bad value (cortex-a7) for -mtune switch
/home/debian/unikraft/unikraft/support/build/Makefile.build:48:
                 recipe for target
'/home/debian/unikraft/apps/helloworld/build/libxenplat/hypervisor.o'
            failed
                 make[1]: ***
[/home/debian/unikraft/apps/helloworld/build/libxenplat/hypervisor.o]
            Error
                 1
                 make[1]: Leaving directory '/home/debian/unikraft/unikraft'
                 Makefile:6: recipe for target 'all' failed
                 make: *** [all] Error 2
                 debian@debian-armhf:~/unikraft/apps/helloworld$
#################################################################################




                 So, we proceed to remove the -mtune=cortex-a7 and
            -mcpu=cortex-a7
                 flags from unikraft/unikraft/arch/arm/Makefile.uk
            <http://efile.uk>.
                 Thereafter, upon recompiling, we get

#################################################################################

                 debian@debian-armhf:~/unikraft/apps/helloworld$ make
                 make[1]: Entering directory
            '/home/debian/unikraft/unikraft'
                    CP      config
                    CC      libxenplat: hypervisor.o
                 In file included from
                 /home/debian/unikraft/unikraft/plat/xen/hypervisor.c:43:0:
/home/debian/unikraft/unikraft/include/uk/arch/atomic.h: In
            function
                 ‘ukarch_test_and_clr_bit’:
/home/debian/unikraft/unikraft/include/uk/arch/atomic.h:90:2:
                 warning: implicit declaration of function
            ‘__atomic_fetch_and’
                 [-Wimplicit-function-declaration]
/home/debian/unikraft/unikraft/include/uk/arch/atomic.h:90:40:
                 error: ‘__ATOMIC_RELAXED’ undeclared (first use in this
            function)
/home/debian/unikraft/unikraft/include/uk/arch/atomic.h:90:40:
            note:
                 each undeclared identifier is reported only once for
            each function
                 it appears in
/home/debian/unikraft/unikraft/include/uk/arch/atomic.h: In
            function
                 ‘ukarch_test_and_set_bit’:
/home/debian/unikraft/unikraft/include/uk/arch/atomic.h:105:2:
                 warning: implicit declaration of function
            ‘__atomic_fetch_or’
                 [-Wimplicit-function-declaration]
/home/debian/unikraft/unikraft/include/uk/arch/atomic.h:105:38:
                 error: ‘__ATOMIC_RELAXED’ undeclared (first use in this
            function)
/home/debian/unikraft/unikraft/include/uk/arch/atomic.h: In
            function
                 ‘ukarch_test_and_clr_bit_sync’:
/home/debian/unikraft/unikraft/include/uk/arch/atomic.h:148:40:
                 error: ‘__ATOMIC_SEQ_CST’ undeclared (first use in this
            function)
/home/debian/unikraft/unikraft/include/uk/arch/atomic.h: In
            function
                 ‘ukarch_test_and_set_bit_sync’:
/home/debian/unikraft/unikraft/include/uk/arch/atomic.h:161:38:
                 error: ‘__ATOMIC_SEQ_CST’ undeclared (first use in this
            function)
                 /home/debian/unikraft/unikraft/plat/xen/hypervisor.c:
            In function
                 ‘do_hypervisor_callback’:
/home/debian/unikraft/unikraft/plat/xen/hypervisor.c:71:2:
            warning:
                 implicit declaration of function ‘__atomic_exchange_n’
                 [-Wimplicit-function-declaration]
/home/debian/unikraft/unikraft/plat/xen/hypervisor.c:71:7:
            error:
                 ‘__ATOMIC_SEQ_CST’ undeclared (first use in this function)
/home/debian/unikraft/unikraft/support/build/Makefile.build:48:
                 recipe for target
'/home/debian/unikraft/apps/helloworld/build/libxenplat/hypervisor.o'
            failed
                 make[1]: ***
[/home/debian/unikraft/apps/helloworld/build/libxenplat/hypervisor.o]
            Error
                 1
                 make[1]: Leaving directory '/home/debian/unikraft/unikraft'
                 Makefile:6: recipe for target 'all' failed
                 make: *** [all] Error 2
#################################################################################



                 What are we missing?


                 Thanks and Regards,
                 Ajay


                         Thanks and Regards,
                         Ajay



                     Thanks,

                     Simon




                 --     Regards,
                 Ajay




-- Regards,
            Ajay




--
Regards,
Ajay

_______________________________________________
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®.