Received: by 10.223.185.116 with SMTP id b49csp3906712wrg; Tue, 6 Mar 2018 06:58:37 -0800 (PST) X-Google-Smtp-Source: AG47ELv0XTvWyIHfAAGbmx44hzpnVmVSIUukbARjAHoFPs5Ymv/aIve1ALdRWCt7UlkDmhGFuEcN X-Received: by 10.99.178.6 with SMTP id x6mr15682704pge.98.1520348317415; Tue, 06 Mar 2018 06:58:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520348317; cv=none; d=google.com; s=arc-20160816; b=HbSs3hF9Tk7qjQg8slktqQnyb2Kc5RbetQ5suhGYUSSdyRpsgEmc/cZpAqpk4d5tCf oza9aL4d+HaLUQwKuyPgh21h5jGFjyfH4h/vkLR3CwYhfscf3l6+3XdLf5EvTnfSZ4qS gmEs/jn+5IuWJHcPtPn26sVX6wtSfqFTzrzrExUK+mHKoaIKmpDy/QwnCcQJbO44hXXx IW5vOFOEiqUTe3WCZoViq7eaCYOxQ72E8xbMWNrGY1RIm4jy6eYvKOz4Hw6fQAyk5cbi WLyz7wa316ALNUgqo9NvEPW8yFKEggXJFXecAiM7k4E1EuZ8gGkB9nTv+8MreZXx2SaT 7oLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:cc:references:to:subject:arc-authentication-results; bh=NqcFO6M4fIsrW/xrep5b65xW/fIcF6/sVH6D6pg/G4c=; b=FTvSzF1Op18Tgd34m1aDwxDCRB9CYy/HMigGoSlghO//7JZ+VVCYo7XZGi1wrDpocr /RRFQfL+lR25WVrrubtaQTZfGYa8Ry1m1INnnNTEaVPU6QShlEuCqdJJyKMEsWtf6mfI K1p3fZpbAhrinNbKkLHxFWFh1HGPrdl22U7HLi8nkHnJZlHij692J7XqzPRdnnBwhZpv U/b6qJPpn1EUVQEDe0MYWgj4ya6lEdGiD2f+Ssw9xYknsSrchVBkqwWQFhVkG9QQ4QgD Nc5FvLBpw4P4DaJhf4RnPjeUSJB6D/5n8EqzVzkhBNe3HPsvh5GNKS2Gv04sAKyNoBlt hUVQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q11si9946509pgf.90.2018.03.06.06.58.22; Tue, 06 Mar 2018 06:58:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933030AbeCFO4O (ORCPT + 99 others); Tue, 6 Mar 2018 09:56:14 -0500 Received: from mga18.intel.com ([134.134.136.126]:20369 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932418AbeCFO4J (ORCPT ); Tue, 6 Mar 2018 09:56:09 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Mar 2018 06:56:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,431,1515484800"; d="scan'208";a="23368215" Received: from unknown (HELO [10.7.201.16]) ([10.7.201.16]) by orsmga006.jf.intel.com with ESMTP; 06 Mar 2018 06:56:08 -0800 Subject: Re: [RFC, PATCH 21/22] x86/mm: Introduce page_keyid() and page_encrypted() To: "Kirill A. Shutemov" References: <20180305162610.37510-1-kirill.shutemov@linux.intel.com> <20180305162610.37510-22-kirill.shutemov@linux.intel.com> <61041640-435e-1a67-177f-a75791130514@intel.com> <20180306085751.tvozsfe6hogh37pd@node.shutemov.name> 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 From: Dave Hansen Message-ID: <91d27559-3f28-d53c-9fd9-d16e015a3f59@intel.com> Date: Tue, 6 Mar 2018 06:56:08 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180306085751.tvozsfe6hogh37pd@node.shutemov.name> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/06/2018 12:57 AM, Kirill A. Shutemov wrote: > 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. Doesn't it really mean "am I able to use the direct map to get this page's contents?"