[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180618133312.kb6j25jvf6dr7dvh@black.fi.intel.com>
Date: Mon, 18 Jun 2018 16:33:12 +0300
From: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>
To: Dave Hansen <dave.hansen@...el.com>
Cc: Ingo Molnar <mingo@...hat.com>, x86@...nel.org,
Thomas Gleixner <tglx@...utronix.de>,
"H. Peter Anvin" <hpa@...or.com>,
Tom Lendacky <thomas.lendacky@....com>,
Kai Huang <kai.huang@...ux.intel.com>,
Jacob Pan <jacob.jun.pan@...ux.intel.com>,
linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [PATCHv3 15/17] x86/mm: Implement sync_direct_mapping()
On Wed, Jun 13, 2018 at 06:41:21PM +0000, Dave Hansen wrote:
> On 06/12/2018 07:39 AM, Kirill A. Shutemov wrote:
> > arch/x86/include/asm/mktme.h | 6 +
> > arch/x86/mm/init_64.c | 6 +
> > arch/x86/mm/mktme.c | 444 +++++++++++++++++++++++++++++++++++
> > 3 files changed, 456 insertions(+)
>
> Can we not do any better than 400 lines of new open-coded pagetable
> hacking?
It's not pretty, but I don't see much options.
I first tried to modify routines that initialize/modify/remove parts of
direct mapping to keep all per-KeyID direct mappings in sync from start.
But it didn't really fly. We need to initialize direct mapping very early
when we don't have a way to allocated page in a usual way. We have very
limited pool of pre-allocated pages to allocate page tables from and it's
not able to satisfy demand for multiple direct mappings.
So I had to go with syncing it later on. When we have working page
allocator.
Regarding open-codeness, we need to walk two subtrees in lock steps.
I don't see how get mm/pagewalk.c to work in such use case. (And I don't
really like callback-based pagewalker.)
--
Kirill A. Shutemov
Powered by blists - more mailing lists