Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3912104imm; Mon, 18 Jun 2018 06:15:56 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKQro74fNNsqW1ygdYz+G/+CltVUknRi+KEyR+OzRjNLHiDtMHF+gToWJRsYawkPaCflPDM X-Received: by 2002:a62:56cd:: with SMTP id h74-v6mr8946279pfj.203.1529327756520; Mon, 18 Jun 2018 06:15:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529327756; cv=none; d=google.com; s=arc-20160816; b=UgI5QjoGJTiuuSq+3yyld4AbwQnaU3589BBaTpX4MSK9E2RQiJRLf33RRtnm35EmsR uC5KHBdKfkxzvR5spMZtuMVkgDBjvdxBAD8PuORMF09hJMO5lqhQswkIYkk9sGEliQwA nO5YNa7ytoBjIqZgsDua4dY2WQKFaMwTxXjH7KjXI4aUGwvkigxjfp9NwhAGF3DH4uLr ZHFIr4afKZzDCqiPCK3SaTNA/MjJRuwiFIEUMYh+LkXRxT6oNt2aIT6NVqsLUM7AJQkU g70NdPErimS3vl31lcO3i/52ombhymUAI/eIB+H+CKpF3ONgAROSWOJG5+cfpHhikCX4 8y+w== 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=w1kop7h9zZ7iutEc6nxiLUkVGf9bZz0fQXx5xnwSTEE=; b=InA+3E3x3iQKBuI36muhOM4DyGb4w0CrE50mdW9yVdxmHa048vyRyiZB5somTgUD0h YfnI03dAVYwKxXaufoQiL/jDaDQTUWdtCvsOSCI55nK3xzcRuwyROFYsdKAu0GxWg7/+ M3skXeWyErAFAOq++Qcz/HIuZNIFBzP7MPyMKVRwjKKLtEESpXEYrel/q0rn+TW2wiPn ENZ9TR3ZZeOUZ1Qow03V5nCV9J2b0ZTkYJzuUtvlselYsTE2knPAxKAjq1lcCmTtRsKF gcg1JxUKP3WKj6HA8smH4qh2NRDFbdA6wvGhgCjDSsDsffI65nb9y2On7rhYhONbokPj Tc7Q== 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 r9-v6si11907215pgp.591.2018.06.18.06.15.42; Mon, 18 Jun 2018 06:15:56 -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 S933741AbeFRNOI (ORCPT + 99 others); Mon, 18 Jun 2018 09:14:08 -0400 Received: from mga05.intel.com ([192.55.52.43]:58147 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932843AbeFRNOH (ORCPT ); Mon, 18 Jun 2018 09:14:07 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Jun 2018 06:14:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,239,1526367600"; d="scan'208";a="49863550" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga007.jf.intel.com with ESMTP; 18 Jun 2018 06:14:04 -0700 Received: by black.fi.intel.com (Postfix, from userid 1000) id 891D7FA; Mon, 18 Jun 2018 16:14:05 +0300 (EEST) Date: Mon, 18 Jun 2018 16:14:05 +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: <20180618131405.ohpxk6sr4zogqmzn@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> <20180618100721.qvm4maovfhxbfoo7@black.fi.intel.com> <7fab87eb-7b6d-6995-b6c6-46c0fd049d2a@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7fab87eb-7b6d-6995-b6c6-46c0fd049d2a@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 Mon, Jun 18, 2018 at 12:54:29PM +0000, Dave Hansen wrote: > On 06/18/2018 03:07 AM, Kirill A. Shutemov wrote: > > 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. > > Right. We have tons of synthetic features that have no basis in the > hardware CPUID feature. > > > Well, I guess we can invent syntactic one or just use static key directly. > > Did you mean synthetic? Right. > > Let's see how it behaves performance-wise before optimizing this. > > It's not an optimization, it's how we do things in arch/x86, and it has > a *ton* of optimization infrastructure behind it that you get for free > if you use it. > > I'm just trying to save Thomas's tired fingers from having to say the > same thing in a week or two when he looks at this. Okay, I'll look into this. -- Kirill A. Shutemov