Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial preparation for model checking #228

Merged
merged 5 commits into from
Nov 7, 2023

Conversation

zpzigi754
Copy link
Collaborator

This PR prepares for basic environment setup for model checking. Slightly modified kani has been used to verify with aarch64 target instead of x86_64 target, yet using the unmodified one for normal usage would be fine. Verification harnesses will be added later.

Rust source files (*.rs) don't have to be executable.
This is required to avoid the following error.
```
error[E0308]: `#[panic_handler]` function has wrong type
  --> rmm/src/panic.rs:15:1
   |
15 | pub extern "C" fn panic_handler(_info: &core::panic::PanicInfo<'_>) -> ! {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected "Rust" fn, found "C" fn
   |
   = note: expected signature `for<'a, 'b> fn(&'a core::panic::PanicInfo<'b>) -> _`
              found signature `extern "C" for<'a, 'b> fn(&'a core::panic::PanicInfo<'b>) -> _`
```
This is required to avoid the following errors.
```
error: the `#[alloc_error_handler]` in islet_rmm conflicts with allocation error handler in: std

error[E0152]: duplicate lang item in crate `std` (which `kani` depends on): `panic_impl`.

error: aborting due to previous error

error: could not compile `fvp` (bin "fvp") due to 2 previous errors
error: Failed to execute cargo (exit status: 101). Found 2 compilation errors.
make: *** [Makefile:8: verify] Error 1
```
This is required to resolve a conflict in supporting model checking.
Usage 1) Verify islet using model checking

(in plat/fvp)

$ make verify

Usage 2) Remove generated output

(in plat/fvp)

$ make clean
Copy link
Collaborator

@bitboom bitboom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice to see kani here!

@zpzigi754 zpzigi754 merged commit add0935 into islet-project:main Nov 7, 2023
@hihi-wang
Copy link
Collaborator

Good to start with model checking with Kani!

@zpzigi754 zpzigi754 deleted the use-kani branch April 23, 2024 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants