Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1248388imm; Fri, 15 Jun 2018 13:46:00 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKLKMlnZTh2++1/yK6jgsuyJo1ANUjLbgImGQzNMepo9wfi2uxl2FCEQPRbENK65Lrjq+zR X-Received: by 2002:a63:6f8a:: with SMTP id k132-v6mr3001200pgc.153.1529095560509; Fri, 15 Jun 2018 13:46:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529095560; cv=none; d=google.com; s=arc-20160816; b=ZiI4na6WY4yXYOAxHrFT6O8gyLwyY5colPp6KGiqvDXK6hMHqw0eM7FgI+Lsa1wbt4 RnKACTLrqLEWEiXVJuRDWAm8V67YY2ncaEzFcTa3Ml93CkvBpAEDryIxgXfsacdbRnR7 4+B8fuhga9Qn7pZ4eqCHGt7a5nMtZrnb/kRFuf1H8GTaIISDqNN5BTAv9JpCHgGuztV/ 0IRPguL2H5FdeObTOXgTfZxqwe6tUtR5tLQgxxlQ5XzV+oDatK9KkDhY4I79XencaJYW 2lmVZXu8lTgPk48ZpBeKvEyFqPjMBUonlicBv2cvfK121EJuxxQYVHbqcViN43wsZGVe 8lwQ== 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:arc-authentication-results; bh=7vE9eSl1P82j9NchLmBFmMmTwmYs/dM2OyXuqTe7tXM=; b=jtyanRiIpZ3pnQz2XIkyf37+EKanAyW+m220NKxbEwIH0NgRY3BoZ9t7pD3NItE7zL OVmR1hOo8tVZmNfIg/qyR+u+V5mue+L35zR23WsUD+O2dcPUIMGRQyrxDnez8xIiQj6y X798UnGJGjlKUwHp+1Vz3avqyKzgtkF5iQ4mXR+A7RdXJW2Ij7nHRZMx3SYhSsoSgeir HMfFAP6NnuR6uH4ZB/hwUjqzcbsTbUX3heYDswO7iB6mpiciojuCyU/U4I86yLXHDOrw 8oBMVO+mqxFRikWp9BNhROR/2kq3k8lDXLJzqGUleEOfMJzDMEvwoze/Rf/N+sppjSvr kTOw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q86-v6si8663835pfg.298.2018.06.15.13.45.45; Fri, 15 Jun 2018 13:46:00 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756434AbeFOUpR (ORCPT + 99 others); Fri, 15 Jun 2018 16:45:17 -0400 Received: from mga17.intel.com ([192.55.52.151]:3800 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752133AbeFOUpQ (ORCPT ); Fri, 15 Jun 2018 16:45:16 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Jun 2018 13:45:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,228,1526367600"; d="scan'208";a="59586326" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga003.jf.intel.com with ESMTP; 15 Jun 2018 13:45:12 -0700 Received: by black.fi.intel.com (Postfix, from userid 1000) id 0A903166; Fri, 15 Jun 2018 23:45:12 +0300 (EEST) Date: Fri, 15 Jun 2018 23:45:12 +0300 From: "Kirill A. Shutemov" To: Dave Hansen Cc: Ingo Molnar , x86@kernel.org, Thomas Gleixner , "H. Peter Anvin" , Tom Lendacky , Kai Huang , Jacob Pan , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCHv3 07/17] x86/mm: Preserve KeyID on pte_modify() and pgprot_modify() Message-ID: <20180615204512.axt2avr4ysc2iyrp@black.fi.intel.com> References: <20180612143915.68065-1-kirill.shutemov@linux.intel.com> <20180612143915.68065-8-kirill.shutemov@linux.intel.com> <8c31f6d2-6512-2726-763e-6dd1cbb0350a@intel.com> <20180615125720.r755xaegvfcqfr6x@black.fi.intel.com> <645a4ca8-ae77-dcdd-0cbc-0da467fc210d@intel.com> <20180615152731.3y6rre7g66rmncxr@black.fi.intel.com> <20180615160613.arntdivl5gdpfwfw@black.fi.intel.com> <445af5b3-eaca-0589-8899-88a3b26fb509@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <445af5b3-eaca-0589-8899-88a3b26fb509@intel.com> User-Agent: NeoMutt/20170714-126-deb55f (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 15, 2018 at 04:58:24PM +0000, Dave Hansen wrote: > On 06/15/2018 09:06 AM, Kirill A. Shutemov wrote: > > I have no idea what such concept should be called. I cannot come with > > anything better than PTE_PFN_MASK_MAX. Do you? > > PTE_PRESERVE_MASK > > Or maybe: > > PTE_MODIFY_PRESERVE_MASK It just replacing one confusion with another. Preserve what? How does it differ from _PAGE_CHG_MASK? I frankly think my name proposal convey more meaning. > Maybe a comment to go along with it: > > /* > * These are the bits that must be preserved during when doing a > * PTE permission modification operation, like taking a PTE from > * R/W->R/O. They include the physical address and the memory > * encryption keyID. The paddr and the keyID never occupy the same > * bits at the same time. But, a given bit might be used for the keyID > * on one system and used for the physical address on another. As an > * optimization, we manage them in one unit here since their combination > * always occupies the same hardware bits. > */ Thanks, this is useful. -- Kirill A. Shutemov