lkml.org 
[lkml]   [2018]   [Jun]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCHv3 09/17] x86/mm: Implement page_keyid() using page_ext
On Mon, Jun 18, 2018 at 12:54:29PM +0000, Dave Hansen wrote:
> On 06/18/2018 03:07 AM, Kirill A. Shutemov wrote:
> > On Wed, Jun 13, 2018 at 06:20:10PM +0000, Dave Hansen wrote:
> >>> +int page_keyid(const struct page *page)
> >>> +{
> >>> + if (mktme_status != MKTME_ENABLED)
> >>> + return 0;
> >>> +
> >>> + return lookup_page_ext(page)->keyid;
> >>> +}
> >>> +EXPORT_SYMBOL(page_keyid);
> >> Please start using a proper X86_FEATURE_* flag for this. It will give
> >> you all the fancy static patching that you are missing by doing it this way.
> > There's no MKTME CPU feature.
>
> Right. We have tons of synthetic features that have no basis in the
> hardware CPUID feature.

I've tried the approach, but it doesn't fit here.

We enable MKTME relatively late during boot process -- after page_ext as
page_keyid() depends on it. Enabling it earlier would make page_keyid()
return garbage.

By the time page_ext initialized, CPU features is already handled and
setup_force_cpu_cap() doesn't do anything.

I've implemented the enabling with static key instead.

--
Kirill A. Shutemov

\
 
 \ /
  Last update: 2018-06-22 17:41    [W:0.325 / U:0.596 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site