From: Jarkko Sakkinen <jarkko@kernel.org>
To: Reinette Chatre <reinette.chatre@intel.com>,
Dave Hansen <dave.hansen@linux.intel.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
Jonathan Corbet <corbet@lwn.net>
Cc: linux-sgx@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-doc@vger.kernel.org
Subject: Re: [PATCH v5 2/2] x86/sgx: Add an attribute for the amount of SGX memory in a NUMA node
Date: Tue, 28 Sep 2021 06:01:38 +0300 [thread overview]
Message-ID: <20d92bf2ae51aac2e5acaf5a206f7cdbb065904b.camel@kernel.org> (raw)
In-Reply-To: <0f75a6db-27e6-dfc5-4025-e81d8e753e30@intel.com>
On Thu, 2021-09-23 at 13:39 -0700, Reinette Chatre wrote:
> Hi Jarkko,
>
> On 9/23/2021 1:30 PM, Jarkko Sakkinen wrote:
> > So cat you pick these patches to your patch set, and squash
> > this fix to it?
>
> My patch set is focused on SGX selftests while this series target the
> x86 tree. I assumed that this series would go into x86 separately and
> after they land we can proceed with the SGX selftest work.
But now your series has no chance to be applied, given that
it contains patches which have discarded given a superior
approach.
Anyway, node fields are initialized here:
if (!node_isset(nid, sgx_numa_mask)) {
spin_lock_init(&sgx_numa_nodes[nid].lock);
INIT_LIST_HEAD(&sgx_numa_nodes[nid].free_page_list);
node_set(nid, sgx_numa_mask);
}
The correct way to fix the issue is to add
sgx_numa_nodes[nid].size = 0;
Using kcalloc() would not be very sound, since you would wastefully
initialize the pre-existing fields of the struct two times: first
with zeros, and then with "real" values.
/Jarkko
prev parent reply other threads:[~2021-09-28 3:01 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-14 3:04 [PATCH v5 1/2] x86/sgx: Rename fallback labels in sgx_init() Jarkko Sakkinen
2021-09-14 3:04 ` [PATCH v5 2/2] x86/sgx: Add an attribute for the amount of SGX memory in a NUMA node Jarkko Sakkinen
2021-09-22 23:30 ` Reinette Chatre
2021-09-23 20:30 ` Jarkko Sakkinen
2021-09-23 20:39 ` Reinette Chatre
2021-09-28 3:01 ` Jarkko Sakkinen [this message]
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=20d92bf2ae51aac2e5acaf5a206f7cdbb065904b.camel@kernel.org \
--to=jarkko@kernel.org \
--cc=bp@alien8.de \
--cc=corbet@lwn.net \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sgx@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=reinette.chatre@intel.com \
--cc=tglx@linutronix.de \
--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;
as well as URLs for NNTP newsgroup(s).