Re: [PATCHv3 1/3] x86/mm/encrypt: Move page table helpers into separate translation unit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 30, 2018 at 04:26:03PM -0600, Tom Lendacky wrote:
> On 1/24/2018 10:36 AM, Kirill A. Shutemov wrote:
> > There are bunch of functions in mem_encrypt.c that operate on the
> > identity mapping, which means they want virtual addresses to be equal to
> > physical one, without PAGE_OFFSET shift.
> > 
> > We also need to avoid paravirtualizaion call there.
> > 
> > Getting this done is tricky. We cannot use usual page table helpers.
> > It forces us to open-code a lot of things. It makes code ugly and hard
> > to modify.
> > 
> > We can get it work with the page table helpers, but it requires few
> > preprocessor tricks. These tricks may have side effects for the rest of
> > the file.
> > 
> > Let's isolate such functions into own translation unit.
> > 
> > Signed-off-by: Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx>
> 
> Just one minor comment at the end.  With that change:
> 
> Reviewed-by: Tom Lendacky <thomas.lendacky@xxxxxxx>
> 
> > ---
> >  arch/x86/mm/Makefile               |  14 +-
> >  arch/x86/mm/mem_encrypt.c          | 578 +----------------------------------
> >  arch/x86/mm/mem_encrypt_identity.c | 596 +++++++++++++++++++++++++++++++++++++
> >  arch/x86/mm/mm_internal.h          |   1 +
> >  4 files changed, 607 insertions(+), 582 deletions(-)
> >  create mode 100644 arch/x86/mm/mem_encrypt_identity.c
> > 
> 
> ...
> 
> > diff --git a/arch/x86/mm/mm_internal.h b/arch/x86/mm/mm_internal.h
> > index 4e1f6e1b8159..7b4fc4386d90 100644
> > --- a/arch/x86/mm/mm_internal.h
> > +++ b/arch/x86/mm/mm_internal.h
> > @@ -19,4 +19,5 @@ extern int after_bootmem;
> >  
> >  void update_cache_mode_entry(unsigned entry, enum page_cache_mode cache);
> >  
> > +extern bool sev_enabled __section(.data);
> 
> Lets move this into arch/x86/include/asm/mem_encrypt.h and then add
> #include <linux/mem_encrypt.h> to mem_encrypt_identity.c.

Why? Will we need it beyond arch/x86/mm/ in the future?

-- 
 Kirill A. Shutemov

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]
  Powered by Linux