Repository navigation
Manually allocate callee-saved registers so values don't get overwritten in fault rejection - #55
Conversation
JamesHuard
left a comment
There was a problem hiding this comment.
It auto'd LR?! Thanks, inline assembly. Clearly the most reasonable thing to do here.
|
This would be a comment for PR 50, but I'll add it here: might make sense to use the NbootBool instead of just a generic bool in Dev Mode |
|
Aonther comment: Wouldn't make more sense to do the DEV mode RKTH copy in verification.rs once the body executes and we are in the okay arm, instead of copying in the body itself? |
|
On device testing and assembly for this PR checks out okay. I think we are good to merge pending responses to comments. |
|
I'll look at it tomorrow, but most of these comments don't pertain to the PR at hand. It'd be better to open an issue and discus there instead of holding up this fix that seemingly works |
Agreed, this one is all set. We can merge. |
|
@JamesHuard @felipebalbi Can this one be merged? Our PRs using ToT of this branch once boot. |
5cb500d to
e465473
Compare
fdd29a1
into
OpenDevicePartnership:mcxa-secure-boot
done, it just needed a rebase and a "resolve conversation" on your own question. |
This should fix what @alamfarjadf saw here: #50 (comment)
What happened was that one of the allocated registers was the LR register. I don't know why that's being picked as it sounds like a terrible choice.
The value would get overwritten by the first
blinstruction which caused thebodyclosure to not get called (properly).By allocating the registers manually, we know they're ok to use. In the disassembly I can also see these registers are pushed and popped to/from the stack as they should.