public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko@kernel.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	reinette.chatre@intel.com, tony.luck@intel.com,
	nathaniel@profian.com, linux-kernel@vger.kernel.org,
	linux-sgx@vger.kernel.org
Subject: Re: [PATCH v11 2/2] x86/sgx: Add an attribute for the amount of SGX memory in a NUMA node
Date: Wed, 03 Nov 2021 23:54:50 +0200	[thread overview]
Message-ID: <7c859ba3feefe50fc84f5050e50465a5ffe3f572.camel@kernel.org> (raw)
In-Reply-To: <d3711ca7d612627bb891c10e20c3d569fa6f2bf3.camel@kernel.org>

On Wed, 2021-11-03 at 23:49 +0200, Jarkko Sakkinen wrote:
> On Wed, 2021-11-03 at 09:22 +0100, Greg Kroah-Hartman wrote:
> > That's not the proper thing to do here at all, these values should be
> > part of the device structure that this attribute lives on, in order to
> > properly handle all of these reference counting and locking issues
> > automatically.
> 
> The attribute group is part of the device structure, so in that sense
> it is already like this. And I think that all NUMA node specific data
> (most of which is unrelated to device sysfs) is best kept in the private
> struct.

If you are concerned that the SGX driver might go away when NUMA code
calls it, I can address that concern too.

The memory management code if arch/x86/kernel/cpu/sgx is not associated
with the user space facing driver. E.g. you can use memory manager with
KVM without having the driver even enabled in the kernel.

This include the numa code in the SGX subsystem. It's life-cycle is the
same as the power-cycle. It is guaranteed that any possible time during
the power cycle, when that sysfs callback is called, all the data is valid.
That's why it is safe to be part of the attribute groups of the NUMA
device.


/Jarkko


  reply	other threads:[~2021-11-03 21:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-03  1:28 [PATCH v11 1/2] x86/sgx: Rename fallback labels in sgx_init() Jarkko Sakkinen
2021-11-03  1:28 ` [PATCH v11 2/2] x86/sgx: Add an attribute for the amount of SGX memory in a NUMA node Jarkko Sakkinen
2021-11-03  8:22   ` Greg Kroah-Hartman
2021-11-03 21:49     ` Jarkko Sakkinen
2021-11-03 21:54       ` Jarkko Sakkinen [this message]
2021-11-04  7:25       ` Greg Kroah-Hartman
2021-11-05 22:14         ` Jarkko Sakkinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7c859ba3feefe50fc84f5050e50465a5ffe3f572.camel@kernel.org \
    --to=jarkko@kernel.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sgx@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=nathaniel@profian.com \
    --cc=rafael@kernel.org \
    --cc=reinette.chatre@intel.com \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox