Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp5014289pxv; Tue, 6 Jul 2021 15:10:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwX2iLlBr/bBrSMIK5rW1XhWdBKl6PJDZkZUSKVaQCHA84KZeG8fl0ixDdpH6imHBQFJtpw X-Received: by 2002:aa7:cc01:: with SMTP id q1mr26386037edt.84.1625609433549; Tue, 06 Jul 2021 15:10:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625609433; cv=none; d=google.com; s=arc-20160816; b=qQa5MDeW9KtkN//E9TabK6BKPAwYhFRUey+vcm8B5PkOI3o4f6HgI1jdvqmQXFotfG 5ZAdpJYhaJk/SY86Vb9jWXdRBeoh/A1o8uGqQD4CPGlhMrFzSl/YJURPMv2A0yfGZGb/ WCKJ85HJrwp3nKj2j4D1iLC5Tka9tEWrUtf/a9LnXbdL8iIMsXdYn+9V2eszlmCGwEGN CuWHVxkE22SzJ9RJPQAyp9LZpmM/d4t1N/Ehh/MmBsHn3k/7GzTvWsE5RWLe7b+l5kxA VCQ4PYejwdJbwjzdNlDUg8b5Bm9/04Jc2UKI8mIGJC4q23YWliW4wkRu4TGj/lFU1p7A 5CGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=miWKQEzuwjUaUL9AUD4+6G1lRcgnXemYADJ4ctw80Ww=; b=tdllfNKJV6+IFnDh3w3FNbhHCc8ZOiHoCDP8BCqTQk1lYVv+kM0GX1SpsPbs35wtbc /LthnKa+Y7lpUL2eWD8nyCZ4RcsvxZKHYQ9LjbKDF99fpeNWEcZoHWQCXV7Wo1lZ1E6W qHsiVCAUClYcIXwqfvKUE22GuCfXjgzvMAlSkbUrvBpQUpgiZBXrwy+k0GIACOy+uPQ4 vKHqDOXYXltE9hLLOBudSCWsWU3VQ8DjT9WDtsCIRNGNbmSZNloL+4sXVcymVjzI3+uH rD90Pf6NeMtBHTuP1Ah63jgmP+rxBlC3QrvTx3tPNhTDZL5xEOgFJSVr1Dpl0VEwy/R5 emHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Sz6M7IIY; 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 er22si16376845ejc.273.2021.07.06.15.09.54; Tue, 06 Jul 2021 15:10:33 -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=Sz6M7IIY; 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 S229910AbhGFWLP (ORCPT + 99 others); Tue, 6 Jul 2021 18:11:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:37546 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229753AbhGFWLP (ORCPT ); Tue, 6 Jul 2021 18:11:15 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D321161C3B; Tue, 6 Jul 2021 22:08:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625609316; bh=2L3Ocp8KQ9SS2sryL+eJl3QieYb1cDeo5ApMXvhPHXk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Sz6M7IIYPsbwSuPTSIJLMXmvvzbOc9NS1uFdD8ngAKjtR9A/gzmEsQH8etjMCZudz DzqMFZtKg0mnrg0Gz9XkFrS8ABQibuYXe/pRQSB4tO0NLRJXNUGzZMRl+puoZA+/qh D7V/k4pQ4XhKL4TXBykHmpLvARYulEkG2IWvxTRR8WDbUAHd2UGzYeJK3tIuIFIvco obMZq0betmBlWhkDZD5akVqC3ADile3LQqjHmYe4HiUMVMvB0nmjTwPuD1dhcVQubA sT9En35yZp0w7bok/yzxN4O3MwvwVEwRTADKOPrOazlMpZx0SjHopJULnwf40AL0fc 1xcSYaDTj26PQ== Date: Wed, 7 Jul 2021 01:08:33 +0300 From: Jarkko Sakkinen To: Dave Hansen Cc: Shuah Khan , linux-kselftest@vger.kernel.org, linux-sgx@vger.kernel.org, Reinette Chatre , Borislav Petkov , Dave Hansen , Thomas Gleixner , Ingo Molnar , x86@kernel.org, "H. Peter Anvin" , Jonathan Corbet , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Subject: Re: [PATCH 1/4] x86/sgx: Add sgx_nr_all_pages to the debugfs Message-ID: <20210706220833.d2o7ncbxs3sztaws@kernel.org> References: <20210705143652.116125-1-jarkko@kernel.org> <20210705143652.116125-2-jarkko@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 06, 2021 at 07:56:40AM -0700, Dave Hansen wrote: > On 7/5/21 7:36 AM, Jarkko Sakkinen wrote: > > Create /sys/kernel/debug/x86/sgx_nr_all_pages, which reports total > > number of EPC pages available in the system. > Could we flesh this out a bit, please? > > What's the value here when userspace could just re-enumerate the EPC > size from CPUID? My thinking is that it is better to use "kernel synthesized" value for the EPC size, because kernel controls the EPC. > I'd really appreciate if we could draw parallels between these additions > to the "SGX VM" and their analogs in the "core VM". In this case, I > think the closest analog is probably "MemTotal" in /proc/meminfo. Would make sense. > Second, how is this going to be used? SGX kselftest creates a heap, of which size is the same as the total size of the EPC reported by the kernel. > Third, is this going to be the ABI forever? AFAIK, debugfs is not part of the ABI. /Jarkko