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=-5.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 5F4D1C4CEC9 for ; Wed, 18 Sep 2019 16:46:04 +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 2BE6920882 for ; Wed, 18 Sep 2019 16:46:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="FRqT2l/F" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2BE6920882 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=XMgkCdS+4RZ9BnzTwq3MynY9hzmHXqRP+N2MzRpuerM=; b=FRqT2l/FRaDM/R MTZe3FVkR2p8D1Fvu7LMNswOZYla5MCSCMdu2ztLdL88s0+c6vVg1HwFutWIorb8cRVuGFQlezS4T 630HNjrfEtsgQ8C1DPk1Ua9K17e5twJYMv2asgI1KLQRGAdcxvi2LR8DESF5hulTycL5DtlYzbBjS boLhb0XNT5U9NDcjMUu5KyBMwsjYmtm0pE2EQw+eOOQWlq5BWG008jE6ctpvyaWxFwwiGccByU9bv nkq9NvA37ltzqboCYbyjKJiYh7hUkrpM5BuSI/CSlxhw+lEPsVKh7x8iBKXDDbKLf+pqGg0xvQzQ9 4ouo6ne7PS9YKODVF3Kw==; 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 1iAd5Z-0006iG-EH; Wed, 18 Sep 2019 16:45:57 +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 1iAd5W-0006hW-Hj for linux-arm-kernel@lists.infradead.org; Wed, 18 Sep 2019 16:45:55 +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 B8647337; Wed, 18 Sep 2019 09:45:51 -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 1356A3F59C; Wed, 18 Sep 2019 09:45:48 -0700 (PDT) Date: Wed, 18 Sep 2019 17:45:47 +0100 From: Catalin Marinas To: Suzuki K Poulose Subject: Re: [PATCH v4 1/3] arm64: cpufeature: introduce helper cpu_has_hw_af() Message-ID: <20190918164546.GA41588@arrakis.emea.arm.com> References: <20190918131914.38081-1-justin.he@arm.com> <20190918131914.38081-2-justin.he@arm.com> <78881acb-5871-9534-c8cc-6f54937be3fd@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <78881acb-5871-9534-c8cc-6f54937be3fd@arm.com> 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_094554_633502_446269B3 X-CRM114-Status: GOOD ( 12.64 ) 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 , Anshuman Khandual , Marc Zyngier , linux-kernel@vger.kernel.org, Matthew Wilcox , 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 03:20:41PM +0100, Suzuki K Poulose wrote: > On 18/09/2019 14:19, Jia He wrote: > > diff --git a/arch/arm64/include/asm/cpufeature.h b/arch/arm64/include/asm/cpufeature.h > > index c96ffa4722d3..206b6e3954cf 100644 > > --- a/arch/arm64/include/asm/cpufeature.h > > +++ b/arch/arm64/include/asm/cpufeature.h > > @@ -390,6 +390,7 @@ extern DECLARE_BITMAP(boot_capabilities, ARM64_NPATCHABLE); > > for_each_set_bit(cap, cpu_hwcaps, ARM64_NCAPS) > > bool this_cpu_has_cap(unsigned int cap); > > +bool cpu_has_hw_af(void); > > void cpu_set_feature(unsigned int num); > > bool cpu_have_feature(unsigned int num); > > unsigned long cpu_get_elf_hwcap(void); > > diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c > > index b1fdc486aed8..c5097f58649d 100644 > > --- a/arch/arm64/kernel/cpufeature.c > > +++ b/arch/arm64/kernel/cpufeature.c > > @@ -1141,6 +1141,12 @@ static bool has_hw_dbm(const struct arm64_cpu_capabilities *cap, > > return true; > > } > > +/* Decouple AF from AFDBM. */ > > +bool cpu_has_hw_af(void) > > +{ > Sorry for not having asked this earlier. Are we interested in, > > "whether *this* CPU has AF support ?" or "whether *at least one* > CPU has the AF support" ? The following code does the former. > > > + return (read_cpuid(ID_AA64MMFR1_EL1) & 0xf); In a non-preemptible context, the former is ok (per-CPU). -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel