-
-
Notifications
You must be signed in to change notification settings - Fork 324
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
qemu handy cpu page size call proposal. #1433
Conversation
@andreafioraldi should take a look but a few thoughts from my side:
|
It is for architectures with fixed page size, we don't support others like PPC atm anyway. Calling a qemu_sys function every time a pointer to page is done (e.g. every mem access for snapshots) is not a good idea, but we can insert a cfg based on target arch and return a constant on mainstream archs like x86 or arm.
Yes, @devnexen just page_size please |
FWIW aarch64 uses both: Asahi Linux / M1 = The request could alternatively be done a |
Of course it might be that 16k pages destroy all other assumptions inside qemu_user... :D |
aa1f818
to
56896dd
Compare
libafl_qemu/src/emu.rs
Outdated
@@ -14,6 +14,10 @@ use std::{ | |||
}; | |||
use std::{slice::from_raw_parts, str::from_utf8_unchecked}; | |||
|
|||
use once_cell::sync::OnceCell; |
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.
Std::cell::OnceCell
-> no create needed anymore
libafl_qemu/src/emu.rs
Outdated
@@ -1,4 +1,4 @@ | |||
//! Expose QEMU user `LibAFL` C api to Rust | |||
// Expose QEMU user `LibAFL` C api to Rust | |||
|
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 this as doc string anymore? Cannot hurt?
56896dd
to
2455e89
Compare
2455e89
to
61e1152
Compare
@andreafioraldi okay like this? |
Not it was not, don't merge qemu PRs... Gonna revert this, the page_size method is useful, but SNAPSHOT_PAGE_SIZE can remain a constant |
This reverts commit d338b30.
This is different from the constant in snapshot tough. |
Yes, but it needs to use another variable. In addition, the purpose of calling qemu_target_page_size in system mode is that there are architectures in qemu that can change page size during the execution of the guest, so it can't be stored in a once cell. Gonna make page_size simply return a call to qemu_target_page_size every time. |
oh ok it looks more a fix than a revert. cheers. |
Sorrey :) |
No description provided.