From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f71.google.com (mail-wm0-f71.google.com [74.125.82.71]) by kanga.kvack.org (Postfix) with ESMTP id 69DA96B0005 for ; Tue, 6 Mar 2018 03:58:08 -0500 (EST) Received: by mail-wm0-f71.google.com with SMTP id p14so4840974wmc.0 for ; Tue, 06 Mar 2018 00:58:08 -0800 (PST) Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id u16sor6952697edb.42.2018.03.06.00.58.07 for (Google Transport Security); Tue, 06 Mar 2018 00:58:07 -0800 (PST) Date: Tue, 6 Mar 2018 11:57:51 +0300 From: "Kirill A. Shutemov" Subject: Re: [RFC, PATCH 21/22] x86/mm: Introduce page_keyid() and page_encrypted() Message-ID: <20180306085751.tvozsfe6hogh37pd@node.shutemov.name> References: <20180305162610.37510-1-kirill.shutemov@linux.intel.com> <20180305162610.37510-22-kirill.shutemov@linux.intel.com> <61041640-435e-1a67-177f-a75791130514@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <61041640-435e-1a67-177f-a75791130514@intel.com> Sender: owner-linux-mm@kvack.org List-ID: To: Dave Hansen Cc: "Kirill A. Shutemov" , Ingo Molnar , x86@kernel.org, Thomas Gleixner , "H. Peter Anvin" , Tom Lendacky , Kai Huang , linux-kernel@vger.kernel.org, linux-mm@kvack.org On Mon, Mar 05, 2018 at 09:08:53AM -0800, Dave Hansen wrote: > On 03/05/2018 08:26 AM, Kirill A. Shutemov wrote: > > +static inline bool page_encrypted(struct page *page) > > +{ > > + /* All pages with non-zero KeyID are encrypted */ > > + return page_keyid(page) != 0; > > +} > > Is this true? I thought there was a KEYID_NO_ENCRYPT "Do not encrypt > memory when this KeyID is in use." Is that really only limited to key 0. Well, it depends on what we mean by "encrypted". For memory management pruposes we care if the page is encrypted with KeyID different from default one. All pages with non-default KeyID threated the same by memory management. So far we don't have users for the interface. We may reconsider the meaning once we get users. -- Kirill A. Shutemov -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org