Skip to content
This repository was archived by the owner on Nov 29, 2023. It is now read-only.

Commit 4d84a65

Browse files
committed
Merge branch 'master' into hmac
2 parents b9f8901 + 1f7f80e commit 4d84a65

File tree

9 files changed

+274
-128
lines changed

9 files changed

+274
-128
lines changed

.circleci/config.yml

+188
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
# Use the latest 2.1 version of CircleCI pipeline process engine. See: https://circleci.com/docs/2.0/configuration-reference
2+
version: 2.1
3+
4+
# prebuilt docker images with toolchain
5+
executors:
6+
setup-rv64gc:
7+
docker:
8+
- image: keystoneenclaveorg/keystone:init-rv64gc
9+
setup-rv32gc:
10+
docker:
11+
- image: keystoneenclaveorg/keystone:init-rv32gc
12+
13+
14+
15+
commands:
16+
update-riscv-toolchain-path:
17+
steps:
18+
- run: echo 'export PATH=/keystone/riscv/bin:/keystone/riscv64/bin:/keystone/riscv32/bin:$PATH' >> $BASH_ENV
19+
build-sdk:
20+
steps:
21+
- run: |
22+
cd /keystone/sdk
23+
mkdir build
24+
cd build
25+
KEYSTONE_SDK_DIR=$(pwd) cmake ..
26+
make install
27+
checkout-runtime:
28+
steps:
29+
- run: |
30+
git submodule sync
31+
git submodule update --init
32+
33+
jobs:
34+
format:
35+
executor: setup-rv64gc
36+
steps:
37+
- checkout
38+
- checkout-runtime
39+
- update-riscv-toolchain-path
40+
- run: apt-get install clang-format -y
41+
- run:
42+
name: "test"
43+
environment:
44+
KEYSTONE_SDK_DIR: /keystone/sdk/build
45+
command: |
46+
make format
47+
no_output_timeout: 120m
48+
default-build:
49+
executor: setup-rv64gc
50+
steps:
51+
- checkout
52+
- checkout-runtime
53+
- update-riscv-toolchain-path
54+
- build-sdk
55+
- run:
56+
name: "Default build"
57+
environment:
58+
KEYSTONE_SDK_DIR: /keystone/sdk/build
59+
command: |
60+
./build.sh
61+
no_output_timeout: 120m
62+
use-freemem:
63+
executor: setup-rv64gc
64+
steps:
65+
- checkout
66+
- checkout-runtime
67+
- update-riscv-toolchain-path
68+
- build-sdk
69+
- run:
70+
name: "USE_FREEMEM"
71+
environment:
72+
KEYSTONE_SDK_DIR: /keystone/sdk/build
73+
command: |
74+
./build.sh freemem
75+
no_output_timeout: 120m
76+
use_linux_syscall_use_freemem:
77+
executor: setup-rv64gc
78+
steps:
79+
- checkout
80+
- checkout-runtime
81+
- update-riscv-toolchain-path
82+
- build-sdk
83+
- run:
84+
name: "USE_LINUX_SYSCALL + USE_FREEMEM"
85+
environment:
86+
KEYSTONE_SDK_DIR: /keystone/sdk/build
87+
command: |
88+
./build.sh linux_syscall freemem
89+
no_output_timeout: 120m
90+
use_paging:
91+
executor: setup-rv64gc
92+
steps:
93+
- checkout
94+
- checkout-runtime
95+
- update-riscv-toolchain-path
96+
- build-sdk
97+
- run:
98+
name: "USE_PAGING"
99+
environment:
100+
KEYSTONE_SDK_DIR: /keystone/sdk/build
101+
command: |
102+
./build.sh paging
103+
no_output_timeout: 120m
104+
use_package_crypto:
105+
executor: setup-rv64gc
106+
steps:
107+
- checkout
108+
- checkout-runtime
109+
- update-riscv-toolchain-path
110+
- build-sdk
111+
- run:
112+
name: "USE_PAGE_CRYPTO"
113+
environment:
114+
KEYSTONE_SDK_DIR: /keystone/sdk/build
115+
command: |
116+
./build.sh paging page_crypto
117+
no_output_timeout: 120m
118+
use_page_hash:
119+
executor: setup-rv64gc
120+
steps:
121+
- checkout
122+
- checkout-runtime
123+
- update-riscv-toolchain-path
124+
- build-sdk
125+
- run:
126+
name: "USE_PAGE_HASH"
127+
environment:
128+
KEYSTONE_SDK_DIR: /keystone/sdk/build
129+
command: |
130+
./build.sh paging page_hash
131+
no_output_timeout: 120m
132+
use_page_crypto_use_page_hash:
133+
executor: setup-rv64gc
134+
steps:
135+
- checkout
136+
- checkout-runtime
137+
- update-riscv-toolchain-path
138+
- build-sdk
139+
- run:
140+
name: "USE_PAGE_CRYPTO + USE_PAGE_HASH"
141+
environment:
142+
KEYSTONE_SDK_DIR: /keystone/sdk/build
143+
command: |
144+
./build.sh paging page_crypto page_hash
145+
no_output_timeout: 120m
146+
test:
147+
executor: setup-rv64gc
148+
steps:
149+
- checkout
150+
- checkout-runtime
151+
- update-riscv-toolchain-path
152+
- build-sdk
153+
- run:
154+
name: "test"
155+
environment:
156+
KEYSTONE_SDK_DIR: /keystone/sdk/build
157+
command: |
158+
mkdir -p obj/test
159+
pushd obj/test
160+
cmake ../../test
161+
make
162+
ctest -VV || ( cat obj/test/Testing/Temporary/LastTest.log && false )
163+
popd
164+
no_output_timeout: 120m
165+
166+
workflows:
167+
build-and-test:
168+
jobs:
169+
- default-build
170+
- format
171+
- use-freemem:
172+
requires:
173+
- default-build
174+
- use_linux_syscall_use_freemem:
175+
requires:
176+
- default-build
177+
- use_package_crypto:
178+
requires:
179+
- default-build
180+
- use_page_hash:
181+
requires:
182+
- default-build
183+
- use_page_crypto_use_page_hash:
184+
requires:
185+
- default-build
186+
- test:
187+
requires:
188+
- default-build

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ eyrie-rt
33
*.o
44
obj/
55
.exists
6+
.format-diff

