[RFC PATCH 02/12] riscv: add landing pad for asm routines.
Sami Tolvanen
samitolvanen at google.com
Thu Apr 11 11:33:33 PDT 2024
On Thu, Apr 11, 2024 at 5:53 PM Deepak Gupta <debug at rivosinc.com> wrote:
>
> In principle, I agree it should converge with software based kcfi scheme
> as much as possible. However blocker that I see is `hash` is placed just
> before function. This breaks for code mapped as execute only scenarios.
> And ideally would like to have immediates at callsites instead of loads
> (purely perf reason and not security).
I'm not saying the schemes have to be compatible, just that it would
be great to avoid reinventing type annotations etc. For example, when
you implement the fine-grained variant, you could simply override
SYM_TYPED_ENTRY (defined in include/linux/cfi_types.h) to move
__CFI_TYPE inside the function, and then redefine __CFI_TYPE to emit a
landing pad with the correct label. This allows SYM_TYPED_* in
assembly code to work with both KCFI and fine-grained Zicfilp. For the
coarse-grained variant, your current macros are perfectly fine.
> But yes in next version, I'll take a look and try to converge as much as
> possible.
Great, sounds good!
Sami
More information about the linux-riscv
mailing list