[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200318223937.GC52244@linux.intel.com>
Date: Thu, 19 Mar 2020 00:39:37 +0200
From: Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>
To: Sean Christopherson <sean.j.christopherson@...el.com>
Cc: Nathaniel McCallum <npmccallum@...hat.com>,
linux-kernel@...r.kernel.org, x86@...nel.org,
linux-sgx@...r.kernel.org, akpm@...ux-foundation.org,
dave.hansen@...el.com, Neil Horman <nhorman@...hat.com>,
"Huang, Haitao" <haitao.huang@...el.com>,
andriy.shevchenko@...ux.intel.com, tglx@...utronix.de,
"Svahn, Kai" <kai.svahn@...el.com>, bp@...en8.de,
Josh Triplett <josh@...htriplett.org>, luto@...nel.org,
kai.huang@...el.com, David Rientjes <rientjes@...gle.com>,
cedric.xing@...el.com, Patrick Uiterwijk <puiterwijk@...hat.com>,
Andy Lutomirski <luto@...capital.net>,
Jethro Beekman <jethro@...tanix.com>,
Connor Kuehl <ckuehl@...hat.com>,
Harald Hoyer <harald@...hat.com>,
Lily Sturmann <lsturman@...hat.com>
Subject: Re: [PATCH v28 21/22] x86/vdso: Implement a vDSO for Intel SGX
enclave call
On Mon, Mar 16, 2020 at 03:53:22PM -0700, Sean Christopherson wrote:
> Yes and no. If we wanted to minimize the amount of wrapping around the
> vDSO's ENCLU then we wouldn't have the exit handler shenanigans in the
> first place. The whole process has been about balancing the wants of each
> use case against the overall quality of the API and code.
Minimizing is not something that happens in a void. Given the user base
for the SDK having the handler was a necessity. Otherwise, we would not
have that handler in the first place.
> Up until Nathaniel joined the party, the only stakeholder in terms of the
> exit handler was the Intel SDK. There was a general consensus to pass
> registers as-is when there isn't a strong reason to do otherwise. Note
> that Nathaniel has also expressed approval of that approach.
OK, great.
> The major benefits being that the vDSO would be callable from C and that
> the kernel could define a legitimate prototype instead of a frankenstein
> prototype that's half assembly and half C. For me, those are significant
I was not aware that there was a plot to make it callable by C.
OK, so right now
A. @leaf = %eax
B. @tcs = 8(%rsp)
C. @e = 0x10(%rsp)
D. @handler = 0x18(%rsp)
On x86-64 Linux C calling convention means DI/SI/DX/CX type of thing.
So what is the thing that we are referring to C calling convetion in
this email discussion?
> benefits and well worth the extra MOV, PUSH and POP. For some use cases
> it would eliminate the need for an assembly wrapper. For runtimes that
> need an assembly wrapper for whatever reason, it's probably still a win as
> a well designed runtime can avoid register shuffling in the wrapper. And
> if there is a runtime that isn't covered by the above, it's at worst an
> extra MOV.
Is it cool if I rip of the documentation from vsgx_enter_enclave.S and
move it to Documentation/ ? It is nasty to keep and update it where it
is right now. How it is right now, it is destined to rotten.
/Jarkko
Powered by blists - more mailing lists