lkml.org 
[lkml]   [2021]   [Jul]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v3 1/7] x86/sgx: Provide indication of life-cycle of EPC pages
From
Date
On 7/28/21 3:57 PM, Luck, Tony wrote:
>> Wouldn't it be safer to do something like:
>>
>> page->owner = owner ? owner : (void *)-1;
>>
>> -1 is non-NULL, but also invalid, which makes it harder for us to poke
>> ourselves in the eye.
> Does Linux have some #define INVALID_POINTER thing that
> provides a guaranteed bad (e.g. non-canonical) value?
>
> (void *)-1 seems hacky.

ERR_PTR(-SOMETHING) wouldn't be too bad. I guess it could even be:

page->owner = ERR_PTR(SGX_EPC_PAGE_VA);

and then:

#define SGX_EPC_PAGE_VA 0xffff...something...greppable

I *thought* we had a file full of these magic values, but maybe I'm
misremembering the uapi magic header.

\
 
 \ /
  Last update: 2021-07-29 01:13    [W:0.135 / U:3.300 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site