[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cc63f92a-4020-79b5-9b49-4cdd5cb800d2@intel.com>
Date: Wed, 13 Jun 2018 11:18:05 -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 08/17] x86/mm: Implement vma_is_encrypted() and
vma_keyid()
On 06/12/2018 07:39 AM, Kirill A. Shutemov wrote:
> +bool vma_is_encrypted(struct vm_area_struct *vma)
> +{
> + return pgprot_val(vma->vm_page_prot) & mktme_keyid_mask;
> +}
> +
> +int vma_keyid(struct vm_area_struct *vma)
> +{
> + pgprotval_t prot;
> +
> + if (!vma_is_anonymous(vma))
> + return 0;
> +
> + prot = pgprot_val(vma->vm_page_prot);
> + return (prot & mktme_keyid_mask) >> mktme_keyid_shift;
> +}
Why do we have a vma_is_anonymous() in one of these but not the other?
While this reuse of ->vm_page_prot is cute, is there any downside? It's
the first place I know of that we can't derive ->vm_page_prot from
->vm_flags on non-VM_IO/PFNMAP VMAs. Is that a problem?
Powered by blists - more mailing lists