Skip to content

Conversation

priyasiddharth
Copy link

@priyasiddharth priyasiddharth commented Jun 18, 2025

Summary of the PR

virtio-queue: add verification for add_used operation

Kani proofs like verify_add_used do not finish in practical time if we use the production memory region. So we implement a stub region with a simple vector backing it. This will help subsequent proofs work and also enable stateful proofs.

Note that unsafe code is added only for StubRegion that will run in Kani.
Kani verifies all unsafe accesses do not cause undefined behaviour (in the context of unit proof execution).

Requirements

Before submitting your PR, please make sure you addressed the following
requirements:

  • All commits in this PR have Signed-Off-By trailers (with
    git commit -s), and the commit message has max 60 characters for the
    summary and max 75 characters for each description line.
  • All added/changed functionality has a corresponding unit/integration
    test.
  • All added/changed public-facing functionality has entries in the "Upcoming
    Release" section of CHANGELOG.md (if no such section exists, please create one).
  • Any newly added unsafe code is properly documented.

@priyasiddharth

This comment was marked as outdated.

@priyasiddharth priyasiddharth force-pushed the verify_add_used branch 4 times, most recently from 96d3228 to 89e9614 Compare July 29, 2025 15:15
@priyasiddharth priyasiddharth changed the title verify add_used operation using guestmemory stubs unit proof for add_used operation Aug 5, 2025
@priyasiddharth priyasiddharth marked this pull request as ready for review August 5, 2025 15:24
@MatiasVara
Copy link
Contributor

LGTM!

Copy link
Member

@stefano-garzarella stefano-garzarella left a comment

Choose a reason for hiding this comment

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

Please for the commit description, follow the style of other commits, using the crate as prefix, something like this:

virtio-queue: add unit proof for add_used method (sec 2.8.22)

@priyasiddharth priyasiddharth reopened this Aug 7, 2025
@priyasiddharth priyasiddharth changed the title unit proof for add_used operation virtio-queue: add stub memory region for kani proofs Aug 7, 2025
@priyasiddharth priyasiddharth changed the title virtio-queue: add stub memory region for kani proofs virtio-queue: add verify_add_used and stub memory region Aug 8, 2025
@priyasiddharth priyasiddharth force-pushed the verify_add_used branch 3 times, most recently from 7f83b55 to 6451a84 Compare August 19, 2025 18:37
Kani proofs do not finish in practical time if we use the production
memory region. So we implement a stub region with a simple vector backing it.
This will help subsequent proofs work and also enable stateful
proofs.

Signed-off-by: Siddharth Priya <[email protected]>
Copy link
Member

@stefano-garzarella stefano-garzarella left a comment

Choose a reason for hiding this comment

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

minor comments from my side. LGTM but I'd like an approval from @MatiasVara and @roypat

@stefano-garzarella
Copy link
Member

minor comments from my side. LGTM but I'd like an approval from @MatiasVara and @roypat

and @epilys

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