From 7d27d28bed4ece8c57d97b3abbb7aadbf5a79290 Mon Sep 17 00:00:00 2001 From: Axel Heider Date: Tue, 9 Apr 2024 21:22:56 +0200 Subject: [PATCH 1/3] arm: avoid attic assembly syntax Clang does not support the attic syntax. Signed-off-by: Axel Heider --- .../sel4_arch_include/aarch32/sel4_arch/fault.h | 2 +- .../sel4_arch_include/aarch32/sel4_arch/hardware.h | 2 +- .../sel4_arch_include/aarch32/sel4_arch/ipc.h | 12 ++++++------ .../sel4_arch_include/aarch32/sel4_arch/signal.h | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/libsel4benchsupport/sel4_arch_include/aarch32/sel4_arch/fault.h b/libsel4benchsupport/sel4_arch_include/aarch32/sel4_arch/fault.h index c3d70e6e..8669bb87 100644 --- a/libsel4benchsupport/sel4_arch_include/aarch32/sel4_arch/fault.h +++ b/libsel4benchsupport/sel4_arch_include/aarch32/sel4_arch/fault.h @@ -38,5 +38,5 @@ } while(0) #endif /* CONFIG_KERNEL_MCS */ -#define DO_REAL_REPLY_RECV_1(ep, mr0, ro) DO_REPLY_RECV_1(ep, mr0, ro, "swi $0") +#define DO_REAL_REPLY_RECV_1(ep, mr0, ro) DO_REPLY_RECV_1(ep, mr0, ro, "swi #0") #define DO_NOP_REPLY_RECV_1(ep, mr0, ro) DO_REPLY_RECV_1(ep, mr0, ro, "nop") diff --git a/libsel4benchsupport/sel4_arch_include/aarch32/sel4_arch/hardware.h b/libsel4benchsupport/sel4_arch_include/aarch32/sel4_arch/hardware.h index 1e26edcc..01b45d55 100644 --- a/libsel4benchsupport/sel4_arch_include/aarch32/sel4_arch/hardware.h +++ b/libsel4benchsupport/sel4_arch_include/aarch32/sel4_arch/hardware.h @@ -14,5 +14,5 @@ ); \ } while (0); -#define DO_REAL_NULLSYSCALL() DO_NULLSYSCALL("swi $0") +#define DO_REAL_NULLSYSCALL() DO_NULLSYSCALL("swi #0") #define DO_NOP_NULLSYSCALL() DO_NULLSYSCALL("nop") diff --git a/libsel4benchsupport/sel4_arch_include/aarch32/sel4_arch/ipc.h b/libsel4benchsupport/sel4_arch_include/aarch32/sel4_arch/ipc.h index 1304c3e0..a80a8eca 100644 --- a/libsel4benchsupport/sel4_arch_include/aarch32/sel4_arch/ipc.h +++ b/libsel4benchsupport/sel4_arch_include/aarch32/sel4_arch/ipc.h @@ -106,16 +106,16 @@ } while(0) #endif /* CONFIG_KERNEL_MCS */ -#define DO_REAL_CALL(ep, tag) DO_CALL(ep, tag, "swi $0") +#define DO_REAL_CALL(ep, tag) DO_CALL(ep, tag, "swi #0") #define DO_NOP_CALL(ep, tag) DO_CALL(ep, tag, "nop") -#define DO_REAL_CALL_10(ep, tag) DO_CALL_10(ep, tag, "swi $0") +#define DO_REAL_CALL_10(ep, tag) DO_CALL_10(ep, tag, "swi #0") #define DO_NOP_CALL_10(ep, tag) DO_CALL_10(ep, tag, "nop") -#define DO_REAL_SEND(ep, tag) DO_SEND(ep, tag, "swi $0") +#define DO_REAL_SEND(ep, tag) DO_SEND(ep, tag, "swi #0") #define DO_NOP_SEND(ep, tag) DO_SEND(ep, tag, "nop") -#define DO_REAL_REPLY_RECV(ep, tag, ro) DO_REPLY_RECV(ep, tag, ro, "swi $0") +#define DO_REAL_REPLY_RECV(ep, tag, ro) DO_REPLY_RECV(ep, tag, ro, "swi #0") #define DO_NOP_REPLY_RECV(ep, tag, ro) DO_REPLY_RECV(ep, tag, ro, "nop") -#define DO_REAL_REPLY_RECV_10(ep, tag, ro) DO_REPLY_RECV_10(ep, tag, ro, "swi $0") +#define DO_REAL_REPLY_RECV_10(ep, tag, ro) DO_REPLY_RECV_10(ep, tag, ro, "swi #0") #define DO_NOP_REPLY_RECV_10(ep, tag, ro) DO_REPLY_RECV_10(ep, tag, ro, "nop") -#define DO_REAL_RECV(ep, ro) DO_RECV(ep, ro, "swi $0") +#define DO_REAL_RECV(ep, ro) DO_RECV(ep, ro, "swi #0") #define DO_NOP_RECV(ep, ro) DO_RECV(ep, ro, "nop") diff --git a/libsel4benchsupport/sel4_arch_include/aarch32/sel4_arch/signal.h b/libsel4benchsupport/sel4_arch_include/aarch32/sel4_arch/signal.h index fd977a95..69c562a7 100644 --- a/libsel4benchsupport/sel4_arch_include/aarch32/sel4_arch/signal.h +++ b/libsel4benchsupport/sel4_arch_include/aarch32/sel4_arch/signal.h @@ -24,7 +24,7 @@ #endif #define DO_SIGNAL(ntfn, swi) DO_NTFN_OP(ntfn, swi, seL4_SysSend) -#define DO_REAL_WAIT(ntfn) DO_WAIT(ntfn, "swi $0") +#define DO_REAL_WAIT(ntfn) DO_WAIT(ntfn, "swi #0") #define DO_NOP_WAIT(ntfn) DO_WAIT(ntfn, "nop") -#define DO_REAL_SIGNAL(ntfn) DO_SIGNAL(ntfn, "swi $0") +#define DO_REAL_SIGNAL(ntfn) DO_SIGNAL(ntfn, "swi #0") #define DO_NOP_SIGNAL(ntfn) DO_SIGNAL(ntfn, "nop") From d9e1d6a0e6971398a13c959d07cfb5eb8f75dbe1 Mon Sep 17 00:00:00 2001 From: Axel Heider Date: Tue, 9 Apr 2024 19:42:02 +0200 Subject: [PATCH 2/3] support compiling with clang Signed-off-by: Axel Heider --- settings.cmake | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/settings.cmake b/settings.cmake index 54af1d77..eb53c4ab 100644 --- a/settings.cmake +++ b/settings.cmake @@ -64,7 +64,14 @@ if(NOT Sel4benchAllowSettingsOverride) # This option is controlled by ApplyCommonReleaseVerificationSettings mark_as_advanced(CMAKE_BUILD_TYPE) if(RELEASE) - if(NOT KernelArchRiscV) + # Known issues with KernelFWholeProgram ('-fwhole-program'): + # - the RISC-V kernel build with gcc currently fails due to a missing + # compiler runtime helper function. + # - this option is not supposed by 'clang' at all. Note that we can't + # check CMAKE_C_COMPILER_ID here, because it is empty, as this file + # might get processed before CMake does any compiler evaluation. Thus, + # the only option is checking if TRIPLE is set or not. + if((NOT KernelArchRiscV) AND (TRIPLE STREQUAL "")) set(KernelFWholeProgram ON CACHE BOOL "" FORCE) endif() endif() From f372bdb6925e5364eb96da55ccfead8422f2bd67 Mon Sep 17 00:00:00 2001 From: Axel Heider Date: Tue, 9 Apr 2024 19:50:16 +0200 Subject: [PATCH 3/3] CI: run for gcc and clang Signed-off-by: Axel Heider --- .github/workflows/sel4bench-pr.yml | 9 ++++++--- .github/workflows/sel4bench.yml | 18 ++++++++++-------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/.github/workflows/sel4bench-pr.yml b/.github/workflows/sel4bench-pr.yml index a8ad7934..47fce34e 100644 --- a/.github/workflows/sel4bench-pr.yml +++ b/.github/workflows/sel4bench-pr.yml @@ -44,16 +44,18 @@ jobs: fail-fast: false matrix: march: [armv7a, armv8a, nehalem, rv64imac] + compiler: [gcc, clang] steps: - name: Build uses: seL4/ci-actions/sel4bench@master with: xml: ${{ needs.code.outputs.xml }} march: ${{ matrix.march }} + compiler: ${{ matrix.compiler }} - name: Upload images uses: actions/upload-artifact@v4 with: - name: images-${{ matrix.march }} + name: images-${{ matrix.march }}-${{ matrix.compiler }} path: '*-images.tar.gz' hw-run: @@ -100,7 +102,8 @@ jobs: - name: Download image uses: actions/download-artifact@v4 with: - name: images-${{ steps.plat.outputs.march }} + pattern: images-${{ steps.plat.outputs.march }}-* + merge-multiple: true - name: Run uses: seL4/ci-actions/sel4bench-hw@master with: @@ -113,5 +116,5 @@ jobs: uses: actions/upload-artifact@v4 with: # funky expression below is to work around lack of ternary operator - name: sel4bench-results-${{ matrix.platform }}${{ matrix.req != '' && format('-{0}', matrix.req) || '' }} + name: sel4bench-results-${{ matrix.platform }}${{ matrix.req != '' && format('-{0}', matrix.req) || '' }}-${{matrix.compiler}} path: '*.json' diff --git a/.github/workflows/sel4bench.yml b/.github/workflows/sel4bench.yml index 22c4fcb6..1016bca7 100644 --- a/.github/workflows/sel4bench.yml +++ b/.github/workflows/sel4bench.yml @@ -40,16 +40,18 @@ jobs: fail-fast: false matrix: march: [armv7a, armv8a, nehalem, rv64imac] + compiler: [gcc, clang] steps: - name: Build uses: seL4/ci-actions/sel4bench@master with: xml: ${{ needs.code.outputs.xml }} march: ${{ matrix.march }} + compiler: ${{ matrix.compiler }} - name: Upload images uses: actions/upload-artifact@v4 with: - name: images-${{ matrix.march }} + name: images-${{ matrix.march }}-${{matrix.compiler}} path: '*-images.tar.gz' hw-run: @@ -90,7 +92,7 @@ jobs: - name: Download image uses: actions/download-artifact@v4 with: - name: images-${{ steps.plat.outputs.march }} + name: images-${{ steps.plat.outputs.march }}-${{matrix.compiler}} - name: Run uses: seL4/ci-actions/sel4bench-hw@master with: @@ -103,7 +105,7 @@ jobs: uses: actions/upload-artifact@v4 with: # funky expression below is to work around lack of ternary operator - name: sel4bench-results-${{ matrix.platform }}${{ matrix.req != '' && format('-{0}', matrix.req) || '' }} + name: sel4bench-results-${{ matrix.platform }}${{ matrix.req != '' && format('-{0}', matrix.req) || '' }}-${{matrix.compiler}} path: '*.json' deploy: @@ -128,23 +130,23 @@ jobs: - name: Get results for web deployment (sabre) uses: actions/download-artifact@v4 with: - name: sel4bench-results-sabre + name: sel4bench-results-sabre-gcc - name: Get results for web deployment (haswell) uses: actions/download-artifact@v4 with: - name: sel4bench-results-pc99-haswell3 + name: sel4bench-results-pc99-haswell3-gcc - name: Get results for web deployment (skylake) uses: actions/download-artifact@v4 with: - name: sel4bench-results-pc99-skylake + name: sel4bench-results-pc99-skylake-gcc - name: Get results for web deployment (tx1) uses: actions/download-artifact@v4 with: - name: sel4bench-results-tx1 + name: sel4bench-results-tx1-gcc - name: Get results for web deployment (hifive) uses: actions/download-artifact@v4 with: - name: sel4bench-results-hifive + name: sel4bench-results-hifive-gcc - name: Generate web page uses: seL4/ci-actions/sel4bench-web@master with: