lkml.org 
[lkml]   [2022]   [Aug]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2 5/6] selftests/sgx: retry the ioctls returned with EAGAIN
From
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

\
 
 \ /
  Last update: 2022-08-31 22:09    [W:0.034 / U:0.364 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site