Conversation
|
The |
|
I didn't used any |
|
@rikosellic, btw, do we need to add functions that take |
|
@hiroki-chen I’m not sure I fully understand your point. Do you mean converting |
Yes, the original function signature is Example: fn foo(&self); // assume self has "RwArc<T>"
// becomes
fn foo(&RwLockReadGuard<T>)so that we can put pre-conditions and post-conditions to the second one, which makes the verification more explicit. The downside is that an extra wrapper might be needed – to be compatible with the original one. |
|
I think this modification will change the code behaviour. The design of As for writing through |
You are correct regarding the concurrency limitations of Reasoning directly on |
|
Now I get your point! I'm still thinking whether we can do this without spliting the function. When I used to prove system calls in uC/OS II, we are facing a simliar situation, where the kernel can be concurrently called by many system calls and is synchronized through a big lock, but they have a clear way to state what transition we will do to the inner invariant (which may be nondeterminisitic) through context refinement. I will get back to you with more details later and maybe we can think whether we can achieve this in Verus. Until then the splitting approach is accepatable. |
|
Lol, finally made some progress on this |
|
@SNoAnd, Sean, seems we need to have |
5054899 to
1596de4
Compare
This partially fulfills #344's goal but since
RwArcis a runtime-checked object, we define most of the APIs on theRwLock*Guardwhich as a view method on it.The most significant changes include the introduction of a new DMA mapping set infrastructure, enhanced specification and verification for untyped memory segment access, and a substantial redesign of the
VmIotrait to unify and clarify read/write specifications. Additionally, the PR includes various code cleanups, import reorderings, and minor improvements to frame and segment APIs.DMA Mapping Infrastructure
Basically introduced verified APIs for DMA operations.
Untyped Memory Segment Access
readerandwritermethods forSegment<M>whereM: AnyUFrameMeta + OwnerOf, with detailed specification and proof blocks to ensure correct kernel-space access and invariants.Virtual Memory I/O Trait Redesign
VmIotrait to unify and clarify read/write specifications, replacing multiple*_requiresand*_ensuresspec functions withread_specandwrite_spec, and updating the method signatures forreadandwriteto useVmWriter/VmReaderand ownership tokens. This makes the contract for virtual memory I/O more explicit and verifiable.I'm not sure if the usage of
RwArcand some of the derived structs make sense so any comment or advice is strongly welcomed.