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,URIBL_BLOCKED,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 4FF6EC4CEC4 for ; Wed, 18 Sep 2019 14:20:23 +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 2200C2067B for ; Wed, 18 Sep 2019 14:20:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="HwxxRHHi" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2200C2067B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org 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=F25XcCPzhvNajM3UQMRVOXgVvbjGAVLgtRsXu1zGhqc=; b=HwxxRHHiSjuTfJ sKlAQleu68ewGQNJtuyUiX4n7eSCFbRTDxrYlg2LHDdd+eBecRiDE0A6lxunKkDIz+ZW7EQ34H39h vb7bUnRIf/4tgGs6TUMesS1pwkB9e2ThZf+CqvzeM7Efm6vVboNwj5X3FvISNKj/waP7TioOZgfji pViVFY7NqekgwQzBfnGZZe6NxJh8Pod5yls1Eus+VXLZePjdZFdVTD9XhmPooitQ21UBIexkDIWoj 3l2DjuHB0fSdPd00Gm6pSZz65Zfr9Rb5cvgttRJedRMVWP+hz1MlMs0UYXTzUzI9CCUuDXpZp7sE5 vOusJsLsVIaDNIUc3rdg==; 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 1iAaog-0006iu-It; Wed, 18 Sep 2019 14:20:22 +0000 Received: from willy by bombadil.infradead.org with local (Exim 4.92.2 #3 (Red Hat Linux)) id 1iAaob-0006gt-J4; Wed, 18 Sep 2019 14:20:17 +0000 Date: Wed, 18 Sep 2019 07:20:17 -0700 From: Matthew Wilcox To: Jia He Subject: Re: [PATCH v4 1/3] arm64: cpufeature: introduce helper cpu_has_hw_af() Message-ID: <20190918142017.GC9880@bombadil.infradead.org> References: <20190918131914.38081-1-justin.he@arm.com> <20190918131914.38081-2-justin.he@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190918131914.38081-2-justin.he@arm.com> User-Agent: Mutt/1.12.1 (2019-06-15) 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 , Andrew Morton , Suzuki Poulose , Catalin Marinas , 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 , Marc Zyngier , 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 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. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel