Received: by 10.213.65.68 with SMTP id h4csp655750imn; Wed, 28 Mar 2018 10:15:57 -0700 (PDT) X-Google-Smtp-Source: AIpwx49vaaleP6gMbQkb0B9mk90tZjGQ15KlRHP9AGpWbm77X7R7zNGsvCuCu28Ct5+an+ejzPrX X-Received: by 2002:a17:902:59c9:: with SMTP id d9-v6mr4692923plj.251.1522257357680; Wed, 28 Mar 2018 10:15:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522257357; cv=none; d=google.com; s=arc-20160816; b=tB8nW9YY2AtwV7j9jn1zY/U+OH1OgKXts+rhiCopg0ewHxaRbIvCmk3ExkGoxMXANn abiDjgpHnBrYUmFUPBOkAR5MpZasfTcHKWJIb/SE0BPYop8ob6M1SNGgO+qji4MkFA+s KX5FhO2anhwmlBd+Mwpsw6yez4yhIlpDJat8JDjUYoQ0MZTH45KlIKKGpOxBKu/UTOS9 08TAUDOTFiJSopKTch8nEjLCy79yCEsqWOr6UP+0EZL8U1kYKZXrcnVImpMw113dGYoo wi3Q2Jw19z5HmTktl0MQL0b2cEZLfmqWf3kizyHiIvMa5OY61EG3Dw8CwB1HP2QxhCG1 la0Q== 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=sWZhRMcMTWvBdNvWW+71sfemwMWjzTuLP03vVGDeHMo=; b=Xoe9ibXA58ymJpeegdmVLcFqnqkpsCLq1mv5YkV90dUqico8m+mvnpuKeBCaEbn0z7 OQGVlDcqH9tp9t8Va68ToSIfRFEmeRRQ2Ivs3yZJ/sSngUZYy3cWUh+LyhvS9pdtvVLh h+jMVqBDa4fFDmzBbPwfbuy4cbEU/fxvIvief+ZejBmWEM7jI8knW3XTrcJPuYnVVtzz 7DliqflwB3rSkTwtBSV/K6Jbq7Z83+Qmtz+Fn2x28d9j5dlAcw8c4czTKkU7AG1P5ZaJ a4T3mepPLde9MGl0DPw66Dc4IclGgP0GxmTnXw6PFvvNz/rJ7PlLiv5+JSHphpWJP0To F+aA== 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 x7si2676322pgv.796.2018.03.28.10.15.43; Wed, 28 Mar 2018 10:15:57 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753352AbeC1Q7Z (ORCPT + 99 others); Wed, 28 Mar 2018 12:59:25 -0400 Received: from mga02.intel.com ([134.134.136.20]:53437 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752175AbeC1Q7Y (ORCPT ); Wed, 28 Mar 2018 12:59:24 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Mar 2018 09:59:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,372,1517904000"; d="scan'208";a="38892007" Received: from pkiser-mobl4.amr.corp.intel.com (HELO [10.252.132.245]) ([10.252.132.245]) by orsmga003.jf.intel.com with ESMTP; 28 Mar 2018 09:59:23 -0700 Subject: Re: [PATCHv2 12/14] x86/mm: Implement page_keyid() using page_ext To: "Kirill A. Shutemov" , Ingo Molnar , x86@kernel.org, Thomas Gleixner , "H. Peter Anvin" , Tom Lendacky References: <20180328165540.648-1-kirill.shutemov@linux.intel.com> <20180328165540.648-13-kirill.shutemov@linux.intel.com> Cc: Kai Huang , linux-kernel@vger.kernel.org, linux-mm@kvack.org From: Dave Hansen Message-ID: Date: Wed, 28 Mar 2018 09:59:23 -0700 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: <20180328165540.648-13-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/28/2018 09:55 AM, Kirill A. Shutemov wrote: > +static inline int page_keyid(struct page *page) > +{ > + if (!mktme_nr_keyids) > + return 0; > + > + return lookup_page_ext(page)->keyid; > +} This doesn't look very optimized. Don't we normally try to use X86_FEATURE_* for these checks so that we get the runtime patching *and* compile-time optimizations?