-
Notifications
You must be signed in to change notification settings - Fork 167
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
Add unratified Zicfilp extension #355
Conversation
c85f8cb
to
cb61fcd
Compare
3f9b362
to
f4f28a3
Compare
bbac057
to
fc0b599
Compare
Can you please do your development of the feature elsewhere and file the PR when it's actually ready? 11 pushes to the branch used for this PR in the space of the past 24h is way too high, shows the PR as submitted was not at all ready and makes it hard to know when it's actually appropriate to review the PR (nobody wants to waste their time reviewing something that's known to be broken/incomplete or is going to be rewritten...). Not to mention I know have 15 GitHub notifications in my inbox for this PR since it was opened a week ago, all of them from you, which isn't particularly welcome. |
x1 = x1 // to avoid hook being optimized out | ||
x1 = x1; // to avoid hook being optimized out | ||
/* Zicfilp register state */ | ||
init_zicfilp_regs(); |
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.
This is the first thing I saw opening the PR. Please read the style guide:
Do not use the ext* types and hooks for standard extensions unless providing a stub implementation; these are reserved for use by out-of-tree extensions that provide their own non-stub implementations
RISCV_LUI => off, | ||
RISCV_AUIPC => get_arch_pc() + off | ||
/* Zicfilp : AUIPC with rd=x0 is a landing pad */ | ||
if haveZicfilp() & rd == 0b00000 & op == RISCV_AUIPC then { |
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.
Match it as a separate instruction that takes precedence over AUIPC
|
||
/* extensions */ | ||
E_Extension(e) => ext_exc_type_to_str(e) | ||
} | ||
|
||
overload to_str = {exceptionType_to_str} | ||
|
||
/* SW check exception codes */ | ||
enum SWCheckCodes = {LANDING_PAD_FAULT, SHADOW_STACK_FAULT} |
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.
Shadow stack exceptions should be added when adding shadow stack support, not as part of landing pad support
function handle_trap_extension(p : Privilege, pc : xlenbits, u : option(unit)) -> unit = () | ||
/* Zicfilp : save elp on trap */ | ||
val zicfilp_trap_extension : (Privilege) -> unit | ||
function handle_trap_extension(del_priv : Privilege, pc : xlenbits, u : option(unit)) -> unit = { |
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.
This is one of those ext* functions, just not named quite uniformly like the others
Also:
|
Sorry about the inconvenience. Indeed I realized on further testing that more changes were needed and the PR was created a bit prematurely. Thanks for the feedback on the ext functions. I will close this and send a new PR. |
Requesting feedback on the PR.
Zicfilp extension introduces labeled landing pads for forward-edge control flow integrity.
Specification: