[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <090170d5-44a7-9bd6-2287-c1f9f87f536f@intel.com>
Date: Wed, 13 Jun 2018 10:45:24 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
Ingo Molnar <mingo@...hat.com>, x86@...nel.org,
Thomas Gleixner <tglx@...utronix.de>,
"H. Peter Anvin" <hpa@...or.com>,
Tom Lendacky <thomas.lendacky@....com>
Cc: 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 01/17] mm: Do no merge VMAs with different encryption
KeyIDs
On 06/12/2018 07:38 AM, Kirill A. Shutemov wrote:
> VMAs with different KeyID do not mix together. Only VMAs with the same
> KeyID are compatible.
>
> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@...ux.intel.com>
> ---
> include/linux/mm.h | 7 +++++++
> mm/mmap.c | 3 ++-
> 2 files changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index 02a616e2f17d..1c3c15f37ed6 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -1492,6 +1492,13 @@ static inline bool vma_is_anonymous(struct vm_area_struct *vma)
> return !vma->vm_ops;
> }
>
> +#ifndef vma_keyid
> +static inline int vma_keyid(struct vm_area_struct *vma)
> +{
> + return 0;
> +}
> +#endif
I'm generally not a fan of this #ifdef'ing method. It makes it hard to
figure out who is supposed to define it, and it's also substantially
more fragile in the face of #include ordering.
I'd much rather see some Kconfig involvement, like
CONFIG_ARCH_HAS_MEM_ENCRYPTION or something.
Powered by blists - more mailing lists