Weekly PR: ref_count TSM - #683
Conversation
|
I'm wondering whether we do need a tokenized state machine for the reference-counting mechanism. The VerusSync-style tokenized state machine is just one kind of resource that can be stored in |
|
AFAIK, this depends on the goal of the verification. TSM is convenient if the target being verified is myopic and self-contained so that its internal states solely interfact everything from within. For frames I'm afraid they might get entangled with other OS components and future extension is needed. In this case the price we pay does not justify the architectural overhaul. Also It seems that PCM is a superset of TSM so switching to resource algebra doesn't hurt too much. |
|
@rikosellic, I tend to agree that the ref_count mechanism alone doesn't need to be its own TSM. My plan was to start there and expand to cover the @hiroki-chen, I think you're mostly thinking in terms of the latter approach, or are there other reasons that TSM is undesirable for a more dynamic codebase? Experiments are now moved to a dedicated module, outside of The best thing about the TSM in my book is that it naturally lends itself to a top-level theorem: all executions are modeled by this state machine, therefore all executions are defined, which is soundness. If we take the PCM approach I would want to write something resembling a state machine with it, just not using the TSM DSL. |
|
@SNoAnd If you design a TSM the most of the states you are tracking are internally visible because TSM needs a "self-contained" design. If other kernel stuffs like the page table needs to manage the frame lifecycles on its own, the TSM might not work well in this case. |
This PR includes the prototype VerusSync-style tokenized state machine for the
ref_countfield of each frame. Since we are planning on splitting up the 'inner' perms that are currently carried together inMetaRegionOwners, I modeled that behavior with a simplifiedTmpRegionOwnersthat can be replaced by the updated one. Then verified some simple approximations of our actual code with it. It all seems to work so far. Nothing touches the main project source.The other main thread, types and layouts, ran into problems when I started porting it into Verus. I think it'll be pretty manageable but I ended up backing it out of this PR for now. Most of the work lives in VerusBelt anyway. Maybe I'll make a separate, branched PR for it and keep this one just for TSM stuff.