-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cpu: implement IPI support #579
Conversation
dcc98e1
to
101a911
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this, Jon. I left a view review comments.
bea6820
to
5d94146
Compare
I've added the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this looks good to me. There are two things I mentioned in separate comments which need attention.
KVM does not support tracking interrupt state separately for each VMPL. The use of interrupts by the SVSM should be suppressed when running with SNP any time the SVSM is running under KVM/QEMU, not just when restricted injection is enabled. Signed-off-by: Jon Lange <[email protected]>
`CpuSet` is an object that can represent a set of CPUs. Two versions are defined, both atomic and non-atomic. The atomic version permits multiple threads to simultaneously add, remove, or iterate elements of the set. Signed-off-by: Jon Lange <[email protected]>
`ScopedRef` and `ScopedMut` are designed to solve the problem of managing lifetimes of references created from pointers. Normally, when a reference is created from a pointer (such as with `ptr::as_ref()`), it is associated with the static lifetime, and as a result, the compiler is unable to determine whether the reference will live long enough for its intended use. While functions like `ptr::as_ref()` can associate the reference with a lifetime, the compiler cannot usefully use this information to enfoce lifetime checks on pointers generated in this way because although every reference can be bound to a lifetime, a reference does not by itself own a lifetime, and without an owning lifetime, the compiler has no way to know when the lifetime to which the reference is bound goes out of scope. The `ScopedRef` and `ScopedMut` objects solve this by creating a new object every time a pointer is converted to a reference, so there is an actual object with an associated lifetime that the compiler can use to ensure that the reference remains valid. Signed-off-by: Jon Lange <[email protected]>
The address of a `PerCpuShared` as observed by the local CPU is different than the address of the same `PerCpuShared` observed by other CPUs in the global address space. There are cases where a local CPU needs to know the address that will be used by other CPUs. Signed-off-by: Jon Lange <[email protected]>
This change provides routines that enable one processor to send a message to one or other processors to perform work. Signed-off-by: Jon Lange <[email protected]>
This change includes logic to support sending inter-processor interrupts (IPIs) to other processors. An IPI can be sent as a multicast message, or as a unicast message to a specific processor as a mutable message which receives a response. All IPI delivery is synchronous, meaning that the sender will block until the IPI is delivered and the receiver has processed it.