[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fd8f8e79-f63f-7d6f-277e-1ad08ab7b6b8@intel.com>
Date: Wed, 28 Jul 2021 16:12:38 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: "Luck, Tony" <tony.luck@...el.com>,
Sean Christopherson <seanjc@...gle.com>,
Jarkko Sakkinen <jarkko@...nel.org>
Cc: "x86@...nel.org" <x86@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 1/7] x86/sgx: Provide indication of life-cycle of EPC
pages
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.
Powered by blists - more mailing lists