Implement Zicfiss and Zicfilp extensions for Control-Flow Integrity#47
Draft
emanueleparisi wants to merge 2 commits intopulp-platform:astralfrom
Draft
Implement Zicfiss and Zicfilp extensions for Control-Flow Integrity#47emanueleparisi wants to merge 2 commits intopulp-platform:astralfrom
Zicfiss and Zicfilp extensions for Control-Flow Integrity#47emanueleparisi wants to merge 2 commits intopulp-platform:astralfrom
Conversation
core/cfi_landingpad_port.sv
Outdated
Comment on lines
47
to
53
| always_comb begin : landingpad_port | ||
| elp_o = elp_i; | ||
| lpl_o = lpl_i; | ||
| commit_ack_o = commit_ack_i; | ||
| we_gpr_o = we_gpr_i; | ||
| lp_fault_o = 'b0; | ||
| end |
There was a problem hiding this comment.
[verible-verilog-format] reported by reviewdog 🐶
Suggested change
| always_comb begin : landingpad_port | |
| elp_o = elp_i; | |
| lpl_o = lpl_i; | |
| commit_ack_o = commit_ack_i; | |
| we_gpr_o = we_gpr_i; | |
| lp_fault_o = 'b0; | |
| end | |
| always_comb begin : landingpad_port | |
| elp_o = elp_i; | |
| lpl_o = lpl_i; | |
| commit_ack_o = commit_ack_i; | |
| we_gpr_o = we_gpr_i; | |
| lp_fault_o = 'b0; | |
| end |
eda1b97 to
d74f5af
Compare
d74f5af to
43ed429
Compare
Comment on lines
+2655
to
+2657
| menvcfg_q <= menvcfg_d; | ||
| henvcfg_q <= henvcfg_d; | ||
| senvcfg_q <= senvcfg_d; |
There was a problem hiding this comment.
[verible-verilog-format] reported by reviewdog 🐶
Suggested change
| menvcfg_q <= menvcfg_d; | |
| henvcfg_q <= henvcfg_d; | |
| senvcfg_q <= senvcfg_d; | |
| menvcfg_q <= menvcfg_d; | |
| henvcfg_q <= henvcfg_d; | |
| senvcfg_q <= senvcfg_d; |
Comment on lines
+803
to
+808
| localparam logic [63:0] ENVCFG_FIOM = 64'h0000000000000001; | ||
| localparam logic [63:0] ENVCFG_LPE = 64'h0000000000000004; | ||
| localparam logic [63:0] ENVCFG_SSE = 64'h0000000000000008; | ||
| localparam logic [63:0] ENVCFG_CBIE = 64'h0000000000000030; | ||
| localparam logic [63:0] ENVCFG_CBFE = 64'h0000000000000040; | ||
| localparam logic [63:0] ENVCFG_CBZE = 64'h0000000000000080; |
There was a problem hiding this comment.
[verible-verilog-format] reported by reviewdog 🐶
Suggested change
| localparam logic [63:0] ENVCFG_FIOM = 64'h0000000000000001; | |
| localparam logic [63:0] ENVCFG_LPE = 64'h0000000000000004; | |
| localparam logic [63:0] ENVCFG_SSE = 64'h0000000000000008; | |
| localparam logic [63:0] ENVCFG_CBIE = 64'h0000000000000030; | |
| localparam logic [63:0] ENVCFG_CBFE = 64'h0000000000000040; | |
| localparam logic [63:0] ENVCFG_CBZE = 64'h0000000000000080; | |
| localparam logic [63:0] ENVCFG_FIOM = 64'h0000000000000001; | |
| localparam logic [63:0] ENVCFG_LPE = 64'h0000000000000004; | |
| localparam logic [63:0] ENVCFG_SSE = 64'h0000000000000008; | |
| localparam logic [63:0] ENVCFG_CBIE = 64'h0000000000000030; | |
| localparam logic [63:0] ENVCFG_CBFE = 64'h0000000000000040; | |
| localparam logic [63:0] ENVCFG_CBZE = 64'h0000000000000080; |
| localparam logic [63:0] ENVCFG_CBFE = 64'h0000000000000040; | ||
| localparam logic [63:0] ENVCFG_CBZE = 64'h0000000000000080; | ||
| localparam logic [63:0] ENVCFG_PBMTE = 64'h4000000000000000; | ||
| localparam logic [63:0] ENVCFG_STCE = 64'h8000000000000000; |
There was a problem hiding this comment.
[verible-verilog-format] reported by reviewdog 🐶
Suggested change
| localparam logic [63:0] ENVCFG_STCE = 64'h8000000000000000; | |
| localparam logic [63:0] ENVCFG_STCE = 64'h8000000000000000; |
Comment on lines
+813
to
+815
| localparam logic [63:0] SECCFG_MML = 64'h0000000000000001; | ||
| localparam logic [63:0] SECCFG_MMWP = 64'h0000000000000002; | ||
| localparam logic [63:0] SECCFG_RLP = 64'h0000000000000004; |
There was a problem hiding this comment.
[verible-verilog-format] reported by reviewdog 🐶
Suggested change
| localparam logic [63:0] SECCFG_MML = 64'h0000000000000001; | |
| localparam logic [63:0] SECCFG_MMWP = 64'h0000000000000002; | |
| localparam logic [63:0] SECCFG_RLP = 64'h0000000000000004; | |
| localparam logic [63:0] SECCFG_MML = 64'h0000000000000001; | |
| localparam logic [63:0] SECCFG_MMWP = 64'h0000000000000002; | |
| localparam logic [63:0] SECCFG_RLP = 64'h0000000000000004; |
| localparam logic [63:0] SECCFG_RLP = 64'h0000000000000004; | ||
| localparam logic [63:0] SECCFG_USEED = 64'h0000000000000100; | ||
| localparam logic [63:0] SECCFG_SSEED = 64'h0000000000000200; | ||
| localparam logic [63:0] SECCFG_MLPE = 64'h0000000000000400; |
There was a problem hiding this comment.
[verible-verilog-format] reported by reviewdog 🐶
Suggested change
| localparam logic [63:0] SECCFG_MLPE = 64'h0000000000000400; | |
| localparam logic [63:0] SECCFG_MLPE = 64'h0000000000000400; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implement the
ZicfissandZicfilpISA extensions for Control-Flow Integrity.ZicfissThe Zicfiss extension introduces a shadow stack to enforce backward-edge control-flow integrity. A shadow stack is a second stack used to store a shadow copy of the return address in the link register if it needs to be spilled. The shadow stack is designed to provide integrity to control transfers performed using a return, where the return may be from a procedure invoked using an indirect call or a direct call, and this is referred to as backward-edge protection. The extension adds the following instructions:
SSPUSH x1,SSPUSH x5C.SSPUSH x1SSPOPCHK x1,SSPOPCHK x5C.SSPOPCHK x5SSRDPSSAMOSWAP.W,SSAMOSWAP.DZicfilpTo enforce forward-edge control-flow integrity, the
Zicfilpextension introduces a landing pad (LPAD) instruction. TheLPADinstruction must be placed at the program locations that are valid targets of indirect jumps or calls. TheLPADinstruction is encoded using theAUIPCmajor opcode withrd=x0.Relevant links: