Re: [PATCH v38 21/24] x86/vdso: Implement a vDSO for Intel SGX enclave call

From: Borislav Petkov
Date: Fri Sep 25 2020 - 04:28:16 EST


On Fri, Sep 25, 2020 at 04:00:40AM +0300, Jarkko Sakkinen wrote:
> I renamed it as vsgx.S (for the sake of convention).

Right.

> I have not authored this patch but what I would propose is to use just
> raw value in the place of these constants. It is practially just a
> boolean value.
>
> I can also add sgx_vdso.h to uapi directory. I just don't see the point.

Just be very cautious what you add to the uapi/ directory because it
becomes API and there's no changing it. That's why I point you guys to
it, to think hard what you expose there and that it becomes contract
with luserspace.

> > I can see why you would write "TCS" though - there's a thread control
> > structure thing too in that patch.
>
> Renamed.

See Sean's reply.

> /**
> * typedef sgx_enclave_exit_handler_t - Exit handler function accepted by
> * __vdso_sgx_enter_enclave()
> * @rdi: RDI snapshot
> * @rsi: RSI snapshot
> * @rdx: RDX snapshot
> * @rsp: RSP snapshot (untrusted stack)
> * @r8: R8 snapshot
> * @r9: R9 snapshot

I'd say here:

"The registers' content is the snapshot made at enclave exit."

> Also, I renamed 'r' as 'run' in some places.
>
> End result:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-sgx.git/tree/arch/x86/include/uapi/asm/sgx.h
>
> I'm wondering this sentence:
>
> "The calling convention is custom and does not follow System V x86-64 ABI."

Yeah, I was wondering what that meant too.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette