Skip to content

Commit 13c6e59

Browse files
committed
Progress on page allocator verification
Signed-off-by: Lennard Gäher <[email protected]>
1 parent b831232 commit 13c6e59

File tree

79 files changed

+2502
-516
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+2502
-516
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env python3
2+
import re
3+
import sys
4+
5+
if len(sys.argv) < 3:
6+
print("usage: prune_dune_modules.py <dune-file> <module1> [module2 ...]")
7+
sys.exit(1)
8+
9+
path = sys.argv[1]
10+
remove = set(sys.argv[2:])
11+
12+
with open(path) as f:
13+
text = f.read()
14+
15+
# Matches: (modules ... )
16+
pattern = re.compile(r'\(modules\b([^)]*)\)')
17+
18+
def prune(match):
19+
modules = match.group(1).split()
20+
kept = [m for m in modules if m not in remove]
21+
return "(modules " + " ".join(kept) + ")"
22+
23+
new_text = pattern.sub(prune, text)
24+
25+
with open(path, "w") as f:
26+
f.write(new_text)

.github/workflows/verify.yml

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
- name: Install RefinedRust type system
4040
run: eval $(opam env) && REFINEDRUST_ROOT=$PWD/verification/refinedrust ./verification/refinedrust/scripts/install-typesystem.sh
4141
- name: Check cargo version
42-
run: cargo --version
42+
run: cargo --version
4343
- name: Install RefinedRust stdlib
4444
run: eval $(opam env) && REFINEDRUST_ROOT=$PWD/verification/refinedrust ./verification/refinedrust/scripts/install-stdlib.sh
4545
- name: Exclude RefinedRust from dune build
@@ -55,4 +55,32 @@ jobs:
5555
- name: make devtools
5656
run: source "$HOME/.cargo/env" && eval $(opam env) && make devtools
5757
- name: Translate specified files using RefinedRust and check proofs
58-
run: source "$HOME/.cargo/env" && eval $(opam env) && DUNEFLAGS="-j 1" make verify
58+
run: |
59+
set -o pipefail
60+
(source "$HOME/.cargo/env" && eval $(opam env) && make generate_refinedrust_translation) 2>&1 | tee full-build.log
61+
- name: Patch dune modules to exclude big proofs from CI
62+
run: |
63+
python3 .github/workflows/prune_dune_modules.py verification/rust_proofs/ace/proofs/dune \
64+
proof_core_page_allocator_allocator_PageAllocator_add_memory_region \
65+
proof_core_page_allocator_allocator_PageStorageTreeNode_store_page_token \
66+
proof_core_page_allocator_allocator_PageStorageTreeNode_divide_page_token_if_necessary \
67+
proof_core_page_allocator_allocator_PageAllocator_find_largest_page_size \
68+
proof_core_page_allocator_page_Page_T_write \
69+
proof_core_page_allocator_page_Page_core_page_allocator_page_Allocated_read \
70+
proof_core_page_allocator_allocator_PageStorageTreeNode_store_page_token \
71+
proof_core_page_allocator_page_Page_core_page_allocator_page_UnAllocated_divide
72+
- name: Compile Rocq proofs
73+
run: |
74+
(
75+
set -o pipefail
76+
source "$HOME/.cargo/env"
77+
eval "$(opam env)"
78+
cd verification
79+
DUNEFLAGS="-j 1 --display verbose" dune build
80+
) 2>&1 | tee full-build.log
81+
- name: Upload full build log
82+
if: always()
83+
uses: actions/upload-artifact@v4
84+
with:
85+
name: full-build-log
86+
path: full-build.log

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ tools: setup
9696
verify:
9797
rm -rf $(ACE_DIR)/security_monitor/verify/
9898
PATH="$(RISCV_GNU_TOOLCHAIN_WORK_DIR)/bin:$(PATH)" ACE_DIR=$(ACE_DIR) LINUX_IMAGE=$(LINUX_IMAGE) CROSS_COMPILE=$(CROSS_COMPILE) PLATFORM_RISCV_XLEN=$(PLATFORM_RISCV_XLEN) PLATFORM_RISCV_ISA=$(PLATFORM_RISCV_ISA) PLATFORM_RISCV_ABI=$(PLATFORM_RISCV_ABI) $(MAKE) -C verification verify
99+
generate_refinedrust_translation:
100+
rm -rf $(ACE_DIR)/security_monitor/verify/
101+
PATH="$(RISCV_GNU_TOOLCHAIN_WORK_DIR)/bin:$(PATH)" ACE_DIR=$(ACE_DIR) LINUX_IMAGE=$(LINUX_IMAGE) CROSS_COMPILE=$(CROSS_COMPILE) PLATFORM_RISCV_XLEN=$(PLATFORM_RISCV_XLEN) PLATFORM_RISCV_ISA=$(PLATFORM_RISCV_ISA) PLATFORM_RISCV_ABI=$(PLATFORM_RISCV_ABI) $(MAKE) -C verification generate
99102

100103
clean:
101104
rm -rf $(ACE_DIR)

