coconut-svsm / svsm

COCONUT-SVSM
MIT License
122 stars 43 forks source link

Rework Entry code to use separate entry points and handling functions per exception vector #266

Closed joergroedel closed 9 months ago

joergroedel commented 9 months ago

This PR changes the entry code of the SVSM kernel to implement separate entry points for each vector in assembly and call vector-specific handling functions. With these changes the vector dispatch in generic_idt_handler() is not needed anymore and the old entry code is removed.

p4zuu commented 9 months ago

Looks good to me to add IST support upon this. I would need to add a bit of code between push regs and call ex_handler_\handler, but I guess I can add a new IST entry in entry.S that will be loaded in init_ist_vectors() (instead of using the default_entry_no_ist). I think it will be much cleaner to add IST entries with these changes than with the current code.

joergroedel commented 9 months ago

Looks good to me to add IST support upon this. I would need to add a bit of code between push regs and call ex_handler_\handler, but I guess I can add a new IST entry in entry.S that will be loaded in init_ist_vectors() (instead of using the default_entry_no_ist). I think it will be much cleaner to add IST entries with these changes than with the current code.

Yes, the way to do this is to create new macro similar to default_entry_no_ist for VC and use it to create the VC entry point.