Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4891066pxv; Tue, 6 Jul 2021 11:38:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwwLSsThWWQexxhLyjS+kYkoZ+poV6mEntMCyCTDdHj4vJaiNWjA50WfcxKUOXOsTcyDS9o X-Received: by 2002:a05:6402:48f:: with SMTP id k15mr24840550edv.262.1625596700312; Tue, 06 Jul 2021 11:38:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625596700; cv=none; d=google.com; s=arc-20160816; b=zgH7/7XNNSUCkl4zJTAbAEJnXqPTcMOlXqPol16DfRUk4aB2HNSVq1yhwpXjwL3l4o Za6WQe08DQiBx92xW+CQeJyoZPLzLT+YaIS/UBvla7VGeeuF5yodXRv4sBwmfYbbh/qJ v6X2E0bBAiDJOixrunE0iW6u8UAuOu0KkXo2JD1uheTRjzDcPA+W8qKgwrD68HVWvFd3 hihDCy7sF1kQi7SeKiA3PlNOks2vfCugWri5KBjhHTmckXapo8ZGJqfl10VjiJ+uJSJ0 AuIjv8nY4gLTI8eJTVhWOjDeasQlVIruuU2CGjGPneMAbzB19eLkpymVOjU4RXiDMF1N AcLQ== 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; bh=aTMEWrqzaNNJj8WnsjWl1MgyU288uxIqYqKGfl7t3DA=; b=SeQxL7XKHs0E58f3CahUvWQWT5uyQwbmvhog0VaCJvVyulP6uJKb15U8OTagbXw11U qF0hNMWoVOWpp+rufUCfecjwNpQRXWvqet+YaR7aAtKvI5SERxgnOv3x3PgvyASh3zr2 wpNj928E91DU8hNvpH810t5jImFjA9YOgaiHUx7tEXQdi3D4c822Sv9tKjwbEs8p8gEo orgbhEYhdmkt+49vtF3LVPKm905DPIFqCoi0nYH8ZHPegViTPlWpg/4KarcdxcsbMKHH pfwjKnhakvXDubtItUyIV9kiAEIby6q35/XKKDBkox1ZSwHED5i3Sa9L1e9aep8FO68D 4Ziw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ia8si15488490ejc.187.2021.07.06.11.37.56; Tue, 06 Jul 2021 11:38:20 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231341AbhGFShh (ORCPT + 99 others); Tue, 6 Jul 2021 14:37:37 -0400 Received: from mga09.intel.com ([134.134.136.24]:26101 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231172AbhGFShh (ORCPT ); Tue, 6 Jul 2021 14:37:37 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10037"; a="209130117" X-IronPort-AV: E=Sophos;i="5.83,329,1616482800"; d="scan'208";a="209130117" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jul 2021 11:34:56 -0700 X-IronPort-AV: E=Sophos;i="5.83,329,1616482800"; d="scan'208";a="481695884" Received: from rchatre-mobl3.amr.corp.intel.com (HELO [10.212.213.166]) ([10.212.213.166]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jul 2021 11:34:55 -0700 Subject: Re: [PATCH 4/4] selftests/sgx: Trigger the reclaimer and #PF handler To: Jarkko Sakkinen , Shuah Khan Cc: linux-kselftest@vger.kernel.org, linux-sgx@vger.kernel.org, Borislav Petkov , Dave Hansen , linux-kernel@vger.kernel.org References: <20210705143652.116125-1-jarkko@kernel.org> <20210705143652.116125-5-jarkko@kernel.org> From: Reinette Chatre Message-ID: <715ed555-5044-6fee-1d09-1c4cfa827af3@intel.com> Date: Tue, 6 Jul 2021 11:34:54 -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: <20210705143652.116125-5-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 7/5/2021 7:36 AM, Jarkko Sakkinen wrote: > Create a heap for the test enclave, which has the same size as all > available Enclave Page Cache (EPC) pages in the system. This will guarantee > that all test_encl.elf pages *and* SGX Enclave Control Structure (SECS) > have been swapped out by the page reclaimer during the load time. Actually, > this adds a bit more stress than that since part of the EPC gets reserved > for the Version Array (VA) pages. > > For each test, the page fault handler gets triggered in two occasions: > > - When SGX_IOC_ENCLAVE_INIT is performed, SECS gets swapped in by the > page fault handler. > - During the execution, each page that is referenced gets swapped in > by the page fault handler. > If I understand this correctly, all EPC pages are now being consumed during fixture setup and thus every SGX test, no matter how big or small, now becomes a stress test of the reclaimer instead of there being a unique reclaimer test. Since an enclave is set up and torn down for every test this seems like a significant addition. It also seems like this would impact future tests of dynamic page addition where not all scenarios could be tested with all EPC pages already consumed. Reinette