From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4F564C4CEC9 for ; Wed, 18 Sep 2019 16:49:39 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2443F218AE for ; Wed, 18 Sep 2019 16:49:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="rZhYsi8R" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2443F218AE Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=L0O7gTl6Fhg57uYd9siIOFmkCDumlae4Fq8SCGlbmfQ=; b=rZhYsi8RqaeFdj KKbQkl8NkaqCckq/sA37sX1HVxwRnkUC/XyQ1KqUt0NEUyGCNmfym6X9CYAsr1WTJInxg+DURXJ5f X31OgxUhwTcbA/bF9hysQdrJLuv6cBUYScrCbRHxJQA3b5SAkdfla8ZusMrUFmjv2zXqT4roZi2iD WQgTQ1AraZ642BANnJ58vp6N5w5Hel5pil6gWZxdZdZzjFn/F/btouTc0GXVfOa2jP3tX9POlqugz jgaTYRc7FdDS1LRRebC8tXn0c9ZH4LMwyZhYhW4bGj6AOXbpVuC7L1kAb7sXwz15lbMC1usir5Klm himEpj30Eob/7xR8BboQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) id 1iAd93-00076K-Qc; Wed, 18 Sep 2019 16:49:33 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) id 1iAd91-00075y-FU for linux-arm-kernel@lists.infradead.org; Wed, 18 Sep 2019 16:49:32 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A0961337; Wed, 18 Sep 2019 09:49:30 -0700 (PDT) Received: from arrakis.emea.arm.com (arrakis.cambridge.arm.com [10.1.196.78]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id F0AAA3F59C; Wed, 18 Sep 2019 09:49:27 -0700 (PDT) Date: Wed, 18 Sep 2019 17:49:25 +0100 From: Catalin Marinas To: Matthew Wilcox Subject: Re: [PATCH v4 1/3] arm64: cpufeature: introduce helper cpu_has_hw_af() Message-ID: <20190918164925.GB41588@arrakis.emea.arm.com> References: <20190918131914.38081-1-justin.he@arm.com> <20190918131914.38081-2-justin.he@arm.com> <20190918142017.GC9880@bombadil.infradead.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190918142017.GC9880@bombadil.infradead.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190918_094931_563606_55217C59 X-CRM114-Status: GOOD ( 11.78 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Kaly Xin , Ralph Campbell , Jia He , Andrew Morton , Suzuki Poulose , Marc Zyngier , Anshuman Khandual , linux-kernel@vger.kernel.org, Jun Yao , linux-mm@kvack.org, =?iso-8859-1?B?Suly9G1l?= Glisse , James Morse , linux-arm-kernel@lists.infradead.org, Punit Agrawal , hejianet@gmail.com, Thomas Gleixner , Will Deacon , Alex Van Brunt , "Kirill A. Shutemov" , Robin Murphy Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Sep 18, 2019 at 07:20:17AM -0700, Matthew Wilcox wrote: > On Wed, Sep 18, 2019 at 09:19:12PM +0800, Jia He wrote: > > +/* Decouple AF from AFDBM. */ > > +bool cpu_has_hw_af(void) > > +{ > > + return (read_cpuid(ID_AA64MMFR1_EL1) & 0xf); > > +} > > + > > Do you really want to call read_cpuid() every time? I would have thought > you'd want to use the static branch mechanism to do the right thing at > boot time. See Documentation/static-keys.txt. We do have a static branch mechanism for other CPU features but mostly because on some big.LITTLE systems, the CPUs may differ slightly so we only advertise the common features. I guess here the additional instructions for reading and checking the CPUID here would be lost in the noise compared to the actual page copying. -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel