-
-
Notifications
You must be signed in to change notification settings - Fork 386
intel PT: check for availability in VMX #3328
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
Conversation
.read(true) | ||
.open("/dev/cpu/0/msr") | ||
.map_err(|e| { | ||
format!( |
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.
Why not use proper errors 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.
you mean an enum of some kind?
In the end the availability checks are made to display possible reasons of PT unavailability to users, not to other parts of the code so adding enums with display method ecc feels just useless bilerplate
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.
Just the normal libafl Error
, returning a String as error is dirty
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.
wrapping everything in an Unsupported
or Unknown
libafl error just to call to_string
in the other side isn't cleaner nor useful since it adds useless stuff in the print :D
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 more like OsError
right? Still a better love story than Strings IMHO
I guess for an internal function it doesn't matter much. In the future prefer proper errors though |
Description
intel PT: check for availability in VMX
Check a CPU MSR to ensure that the CPU supports PT tracing in VMs
Checklist
./scripts/precommit.sh
and addressed all comments