From: Jarkko Sakkinen <jarkko@kernel.org>
To: Dave Hansen <dave.hansen@intel.com>
Cc: Kristen Carlson Accardi <kristen@linux.intel.com>,
linux-sgx@vger.kernel.org,
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>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] x86/sgx: account backing pages
Date: Sat, 15 Jan 2022 01:57:09 +0200 [thread overview]
Message-ID: <YeIN1RQydD1juJGA@iki.fi> (raw)
In-Reply-To: <ed190b80-75cb-3137-1d64-1a87e1ac930e@intel.com>
On Fri, Jan 14, 2022 at 09:55:51AM -0800, Dave Hansen wrote:
> On 1/14/22 9:51 AM, Kristen Carlson Accardi wrote:
> >>> +int sgx_encl_lookup_backing(struct sgx_encl *encl, unsigned long
> >>> page_index,
> >>> + struct sgx_backing *backing)
> >>> +{
> >>> + return sgx_encl_get_backing(encl, page_index, backing);
> >>> +}
> >> IMHO, sgx_encl_backing() should be open-coded here.
> > I can understand your hesitation, but I agree with Dave here that
> > wrapping the function makes the code more clear. I would prefer to keep
> > this the way it is.
>
> I'd also like to see sgx_encl_lookup_backing() and
> sgx_encl_alloc_backing() diverge more in the future.
>
> For instance, sgx_encl_alloc_backing() could ensure that the page does
> not exist in the file before doing the sgx_encl_get_backing() call.
> This would ensure that it truly *does* allocate a page and does not just
> return a previously-allocated page.
>
> sgx_encl_lookup_backing() could ensure the opposite: that the page
> *DOES* exist in the file before doing the sgx_encl_get_backing() call.
> This would ensure that it does not allocate a page in a case where we
> expected an old, existing page to be present.
Would it be a too big tretch to add these and make the whole scheme
fully legit? Does not sound like an extremely huge stretch and there is now
a full cycle amount of time make it happen before 5.18 merge window.
/Jarkko
next prev parent reply other threads:[~2022-01-14 23:57 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-07 18:16 [PATCH v2 0/2] x86/sgx: Limit EPC overcommit Kristen Carlson Accardi
2022-01-07 18:16 ` [PATCH v2 1/2] x86/sgx: Add accounting for tracking overcommit Kristen Carlson Accardi
2022-01-07 18:46 ` Dave Hansen
2022-01-07 19:16 ` Kristen Carlson Accardi
2022-01-11 14:20 ` Haitao Huang
2022-01-11 15:43 ` Dave Hansen
2022-01-11 16:33 ` Haitao Huang
2022-01-11 17:39 ` Dave Hansen
2022-01-14 17:45 ` Kristen Carlson Accardi
2022-01-08 15:59 ` Jarkko Sakkinen
2022-01-14 17:47 ` Kristen Carlson Accardi
2022-01-07 18:16 ` [PATCH v2 2/2] x86/sgx: account backing pages Kristen Carlson Accardi
2022-01-08 16:05 ` Jarkko Sakkinen
2022-01-14 17:51 ` Kristen Carlson Accardi
2022-01-14 17:55 ` Dave Hansen
2022-01-14 23:57 ` Jarkko Sakkinen [this message]
2022-01-15 0:16 ` Dave Hansen
2022-01-15 0:56 ` Jarkko Sakkinen
2022-01-14 23:52 ` Jarkko Sakkinen
2022-01-14 23:55 ` Dave Hansen
2022-01-15 0:58 ` Jarkko Sakkinen
2022-01-15 18:57 ` [PATCH v2 0/2] x86/sgx: Limit EPC overcommit Jarkko Sakkinen
2022-01-15 19:02 ` 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=YeIN1RQydD1juJGA@iki.fi \
--to=jarkko@kernel.org \
--cc=bp@alien8.de \
--cc=dave.hansen@intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=kristen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sgx@vger.kernel.org \
--cc=mingo@redhat.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
Powered by JetHome