Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1586372

Re: [RFC PATCH v4 07/28] x86: Provide general kernel support for memory encryption

From Dave Hansen <dave.hansen@intel.com>
Newsgroups linux.kernel
Subject Re: [RFC PATCH v4 07/28] x86: Provide general kernel support for memory encryption
Date 2017-02-22 19:20 +0100
Message-ID <tdJGa-5HP-19@gated-at.bofh.it> (permalink)
References <tbyvy-1iO-79@gated-at.bofh.it> <tcY4y-6nx-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 02/16/2017 07:43 AM, Tom Lendacky wrote:
>  static inline unsigned long pte_pfn(pte_t pte)
>  {
> -	return (pte_val(pte) & PTE_PFN_MASK) >> PAGE_SHIFT;
> +	return (pte_val(pte) & ~sme_me_mask & PTE_PFN_MASK) >> PAGE_SHIFT;
>  }
>  
>  static inline unsigned long pmd_pfn(pmd_t pmd)
>  {
> -	return (pmd_val(pmd) & pmd_pfn_mask(pmd)) >> PAGE_SHIFT;
> +	return (pmd_val(pmd) & ~sme_me_mask & pmd_pfn_mask(pmd)) >> PAGE_SHIFT;
>  }

Could you talk a bit about why you chose to do the "~sme_me_mask" bit in
here instead of making it a part of PTE_PFN_MASK / pmd_pfn_mask(pmd)?

It might not matter, but I'd be worried that this ends up breaking
direct users of PTE_PFN_MASK / pmd_pfn_mask(pmd) since they now no
longer mask the PFN out of a PTE.

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [RFC PATCH v4 07/28] x86: Provide general kernel support for  memory encryption Dave Hansen <dave.hansen@intel.com> - 2017-02-22 19:20 +0100

csiph-web