.travis.yml

-80
This file was deleted.

Makefile

+10-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ifndef KEYSTONE_SDK_DIR
88
endif
99

1010
CFLAGS = -Wall -Werror -fPIC -fno-builtin -std=c11 -g $(OPTIONS_FLAGS)
11-
SRCS = aes.c sha256.c boot.c interrupt.c printf.c syscall.c string.c linux_wrap.c io_wrap.c rt_util.c mm.c env.c freemem.c paging.c sbi.c hmac.c page_swap.c
11+
SRCS = aes.c sha256.c boot.c interrupt.c printf.c syscall.c string.c linux_wrap.c io_wrap.c rt_util.c mm.c env.c freemem.c paging.c sbi.c hmac.c page_swap.c vm.c
1212
ASM_SRCS = entry.S
1313
RUNTIME = eyrie-rt
1414
LINK = $(CROSS_COMPILE)ld
@@ -68,8 +68,16 @@ test:
6868
$(MAKE) -C obj/test
6969
$(MAKE) -C obj/test test
7070

71+
clang-format:
72+
# This is an attempt to get the clang-format command in git.
73+
git $(shell git help -a | grep clang-format) | tee .format-diff
74+
75+
format: clang-format
76+
$(eval FORMAT_DIF := "$(shell cat .format-diff)")
77+
@\[ $(FORMAT_DIF) = "no modified files to format" \] || \[ $(FORMAT_DIF) = "clang-format did not modify any files" \]
78+
7179
clean:
7280
rm -rf $(RUNTIME) obj
7381
$(MAKE) -C tmplib clean
7482
# for legacy reasons, remove any lingering uaccess.h
75-
rm -f uaccess.h
83+
rm -f uaccess.h $(TMPLIB)

0 commit comments

Comments
 (0)