[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <75e0121d-2d24-4e72-8514-412d1fd0d23b@intel.com>
Date: Wed, 31 Aug 2022 13:08:25 -0700
From: Reinette Chatre <reinette.chatre@...el.com>
To: Jarkko Sakkinen <jarkko@...nel.org>, <linux-sgx@...r.kernel.org>
CC: Haitao Huang <haitao.huang@...ux.intel.com>,
Vijay Dhanraj <vijay.dhanraj@...el.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
"Paul Menzel" <pmenzel@...gen.mpg.de>,
Shuah Khan <shuah@...nel.org>,
"open list:KERNEL SELFTEST FRAMEWORK"
<linux-kselftest@...r.kernel.org>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 5/6] selftests/sgx: retry the ioctls returned with
EAGAIN
Hi Jarkko,
On 8/31/2022 10:38 AM, Jarkko Sakkinen wrote:
> @@ -458,16 +459,30 @@ TEST_F_TIMEOUT(enclave, unclobbered_vdso_oversubscribed_remove, 900)
> modt_ioc.offset = heap->offset;
> modt_ioc.length = heap->size;
> modt_ioc.page_type = SGX_PAGE_TYPE_TRIM;
> -
> + count = 0;
> TH_LOG("Changing type of %zd bytes to trimmed may take a while ...",
> heap->size);
> - ret = ioctl(self->encl.fd, SGX_IOC_ENCLAVE_MODIFY_TYPES, &modt_ioc);
> - errno_save = ret == -1 ? errno : 0;
> + do {
> + ret = ioctl(self->encl.fd, SGX_IOC_ENCLAVE_MODIFY_TYPES, &modt_ioc);
> +
> + errno_save = ret == -1 ? errno : 0;
> + if (errno_save != EAGAIN)
> + break;
> +
> + EXPECT_EQ(modt_ioc.result, 0);
> +
> + count += modt_ioc.count;
> + modt_ioc.offset += modt_ioc.count;
> + modt_ioc.length -= modt_ioc.count;
> + modt_ioc.result = 0;
>From the discussion in V1 it seemed that you were planning to add a check
on the result value instead of just overwriting it. Are you still planning to
do this?
Reinette
Powered by blists - more mailing lists