File tree 8 files changed +100
-3
lines changed
8 files changed +100
-3
lines changed Original file line number Diff line number Diff line change 62
62
uses : actions-rs/cargo@v1
63
63
with :
64
64
command : clippy
65
- args : --workspace --all-features --exclude svsm --exclude svsm-fuzz --exclude init --target=x86_64-unknown-linux-gnu -- -D warnings
65
+ args : --workspace --all-features --exclude svsm --exclude svsm-fuzz --exclude init --exclude dm -- target=x86_64-unknown-linux-gnu -- -D warnings
66
66
67
67
- name : Clippy on svsm-fuzz
68
68
uses : actions-rs/cargo@v1
Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ members = [
16
16
" syscall" ,
17
17
# init process
18
18
" init" ,
19
+ # device model application
20
+ " dm" ,
19
21
]
20
22
21
23
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ IGVMBIN = bin/igvmbld
45
45
IGVMMEASURE = "target/x86_64-unknown-linux-gnu/${TARGET_PATH}/igvmmeasure"
46
46
IGVMMEASUREBIN = bin/igvmmeasure
47
47
INITELF = "target/x86_64-unknown-none/${TARGET_PATH}/init"
48
+ DMELF = "target/x86_64-unknown-none/${TARGET_PATH}/dm"
48
49
49
50
RUSTDOC_OUTPUT = target/x86_64-unknown-none/doc
50
51
DOC_SITE = target/x86_64-unknown-none/site
@@ -140,7 +141,11 @@ bin/init: bin
140
141
cargo build --manifest-path init/Cargo.toml ${CARGO_ARGS} --bin init
141
142
objcopy -O elf64-x86-64 --strip-unneeded ${INITELF} $@
142
143
143
- user : bin/init
144
+ bin/dm : bin
145
+ cargo build --manifest-path dm/Cargo.toml ${CARGO_ARGS} --bin dm
146
+ objcopy -O elf64-x86-64 --strip-unneeded ${DMELF} $@
147
+
148
+ user : bin/init bin/dm
144
149
145
150
${FS_BIN} : bin
146
151
ifneq ($(FS_FILE ) , none)
@@ -183,7 +188,7 @@ bin/svsm-test.bin: bin/stage1-test
183
188
184
189
clippy :
185
190
cargo clippy --workspace --all-features --exclude svsm-fuzz --exclude igvmbuilder --exclude igvmmeasure -- -D warnings
186
- cargo clippy --workspace --all-features --exclude svsm-fuzz --exclude svsm --exclude init --target=x86_64-unknown-linux-gnu -- -D warnings
191
+ cargo clippy --workspace --all-features --exclude svsm-fuzz --exclude svsm --exclude init --exclude dm -- target=x86_64-unknown-linux-gnu -- -D warnings
187
192
RUSTFLAGS=" --cfg fuzzing" cargo clippy --package svsm-fuzz --all-features --target=x86_64-unknown-linux-gnu -- -D warnings
188
193
cargo clippy --workspace --all-features --tests --target=x86_64-unknown-linux-gnu -- -D warnings
189
194
Original file line number Diff line number Diff line change
1
+ [package ]
2
+ name = " dm"
3
+ version = " 0.1.0"
4
+ edition = " 2021"
5
+
6
+ [[bin ]]
7
+ name = " dm"
8
+ path = " src/main.rs"
9
+ test = false
10
+
11
+ [dependencies ]
12
+ syscall = { path = " ../syscall" }
13
+
14
+ [lints ]
15
+ workspace = true
Original file line number Diff line number Diff line change
1
+ // SPDX-License-Identifier: MIT OR Apache-2.0
2
+ fn main ( ) {
3
+ println ! ( "cargo:rustc-link-arg-bin=dm=-nostdlib" ) ;
4
+ println ! ( "cargo:rustc-link-arg-bin=dm=-no-pie" ) ;
5
+ println ! ( "cargo:rustc-link-arg-bin=dm=-Tdm/dm.lds" ) ;
6
+ }
Original file line number Diff line number Diff line change
1
+ /* Temporary WA until p_vaddr alignment issue is fixed in our ELF parser */
2
+
3
+ OUTPUT_ARCH (i386:x86-64 )
4
+
5
+ PHDRS
6
+ {
7
+ text PT_LOAD FLAGS(5); /* Read + Execute */
8
+ rodata PT_LOAD FLAGS(4); /* Read-only */
9
+ data PT_LOAD FLAGS(6); /* Read + Write */
10
+ bss PT_LOAD FLAGS(6); /* Read + Write */
11
+ }
12
+
13
+ SECTIONS
14
+ {
15
+ .text : {
16
+ *(.text)
17
+ *(.text.*)
18
+ } :text
19
+ . = ALIGN (4096);
20
+ .rodata : {
21
+ *(.rodata)
22
+ *(.rodata.*)
23
+ } :rodata
24
+ . = ALIGN (4096);
25
+ .data : {
26
+ *(.data)
27
+ *(.data.*)
28
+ } :data
29
+ . = ALIGN (4096);
30
+ .bss : {
31
+ *(.bss) *(.bss.*)
32
+ . = ALIGN (4096);
33
+ } :bss
34
+ . = ALIGN (4096);
35
+ }
36
+
37
+ ENTRY (dm_start )
Original file line number Diff line number Diff line change
1
+ // SPDX-License-Identifier: MIT OR Apache-2.0
2
+ //
3
+ // Copyright (c) 2024 Intel Corporation.
4
+ //
5
+ // Author: Chuanxiao Dong <[email protected] >
6
+
7
+ #![ no_std]
8
+ #![ no_main]
9
+
10
+ use core:: panic:: PanicInfo ;
11
+ use syscall:: exit;
12
+
13
+ fn dm_exit ( ) -> ! {
14
+ exit ( 0 ) ;
15
+ }
16
+
17
+ #[ no_mangle]
18
+ pub extern "C" fn dm_start ( ) -> ! {
19
+ dm_exit ( ) ;
20
+ }
21
+
22
+ #[ panic_handler]
23
+ fn panic ( _info : & PanicInfo < ' _ > ) -> ! {
24
+ dm_exit ( ) ;
25
+ }
You can’t perform that action at this time.
0 commit comments