Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1266392ybb; Wed, 1 Apr 2020 19:53:02 -0700 (PDT) X-Google-Smtp-Source: APiQypLz49Vw/+n0g9jPdIn9c9zRDbTMP9c7bGfpNqVvBpFx8VkF03jKnVNxDxNkgiAo8hLOHVQs X-Received: by 2002:a05:6808:43:: with SMTP id v3mr779196oic.59.1585795981994; Wed, 01 Apr 2020 19:53:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585795981; cv=none; d=google.com; s=arc-20160816; b=RoH455loguS9EBLEiZCZitpU+iZkMFMCEWIutOo30kBvI9hxhBQd8xDAkPBbeX46S+ E8J6lfSbjUyzmnBVx9prcmTbEh/IlrJsK+v8Gw1xQZnJQj5k7qpNmv1mCeyWQmaYCcaK fUUFdVmFfpBuUtJ8mYQYXRnVKoKmkqqPmFXQrwk9upkLPjFbB2QKzhScaOMXmr7UIIKs SReHL/7rRIktC0SZ+kSRqb/a+KPzzaPNVdGTsDb8E7VA+RXLtr+7en2ljI+s+Vj5v9TC KD5qpFDrhX/57MytkcGulWOzZk8KQMBgdqCWRl7da8D3rvgUH7tTbJGrYXMbAHeeun29 2Xgg== 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:references:cc:to:subject; bh=VOXvz/Zd1bZPTLiTCly2T3TgCLtzKObqsCV72FOypGQ=; b=Whf9LaLC6s2QcGC1LWmDtM3bkyyX69UwDYoi/AKIxUV9mMFyIvQG6pVA0yfhRQ2SNK uUqXQopFWBkFtxuj5Uy2NmU0zYLyFpLfAIvJ0+z2QDzhbbKTdvblE5AgILGGzCvPW2tz PyYmdF16vw1FXCgQzipm3WlCWuDv/fxh1peStXZSUl92pj8x35ERTCjengHFzuMbmXnB 8KVXy7PaJbczgZwHOrauaL+1dXHSbCOyJ6+jJzP24WwZ0DSePZBYqq+BoW7IzXBnAsqm iEPn7TKwnSB+5KEaoFZji1KFcqX8ptotUquIolS6Ec5kd0N6Lo9e0AwMVqGa2fRq7FUO UtoA== 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 h22si1728011otq.243.2020.04.01.19.52.49; Wed, 01 Apr 2020 19:53:01 -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 S1733251AbgDBCon (ORCPT + 99 others); Wed, 1 Apr 2020 22:44:43 -0400 Received: from foss.arm.com ([217.140.110.172]:36418 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727135AbgDBCom (ORCPT ); Wed, 1 Apr 2020 22:44:42 -0400 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 268E330E; Wed, 1 Apr 2020 19:44:42 -0700 (PDT) Received: from [10.163.1.8] (unknown [10.163.1.8]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CE6F93F71E; Wed, 1 Apr 2020 19:44:39 -0700 (PDT) Subject: Re: [PATCH 6/6] arm64/cpufeature: Replace all open bits shift encodings with macros To: Suzuki K Poulose , linux-arm-kernel@lists.infradead.org Cc: catalin.marinas@arm.com, will@kernel.org, maz@kernel.org, mark.rutland@arm.com, james.morse@arm.com, linux-kernel@vger.kernel.org References: <1580215149-21492-1-git-send-email-anshuman.khandual@arm.com> <1580215149-21492-7-git-send-email-anshuman.khandual@arm.com> From: Anshuman Khandual Message-ID: <5d331165-6d3f-55d3-8994-d736d5fdb3ef@arm.com> Date: Thu, 2 Apr 2020 08:14:32 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/21/2020 12:10 AM, Suzuki K Poulose wrote: > On 01/28/2020 12:39 PM, Anshuman Khandual wrote: >> There are many open bits shift encodings for various CPU ID registers that >> are scattered across cpufeature. This replaces them with register specific >> sensible macro definitions. This should not have any functional change. >> >> Cc: Catalin Marinas >> Cc: Will Deacon >> Cc: Marc Zyngier >> Cc: Mark Rutland >> Cc: James Morse >> Cc: Suzuki K Poulose >> Cc: linux-kernel@vger.kernel.org >> Signed-off-by: Anshuman Khandual >> --- > > >> --- a/arch/arm64/kernel/cpufeature.c >> +++ b/arch/arm64/kernel/cpufeature.c >> @@ -263,7 +263,7 @@ static const struct arm64_ftr_bits ftr_ctr[] = { >>        * make use of *minLine. >>        * If we have differing I-cache policies, report it as the weakest - VIPT. >>        */ >> -    ARM64_FTR_BITS(FTR_VISIBLE, FTR_NONSTRICT, FTR_EXACT, 14, 2, ICACHE_POLICY_VIPT),    /* L1Ip */ >> +    ARM64_FTR_BITS(FTR_VISIBLE, FTR_NONSTRICT, FTR_EXACT, CTR_L1IP_SHIFT, 2, ICACHE_POLICY_VIPT),    /* L1Ip */ >>       ARM64_FTR_BITS(FTR_VISIBLE, FTR_STRICT, FTR_LOWER_SAFE, CTR_IMINLINE_SHIFT, 4, 0), >>       ARM64_FTR_END, >>   }; >> @@ -274,19 +274,19 @@ struct arm64_ftr_reg arm64_ftr_reg_ctrel0 = { >>   }; >>     static const struct arm64_ftr_bits ftr_it will not be a good idea to id_mmfr0[] = { >> -    S_ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, 28, 4, 0xf),    /* InnerShr */ >> -    ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, 24, 4, 0),    /* FCSE */ >> -    ARM64_FTR_BITS(FTR_HIDDEN, FTR_NONSTRICT, FTR_LOWER_SAFE, 20, 4, 0),    /* AuxReg */ >> -    ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, 16, 4, 0),    /* TCM */ >> -    ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, 12, 4, 0),    /* ShareLvl */ >> -    S_ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, 8, 4, 0xf),    /* OuterShr */ >> -    ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, 4, 4, 0),    /* PMSA */ >> -    ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, 0, 4, 0),    /* VMSA */ >> +    S_ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, ID_MMFR0_INNERSHR_SHIFT, 4, 0xf), >> +    ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, ID_MMFR0_FCSE_SHIFT, 4, 0), >> +    ARM64_FTR_BITS(FTR_HIDDEN, FTR_NONSTRICT, FTR_LOWER_SAFE, ID_MMFR0_AUXREG_SHIFT, 4, 0), >> +    ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, ID_MMFR0_TCM_SHIFT, 4, 0), >> +    ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, ID_MMFR0_SHARELVL_SHIFT, 4, 0), >> +    S_ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, ID_MMFR0_OUTERSHR_SHIFT, 4, 0xf), >> +    ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, ID_MMFR0_PMSA_SHIFT, 4, 0), >> +    ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_LOWER_SAFE, ID_MMFR0_VMSA_SHIFT, 4, 0), >>       ARM64_FTR_END, >>   }; >>     static const struct arm64_ftr_bits ftr_id_aa64dfr0[] = { >> -    ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_EXACT, 36, 28, 0), >> +    ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_EXACT, ID_AA64DFR0_DOUBLELOCK_SHIFT, 28, 0), > > This must be a signed feature, as we have the following possible values : > >     0b0000 - Double lock implemented >     0b1111 - Double lock not implemented. > > So, in case of a conflict we want the safe value as 0b1111. > > Please could you fix this as well ? Sure but in a separate patch, as would like to prevent mixing any actual code change from macro replacement. > > > This patch as such looks fine to me. > > Reviewed-by: Suzuki K Poulose >