Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4071956pxj; Tue, 15 Jun 2021 14:56:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCm76Lq1wvEH8Hs+1vqAmIJKWXb2vSh5dU7DXcbIkZ4ifwUDNopvjJWX5FXhaxlL5Y19vS X-Received: by 2002:a17:906:2dcb:: with SMTP id h11mr1753810eji.52.1623794213059; Tue, 15 Jun 2021 14:56:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623794213; cv=none; d=google.com; s=arc-20160816; b=KI5G4vqvzA6vIfsQn57yslZwHG5zIKSJfbpd7NAhPcp5Wxwa1IrxbhSDDSZeoMYCSi zyi0GJHvwogIAq6lUeHoSSpiDr0tyRJvdqp2/JNK2K/1NwS6M0CfLxhoWHvySGGSjSwN B3MU3LyBp+uQdzf6G2jtmrfD2roifpRdZcNOv92XspC2Ssy/3Jy96s2/7eIKcNl9vI2W w07SHJ0oL547j/SVX0BVkVmVUaJz+0HaQL/P21TFt1OMgobB6qzTlvMLNTFfI8kywYSO 3k2jnK6EVnrgGFCtc/gnND8q1Xqj3cRtXMN/mchO+mzcaQ/3d+W7KgioWLFdEoQb97UZ POqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=gGlMil9gXKdK98e+z/3//0TEFr3A94FGVQzcCF7IEdg=; b=Nu7g89ecvHH+FQ+KBUGsixyY9m6hpKYmpM6JunjKhkuYfA1SFBxsLBfxGVAshCoV8a +CI7jAn/wTHBGpoXn1gm8J8fMBLdtMEncOOhihytpzvQBFeIKL3/ERzrvENw/gnE26qU 6OBUJIhGCf5MtB+U1u14Fulf6sWQ81Bf8S2gMgL0WYtD6VgIcwzRBlYdhFtEFks2bOV7 5btAtcxFPA6JJD/ZDcwu5tnKcQinUa2G/6sjlj1CYtIZ0wDXbI2M5VkHhv+XQLSMB4Vg J4Ft3ya4qqOZrCHXxVpXuKY7WsVWUwV/q2E7VtRop60UtmlVy74QU++Zavb67VwUeGil 19bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=E4n+xiU6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b16si48706ede.389.2021.06.15.14.56.27; Tue, 15 Jun 2021 14:56:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=E4n+xiU6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230402AbhFOV5e (ORCPT + 99 others); Tue, 15 Jun 2021 17:57:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229782AbhFOV5d (ORCPT ); Tue, 15 Jun 2021 17:57:33 -0400 Received: from mail-il1-x12d.google.com (mail-il1-x12d.google.com [IPv6:2607:f8b0:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF084C06175F for ; Tue, 15 Jun 2021 14:55:27 -0700 (PDT) Received: by mail-il1-x12d.google.com with SMTP id i17so467504ilj.11 for ; Tue, 15 Jun 2021 14:55:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=gGlMil9gXKdK98e+z/3//0TEFr3A94FGVQzcCF7IEdg=; b=E4n+xiU6XmWOto6x2oSKuUqg2Y3hZugY9I+InERxKH2yDgoypfGzeYm/zUcDsuVgGv YAgCOFaxAKVvwJo2xWx8EwQ6T775mKH02/W8MY7JdDXMymNvvl34Lqdv2k6eWwKNmpJ2 hKHQxlHRfGZvDh+wZ6DNEw551U1ZdDPC3mXY4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=gGlMil9gXKdK98e+z/3//0TEFr3A94FGVQzcCF7IEdg=; b=ZcoJsiIJnLuCN7v9GWGhmxCNrD6+fxl2efQj8m7V8WbFYRQjv48iKNcF7T4AFN4hjL ryFKTKVDUfLyRmvyXUQZu93FcjjlbB//i3coD5pjBeLW1zII+TNX+zoFR7z1Scqr5q6Z 5i1bpcODGOLQtvBeOUseLGmOs5jnSMrRoAgs+rr/aXM90lJpqhmFjRjMY1sSdveCtmnM aJ+0lASSei8Aq0ENmO3OHQ8cafYmxZeqkw/VN6ZIXNGaNcZXgpvqaWxr+WiIhjJVuwB7 ORkQcXGBrd/WgZm6NPtF5KuomLNnGlG2R7DOFBdI0f8WmQggg/LPvbwiK0JHnY38iBF6 GTpA== X-Gm-Message-State: AOAM530iCFWo0AsiisQV+abbf4Bo7aPADqKH1YQ1rxduXYcrv8rl3oQ9 nKnPq70l8QJyB5O5AttGZ196vQ== X-Received: by 2002:a05:6e02:11b1:: with SMTP id 17mr1027938ilj.225.1623794127136; Tue, 15 Jun 2021 14:55:27 -0700 (PDT) Received: from [192.168.1.112] (c-24-9-64-241.hsd1.co.comcast.net. [24.9.64.241]) by smtp.gmail.com with ESMTPSA id k10sm161902ion.38.2021.06.15.14.55.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 15 Jun 2021 14:55:26 -0700 (PDT) Subject: Re: [PATCH v8 5/5] selftests/sgx: Refine the test enclave to have storage To: Jarkko Sakkinen Cc: shuah@kernel.org, linux-kselftest@vger.kernel.org, linux-sgx@vger.kernel.org, Reinette Chatre , Dave Hansen , linux-kernel@vger.kernel.org, Shuah Khan References: <20210610083021.392269-1-jarkko@kernel.org> <20210610083021.392269-5-jarkko@kernel.org> <20210615131359.zrfvi36sjdpxghzl@kernel.org> <20210615131553.5y3jssldqc3sv2ge@kernel.org> From: Shuah Khan Message-ID: Date: Tue, 15 Jun 2021 15:55:25 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210615131553.5y3jssldqc3sv2ge@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/15/21 7:15 AM, Jarkko Sakkinen wrote: > On Tue, Jun 15, 2021 at 04:14:02PM +0300, Jarkko Sakkinen wrote: >> On Mon, Jun 14, 2021 at 02:16:15PM -0600, Shuah Khan wrote: >>> On 6/10/21 2:30 AM, Jarkko Sakkinen wrote: >>>> Extend the enclave to have two operations: ENCL_OP_PUT and ENCL_OP_GET. >>>> ENCL_OP_PUT stores value inside the enclave address space and >>>> ENCL_OP_GET reads it. The internal buffer can be later extended to be >>>> variable size, and allow reclaimer tests. >>>> >>>> Signed-off-by: Jarkko Sakkinen >>>> --- >>>> tools/testing/selftests/sgx/defines.h | 10 ++++ >>>> tools/testing/selftests/sgx/main.c | 57 ++++++++++++++++++----- >>>> tools/testing/selftests/sgx/test_encl.c | 19 +++++++- >>>> tools/testing/selftests/sgx/test_encl.lds | 3 +- >>>> 4 files changed, 74 insertions(+), 15 deletions(-) >>>> >>> >>> Test output before applying the series: >>> >>> TAP version 13 >>> 1..1 >>> # selftests: sgx: test_sgx >>> # Unable to open /dev/sgx_enclave: No such file or directory >>> # 1..0 # SKIP cannot load enclaves >>> ok 1 selftests: sgx: test_sgx # SKIP >>> >>> Test output after applying second patch >>> >>> selftests/sgx: Migrate to kselftest harness >>> >>> Output changes to the following. It doesn't look like the second >>> patch adds any new tests. What is the point in running the tests >>> that fail if /dev/sgx_enclave is missing. >>> >>> Unfortunately this series doesn't have a cover letter that explains >>> what this series is doing. I don't like the fact that the test >>> output and behavior changes when migrating the test to kselftest >>> harness. Shouldn't the output stay the same as in skip the tests >>> if /dev/sgx_enclave fails. >> >> I get what you are saying but actually I do not know how with >> fixtures I can skip "the rest" when FIXTURE_SETUP() fails. >> >> The reason for the output below is that with fixtures for all >> tests enclave is initialized for each test case. And it kind of >> makes sense because all tests start from the clean expected >> state. >> >> I don't how to do that with zero change in the output. >> Yeah. I took a look at the FIXTURE. Doesn't look like it is possible. >> The reason to do this change is to make it easy to add more tests, >> and return correct status codes to the framework. > > To add: everything I did I based purely to the existing kernel > documentation, following the examples on how to use fixture. > I will pick these up and will add a note to the last commit that output changes, so test rings that run kselftest are aware of the change. thanks, -- Shuah