File tree Expand file tree Collapse file tree 6 files changed +115
-0
lines changed
hyperlight_guest_bin/src/arch/aarch64 Expand file tree Collapse file tree 6 files changed +115
-0
lines changed Original file line number Diff line number Diff line change 1+ /*
2+ Copyright 2025 The Hyperlight Authors.
3+
4+ Licensed under the Apache License, Version 2.0 (the "License");
5+ you may not use this file except in compliance with the License.
6+ You may obtain a copy of the License at
7+
8+ http://www.apache.org/licenses/LICENSE-2.0
9+
10+ Unless required by applicable law or agreed to in writing, software
11+ distributed under the License is distributed on an "AS IS" BASIS,
12+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ See the License for the specific language governing permissions and
14+ limitations under the License.
15+ */
16+
17+ // TODO(aarch64): implement VM exit mechanism (e.g. hvc instruction)
18+
19+ /// Trigger a VM exit sending a 32-bit value to the host on the given port.
20+ pub ( crate ) unsafe fn out32 ( _port : u16 , _val : u32 ) {
21+ unimplemented ! ( "aarch64 out32" )
22+ }
Original file line number Diff line number Diff line change 1+ /*
2+ Copyright 2025 The Hyperlight Authors.
3+
4+ Licensed under the Apache License, Version 2.0 (the "License");
5+ you may not use this file except in compliance with the License.
6+ You may obtain a copy of the License at
7+
8+ http://www.apache.org/licenses/LICENSE-2.0
9+
10+ Unless required by applicable law or agreed to in writing, software
11+ distributed under the License is distributed on an "AS IS" BASIS,
12+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ See the License for the specific language governing permissions and
14+ limitations under the License.
15+ */
16+
17+ // TODO(aarch64): these values are placeholders copied from amd64
18+ pub const MAIN_STACK_TOP_GVA : u64 = 0xffff_ff00_0000_0000 ;
19+ pub const MAIN_STACK_LIMIT_GVA : u64 = 0xffff_fe00_0000_0000 ;
20+
21+ pub fn scratch_size ( ) -> u64 {
22+ unimplemented ! ( "aarch64 scratch_size" )
23+ }
24+
25+ pub fn scratch_base_gpa ( ) -> u64 {
26+ unimplemented ! ( "aarch64 scratch_base_gpa" )
27+ }
28+
29+ pub fn scratch_base_gva ( ) -> u64 {
30+ unimplemented ! ( "aarch64 scratch_base_gva" )
31+ }
Original file line number Diff line number Diff line change 1+ /*
2+ Copyright 2025 The Hyperlight Authors.
3+
4+ Licensed under the Apache License, Version 2.0 (the "License");
5+ you may not use this file except in compliance with the License.
6+ You may obtain a copy of the License at
7+
8+ http://www.apache.org/licenses/LICENSE-2.0
9+
10+ Unless required by applicable law or agreed to in writing, software
11+ distributed under the License is distributed on an "AS IS" BASIS,
12+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ See the License for the specific language governing permissions and
14+ limitations under the License.
15+ */
16+
17+ // TODO(aarch64): implement real aarch64 page allocator
18+
19+ // There are no notable architecture-specific safety considerations
20+ // here, and the general conditions are documented in the
21+ // architecture-independent re-export in prim_alloc.rs
22+ #[ allow( clippy:: missing_safety_doc) ]
23+ pub unsafe fn alloc_phys_pages ( _n : u64 ) -> u64 {
24+ unimplemented ! ( "aarch64 alloc_phys_pages" )
25+ }
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ limitations under the License.
1616
1717#[ cfg_attr( target_arch = "x86_64" , path = "arch/amd64/layout.rs" ) ]
1818#[ cfg_attr( target_arch = "x86" , path = "arch/i686/layout.rs" ) ]
19+ #[ cfg_attr( target_arch = "aarch64" , path = "arch/aarch64/layout.rs" ) ]
1920mod arch;
2021
2122pub use arch:: { MAIN_STACK_LIMIT_GVA , MAIN_STACK_TOP_GVA } ;
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ limitations under the License.
1616
1717#[ cfg_attr( target_arch = "x86_64" , path = "arch/amd64/prim_alloc.rs" ) ]
1818#[ cfg_attr( target_arch = "x86" , path = "arch/i686/prim_alloc.rs" ) ]
19+ #[ cfg_attr( target_arch = "aarch64" , path = "arch/aarch64/prim_alloc.rs" ) ]
1920mod arch;
2021
2122/// Allocate n contiguous physical pages and return the physical
Original file line number Diff line number Diff line change 1+ /*
2+ Copyright 2025 The Hyperlight Authors.
3+
4+ Licensed under the Apache License, Version 2.0 (the "License");
5+ you may not use this file except in compliance with the License.
6+ You may obtain a copy of the License at
7+
8+ http://www.apache.org/licenses/LICENSE-2.0
9+
10+ Unless required by applicable law or agreed to in writing, software
11+ distributed under the License is distributed on an "AS IS" BASIS,
12+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ See the License for the specific language governing permissions and
14+ limitations under the License.
15+ */
16+
17+ // TODO(aarch64): implement aarch64 guest runtime
18+
19+ pub mod dispatch {
20+ /// Dispatch function pointer — set during initialisation and called
21+ /// by the host for each guest function invocation.
22+ #[ unsafe( no_mangle) ]
23+ pub extern "C" fn dispatch_function ( ) {
24+ unimplemented ! ( "aarch64 dispatch_function" )
25+ }
26+ }
27+
28+ /// The entrypoint for the guest binary — called by the hypervisor.
29+ ///
30+ /// On aarch64 this is a stub that will be implemented when the
31+ /// aarch64 hypervisor backend is ready.
32+ #[ unsafe( no_mangle) ]
33+ pub extern "C" fn entrypoint ( ) -> ! {
34+ unimplemented ! ( "aarch64 entrypoint" )
35+ }
You can’t perform that action at this time.
0 commit comments