Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1462503pxb; Thu, 16 Sep 2021 08:01:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgg32eTEk2iVNbrlYkTHmbJucgpuewkQugawqj7fyYxxYl8B4rfrJ4qXfExHKGP7ZtFwjW X-Received: by 2002:a05:6402:4247:: with SMTP id g7mr6847635edb.245.1631804461470; Thu, 16 Sep 2021 08:01:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631804461; cv=none; d=google.com; s=arc-20160816; b=nJcc59waA3swo7tkxPKmJgF9ZDJhjDuseRLs0FeJ6uFdAkZQB38QAs7ORrX3ZKoA0Q Yc/fFZunF8UOkUbm7gMtJfafgzWyQNGuyMiDwQ1wsMd6UGDw82JHz7fGk8VAdnwV+Hi4 G6dKLG2GcC2hYTgYWfdJlWKpJxh3u6tzbFyP31vbBZc+i9/54XYdZ6dAEqCGPai/qamT r0EFsTRD13gfh5zJpD3Ro1DcBndDTpo2kP7kpHYAGSnaDrycuKQcL4nB5PvZ6Hw3AexG SoWehJ3NVLUVnuTkxoCOxod4eN+vZmhyAWgJYIkkjAaZJsVoqBLFwmukiAXss64lAsxI IFWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=PTfvx1JQ9utY+qgbUDrSqMfQkRi0lj1w0Qhgj24Wx8o=; b=hSGW9nOu7hx9a03/AXoij4j0Rqo5ThfBHxTX5iJgukVuXMmVGhZ7h0tbCDr9brsCBP kxKeRzGqDTipqagzzybq9pINU6oYRylDYlbGz+XmKa1xXNX6xmQ5I6QILAed7+olQBk3 w4irqq12Jk+qWv5mBN6a3SZieZUzpnwscFoti0GH915rW7+/8v2EZXajonmvX+QXX5dI qK45wAmL7RqyWX2W30vpdS0yQ7fgHb9mqX6Co/flgswKoYxjv7cEzhRLk3wYgnjfIt+F PbZL27rktHW/i+q3EWMowdRYAgkmpXb75/9LZ7978L5YGQuYk6U8Mw56eS8VpBE9Ciij XRww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HvrpYOLJ; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h93si4721637edd.487.2021.09.16.08.00.31; Thu, 16 Sep 2021 08:01:01 -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=@kernel.org header.s=k20201202 header.b=HvrpYOLJ; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238384AbhIPOLH (ORCPT + 99 others); Thu, 16 Sep 2021 10:11:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:51762 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236328AbhIPOLG (ORCPT ); Thu, 16 Sep 2021 10:11:06 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 59E9160238; Thu, 16 Sep 2021 14:09:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631801385; bh=JSVAyZlj7EFaNRDNJV5SQUCEv0kAxzwlmnzQyh2xd00=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=HvrpYOLJC2Li+zPYNRshCCf9T6Q72DMytidkaG2MJOQgRmlqCuwKjHVGOHfPpeJlH px1pxbidskVQey0HE2pQLslzZwKrXAC9cmD9+Gn5u6hGRUm6ui2HmnSsXPOEvipfX0 QrsDpA8OXqScfjtYF9bgfXtQ0SJq3hv66KKPYMUZtqcfFT5n+5mGyV3rnyiB9+Lafo ZGgTwnCohPIn/a2AFuTgnlZPf2ZctZrHM+5WJeJWF8jmUG1xayo8Ut8vhyq8QImVnW NXMpCd0G6GEqrH+R2HulZYSWoqYkRWx2l1sCDT8C1YeE3/SQlRGKNB0J1y35q4ULo8 9/PPjBcI2Uq2g== Message-ID: <6f3cc681e10877e639b882eaabf1a5e21bd2fc94.camel@kernel.org> Subject: Re: [PATCH 02/14] x86/sgx: Add /sys/kernel/debug/x86/sgx_total_mem From: Jarkko Sakkinen To: Reinette Chatre , linux-sgx@vger.kernel.org, shuah@kernel.org Cc: seanjc@google.com, bp@alien8.de, dave.hansen@linux.intel.com, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Date: Thu, 16 Sep 2021 17:09:43 +0300 In-Reply-To: <086aa5a16faf0d9b47ba9e0ebd2213713d0e76ff.1631731214.git.reinette.chatre@intel.com> References: <086aa5a16faf0d9b47ba9e0ebd2213713d0e76ff.1631731214.git.reinette.chatre@intel.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.36.5-0ubuntu1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2021-09-15 at 13:30 -0700, Reinette Chatre wrote: > From: Jarkko Sakkinen >=20 > Just like normal memory, SGX memory can be overcommitted. SGX has its > own reclaim mechanism which kicks in when physical SGX memory (Enclave > Page Cache / EPC) is exhausted. That reclaim mechanism is relatively > rarely exercised and needs selftests to poke at it. >=20 > The amount of EPC on the system is determined by the BIOS and it varies > wildly between systems. It can be dozens of MB on desktops, or many GB > on servers. >=20 > To run in a reasonable amount of time, the selftest needs to know how > much EPC there is in the system. >=20 > Introduce a new debugfs file to export that information. >=20 > Acked-by: Dave Hansen > Signed-off-by: Jarkko Sakkinen > [reinette: Use as placeholder patch until other discussions complete] > Signed-off-by: Reinette Chatre This could be replaced with the following two patches: https://lore.kernel.org/linux-sgx/20210914030422.377601-1-jarkko@kernel.org= /T/#t I forgot to CC this to you when I sent it, sorry about that. /Jarkko