Add Zisb extension#2901
Conversation
Normative Rule Changes DetectedThis PR modifies normatively tagged text. Please review the changes below to ensure they are intentional. View Detected ChangesNormative Tag Change Reportriscv-spec SpecificationWhat happens next:
How to update reference files (if needed): make update-ref
git add ref/*.json
git commit -m "Update normative tag reference files"
This comment was automatically generated by the normative tag check workflow. |
omasanori
left a comment
There was a problem hiding this comment.
How about adding these citations?
|
Thanks @omasanori @topperc: I haven't carefully read the spec myself recently; I was just dumping it into this PR. |
Is there a different place I should put my comments? |
|
Nope, here is perfect. |
| * Instructions that appear in program order after a DPB must not execute with | ||
| operand values that are the result of data-value speculation by instructions | ||
| in program order before the DPB, until the DPB completes, if such execution | ||
| could be observed through cache-based side channels. |
There was a problem hiding this comment.
Is there any spec that clarifies which instructions may constitute a cache-based side channel? (I guess it will be load/store/branch?) If this is specified, it will allow unpriv eBPF to add DPB before those instructions to prevent data-value prediction from being used for exploits.
There was a problem hiding this comment.
Is there a way to detect whether a CPU model does data-value prediction? If not, unpriv eBPF will just always have to insert (many) DPB barriers no matter if the CPU is affected. The barriers might behave like a nop on unaffected CPUs, but it might still increase the code size significantly.
There was a problem hiding this comment.
Is there a way to detect whether a CPU model does data-value prediction? If not, unpriv eBPF will just always have to insert (many) DPB barriers no matter if the CPU is affected. The barriers might behave like a nop on unaffected CPUs, but it might still increase the code size significantly.
The mconfigptr CSR contains information about the capabilities of the hart
your code is executing on. It should be inspected prior to generating code.
However, AFAIA there is no normative way to provide the information you are
seeking. If I'm not mistaken, someone was working on a specification for the
structure mconfigptr point to. I can't find the repo for the specification,
though.
There was a problem hiding this comment.
I agree it's reasonable to want to be able to determine this information in a standard way, but it can come later rather than being coupled to this spec. Conservatively emitting lots of DPBs, which will execute as NOPs on most processors, is not the end of the world. eBPF's code generation can always be optimized in future, once there's a standard way to know which barriers are needed on a given implementation.
This draft PR incorporates the proposed Zisb extension and will not be merged until it has been ratified.
cc @ved-rivos @dkruckemyer-work @gfavor