Message ID | 20210816202441.4098523-1-mizhang@google.com |
---|---|
Headers | show |
Series | clean up interface between KVM and psp | expand |
On 16/08/21 22:24, Mingwei Zhang wrote: > This patch set is trying to help make the interface between KVM and psp > cleaner and simpler. In particular, the patches do the following > improvements: > - avoid the requirement of psp data structures for some psp APIs. > - hide error handling within psp API, eg., using sev_decommission. > - hide the serialization requirement between DF_FLUSH and DEACTIVATE. > > Mingwei Zhang (3): > KVM: SVM: move sev_decommission to psp driver > KVM: SVM: move sev_bind_asid to psp > KVM: SVM: move sev_unbind_asid and DF_FLUSH logic into psp No objections apart from the build failure on patch 1. However, it's up to Tom whether they prefer this logic in KVM or the PSP driver. Paolo
Hi Paolo, Thanks for the prompt reply. I will update the code and will be waiting for Tom and other AMD folks' feedback. Thanks. Regards -Mingwei On Tue, Aug 17, 2021 at 1:54 AM Paolo Bonzini <pbonzini@redhat.com> wrote: > > On 16/08/21 22:24, Mingwei Zhang wrote: > > This patch set is trying to help make the interface between KVM and psp > > cleaner and simpler. In particular, the patches do the following > > improvements: > > - avoid the requirement of psp data structures for some psp APIs. > > - hide error handling within psp API, eg., using sev_decommission. > > - hide the serialization requirement between DF_FLUSH and DEACTIVATE. > > > > Mingwei Zhang (3): > > KVM: SVM: move sev_decommission to psp driver > > KVM: SVM: move sev_bind_asid to psp > > KVM: SVM: move sev_unbind_asid and DF_FLUSH logic into psp > > No objections apart from the build failure on patch 1. However, it's up > to Tom whether they prefer this logic in KVM or the PSP driver. > > Paolo >
On 8/17/21 1:08 PM, Mingwei Zhang wrote: > Hi Paolo, > > Thanks for the prompt reply. I will update the code and will be > waiting for Tom and other AMD folks' feedback. > > Thanks. Regards > -Mingwei > > On Tue, Aug 17, 2021 at 1:54 AM Paolo Bonzini <pbonzini@redhat.com> wrote: >> >> On 16/08/21 22:24, Mingwei Zhang wrote: >>> This patch set is trying to help make the interface between KVM and psp >>> cleaner and simpler. In particular, the patches do the following >>> improvements: >>> - avoid the requirement of psp data structures for some psp APIs. >>> - hide error handling within psp API, eg., using sev_decommission. >>> - hide the serialization requirement between DF_FLUSH and DEACTIVATE. >>> >>> Mingwei Zhang (3): >>> KVM: SVM: move sev_decommission to psp driver >>> KVM: SVM: move sev_bind_asid to psp >>> KVM: SVM: move sev_unbind_asid and DF_FLUSH logic into psp >> >> No objections apart from the build failure on patch 1. However, it's up >> to Tom whether they prefer this logic in KVM or the PSP driver. >> I have no objection to move those functions in SEV drv. With build fix Acked-by: Brijesh Singh <brijesh.singh@amd.com> Just for the context, SEV API commands are divided in two sets: 1. commands to provision the host (such as PDH_GEN, CSR, CERT_EXPORT, CERT_IMPORT ...) 2. commands to manage the guest (such as LAUNCH_START, LAUNCH_UPDATE ...) I was trying to keep all the guest management commands functions within KVM because no other driver needs it. Having said that, we made exception for the decommission and activate so we can cleanup the firmware resource in non-process context. thanks
> > I have no objection to move those functions in SEV drv. > > With build fix > > Acked-by: Brijesh Singh <brijesh.singh@amd.com> > Thanks for the ack. Will fix all build issues in the next version. > I was trying to keep all the guest management commands functions within > KVM because no other driver needs it. Having said that, we made > exception for the decommission and activate so we can cleanup the > firmware resource in non-process context. > Yes, ACTIVATE / DECOMMISSION is one case that illustrates the need to care about their internal relationship. And there is another case, which is the serialization requirement between DF_FLUSH and DEACTIVATE. This requires KVM to maintain an extra RWSEM. So I feel that it would be good to hide these details away from KVM even if KVM is the only user. Thanks. -Mingwei