-
Notifications
You must be signed in to change notification settings - Fork 0
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
Refactor benchmark code and add more counters #131
Conversation
a501c39
to
392260c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for all the new changes :)
It's a big features so I have a few comments about design and implementation, but it's going in the right direction!
.align 4 | ||
.global _start | ||
_start: | ||
csrw mie, 0x1 // Dummy instruction to exit firmware |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this instruction doing? It sets bit 0 in mie
but why do we need that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not requiered, but it result in a firmware exit: it's to show that the exit counter works :)
Maybe I can add an assertion to really check that the counter is set to 1 or remove this if it's useless here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes, I'll merge that tomorrow :)
Next step is going to get numbers for the paper with our new tools 🥳
for counter in [ | ||
IntervalCounter::ExecutionTime, | ||
IntervalCounter::InstructionRet, | ||
] | ||
.map(Either::IntervalCounter) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow I didn't know we could do that in Rust, thanks for the trick :)
That implies that Either::IntervalCounter
is a function, which is cool.
Code is refactored to make it easier to add a counter. Two type of counters: first one is basic counters with purpose of counting occurences of events. The second one aims to measure difference beetween two events. The counters shares many properties that are grouped under the Either enum. Other properties are recorded like number of world switches or firmware exits.
This commit adds a new benchmark ecall (FID number 3) to Miralis which prints the collected statistics. Because it can be helpful to use this functionality directly from the payload (e.g. Linux) this commit also make it possible to execute some of the Miralis ecalls from the payload.
Two new firmware to test benchmark ecall (FID number 3) from firmware and ecall from payload.
55a856e
to
99c601a
Compare
Code is refactored to make it easier to add a counter. Two type of counters: first one is basic counters yith purpose of counting occurences of events. The second one aims to measure difference beetween two events.
The counters shares many properties that are grouped under the Either enum.
Other properties are recorded like number of world switches or firmware exits.
Related to #125.