lkml.org 
[lkml]   [2021]   [Apr]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 13/25] x86/sgx: Add helpers to expose ECREATE and EINIT to KVM
On Tue, Apr 06, 2021 at 09:44:21AM +1200, Kai Huang wrote:
> The intention was to catch KVM bug, since KVM is the only caller, and in current
> implementation KVM won't call this function if @secs is not a valid userspace
> pointer. But yes we can also return here, but in this case an exception number
> must also be specified to *trapnr so that KVM can inject to guest. It's not that
> straightforward to decide which exception should we inject, but I think #GP
> should be OK. Please see below.

Why should you inject anything in that case?

AFAICT, you can handle the return value in __handle_encls_ecreate() and
inject only when the return value is EFAULT. If it is another negative
error value, you pass it back up to its caller, handle_encls_ecreate()
which returns other error values like -ENOMEM too. Which means, its
callchain can stomach negative values just fine.

--
Regards/Gruss,
Boris.

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

\
 
 \ /
  Last update: 2021-04-06 09:41    [W:0.208 / U:0.212 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site