Closed xurtis closed 4 years ago
I need to look through more closely, but after a quick look I think I understand what's happening and don't currently have any questions
@ssrg-bamboo test
Hello, I'm a bot! I'll bring this PR into Trustworthy Systems and run some tests
Test name | Result |
---|---|
Code Quality - Check licenses - sel4runtime - EXT-xurtis-no-muslc-6 | FAILED |
Code Quality - Style - sel4runtime - EXT-xurtis-no-muslc-6 | FAILED |
Project | Stage | Result summary |
---|---|---|
Code Quality - Check licenses - sel4runtime - EXT-xurtis-no-muslc-6 | Check licenses | 1 of 1 job failed |
Job: lic Build logs
18-Sep-2020 11:02:00 Build Code Quality - Check licenses - sel4runtime - EXT-xurtis-no-muslc-6 - lic #1 (CQ-SEL4RUNTIMECL8-SEL4RUNTIMELICCQ-1) started building on agent A local agent 1
18-Sep-2020 11:02:00 I run on the Bamboo server!
18-Sep-2020 11:02:00 Build working directory is /var/atlassian/application-data/bamboo/xml-data/build-dir/140083221/CQ-SEL4RUNTIMECL8-SEL4RUNTIMELICCQ
18-Sep-2020 11:02:00 Executing build Code Quality - Check licenses - sel4runtime - EXT-xurtis-no-muslc-6 - lic #1 (CQ-SEL4RUNTIMECL8-SEL4RUNTIMELICCQ-1)
18-Sep-2020 11:02:00 Preparing artifact 'code' for use at /var/atlassian/application-data/bamboo/xml-data/build-dir/140083221/CQ-SEL4RUNTIMECL8-SEL4RUNTIMELICCQ/. (location: .)
18-Sep-2020 11:02:00 Artifact 'code' prepared in 26.55 ms at /var/atlassian/application-data/bamboo/xml-data/build-dir/140083221/CQ-SEL4RUNTIMECL8-SEL4RUNTIMELICCQ/./code.tar.gz
18-Sep-2020 11:02:00 Running pre-build action: VCS Version Collector
18-Sep-2020 11:02:00 Starting task 'Untar code' of type 'com.atlassian.bamboo.plugins.scripttask:task.builder.script'
18-Sep-2020 11:02:00 + tar xf code.tar.gz --recursive-unlink
18-Sep-2020 11:02:00 Finished task 'Untar code' with result: Success
18-Sep-2020 11:02:00 Starting task 'Set permissions so Bamboo can cleanup' of type 'com.atlassian.bamboo.plugins.scripttask:task.builder.script'
18-Sep-2020 11:02:00 + chmod -R o+rwx /var/atlassian/application-data/bamboo/xml-data/build-dir/140083221/CQ-SEL4RUNTIMECL8-SEL4RUNTIMELICCQ
18-Sep-2020 11:02:00 Finished task 'Set permissions so Bamboo can cleanup' with result: Success
18-Sep-2020 11:02:00 Starting task 'Check license' of type 'com.atlassian.bamboo.plugins.scripttask:task.builder.script'
18-Sep-2020 11:02:00 + python license-tool/check_license.py sel4runtime
18-Sep-2020 11:02:01 ERROR:root:sel4runtime/include/sel4runtime/elf.h: sel4runtime/include/sel4runtime/elf.h: no owner found
18-Sep-2020 11:02:01 ERROR:root:sel4runtime/include/sel4runtime/stddef.h: sel4runtime/include/sel4runtime/stddef.h: no owner found
18-Sep-2020 11:02:01 ERROR:root:sel4runtime/include/sel4runtime/stdint.h: sel4runtime/include/sel4runtime/stdint.h: no owner found
18-Sep-2020 11:02:01 ERROR:root:sel4runtime/src/vsyscall.c: sel4runtime/src/vsyscall.c: no owner found
18-Sep-2020 11:02:01 Failing task since return code of [/var/atlassian/application-data/bamboo/temp/CQ-SEL4RUNTIMECL8-SEL4RUNTIMELICCQ-1-ScriptBuildTask-8400676720571547236.sh] was 1 while expected 0
18-Sep-2020 11:02:01 Finished task 'Check license' with result: Failed
18-Sep-2020 11:02:01 Starting task 'Set permissions so Bamboo can cleanup' of type 'com.atlassian.bamboo.plugins.scripttask:task.builder.script'
18-Sep-2020 11:02:01 + chmod -R o+rwx /var/atlassian/application-data/bamboo/xml-data/build-dir/140083221/CQ-SEL4RUNTIMECL8-SEL4RUNTIMELICCQ
18-Sep-2020 11:02:01 Finished task 'Set permissions so Bamboo can cleanup' with result: Success
18-Sep-2020 11:02:01 Running post build plugin 'NCover Results Collector'
18-Sep-2020 11:02:01 Running post build plugin 'Artifact Copier'
18-Sep-2020 11:02:01 Running post build plugin 'npm Cache Cleanup'
18-Sep-2020 11:02:01 Running post build plugin 'Clover Results Collector'
18-Sep-2020 11:02:01 Running post build plugin 'Docker Container Cleanup'
18-Sep-2020 11:02:01 Successfully removed working directory at '/var/atlassian/application-data/bamboo/xml-data/build-dir/140083221/CQ-SEL4RUNTIMECL8-SEL4RUNTIMELICCQ'
18-Sep-2020 11:02:01 Finalising the build...
18-Sep-2020 11:02:01 Stopping timer.
18-Sep-2020 11:02:01 Build CQ-SEL4RUNTIMECL8-SEL4RUNTIMELICCQ-1 completed.
18-Sep-2020 11:02:01 Running on server: post build plugin 'NCover Results Collector'
18-Sep-2020 11:02:01 Running on server: post build plugin 'Build Hanging Detection Configuration'
18-Sep-2020 11:02:01 Running on server: post build plugin 'Clover Delta Calculator'
18-Sep-2020 11:02:01 Running on server: post build plugin 'Maven Dependencies Postprocessor'
18-Sep-2020 11:02:01 All post build plugins have finished
18-Sep-2020 11:02:01 Generating build results summary...
18-Sep-2020 11:02:01 Saving build results to disk...
18-Sep-2020 11:02:01 Store variable context...
18-Sep-2020 11:02:01 Indexing build results...
18-Sep-2020 11:02:01 Finished building CQ-SEL4RUNTIMECL8-SEL4RUNTIMELICCQ-1.
Project | Stage | Result summary |
---|---|---|
Code Quality - Style - sel4runtime - EXT-xurtis-no-muslc-6 | Style check on changed files | 1 of 3 jobs failed |
Job: style Build logs
18-Sep-2020 11:02:02 Build Code Quality - Style - sel4runtime - EXT-xurtis-no-muslc-6 - style #1 (CQ-SEL4RUNTIMESTYLE8-SEL4RUNTIMESTYLEPR-1) started building on agent A local agent 1
18-Sep-2020 11:02:02 I run on the Bamboo server!
18-Sep-2020 11:02:02 Build working directory is /var/atlassian/application-data/bamboo/xml-data/build-dir/140083221/CQ-SEL4RUNTIMESTYLE8-SEL4RUNTIMESTYLEPR
18-Sep-2020 11:02:02 Executing build Code Quality - Style - sel4runtime - EXT-xurtis-no-muslc-6 - style #1 (CQ-SEL4RUNTIMESTYLE8-SEL4RUNTIMESTYLEPR-1)
18-Sep-2020 11:02:02 Preparing artifact 'code' for use at /var/atlassian/application-data/bamboo/xml-data/build-dir/140083221/CQ-SEL4RUNTIMESTYLE8-SEL4RUNTIMESTYLEPR/. (location: .)
18-Sep-2020 11:02:02 Artifact 'code' prepared in 30.83 ms at /var/atlassian/application-data/bamboo/xml-data/build-dir/140083221/CQ-SEL4RUNTIMESTYLE8-SEL4RUNTIMESTYLEPR/./code.tar.gz
18-Sep-2020 11:02:02 Running pre-build action: VCS Version Collector
18-Sep-2020 11:02:02 Starting task 'Untar code' of type 'com.atlassian.bamboo.plugins.scripttask:task.builder.script'
18-Sep-2020 11:02:02 + tar xf code.tar.gz --recursive-unlink
18-Sep-2020 11:02:02 Finished task 'Untar code' with result: Success
18-Sep-2020 11:02:02 Starting task 'Set permissions so Bamboo can cleanup' of type 'com.atlassian.bamboo.plugins.scripttask:task.builder.script'
18-Sep-2020 11:02:02 + chmod -R o+rwx /var/atlassian/application-data/bamboo/xml-data/build-dir/140083221/CQ-SEL4RUNTIMESTYLE8-SEL4RUNTIMESTYLEPR
18-Sep-2020 11:02:02 Finished task 'Set permissions so Bamboo can cleanup' with result: Success
18-Sep-2020 11:02:02 Starting task 'Check style of changed files' of type 'com.atlassian.bamboo.plugins.scripttask:task.builder.script'
18-Sep-2020 11:02:02 + cd sel4runtime
18-Sep-2020 11:02:02 + xargs -d '\n' /var/atlassian/application-data/bamboo/xml-data/build-dir/140083221/CQ-SEL4RUNTIMESTYLE8-SEL4RUNTIMESTYLEPR/seL4_tools/misc/style.sh
18-Sep-2020 11:02:02 ++ git merge-base 3398eac8a640f7ec1b49b4275e5587b5eddb8930 4e4705c7503ea82ed8611fb4f597e66706b57309
18-Sep-2020 11:02:02 + git diff --name-only 3398eac8a640f7ec1b49b4275e5587b5eddb8930 4e4705c7503ea82ed8611fb4f597e66706b57309
18-Sep-2020 11:02:02 Unchanged include/arch/riscv/sel4runtime/thread_arch.h
18-Sep-2020 11:02:02 Unchanged include/mode/32/sel4runtime/mode/elf.h
18-Sep-2020 11:02:02 Unchanged include/mode/64/sel4runtime/mode/elf.h
18-Sep-2020 11:02:02 Unchanged include/sel4_arch/aarch32/sel4runtime/thread_arch.h
18-Sep-2020 11:02:02 Formatted include/sel4_arch/aarch64/sel4runtime/thread_arch.h
18-Sep-2020 11:02:02 Unchanged include/sel4_arch/ia32/sel4runtime/thread_arch.h
18-Sep-2020 11:02:02 Unchanged include/sel4_arch/x86_64/sel4runtime/thread_arch.h
18-Sep-2020 11:02:02 Unchanged include/sel4runtime.h
18-Sep-2020 11:02:02 Unchanged include/sel4runtime/auxv.h
18-Sep-2020 11:02:02 Unchanged include/sel4runtime/elf.h
18-Sep-2020 11:02:02 Unchanged include/sel4runtime/start.h
18-Sep-2020 11:02:02 Unchanged include/sel4runtime/stddef.h
18-Sep-2020 11:02:02 Unchanged include/sel4runtime/stdint.h
18-Sep-2020 11:02:02 Unchanged src/crt1.c
18-Sep-2020 11:02:02 Unchanged src/env.c
18-Sep-2020 11:02:02 Formatted src/memcpy.c
18-Sep-2020 11:02:02 Formatted src/memset.c
18-Sep-2020 11:02:02 Unchanged src/start_root.c
18-Sep-2020 11:02:02 Unchanged src/util.h
18-Sep-2020 11:02:02 Unchanged src/vsyscall.c
18-Sep-2020 11:02:04 + git diff --exit-code
18-Sep-2020 11:02:04 diff --git a/include/sel4_arch/aarch64/sel4runtime/thread_arch.h b/include/sel4_arch/aarch64/sel4runtime/thread_arch.h
18-Sep-2020 11:02:04 index 615f466..56426df 100644
18-Sep-2020 11:02:04 --- a/include/sel4_arch/aarch64/sel4runtime/thread_arch.h
18-Sep-2020 11:02:04 +++ b/include/sel4_arch/aarch64/sel4runtime/thread_arch.h
18-Sep-2020 11:02:04 @@ -14,33 +14,38 @@
18-Sep-2020 11:02:04 /*
18-Sep-2020 11:02:04 * Obtain the value of the TLS base for the current thread.
18-Sep-2020 11:02:04 */
18-Sep-2020 11:02:04 -static inline sel4runtime_uintptr_t sel4runtime_read_tpidr_el0(void) {
18-Sep-2020 11:02:04 +static inline sel4runtime_uintptr_t sel4runtime_read_tpidr_el0(void)
18-Sep-2020 11:02:04 +{
18-Sep-2020 11:02:04 sel4runtime_uintptr_t reg;
18-Sep-2020 11:02:04 - __asm__ __volatile__ ("mrs %0,tpidr_el0" : "=r"(reg));
18-Sep-2020 11:02:04 + __asm__ __volatile__("mrs %0,tpidr_el0" : "=r"(reg));
18-Sep-2020 11:02:04 return reg;
18-Sep-2020 11:02:04 }
18-Sep-2020 11:02:04
18-Sep-2020 11:02:04 -static inline void sel4runtime_write_tpidr_el0(sel4runtime_uintptr_t reg) {
18-Sep-2020 11:02:04 - __asm__ __volatile__ ("msr tpidr_el0,%0" :: "r"(reg));
18-Sep-2020 11:02:04 +static inline void sel4runtime_write_tpidr_el0(sel4runtime_uintptr_t reg)
18-Sep-2020 11:02:04 +{
18-Sep-2020 11:02:04 + __asm__ __volatile__("msr tpidr_el0,%0" :: "r"(reg));
18-Sep-2020 11:02:04 }
18-Sep-2020 11:02:04
18-Sep-2020 11:02:04 -static inline sel4runtime_uintptr_t sel4runtime_read_tpidrro_el0(void) {
18-Sep-2020 11:02:04 +static inline sel4runtime_uintptr_t sel4runtime_read_tpidrro_el0(void)
18-Sep-2020 11:02:04 +{
18-Sep-2020 11:02:04 sel4runtime_uintptr_t reg;
18-Sep-2020 11:02:04 - __asm__ __volatile__ ("mrs %0,tpidrro_el0" : "=r"(reg));
18-Sep-2020 11:02:04 + __asm__ __volatile__("mrs %0,tpidrro_el0" : "=r"(reg));
18-Sep-2020 11:02:04 return reg;
18-Sep-2020 11:02:04 }
18-Sep-2020 11:02:04
18-Sep-2020 11:02:04 /*
18-Sep-2020 11:02:04 * Obtain the value of the TLS base for the current thread.
18-Sep-2020 11:02:04 */
18-Sep-2020 11:02:04 -static inline sel4runtime_uintptr_t sel4runtime_get_tls_base(void) {
18-Sep-2020 11:02:04 +static inline sel4runtime_uintptr_t sel4runtime_get_tls_base(void)
18-Sep-2020 11:02:04 +{
18-Sep-2020 11:02:04 return sel4runtime_read_tpidr_el0();
18-Sep-2020 11:02:04 }
18-Sep-2020 11:02:04
18-Sep-2020 11:02:04 /*
18-Sep-2020 11:02:04 * Set the value of the TLS base for the current thread.
18-Sep-2020 11:02:04 */
18-Sep-2020 11:02:04 -static inline void sel4runtime_set_tls_base(sel4runtime_uintptr_t tls_base) {
18-Sep-2020 11:02:04 +static inline void sel4runtime_set_tls_base(sel4runtime_uintptr_t tls_base)
18-Sep-2020 11:02:04 +{
18-Sep-2020 11:02:04 sel4runtime_write_tpidr_el0(tls_base);
18-Sep-2020 11:02:04 }
18-Sep-2020 11:02:04
18-Sep-2020 11:02:04 diff --git a/src/memcpy.c b/src/memcpy.c
18-Sep-2020 11:02:04 index ffa7efe..5a8b333 100644
18-Sep-2020 11:02:04 --- a/src/memcpy.c
18-Sep-2020 11:02:04 +++ b/src/memcpy.c
18-Sep-2020 11:02:04 @@ -28,8 +28,8 @@
18-Sep-2020 11:02:04
18-Sep-2020 11:02:04 void *__sel4runtime_memcpy(void *restrict dest, const void *restrict src, sel4runtime_size_t n)
18-Sep-2020 11:02:04 {
18-Sep-2020 11:02:04 + unsigned char *d = dest;
18-Sep-2020 11:02:04 + const unsigned char *s = src;
18-Sep-2020 11:02:04
18-Sep-2020 11:02:04 #ifdef __GNUC__
18-Sep-2020 11:02:04
18-Sep-2020 11:02:04 @@ -41,108 +41,137 @@ void *__sel4runtime_memcpy(void *restrict dest, const void *restrict src, sel4ru
18-Sep-2020 11:02:04 #define RS >>
18-Sep-2020 11:02:04 #endif
18-Sep-2020 11:02:04
18-Sep-2020 11:02:04 + typedef sel4runtime_uint32_t __attribute__((__may_alias__)) u32;
18-Sep-2020 11:02:04 + sel4runtime_uint32_t w, x;
18-Sep-2020 11:02:04
18-Sep-2020 11:02:04 + for (; (sel4runtime_uintptr_t)s % 4 && n; n--) {
18-Sep-2020 11:02:04 + *d++ = *s++;
18-Sep-2020 11:02:04 + }
18-Sep-2020 11:02:04
18-Sep-2020 11:02:04 + if ((sel4runtime_uintptr_t)d % 4 == 0) {
18-Sep-2020 11:02:04 + for (; n >= 16; s += 16, d += 16, n -= 16) {
18-Sep-2020 11:02:04 + *(u32 *)(d + 0) = *(u32 *)(s + 0);
18-Sep-2020 11:02:04 + *(u32 *)(d + 4) = *(u32 *)(s + 4);
18-Sep-2020 11:02:04 + *(u32 *)(d + 8) = *(u32 *)(s + 8);
18-Sep-2020 11:02:04 + *(u32 *)(d + 12) = *(u32 *)(s + 12);
18-Sep-2020 11:02:04 + }
18-Sep-2020 11:02:04 + if (n & 8) {
18-Sep-2020 11:02:04 + *(u32 *)(d + 0) = *(u32 *)(s + 0);
18-Sep-2020 11:02:04 + *(u32 *)(d + 4) = *(u32 *)(s + 4);
18-Sep-2020 11:02:04 + d += 8;
18-Sep-2020 11:02:04 + s += 8;
18-Sep-2020 11:02:04 + }
18-Sep-2020 11:02:04 + if (n & 4) {
18-Sep-2020 11:02:04 + *(u32 *)(d + 0) = *(u32 *)(s + 0);
18-Sep-2020 11:02:04 + d += 4;
18-Sep-2020 11:02:04 + s += 4;
18-Sep-2020 11:02:04 + }
18-Sep-2020 11:02:04 + if (n & 2) {
18-Sep-2020 11:02:04 + *d++ = *s++;
18-Sep-2020 11:02:04 + *d++ = *s++;
18-Sep-2020 11:02:04 + }
18-Sep-2020 11:02:04 + if (n & 1) {
18-Sep-2020 11:02:04 + *d = *s;
18-Sep-2020 11:02:04 + }
18-Sep-2020 11:02:04 + return dest;
18-Sep-2020 11:02:04 + }
18-Sep-2020 11:02:04
18-Sep-2020 11:02:04 + if (n >= 32) switch ((sel4runtime_uintptr_t)d % 4) {
18-Sep-2020 11:02:04 + case 1:
18-Sep-2020 11:02:04 + w = *(u32 *)s;
18-Sep-2020 11:02:04 + *d++ = *s++;
18-Sep-2020 11:02:04 + *d++ = *s++;
18-Sep-2020 11:02:04 + *d++ = *s++;
18-Sep-2020 11:02:04 + n -= 3;
18-Sep-2020 11:02:04 + for (; n >= 17; s += 16, d += 16, n -= 16) {
18-Sep-2020 11:02:04 + x = *(u32 *)(s + 1);
18-Sep-2020 11:02:04 + *(u32 *)(d + 0) = (w LS 24) | (x RS 8);
18-Sep-2020 11:02:04 + w = *(u32 *)(s + 5);
18-Sep-2020 11:02:04 + *(u32 *)(d + 4) = (x LS 24) | (w RS 8);
18-Sep-2020 11:02:04 + x = *(u32 *)(s + 9);
18-Sep-2020 11:02:04 + *(u32 *)(d + 8) = (w LS 24) | (x RS 8);
18-Sep-2020 11:02:04 + w = *(u32 *)(s + 13);
18-Sep-2020 11:02:04 + *(u32 *)(d + 12) = (x LS 24) | (w RS 8);
18-Sep-2020 11:02:04 + }
18-Sep-2020 11:02:04 + break;
18-Sep-2020 11:02:04 + case 2:
18-Sep-2020 11:02:04 + w = *(u32 *)s;
18-Sep-2020 11:02:04 + *d++ = *s++;
18-Sep-2020 11:02:04 + *d++ = *s++;
18-Sep-2020 11:02:04 + n -= 2;
18-Sep-2020 11:02:04 + for (; n >= 18; s += 16, d += 16, n -= 16) {
18-Sep-2020 11:02:04 + x = *(u32 *)(s + 2);
18-Sep-2020 11:02:04 + *(u32 *)(d + 0) = (w LS 16) | (x RS 16);
18-Sep-2020 11:02:04 + w = *(u32 *)(s + 6);
18-Sep-2020 11:02:04 + *(u32 *)(d + 4) = (x LS 16) | (w RS 16);
18-Sep-2020 11:02:04 + x = *(u32 *)(s + 10);
18-Sep-2020 11:02:04 + *(u32 *)(d + 8) = (w LS 16) | (x RS 16);
18-Sep-2020 11:02:04 + w = *(u32 *)(s + 14);
18-Sep-2020 11:02:04 + *(u32 *)(d + 12) = (x LS 16) | (w RS 16);
18-Sep-2020 11:02:04 + }
18-Sep-2020 11:02:04 + break;
18-Sep-2020 11:02:04 + case 3:
18-Sep-2020 11:02:04 + w = *(u32 *)s;
18-Sep-2020 11:02:04 + *d++ = *s++;
18-Sep-2020 11:02:04 + n -= 1;
18-Sep-2020 11:02:04 + for (; n >= 19; s += 16, d += 16, n -= 16) {
18-Sep-2020 11:02:04 + x = *(u32 *)(s + 3);
18-Sep-2020 11:02:04 + *(u32 *)(d + 0) = (w LS 8) | (x RS 24);
18-Sep-2020 11:02:04 + w = *(u32 *)(s + 7);
18-Sep-2020 11:02:04 + *(u32 *)(d + 4) = (x LS 8) | (w RS 24);
18-Sep-2020 11:02:04 + x = *(u32 *)(s + 11);
18-Sep-2020 11:02:04 + *(u32 *)(d + 8) = (w LS 8) | (x RS 24);
18-Sep-2020 11:02:04 + w = *(u32 *)(s + 15);
18-Sep-2020 11:02:04 + *(u32 *)(d + 12) = (x LS 8) | (w RS 24);
18-Sep-2020 11:02:04 + }
18-Sep-2020 11:02:04 + break;
18-Sep-2020 11:02:04 + }
18-Sep-2020 11:02:04 + if (n & 16) {
18-Sep-2020 11:02:04 + *d++ = *s++;
18-Sep-2020 11:02:04 + *d++ = *s++;
18-Sep-2020 11:02:04 + *d++ = *s++;
18-Sep-2020 11:02:04 + *d++ = *s++;
18-Sep-2020 11:02:04 + *d++ = *s++;
18-Sep-2020 11:02:04 + *d++ = *s++;
18-Sep-2020 11:02:04 + *d++ = *s++;
18-Sep-2020 11:02:04 + *d++ = *s++;
18-Sep-2020 11:02:04 + *d++ = *s++;
18-Sep-2020 11:02:04 + *d++ = *s++;
18-Sep-2020 11:02:04 + *d++ = *s++;
18-Sep-2020 11:02:04 + *d++ = *s++;
18-Sep-2020 11:02:04 + *d++ = *s++;
18-Sep-2020 11:02:04 + *d++ = *s++;
18-Sep-2020 11:02:04 + *d++ = *s++;
18-Sep-2020 11:02:04 + *d++ = *s++;
18-Sep-2020 11:02:04 + }
18-Sep-2020 11:02:04 + if (n & 8) {
18-Sep-2020 11:02:04 + *d++ = *s++;
18-Sep-2020 11:02:04 + *d++ = *s++;
18-Sep-2020 11:02:04 + *d++ = *s++;
18-Sep-2020 11:02:04 + *d++ = *s++;
18-Sep-2020 11:02:04 + *d++ = *s++;
18-Sep-2020 11:02:04 + *d++ = *s++;
18-Sep-2020 11:02:04 + *d++ = *s++;
18-Sep-2020 11:02:04 + *d++ = *s++;
18-Sep-2020 11:02:04 + }
18-Sep-2020 11:02:04 + if (n & 4) {
18-Sep-2020 11:02:04 + *d++ = *s++;
18-Sep-2020 11:02:04 + *d++ = *s++;
18-Sep-2020 11:02:04 + *d++ = *s++;
18-Sep-2020 11:02:04 + *d++ = *s++;
18-Sep-2020 11:02:04 + }
18-Sep-2020 11:02:04 + if (n & 2) {
18-Sep-2020 11:02:04 + *d++ = *s++;
18-Sep-2020 11:02:04 + *d++ = *s++;
18-Sep-2020 11:02:04 + }
18-Sep-2020 11:02:04 + if (n & 1) {
18-Sep-2020 11:02:04 + *d = *s;
18-Sep-2020 11:02:04 + }
18-Sep-2020 11:02:04 + return dest;
18-Sep-2020 11:02:04 #endif
18-Sep-2020 11:02:04
18-Sep-2020 11:02:04 + for (; n; n--) {
18-Sep-2020 11:02:04 + *d++ = *s++;
18-Sep-2020 11:02:04 + }
18-Sep-2020 11:02:04 + return dest;
18-Sep-2020 11:02:04 }
18-Sep-2020 11:02:04 diff --git a/src/memset.c b/src/memset.c
18-Sep-2020 11:02:04 index 0ed0784..badc07b 100644
18-Sep-2020 11:02:04 --- a/src/memset.c
18-Sep-2020 11:02:04 +++ b/src/memset.c
18-Sep-2020 11:02:04 @@ -28,84 +28,98 @@
18-Sep-2020 11:02:04
18-Sep-2020 11:02:04 void *__sel4runtime_memset(void *dest, int c, sel4runtime_size_t n)
18-Sep-2020 11:02:04 {
18-Sep-2020 11:02:04 + unsigned char *s = dest;
18-Sep-2020 11:02:04 + sel4runtime_size_t k;
18-Sep-2020 11:02:04
18-Sep-2020 11:02:04 + /* Fill head and tail with minimal branching. Each
18-Sep-2020 11:02:04 + * conditional ensures that all the subsequently used
18-Sep-2020 11:02:04 + * offsets are well-defined and in the dest region. */
18-Sep-2020 11:02:04
18-Sep-2020 11:02:04 + if (!n) {
18-Sep-2020 11:02:04 + return dest;
18-Sep-2020 11:02:04 + }
18-Sep-2020 11:02:04 + s[0] = s[n - 1] = c;
18-Sep-2020 11:02:04 + if (n <= 2) {
18-Sep-2020 11:02:04 + return dest;
18-Sep-2020 11:02:04 + }
18-Sep-2020 11:02:04 + s[1] = s[n - 2] = c;
18-Sep-2020 11:02:04 + s[2] = s[n - 3] = c;
18-Sep-2020 11:02:04 + if (n <= 6) {
18-Sep-2020 11:02:04 + return dest;
18-Sep-2020 11:02:04 + }
18-Sep-2020 11:02:04 + s[3] = s[n - 4] = c;
18-Sep-2020 11:02:04 + if (n <= 8) {
18-Sep-2020 11:02:04 + return dest;
18-Sep-2020 11:02:04 + }
18-Sep-2020 11:02:04
18-Sep-2020 11:02:04 + /* Advance pointer to align it at a 4-byte boundary,
18-Sep-2020 11:02:04 + * and truncate n to a multiple of 4. The previous code
18-Sep-2020 11:02:04 + * already took care of any head/tail that get cut off
18-Sep-2020 11:02:04 + * by the alignment. */
18-Sep-2020 11:02:04
18-Sep-2020 11:02:04 + k = -(sel4runtime_uintptr_t)s & 3;
18-Sep-2020 11:02:04 + s += k;
18-Sep-2020 11:02:04 + n -= k;
18-Sep-2020 11:02:04 + n &= -4;
18-Sep-2020 11:02:04
18-Sep-2020 11:02:04 #ifdef __GNUC__
18-Sep-2020 11:02:04 + typedef sel4runtime_uint32_t __attribute__((__may_alias__)) u32;
18-Sep-2020 11:02:04 + typedef sel4runtime_uint64_t __attribute__((__may_alias__)) u64;
18-Sep-2020 11:02:04
18-Sep-2020 11:02:04 + u32 c32 = ((u32) - 1) / 255 * (unsigned char)c;
18-Sep-2020 11:02:04
18-Sep-2020 11:02:04 + /* In preparation to copy 32 bytes at a time, aligned on
18-Sep-2020 11:02:04 + * an 8-byte bounary, fill head/tail up to 28 bytes each.
18-Sep-2020 11:02:04 + * As in the initial byte-based head/tail fill, each
18-Sep-2020 11:02:04 + * conditional below ensures that the subsequent offsets
18-Sep-2020 11:02:04 + * are valid (e.g. !(n<=24) implies n>=28). */
18-Sep-2020 11:02:04
18-Sep-2020 11:02:04 + *(u32 *)(s + 0) = c32;
18-Sep-2020 11:02:04 + *(u32 *)(s + n - 4) = c32;
18-Sep-2020 11:02:04 + if (n <= 8) {
18-Sep-2020 11:02:04 + return dest;
18-Sep-2020 11:02:04 + }
18-Sep-2020 11:02:04 + *(u32 *)(s + 4) = c32;
18-Sep-2020 11:02:04 + *(u32 *)(s + 8) = c32;
18-Sep-2020 11:02:04 + *(u32 *)(s + n - 12) = c32;
18-Sep-2020 11:02:04 + *(u32 *)(s + n - 8) = c32;
18-Sep-2020 11:02:04 + if (n <= 24) {
18-Sep-2020 11:02:04 + return dest;
18-Sep-2020 11:02:04 + }
18-Sep-2020 11:02:04 + *(u32 *)(s + 12) = c32;
18-Sep-2020 11:02:04 + *(u32 *)(s + 16) = c32;
18-Sep-2020 11:02:04 + *(u32 *)(s + 20) = c32;
18-Sep-2020 11:02:04 + *(u32 *)(s + 24) = c32;
18-Sep-2020 11:02:04 + *(u32 *)(s + n - 28) = c32;
18-Sep-2020 11:02:04 + *(u32 *)(s + n - 24) = c32;
18-Sep-2020 11:02:04 + *(u32 *)(s + n - 20) = c32;
18-Sep-2020 11:02:04 + *(u32 *)(s + n - 16) = c32;
18-Sep-2020 11:02:04
18-Sep-2020 11:02:04 + /* Align to a multiple of 8 so we can fill 64 bits at a time,
18-Sep-2020 11:02:04 + * and avoid writing the same bytes twice as much as is
18-Sep-2020 11:02:04 + * practical without introducing additional branching. */
18-Sep-2020 11:02:04
18-Sep-2020 11:02:04 + k = 24 + ((sel4runtime_uintptr_t)s & 4);
18-Sep-2020 11:02:04 + s += k;
18-Sep-2020 11:02:04 + n -= k;
18-Sep-2020 11:02:04
18-Sep-2020 11:02:04 + /* If this loop is reached, 28 tail bytes have already been
18-Sep-2020 11:02:04 + * filled, so any remainder when n drops below 32 can be
18-Sep-2020 11:02:04 + * safely ignored. */
18-Sep-2020 11:02:04
18-Sep-2020 11:02:04 + u64 c64 = c32 | ((u64)c32 << 32);
18-Sep-2020 11:02:04 + for (; n >= 32; n -= 32, s += 32) {
18-Sep-2020 11:02:04 + *(u64 *)(s + 0) = c64;
18-Sep-2020 11:02:04 + *(u64 *)(s + 8) = c64;
18-Sep-2020 11:02:04 + *(u64 *)(s + 16) = c64;
18-Sep-2020 11:02:04 + *(u64 *)(s + 24) = c64;
18-Sep-2020 11:02:04 + }
18-Sep-2020 11:02:04 #else
18-Sep-2020 11:02:04 + /* Pure C fallback with no aliasing violations. */
18-Sep-2020 11:02:04 + for (; n; n--, s++) {
18-Sep-2020 11:02:04 + *s = c;
18-Sep-2020 11:02:04 + }
18-Sep-2020 11:02:04 #endif
18-Sep-2020 11:02:04
18-Sep-2020 11:02:04 + return dest;
18-Sep-2020 11:02:04 }
18-Sep-2020 11:02:04 Failing task since return code of [/var/atlassian/application-data/bamboo/temp/CQ-SEL4RUNTIMESTYLE8-SEL4RUNTIMESTYLEPR-1-ScriptBuildTask-7128014601195847880.sh] was 1 while expected 0
18-Sep-2020 11:02:04 Finished task 'Check style of changed files' with result: Failed
18-Sep-2020 11:02:04 Starting task 'Set permissions so Bamboo can cleanup' of type 'com.atlassian.bamboo.plugins.scripttask:task.builder.script'
18-Sep-2020 11:02:04 + chmod -R o+rwx /var/atlassian/application-data/bamboo/xml-data/build-dir/140083221/CQ-SEL4RUNTIMESTYLE8-SEL4RUNTIMESTYLEPR
18-Sep-2020 11:02:04 Finished task 'Set permissions so Bamboo can cleanup' with result: Success
18-Sep-2020 11:02:04 Starting task 'Run astyle code insights' of type 'com.atlassian.bamboo.plugins.scripttask:task.builder.script'
18-Sep-2020 11:02:04 + cd sel4runtime
18-Sep-2020 11:02:04 ++ echo ssh://git@bitbucket.ts.data61.csiro.au:7999/sel4proj/sel4runtime.git
18-Sep-2020 11:02:04 ++ cut -d/ -f4
18-Sep-2020 11:02:04 + bb_proj=sel4proj
18-Sep-2020 11:02:04 + /scripts/bb_code_insights/create_code_insights.sh astyle sel4proj sel4runtime
18-Sep-2020 11:02:04 ++ dirname /scripts/bb_code_insights/create_code_insights.sh
18-Sep-2020 11:02:04 + SCRIPT_DIR=/scripts/bb_code_insights
18-Sep-2020 11:02:04 + BBS_URL=https://bitbucket.ts.data61.csiro.au
18-Sep-2020 11:02:04 + BBS_PROJECT=sel4proj
18-Sep-2020 11:02:04 + BBS_REPO=sel4runtime
18-Sep-2020 11:02:04 + REPORT_TO_RUN=astyle
18-Sep-2020 11:02:04 ++ git rev-parse HEAD
18-Sep-2020 11:02:04 + COMMIT_ID=3398eac8a640f7ec1b49b4275e5587b5eddb8930
18-Sep-2020 11:02:04 + REPORT_KEY=astyle.report
18-Sep-2020 11:02:04 + set +x
18-Sep-2020 11:02:04 + report_file=astyle_report.json
18-Sep-2020 11:02:04 + annotations_file=astyle_annotations.json
18-Sep-2020 11:02:04 + rm -f astyle_report.json astyle_annotations.json
18-Sep-2020 11:02:04 + /scripts/bb_code_insights/astyle
18-Sep-2020 11:02:07 Reporting on these files: ['include/arch/riscv/sel4runtime/thread_arch.h', 'include/mode/32/sel4runtime/mode/elf.h', 'include/mode/64/sel4runtime/mode/elf.h', 'include/sel4_arch/aarch32/sel4runtime/thread_arch.h', 'include/sel4_arch/aarch64/sel4runtime/thread_arch.h', 'include/sel4_arch/ia32/sel4runtime/thread_arch.h', 'include/sel4_arch/x86_64/sel4runtime/thread_arch.h', 'include/sel4runtime.h', 'include/sel4runtime/auxv.h', 'include/sel4runtime/elf.h', 'include/sel4runtime/start.h', 'include/sel4runtime/stddef.h', 'include/sel4runtime/stdint.h', 'src/crt1.c', 'src/env.c', 'src/memcpy.c', 'src/memset.c', 'src/start_root.c', 'src/util.h', 'src/vsyscall.c', 'CMakeLists.txt']
18-Sep-2020 11:02:07 + echo 'Reporting the results to BitBucket, but doing so *secretly*, so people don'\''t see the access token'
18-Sep-2020 11:02:07 Reporting the results to BitBucket, but doing so *secretly*, so people don't see the access token
18-Sep-2020 11:02:07 + set +x
18-Sep-2020 11:02:07 + '[' -f astyle_report.json ']'
18-Sep-2020 11:02:07 + cat astyle_report.json
18-Sep-2020 11:02:07 + '[' -f astyle_annotations.json ']'
18-Sep-2020 11:02:07 + cat astyle_annotations.json
18-Sep-2020 11:02:07 {"data":[{"title":"Total number of files with incorrect style","value":3},{"title":"Total number of lines with incorrect style","value":173}],"createdDate":1600390927217,"key":"astyle.report","title":"Code style"}{"title": "Code style", "data": [{"title": "Total number of files with incorrect style", "value": 3}, {"title": "Total number of lines with incorrect style", "value": 173}]}{"annotations": [{"path": "include/sel4_arch/aarch64/sel4runtime/thread_arch.h", "line": 17, "message": "There are 1 line(s) of incorrect style here.", "severity": "HIGH"}, {"path": "include/sel4_arch/aarch64/sel4runtime/thread_arch.h", "line": 19, "message": "There are 1 line(s) of incorrect style here.", "severity": "HIGH"}, {"path": "include/sel4_arch/aarch64/sel4runtime/thread_arch.h", "line": 23, "message": "There are 2 line(s) of incorrect style here.", "severity": "HIGH"}, {"path": "include/sel4_arch/aarch64/sel4runtime/thread_arch.h", "line": 27, "message": "There are 1 line(s) of incorrect style here.", "severity": "HIGH"}, {"path": "include/sel4_arch/aarch64/sel4runtime/thread_arch.h", "line": 29, "message": "There are 1 line(s) of incorrect style here.", "severity": "HIGH"}, {"path": "include/sel4_arch/aarch64/sel4runtime/thread_arch.h", "line": 36, "message": "There are 1 line(s) of incorrect style here.", "severity": "HIGH"}, {"path": "include/sel4_arch/aarch64/sel4runtime/thread_arch.h", "line": 43, "message": "There are 1 line(s) of incorrect style here.", "severity": "HIGH"}, {"path": "src/memcpy.c", "line": 31, "message": "There are 2 line(s) of incorrect style here.", "severity": "HIGH"}, {"path": "src/memcpy.c", "line": 44, "message": "There are 2 line(s) of incorrect style here.", "severity": "HIGH"}, {"path": "src/memcpy.c", "line": 47, "message": "There are 1 line(s) of incorrect style here.", "severity": "HIGH"}, {"path": "src/memcpy.c", "line": 49, "message": "There are 24 line(s) of incorrect style here.", "severity": "HIGH"}, {"path": "src/memcpy.c", "line": 74, "message": "There are 70 line(s) of incorrect style here.", "severity": "HIGH"}, {"path": "src/memcpy.c", "line": 146, "message": "There are 2 line(s) of incorrect style here.", "severity": "HIGH"}, {"path": "src/memset.c", "line": 31, "message": "There are 2 line(s) of incorrect style here.", "severity": "HIGH"}, {"path": "src/memset.c", "line": 34, "message": "There are 3 line(s) of incorrect style here.", "severity": "HIGH"}, {"path": "src/memset.c", "line": 38, "message": "There are 8 line(s) of incorrect style here.", "severity": "HIGH"}, {"path": "src/memset.c", "line": 47, "message": "There are 4 line(s) of incorrect style here.", "severity": "HIGH"}, {"path": "src/memset.c", "line": 52, "message": "There are 4 line(s) of incorrect style here.", "severity": "HIGH"}, {"path": "src/memset.c", "line": 58, "message": "There are 2 line(s) of incorrect style here.", "severity": "HIGH"}, {"path": "src/memset.c", "line": 61, "message": "There are 1 line(s) of incorrect style here.", "severity": "HIGH"}, {"path": "src/memset.c", "line": 63, "message": "There are 5 line(s) of incorrect style here.", "severity": "HIGH"}, {"path": "src/memset.c", "line": 69, "message": "There are 16 line(s) of incorrect style here.", "severity": "HIGH"}, {"path": "src/memset.c", "line": 86, "message": "There are 3 line(s) of incorrect style here.", "severity": "HIGH"}, {"path": "src/memset.c", "line": 90, "message": "There are 3 line(s) of incorrect style here.", "severity": "HIGH"}, {"path": "src/memset.c", "line": 94, "message": "There are 3 line(s) of incorrect style here.", "severity": "HIGH"}, {"path": "src/memset.c", "line": 98, "message": "There are 7 line(s) of incorrect style here.", "severity": "HIGH"}, {"path": "src/memset.c", "line": 106, "message": "There are 2 line(s) of incorrect style here.", "severity": "HIGH"}, {"path": "src/memset.c", "line": 110, "message": "There are 1 line(s) of incorrect style here.", "severity": "HIGH"}]}
18-Sep-2020 11:02:07 Finished task 'Run astyle code insights' with result: Success
18-Sep-2020 11:02:07 Running post build plugin 'NCover Results Collector'
18-Sep-2020 11:02:07 Running post build plugin 'Artifact Copier'
18-Sep-2020 11:02:07 Running post build plugin 'npm Cache Cleanup'
18-Sep-2020 11:02:07 Running post build plugin 'Clover Results Collector'
18-Sep-2020 11:02:07 Running post build plugin 'Docker Container Cleanup'
18-Sep-2020 11:02:07 Successfully removed working directory at '/var/atlassian/application-data/bamboo/xml-data/build-dir/140083221/CQ-SEL4RUNTIMESTYLE8-SEL4RUNTIMESTYLEPR'
18-Sep-2020 11:02:07 Finalising the build...
18-Sep-2020 11:02:07 Stopping timer.
18-Sep-2020 11:02:07 Build CQ-SEL4RUNTIMESTYLE8-SEL4RUNTIMESTYLEPR-1 completed.
18-Sep-2020 11:02:07 Running on server: post build plugin 'NCover Results Collector'
18-Sep-2020 11:02:07 Running on server: post build plugin 'Build Hanging Detection Configuration'
18-Sep-2020 11:02:07 Running on server: post build plugin 'Clover Delta Calculator'
18-Sep-2020 11:02:07 Running on server: post build plugin 'Maven Dependencies Postprocessor'
18-Sep-2020 11:02:07 All post build plugins have finished
18-Sep-2020 11:02:07 Generating build results summary...
18-Sep-2020 11:02:07 Saving build results to disk...
18-Sep-2020 11:02:07 Store variable context...
18-Sep-2020 11:02:07 Indexing build results...
18-Sep-2020 11:02:07 Finished building CQ-SEL4RUNTIMESTYLE8-SEL4RUNTIMESTYLEPR-1.
This is the most I can report on right now, sorry!
@ssrg-bamboo test
Hello, I'm a bot! I'll bring this PR into Trustworthy Systems and run some tests
Test name | Result |
---|---|
Code Quality - Check licenses - sel4runtime - EXT-xurtis-no-muslc-6 | FAILED |
Code Quality - Style - sel4runtime - EXT-xurtis-no-muslc-6 | SUCCESSFUL |
Project | Stage | Result summary |
---|---|---|
Code Quality - Check licenses - sel4runtime - EXT-xurtis-no-muslc-6 | Check licenses | 1 of 1 job failed |
Job: lic Build logs
18-Sep-2020 11:48:36 Build Code Quality - Check licenses - sel4runtime - EXT-xurtis-no-muslc-6 - lic #2 (CQ-SEL4RUNTIMECL8-SEL4RUNTIMELICCQ-2) started building on agent A local agent 1
18-Sep-2020 11:48:36 I run on the Bamboo server!
18-Sep-2020 11:48:36 Build working directory is /var/atlassian/application-data/bamboo/xml-data/build-dir/140083221/CQ-SEL4RUNTIMECL8-SEL4RUNTIMELICCQ
18-Sep-2020 11:48:36 Executing build Code Quality - Check licenses - sel4runtime - EXT-xurtis-no-muslc-6 - lic #2 (CQ-SEL4RUNTIMECL8-SEL4RUNTIMELICCQ-2)
18-Sep-2020 11:48:36 Preparing artifact 'code' for use at /var/atlassian/application-data/bamboo/xml-data/build-dir/140083221/CQ-SEL4RUNTIMECL8-SEL4RUNTIMELICCQ/. (location: .)
18-Sep-2020 11:48:36 Artifact 'code' prepared in 38.54 ms at /var/atlassian/application-data/bamboo/xml-data/build-dir/140083221/CQ-SEL4RUNTIMECL8-SEL4RUNTIMELICCQ/./code.tar.gz
18-Sep-2020 11:48:36 Running pre-build action: VCS Version Collector
18-Sep-2020 11:48:36 Starting task 'Untar code' of type 'com.atlassian.bamboo.plugins.scripttask:task.builder.script'
18-Sep-2020 11:48:36 + tar xf code.tar.gz --recursive-unlink
18-Sep-2020 11:48:36 Finished task 'Untar code' with result: Success
18-Sep-2020 11:48:36 Starting task 'Set permissions so Bamboo can cleanup' of type 'com.atlassian.bamboo.plugins.scripttask:task.builder.script'
18-Sep-2020 11:48:36 + chmod -R o+rwx /var/atlassian/application-data/bamboo/xml-data/build-dir/140083221/CQ-SEL4RUNTIMECL8-SEL4RUNTIMELICCQ
18-Sep-2020 11:48:36 Finished task 'Set permissions so Bamboo can cleanup' with result: Success
18-Sep-2020 11:48:36 Starting task 'Check license' of type 'com.atlassian.bamboo.plugins.scripttask:task.builder.script'
18-Sep-2020 11:48:36 + python license-tool/check_license.py sel4runtime
18-Sep-2020 11:48:36 ERROR:root:sel4runtime/src/vsyscall.c: sel4runtime/src/vsyscall.c: no owner found
18-Sep-2020 11:48:36 Failing task since return code of [/var/atlassian/application-data/bamboo/temp/CQ-SEL4RUNTIMECL8-SEL4RUNTIMELICCQ-2-ScriptBuildTask-8720019855701440717.sh] was 1 while expected 0
18-Sep-2020 11:48:36 Finished task 'Check license' with result: Failed
18-Sep-2020 11:48:36 Starting task 'Set permissions so Bamboo can cleanup' of type 'com.atlassian.bamboo.plugins.scripttask:task.builder.script'
18-Sep-2020 11:48:36 + chmod -R o+rwx /var/atlassian/application-data/bamboo/xml-data/build-dir/140083221/CQ-SEL4RUNTIMECL8-SEL4RUNTIMELICCQ
18-Sep-2020 11:48:36 Finished task 'Set permissions so Bamboo can cleanup' with result: Success
18-Sep-2020 11:48:36 Running post build plugin 'NCover Results Collector'
18-Sep-2020 11:48:36 Running post build plugin 'Artifact Copier'
18-Sep-2020 11:48:36 Running post build plugin 'npm Cache Cleanup'
18-Sep-2020 11:48:36 Running post build plugin 'Clover Results Collector'
18-Sep-2020 11:48:36 Running post build plugin 'Docker Container Cleanup'
18-Sep-2020 11:48:36 Successfully removed working directory at '/var/atlassian/application-data/bamboo/xml-data/build-dir/140083221/CQ-SEL4RUNTIMECL8-SEL4RUNTIMELICCQ'
18-Sep-2020 11:48:36 Finalising the build...
18-Sep-2020 11:48:36 Stopping timer.
18-Sep-2020 11:48:36 Build CQ-SEL4RUNTIMECL8-SEL4RUNTIMELICCQ-2 completed.
18-Sep-2020 11:48:36 Running on server: post build plugin 'NCover Results Collector'
18-Sep-2020 11:48:36 Running on server: post build plugin 'Build Hanging Detection Configuration'
18-Sep-2020 11:48:36 Running on server: post build plugin 'Clover Delta Calculator'
18-Sep-2020 11:48:36 Running on server: post build plugin 'Maven Dependencies Postprocessor'
18-Sep-2020 11:48:36 All post build plugins have finished
18-Sep-2020 11:48:36 Generating build results summary...
18-Sep-2020 11:48:36 Saving build results to disk...
18-Sep-2020 11:48:36 Store variable context...
18-Sep-2020 11:48:36 Indexing build results...
18-Sep-2020 11:48:36 Finished building CQ-SEL4RUNTIMECL8-SEL4RUNTIMELICCQ-2.
This is the most I can report on right now, sorry!
@ssrg-bamboo test
Hello, I'm a bot! I'll bring this PR into Trustworthy Systems and run some tests
All the tests we ran have passed! Nice job!
In order to reduce the set of dependencies for
sel4runtime
, the small subset of the C standard library that is used has been duplicated inside of the runtime.Additionally, the library used to integrate the standard library (
libsel4muslcsys
) is responsible for ensuring the virtual syscall handler is initialised by the C standard library provided.Blocked by sel4/sel4_libs#21