Received: by 10.223.185.116 with SMTP id b49csp2943256wrg; Mon, 5 Mar 2018 11:10:53 -0800 (PST) X-Google-Smtp-Source: AG47ELvTy/LnlxX1kkWHTS3Pw2BT9fciTZaX50fSVXIqIPm6vfCB2o+aqBnAr3DXOO2vF7ZcDMp9 X-Received: by 2002:a17:902:461:: with SMTP id 88-v6mr14002149ple.88.1520277053110; Mon, 05 Mar 2018 11:10:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520277053; cv=none; d=google.com; s=arc-20160816; b=iyqV4N+yMsJGrGltxz7Vyj+vP1OUaLYBZtk8vpMWDr+PdOhY1Qv4t8VDcTowOb08IY dndz68Jx99Bv5qE6u0gEz4yQ6I5JqJYhkRGKiurcgJa4rzJBjWYr2TnbdC6OpBQJosFb q8H8+ISlNFB0fZQ8W1/LY0eEOuW4U6lD5rRp7KypX0sMCnLGLdoIsXcRWs/dpTXumGsn mwYcw1oh/FGlVizrz/JXZG1oe7JuOGLEFJn5j2QZ0AylrWfSqk5NY1e3HGceIFHPhaF2 faN9RchC7VXgPcBE/B/IE9EwQSZDZzw7YhjDqQn4YO1acE9uHSimqiVObKcfbfDAy7Dg AvKQ== 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=WD9Mb0wcApbDXT8XYfExhJupl4Es4/E/ehrD2OTNKMA=; b=D1RO1GIKRHAiyNJsSknm/BY3B90c7CE0rbH2kfwGB5056e0nFrn4ZPRZd15JNQAgrX LbHdX9+K7LMgtcCsK/K10qqF7hnqk+y5T6Sx85wuovtYvDkw/B4Kki7M/Xbt+d4yBBmv Tm+7n62ZMxLPCIY4L9/MVB4D5hX9Hb3bl0p0ose42SnfSzXgrpMDEZAzOJnPjbOpC2tt f51fJsGJqhD6XBecrHnhYRpyRbPlDxyrMFS3ZQKt5BkG9/IamsSaxQSAZPt2SwBqyxKj o5Ey9xeiNylI7dhDkFXJjHsoHdHPZ9Qxy88AMUwQ88Aolr+sEIqE5LA21W0TiBXxDUFD FU3g== 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 n34-v6si9735105pld.233.2018.03.05.11.10.38; Mon, 05 Mar 2018 11:10:53 -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 S1753061AbeCETJ1 (ORCPT + 99 others); Mon, 5 Mar 2018 14:09:27 -0500 Received: from mga04.intel.com ([192.55.52.120]:54818 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753048AbeCETJY (ORCPT ); Mon, 5 Mar 2018 14:09:24 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Mar 2018 11:09:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,428,1515484800"; d="scan'208";a="32575678" Received: from ray.jf.intel.com (HELO [10.7.201.16]) ([10.7.201.16]) by orsmga003.jf.intel.com with ESMTP; 05 Mar 2018 11:09:24 -0800 Subject: Re: [RFC, PATCH 16/22] x86/mm: Preserve KeyID on pte_modify() and pgprot_modify() To: "Kirill A. Shutemov" , Ingo Molnar , x86@kernel.org, Thomas Gleixner , "H. Peter Anvin" , Tom Lendacky References: <20180305162610.37510-1-kirill.shutemov@linux.intel.com> <20180305162610.37510-17-kirill.shutemov@linux.intel.com> Cc: Kai Huang , linux-kernel@vger.kernel.org, linux-mm@kvack.org From: Dave Hansen Message-ID: <774c1251-46d9-534e-24c2-ca04f1e0a8bb@intel.com> Date: Mon, 5 Mar 2018 11:09:23 -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: <20180305162610.37510-17-kirill.shutemov@linux.intel.com> 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/05/2018 08:26 AM, Kirill A. Shutemov wrote: > + * It includes full range of PFN bits regardless if they were claimed for KeyID > + * or not: we want to preserve KeyID on pte_modify() and pgprot_modify(). > */ > -#define _PAGE_CHG_MASK (PTE_PFN_MASK | _PAGE_PCD | _PAGE_PWT | \ > +#define PTE_PFN_MASK_MAX \ > + (((signed long)PAGE_MASK) & ((1UL << __PHYSICAL_MASK_SHIFT) - 1)) > +#define _PAGE_CHG_MASK (PTE_PFN_MASK_MAX | _PAGE_PCD | _PAGE_PWT | \ > _PAGE_SPECIAL | _PAGE_ACCESSED | _PAGE_DIRTY | \ > _PAGE_SOFT_DIRTY) Is there a way to make this: #define _PAGE_CHG_MASK (PTE_PFN_MASK | PTE_KEY_MASK...? | _PAGE_PCD | That would be a lot more understandable.