confidential-vms/linux_vm/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ LINUX_VM_ROOTFS_SOURCE_DIR ?= $(CONFIDENTIAL_VMS_LINUX_SOURCE_DIR)/hypervisor_
1414
LINUX_VM_BUILDROOT_SOURCE_DIR ?= $(CONFIDENTIAL_VMS_LINUX_SOURCE_DIR)/../../hypervisor/buildroot
1515
LINUX_VM_BUILDROOT_WORK_DIR ?= $(CONFIDENTIAL_VMS_LINUX_WORK_DIR)/buildroot
1616
LINUX_VM_BUILDROOT_ROOTFS ?= $(LINUX_VM_BUILDROOT_WORK_DIR)/images/rootfs.ext2
17-
LINUX_VM_BUILDROOT_ROOTFS_SIZE ?= "256M"
17+
LINUX_VM_BUILDROOT_ROOTFS_SIZE ?= "128M"
1818
LINUX_VM_OVERLAY_SOURCE_DIR ?= $(CONFIDENTIAL_VMS_LINUX_SOURCE_DIR)/overlay
1919
LINUX_VM_OVERLAY_WORK_DIR ?= $(CONFIDENTIAL_VMS_LINUX_WORK_DIR)/overlay
2020
LINUX_VM_OVERLAY_WORK_ROOT_DIR ?= $(LINUX_VM_OVERLAY_WORK_DIR)/root

confidential-vms/linux_vm/configurations/qemu_riscv64_virt_defconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ BR2_TARGET_ROOTFS_EXT2=y
3434
BR2_TARGET_ROOTFS_EXT2_2=n
3535
BR2_TARGET_ROOTFS_EXT2_3=n
3636
BR2_TARGET_ROOTFS_EXT2_4=y
37-
BR2_TARGET_ROOTFS_EXT2_SIZE="5G"
37+
BR2_TARGET_ROOTFS_EXT2_SIZE="1G"
3838

3939
# Kernel
4040
BR2_LINUX_KERNEL=y

hypervisor/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ BUILDROOT_SOURCE_DIR ?= $(MAKEFILE_SOURCE_DIR)/buildroot
1414
HYPERVISOR_BUILDROOT_CONFIG_DIR ?= $(HYPERVISOR_CONFIGURATION_DIR)/qemu_riscv64_virt_defconfig
1515
HYPERVISOR_LINUX_CONFIG ?= $(HYPERVISOR_CONFIGURATION_DIR)/linux64-defconfig
1616
HYPERVISOR_BUILDROOT_OVERRIDE_DIR ?= $(HYPERVISOR_CONFIGURATION_DIR)/package_override.dev
17-
HYPERVISOR_ROOTFS_SIZE ?= "1G"
17+
HYPERVISOR_ROOTFS_SIZE ?= "512M"
1818
HYPERVISOR_OVERLAY_DIR ?= $(HYPERVISOR_WORK_DIR)/overlay
1919
HYPERVISOR_OVERLAY_ROOT_DIR ?= $(HYPERVISOR_OVERLAY_DIR)/root
2020
HYPERVISOR_PATCHES_DIR ?= $(MAKEFILE_SOURCE_DIR)/patches

security-monitor/src/confidential_flow/handlers/shutdown/shutdown_vm.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ use crate::core::control_data::{ConfidentialHart, ConfidentialHartRemoteCommand,
1414
/// shutdown (lifecycle state `Shutdown`). To do so, we send `Shutdown IPI` to all confidential harts. The last
1515
/// confidential hart that shutdowns itself, will remove the entire confidential VM from the control data.
1616
#[derive(Clone, PartialEq)]
17+
#[rr::skip]
1718
pub struct ShutdownRequest {
1819
calling_hart_id: usize,
1920
}

security-monitor/src/confidential_flow/handlers/symmetrical_multiprocessing/fence_i.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use crate::core::control_data::{
1010

1111
/// Handles a request from one confidential hart to execute fence.i instruction on remote confidential harts.
1212
#[derive(Clone, PartialEq)]
13+
#[rr::skip]
1314
pub struct RemoteFenceI {
1415
ipi: Ipi,
1516
}

security-monitor/src/confidential_flow/handlers/symmetrical_multiprocessing/hfence_gvma_vmid.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use crate::core::memory_layout::ConfidentialVmPhysicalAddress;
88

99
/// An inter hart request sent by the security monitor to clear G-stage level cached address translations.
1010
#[derive(Clone, PartialEq)]
11+
#[rr::skip]
1112
pub struct RemoteHfenceGvmaVmid {
1213
ipi: Ipi,
1314
_start_address: Option<ConfidentialVmPhysicalAddress>,

security-monitor/src/confidential_flow/handlers/symmetrical_multiprocessing/ipi.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use crate::core::control_data::{
1010

1111
/// Handles a request from one confidential hart to execute IPI on other confidential harts.
1212
#[derive(PartialEq, Debug, Clone)]
13+
#[rr::skip]
1314
pub struct Ipi {
1415
hart_mask: usize,
1516
hart_mask_base: usize,

0 commit comments

Comments
 (0)