Received: by 10.223.185.116 with SMTP id b49csp3567580wrg; Tue, 6 Mar 2018 00:59:14 -0800 (PST) X-Google-Smtp-Source: AG47ELsWVhPe37/MzHTDlumwjy52XaafIywBqWLfu4zlnx34ASfztAAMvSwMQWFxf8OaCgKsDSHl X-Received: by 10.99.95.15 with SMTP id t15mr14295573pgb.183.1520326754577; Tue, 06 Mar 2018 00:59:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520326754; cv=none; d=google.com; s=arc-20160816; b=vlaIait2Pa5mZjN1AgEiopCv971sknpDxVtqF2vgQi0NKfP3za803KLcZenRMIPVun YDVBGNv+gCc5bYdfY53dzmi2VNcmIjKAX42DN59MnNNk9ne1tVUUB+ccZ/jtAP/r4drz oRYbspp0Npigcv/IIHuHCEJftCj1j7apKPOsggK8Be6ykRIPk5R4xDehpx228umdBwsW r8QwqoIGDST64Oi92tC9J9L/qxBCix3bGJm/qsRlsESmcNaftU0cAVKiTa3NRZJ9LUVw svvv5wRCHytgABYk4fSMAsztO3GV37cV+ici5JNqHiXGy6xu6ktBa9lhjQDJ8jhDcyDD hh5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=Bku9LshbgoAYm8YiK/P5EGUrdbN2Wti8HGjYhDcyo6U=; b=0n7QJi+x3IN80XCE8LZO1AjwD3bm9hklgeaO1iXngTEnrNch62FS9++7CWlXSNxgX7 H9+MjvgyfgCujDQDqWM+mQzKIF7PFKNQya1zCoJygawskNyjOdqQAuDIbtc9GljosDg9 XXOgFIWHBpMXtf+cBAfcwZhanvkbYM9/vhryUiv/4NE1r71TYEB1CgGIfQrcY4II0ql6 yskq8lDST4sR+HWDziinSV3Qs16OUi+SfeCc0tIEuYSss8Vwe/Asw4Ho1u8jryTo7BBB ch7/SCSszjLgpOtRUNysGO7DGc8wqaLlRnzPd7Pr1lkS1E2zB41/GpDiZfawDlRxYwOm buGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=Vj20XCo8; 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 g88si11689288pfk.65.2018.03.06.00.59.00; Tue, 06 Mar 2018 00:59:14 -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; dkim=pass header.i=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=Vj20XCo8; 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 S932078AbeCFI6J (ORCPT + 99 others); Tue, 6 Mar 2018 03:58:09 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:55915 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750730AbeCFI6I (ORCPT ); Tue, 6 Mar 2018 03:58:08 -0500 Received: by mail-wm0-f66.google.com with SMTP id q83so21216910wme.5 for ; Tue, 06 Mar 2018 00:58:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Bku9LshbgoAYm8YiK/P5EGUrdbN2Wti8HGjYhDcyo6U=; b=Vj20XCo8LSK4r9l8b/qvE4s7s38+eyncQVqxBoi4xYM55TFMQZtKXAdD92jR1YGkDc BlojT54M4r/frge3wbHs087ic0y6Z2p/4Miuucf0vU9DGcSwh+4diGkG8VvIrxJ4Ns4m t/HhZ4BqKMPwDLKWig2RmtxvCn/wzm/Yo6JaqbPKZta3eqrBlP0djh+qTOlPnSMfUHv7 1vJqS176XYLUrcS3sJXadNhqwK0Z1/vYsDN2nmh97GIjEPINBUUIBA5dpSMxbcfycDzm QeTlVE1rCnarqpakRYchaIoRC1NagfKeWEE8kCVKvTEE1/XkP0i10IAC2/M5qat4NmWs KYxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Bku9LshbgoAYm8YiK/P5EGUrdbN2Wti8HGjYhDcyo6U=; b=nZ+REJ9znMG9YkImlsN4yhDUkf+/Qsu0d8m3MS6Up7ubi4hCOzkbCQXYjOcQlLujLG mbfLEhYqI9AX4CFDYhpf7jDOVmX9AfHADCeslICJN+4lM/r6VWtUdoATqRVQope0ciJw L0FoZHkniPo2hQ9e5rGNJsIq5VuP6ai8c2rwImUgd3rsJOOdVXX587sHndFdd8WABb2l RXNjjjpu63qeBZ9h6AzUlI5XeSY3QLRHQ+iIPLRa655O+6OnNBcRiMprXkxCzzyM93Um oSlHu2qdTg+VTWMupqUbKMJAq1EohYOat54LD0UE6tyUlqA2cfXdzPPcFZhtZeuDaB78 ryCg== X-Gm-Message-State: APf1xPCt09xqDLXs0U6MQPoWn6Ymw16qyDGNf505ZFcDs3f12YAtnjzL ynbPr2uDs1bWZyNtgxWPSEC9qg== X-Received: by 10.80.134.55 with SMTP id o52mr22243253edo.243.1520326687015; Tue, 06 Mar 2018 00:58:07 -0800 (PST) Received: from node.shutemov.name ([86.57.210.234]) by smtp.gmail.com with ESMTPSA id w2sm12908687edb.25.2018.03.06.00.58.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Mar 2018 00:58:06 -0800 (PST) Received: by node.shutemov.name (Postfix, from userid 1000) id AC448648D520; Tue, 6 Mar 2018 11:57:51 +0300 (+03) Date: Tue, 6 Mar 2018 11:57:51 +0300 From: "Kirill A. Shutemov" 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 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> User-Agent: NeoMutt/20180223 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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