Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3797140imm; Mon, 18 Jun 2018 04:21:03 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKoYWi6DL9udZ+ZIjb4199TTT2fQRIMGt8VJdN09uJxLWcCklo4YvjEM25yif8daSqwFTqG X-Received: by 2002:a63:aa03:: with SMTP id e3-v6mr10733260pgf.169.1529320863083; Mon, 18 Jun 2018 04:21:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529320863; cv=none; d=google.com; s=arc-20160816; b=U7EL0Y5iRCZw2lmEgz79lO9y+Ry47iXAK0q7ldq/j47Ziuez6mIqVLI9ZGD09/r6td LNyRZrvIXIhNcOw9/X7CVHemzCQZZB5oFiXNyfCY6l2rhIG9V1XelmhfDCtqexX4ScP5 GzmZqqzTnY9te3/A2EbrWKYU31PlokswKDzuCFTZplvK1MxzJJZGRd4cZr/JYaMazQdB JDBXMp/de1v2Ga9NaA3I2OX3xsttF85VZYWVTxKbAsuz8Nd09nF/VpPFxO5Jvwowno5R JEDXRS0Z3JCg9NWLt4pOj/QOFyqJZLUs1DDeyxL4ClU9iJXseOjfowVRmzvXPPA72QNM b1Dw== 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=+3pjgbzK6EjWKG7e8obNOn+qJw9NFhRneWcvbsXL0aY=; b=uftQzkBjl2ImGHmSmue6ag+v6iAGCLIe4rXKCqUg1L3JRB2r3F5utHHj+bKlfwdJ0n lPx0dV32WqRcTzwDyjQ0wE5PYrNPn9IXE8qCzIHWxRGfEeSX7q4P9R0E7aj3RW+rcopQ Ek3Aw+yoRHgjzZ8+io1KW3m22L+X+YA/x8LhsmDvmoFxLHhz1PlW+eCTVayGYNdF8WEK 1FKE/Aapm/DrDb7Ayi+7C82YV3G31bBtWKv7WP63NiDsZ53WHMp4Tdim2ba50WcrU7AC W7toZqKlJh8X56oxmQTRSDYUFsUEzyMjb6hr9vS6N6Wj2XcmHDDVFw36QkntWJhX7AbK 7qWw== 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 p8-v6si13741352pfh.249.2018.06.18.04.20.49; Mon, 18 Jun 2018 04:21:03 -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 S935531AbeFRKHc (ORCPT + 99 others); Mon, 18 Jun 2018 06:07:32 -0400 Received: from mga14.intel.com ([192.55.52.115]:35644 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935167AbeFRKHY (ORCPT ); Mon, 18 Jun 2018 06:07:24 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Jun 2018 03:07:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,238,1526367600"; d="scan'208";a="50186109" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga008.jf.intel.com with ESMTP; 18 Jun 2018 03:07:20 -0700 Received: by black.fi.intel.com (Postfix, from userid 1000) id D6FF2F8; Mon, 18 Jun 2018 13:07:21 +0300 (EEST) Date: Mon, 18 Jun 2018 13:07:21 +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 09/17] x86/mm: Implement page_keyid() using page_ext Message-ID: <20180618100721.qvm4maovfhxbfoo7@black.fi.intel.com> References: <20180612143915.68065-1-kirill.shutemov@linux.intel.com> <20180612143915.68065-10-kirill.shutemov@linux.intel.com> <169af1d8-7fb6-5e1a-4f34-0150570018cc@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <169af1d8-7fb6-5e1a-4f34-0150570018cc@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 Wed, Jun 13, 2018 at 06:20:10PM +0000, Dave Hansen wrote: > > +int page_keyid(const struct page *page) > > +{ > > + if (mktme_status != MKTME_ENABLED) > > + return 0; > > + > > + return lookup_page_ext(page)->keyid; > > +} > > +EXPORT_SYMBOL(page_keyid); > > Please start using a proper X86_FEATURE_* flag for this. It will give > you all the fancy static patching that you are missing by doing it this way. There's no MKTME CPU feature. Well, I guess we can invent syntactic one or just use static key directly. Let's see how it behaves performance-wise before optimizing this. -- Kirill A. Shutemov