From 85c1cd3fd0f0f1bfea6847042bbb2965e01b89b3 Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Fri, 26 Aug 2016 19:44:02 +0200 Subject: [PATCH 1/5] Align assembly functions to a cacheline (64 byte) --- hermit/arch/x86/kernel/entry.asm | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/hermit/arch/x86/kernel/entry.asm b/hermit/arch/x86/kernel/entry.asm index 1512de6f6..cd5af54a7 100644 --- a/hermit/arch/x86/kernel/entry.asm +++ b/hermit/arch/x86/kernel/entry.asm @@ -221,6 +221,7 @@ L1: jmp $ %if MAX_CORES > 1 +ALIGN 64 Lsmp_main: xor rax, rax mov eax, DWORD [current_boot_id] @@ -237,7 +238,7 @@ Lsmp_main: jmp $ %endif -ALIGN 4 +ALIGN 64 global gdt_flush extern gp @@ -259,7 +260,7 @@ gdt_flush: ; NASM macro which pushs also an pseudo error code %macro isrstub_pseudo_error 1 global isr%1 - align 16 + align 64 isr%1: push byte 0 ; pseudo error code push byte %1 @@ -271,7 +272,7 @@ gdt_flush: ; on the stack. %macro isrstub 1 global isr%1 - align 16 + align 64 isr%1: push byte %1 jmp common_stub @@ -324,7 +325,7 @@ isrstub_pseudo_error 9 ; NASM macro for asynchronous interrupts (no exceptions) %macro irqstub 1 global irq%1 - align 16 + align 64 irq%1: push byte 0 ; pseudo error code push byte 32+%1 @@ -346,49 +347,49 @@ isrstub_pseudo_error 9 %endrep global apic_timer -align 16 +align 64 apic_timer: push byte 0 ; pseudo error code push byte 123 jmp common_stub global apic_lint0 -align 16 +align 64 apic_lint0: push byte 0 ; pseudo error code push byte 124 jmp common_stub global apic_lint1 -align 16 +align 64 apic_lint1: push byte 0 ; pseudo error code push byte 125 jmp common_stub global apic_error -align 16 +align 64 apic_error: push byte 0 ; pseudo error code push byte 126 jmp common_stub global apic_svr -align 16 +align 64 apic_svr: push byte 0 ; pseudo error code push byte 127 jmp common_stub global wakeup -align 16 +align 64 wakeup: push byte 0 ; pseudo error code push byte 121 jmp common_stub global mmnif_irq -align 16 +align 64 mmnif_irq: push byte 0 ; pseudo error code push byte 122 @@ -403,7 +404,7 @@ extern kernel_stack ; libos => no syscall interface required %if 0 global isrsyscall -align 16 +align 64 ; used to realize system calls isrsyscall: ; IF flag is already cleared @@ -478,7 +479,7 @@ isrsyscall: %endif global switch_context -align 16 +align 64 switch_context: ; by entering a function the DF flag has to be cleared => see ABI cld @@ -534,11 +535,11 @@ Lgo1: jmp common_switch -align 4 +align 64 rollback: ret -align 4 +align 64 common_stub: push rax push rcx From 6314f26c668509eaf0e38f057c7e72faa6d7cf72 Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Fri, 26 Aug 2016 19:57:36 +0200 Subject: [PATCH 2/5] add missing alignment --- hermit/arch/x86/kernel/entry.asm | 1 + 1 file changed, 1 insertion(+) diff --git a/hermit/arch/x86/kernel/entry.asm b/hermit/arch/x86/kernel/entry.asm index cd5af54a7..3b431a11f 100644 --- a/hermit/arch/x86/kernel/entry.asm +++ b/hermit/arch/x86/kernel/entry.asm @@ -654,6 +654,7 @@ Lgo3: iretq global is_single_kernel +align 64 is_single_kernel: mov eax, DWORD [single_kernel] ret From 420fc26c1eb71f71db6683969cd5688972423b03 Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Fri, 26 Aug 2016 20:10:45 +0200 Subject: [PATCH 3/5] add qemu-system-x86 in the list of required packets --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3fc4f227b..227ca8bf3 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Following software packets are required to build HermitCore on a Linux system: On Ubuntu the packets could be installed with following command: ``` - sudo apt-get install nasm texinfo libmpfr-dev libmpc-dev libgmp-dev libisl-dev flex bison + sudo apt-get install qemu-system-x86 nasm texinfo libmpfr-dev libmpc-dev libgmp-dev libisl-dev flex bison ``` ## Building and testing HermitCore within a virtual machine @@ -83,6 +83,6 @@ The following example starts the stream benchmark in a virtual machine, which ha HERMIT_ISLE=qemu HERMIT_CPUS=4 HERMIT_MEM=6G hermit/usr/benchmarks/stream ``` -## Tips and tricks +## Tips 1. By setting the environment variable `HERMIT_VERBOSE` to `1`, the proxy prints at termination the kernel log messages on the screen. From 652345d1ad64747def1b2daa7f987a36b9fd715b Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Fri, 26 Aug 2016 20:27:01 +0200 Subject: [PATCH 4/5] add rule to avoid building the complete linux kernel --- Makefile.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile.in b/Makefile.in index 9554547d6..44b54a458 100644 --- a/Makefile.in +++ b/Makefile.in @@ -6,6 +6,10 @@ default: linux/arch/x86/boot/bzImage make PATH=$(PATH):$(CROSSDIR) -C hermit make PATH=$(PATH):$(CROSSDIR) -C hermit/tools proxy +travis: + make PATH=$(PATH):$(CROSSDIR) -C hermit + make PATH=$(PATH):$(CROSSDIR) -C hermit/tools proxy + all: default linux/arch/x86/boot/bzImage: From 405ac2d1d55d58ece0e18e84a8b9cdb3484963f4 Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Fri, 26 Aug 2016 20:35:35 +0200 Subject: [PATCH 5/5] avoid downloading the linux image --- .travis.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index af7dc14d1..cc6d84887 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,14 +11,11 @@ before_install: - git submodule update --init hermit/lwip hermit/usr/gcc hermit/usr/pte hermit/usr/libomp script: - ./configure - - wget https://www.lankes.org/deploy/bzImage - - mkdir -p linux/arch/x86/boot/ - - mv bzImage linux/arch/x86/boot/ - wget https://www.lankes.org/deploy/newlib.tar.gz - tar xzf newlib.tar.gz - mv tmp hermit/usr/ - mv x86 hermit/usr/ - - make T=1 + - make T=1 travis env: global: - TOPDIR=`pwd`/../..