lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0c935066-008d-b023-7dc3-f4e0ac1b3d20@intel.com>
Date:   Wed, 11 Aug 2021 07:30:13 -0700
From:   Dave Hansen <dave.hansen@...el.com>
To:     Jarkko Sakkinen <jarkko@...nel.org>, linux-sgx@...r.kernel.org
Cc:     Reinette Chatre <reinette.chatre@...el.com>,
        Borislav Petkov <bp@...en8.de>,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, x86@...nel.org,
        "H. Peter Anvin" <hpa@...or.com>, Jonathan Corbet <corbet@....net>,
        linux-kernel@...r.kernel.org, linux-doc@...r.kernel.org
Subject: Re: [PATCH RFC v3] x86/sgx: Add /proc/sys/kernel/sgx/total_mem

On 8/10/21 8:21 PM, Jarkko Sakkinen wrote:
> +The following sysctl files can be found in the ``/proc/sys/kernel/sgx/`` directory:
> +
> +``total_mem``
> +	The total amount of SGX protected memory in bytes available in the system
> +	available for use. In other words, it describes the size of the Enclave
> +	Page Cache (EPC).

I've been acting as if /proc is deprecated for new stuff.  Shouldn't
this be going in sysfs?

I figured, at some point, someone is going to ask for NUMA statistics.
That would tend to point in the direction of us needing something in:

	/sys/devices/system/node/nodeN/

Maybe 'sgxinfo' or 'sgxstat' to go along with 'meminfo'.

But, we'll probably also end up needing some stats for other things.
Folks have, for instance, asked for a counter of the number of
instantiated enclaves.

We could also use the drivers' namespaces:

	/sys/class/misc/sgx_enclave
	/sys/class/misc/sgx_provision
	/sys/class/misc/sgx_vepc

although that is a bit awkward for reporting global resources like memory.

We could create a platform device just for these stats, say:

	/sys/bus/platform/devices/sgx

But I think platform devices are rather highly scrutinized these days.
I'm not sure if SGX counts as one.

/sys/kernel also appears to be a bit of a free-for-all.  Perhaps it
could go in:

	/sys/kernel/sgx
or
	/sys/kernel/enclaves

The other crazy thing we could try would be to just hijack core mm
mechanisms:

	/proc/{meminfo,vmstat}
	/sys/devices/system/node/nodeN/{vmstat,meminfo}

Then we can just use the existing counter infrastructure, which I think
gets us into /sys and /proc.  I'm not sure the mm folks would be fond of
this for something arch and vendor specific, though.

In any case, ABIs are hard and SGX is weird.  News at 11.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