Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

There's a good question in the comments there that I still don't see the answer to. How does this work if there's an interrupt between the branch and the endbranch? Does the OS need to save/restore the "branchness" bit?


Yes, on arm the branch type is saved in SPSR_EL1 in the BTYPE field. That stands for Saved Program State Register for Kernel Mode (Exception Level 1) and Branch Type. https://developer.arm.com/documentation/ddi0595/2021-12/AArc...


there is no branchness bit, if there's an endbranch you can jump to it


Ah so when you return from an interrupt, the check is no longer done?


I'd assume so since it wouldn't be a call/jmp coming from a computed address in a register. That said I haven't read the documentation for any of this. But interrupts should be having a stack pointer change and other things happening that would be different, which is why they use the IRET instruction and not the RET one.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: