[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <131cf7e2-3743-a83e-98cf-5a00c836af16@intel.com>
Date: Thu, 16 Sep 2021 08:37:31 -0700
From: Reinette Chatre <reinette.chatre@...el.com>
To: Jarkko Sakkinen <jarkko@...nel.org>, <linux-sgx@...r.kernel.org>,
<shuah@...nel.org>
CC: <seanjc@...gle.com>, <bp@...en8.de>, <dave.hansen@...ux.intel.com>,
<linux-kselftest@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 12/14] selftests/sgx: Add page permission and exception
test
Hi Jarkko,
On 9/16/2021 8:21 AM, Jarkko Sakkinen wrote:
> On Wed, 2021-09-15 at 13:31 -0700, Reinette Chatre wrote:
...
>> +/*
>> + * Return the offset in the enclave where the data segment can be found.
>> + * The first RW segment loaded is the TCS, skip that to get info on the
>> + * data segment.
>> + */
>> +static off_t encl_get_data_offset(struct encl *encl)
>> +{
>> + int i;
>> +
>> + for (i = 0; i < encl->nr_segments; i++) {
>> + struct encl_segment *seg = &encl->segment_tbl[i];
>> +
>> + if (i != 0 && seg->prot == (PROT_READ | PROT_WRITE))
>> + return seg->offset;
>
> So, why not
>
> for (i = 1; i < encl->nr_segments; i++)
>
> ?
Thank you for catching this. Will do.
Reinette
Powered by blists - more mailing lists