coconut-svsm / svsm

COCONUT-SVSM
MIT License
123 stars 43 forks source link

kernel: Support restricted injection #338

Closed msft-jlange closed 6 months ago

msft-jlange commented 7 months ago

This PR adds the required logic to support restricted injection of interrupts via the #HV protocol. No interrupt handlers are defined in this PR.

joergroedel commented 6 months ago

Hey @msft-jlange, can you please rebase these changes to the latest main branch? I merged it locally and it booted fine, so I will merge it after the update.

There is one follow-on request: Can you please submit an additional PR (or include it when updating this one) adding a comment with pseudo-code describing the flow of the HV handling assembly? That will make it easier to understand the code when someone needs to touch it in the future.

msft-jlange commented 6 months ago

Hey @msft-jlange, can you please rebase these changes to the latest main branch? I merged it locally and it booted fine, so I will merge it after the update.

Done. Hopefully the merge didn't break anything.

There is one follow-on request: Can you please submit an additional PR (or include it when updating this one) adding a comment with pseudo-code describing the flow of the HV handling assembly? That will make it easier to understand the code when someone needs to touch it in the future.

I've expanded the comments as part of this PR. Hopefully they add the clarity you are looking for. It's not pseudocode, but it is a much more detailed explanation of what the code is trying to do.

joergroedel commented 6 months ago

Thanks @msft-jlange. With the comments it becomes a lot easier to maintain. Testing on my side was also successful.

MelodyHuibo commented 6 months ago

Thanks @msft-jlange. With the comments it becomes a lot easier to maintain. Testing on my side was also successful.

Hi @joergroedel , Could you share the details that how did you do the testing for it?

joergroedel commented 6 months ago

Hi @joergroedel , Could you share the details that how did you do the testing for it?

I did not test the functionality itself, as support in KVM is still missing. I tested it in my environment without restricted injection support and made sure there are no regressions.