On 2020-08-26 22:15, Sean Christopherson wrote: > On Wed, Aug 26, 2020 at 12:27:54PM -0700, Xing, Cedric wrote: >> On 8/17/2020 9:24 PM, Sean Christopherson wrote: >>> Rework __vdso_sgx_enter_enclave() to use a struct to hold the input and >>> output params. In the new struct, add an opaque "user_data" that can be >>> used to pass context across the vDSO, and an explicit "exit_reason" to >>> avoid overloading the return value. >>> In order to pass additional parameters to the exit handler, the exinfo >> structure could be embedded in a user-defined structure while the handler >> could pick it up using "container_of" macro. IMO the original interface was >> neat and suffcient, and we are over-engineering it. > > container_of/offsetof shenanigans were my original suggestion as well. > Nathaniel's argument is that using such tricks is less than pleasent in a > Rust environment. > > https://lkml.kernel.org/r/CAOASepOFh-vOrNZEVDFrDSuHs+9GEzzpXUTG-fZMuyjWAkpRWw@xxxxxxxxxxxxxx Just for the record I'm a Rust user and I have nothing against a solution that requires computing field offsets. As others have mentioned, assembly doesn't have facilities for this but it hasn't been a problem there. -- Jethro Beekman | Fortanix
Attachment:
smime.p7s
Description: S/MIME Cryptographic Signature