From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 77151C47082 for ; Mon, 7 Jun 2021 16:35:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 570886136D for ; Mon, 7 Jun 2021 16:35:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231282AbhFGQhX (ORCPT ); Mon, 7 Jun 2021 12:37:23 -0400 Received: from mga11.intel.com ([192.55.52.93]:36380 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231217AbhFGQhR (ORCPT ); Mon, 7 Jun 2021 12:37:17 -0400 IronPort-SDR: MpFVcGBs585a0sMDz9G67pKbeZQaLcYDy+Knt4b9q2sR8F+mw0K07cFPWvo4zz/6EOGWu0I9Qt CUmTWoBbX3Ew== X-IronPort-AV: E=McAfee;i="6200,9189,10008"; a="201636687" X-IronPort-AV: E=Sophos;i="5.83,255,1616482800"; d="scan'208";a="201636687" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2021 09:35:26 -0700 IronPort-SDR: gGHkq0JA9XxW08rmIHn0Yozoin8bhHh51CRsA+vUv/Gtkpqib6IDZfyfn/QmddtWIFah/Ie8xS krPnFy0JLezg== X-IronPort-AV: E=Sophos;i="5.83,255,1616482800"; d="scan'208";a="637329904" Received: from rchatre-mobl3.amr.corp.intel.com (HELO [10.209.69.116]) ([10.209.69.116]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2021 09:35:26 -0700 Subject: Re: [PATCH v7 2/4] selftests/sgx: Migrate to kselftest harness To: Jarkko Sakkinen , shuah@kernel.org Cc: linux-kselftest@vger.kernel.org, linux-sgx@vger.kernel.org, Dave Hansen , linux-kernel@vger.kernel.org References: <20210526124740.16783-1-jarkko@kernel.org> <20210526124740.16783-2-jarkko@kernel.org> From: Reinette Chatre Message-ID: Date: Mon, 7 Jun 2021 09:35:25 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210526124740.16783-2-jarkko@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 Hi Jarkko, On 5/26/2021 5:47 AM, Jarkko Sakkinen wrote: ... > - exit(KSFT_PASS); > +static inline int encl_call(const void *in, void *out, struct sgx_enclave_run *run, bool clobbered) > +{ > + void *in2 = (void *)in; > + int ret; > > -err: > - encl_delete(&encl); > - exit(KSFT_FAIL); > + if (clobbered) > + ret = vdso_sgx_enter_enclave((unsigned long)in2, (unsigned long)out, 0, > + EENTER, 0, 0, run); > + else > + ret = sgx_enter_enclave(in2, out, 0, EENTER, NULL, NULL, run); > + > + return ret; > +} I find this change unnecessary because it is very specific to the current test cases and limiting future test cases. From what I understand it attempts to create a generic "call into the enclave" wrapper but in doing so it constrains the call to use only two registers, assuming there will always and only be just an "in" and "out" parameter needed. Reinette