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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 7E215C4332F for ; Fri, 9 Dec 2022 12:26:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc: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=xAu6laeCF1kTLi5yePCWkPJgE9QVSPNGotGZO45QMg0=; b=ZuTP+3xeZPqE7p lnvUbIzcdNXSSae5BawgRTMuseHPV5tGtaQLaVanXFTEnRsJ2wNsQaZrDDCAmaknosQXCnjiUQu7B Ocx6lWiOzx3I7qE4oCKrFqOmJcFpCZwKMBbJvc0m3jCgmUvLf3TaQck4b8sR0iKbUS8ZysRczq8eN aJFXwvlgqSpIPcloCLHf0Wcg/H0No5yf0NUYejln1HuhohPB+VEJVwPfJt2nCOZp44hr2LrbgsTj9 XGExcbueqwVOInj0M2o6vON8ZQ93Mno9k9W9fzgAnBjBeOYlvzGusu2IvTfkdkpm4N7JrSTEjoSjl F3pUc3351vcZ8K7AdwFg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3cRe-007Wd8-KP; Fri, 09 Dec 2022 12:25:38 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3cRb-007Wbq-GZ for linux-arm-kernel@lists.infradead.org; Fri, 09 Dec 2022 12:25:37 +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 735D023A; Fri, 9 Dec 2022 04:25:37 -0800 (PST) Received: from FVFF77S0Q05N (unknown [10.57.39.232]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8FA1F3F73B; Fri, 9 Dec 2022 04:25:29 -0800 (PST) Date: Fri, 9 Dec 2022 12:25:26 +0000 From: Mark Rutland To: Mark Brown Cc: Catalin Marinas , Will Deacon , Suzuki K Poulose , James Morse , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 1/6] arm64/cpufeature: Fix field sign for DIT hwcap detection Message-ID: References: <20221207-arm64-sysreg-helpers-v1-0-149fa1308a23@kernel.org> <20221207-arm64-sysreg-helpers-v1-1-149fa1308a23@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20221207-arm64-sysreg-helpers-v1-1-149fa1308a23@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221209_042535_618908_B3A4DD3E X-CRM114-Status: GOOD ( 20.05 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Dec 08, 2022 at 04:03:22PM +0000, Mark Brown wrote: > Since it was added our hwcap for DIT has specified that DIT is a signed > field but this appears to be incorrect, the two values for the enumeration > are: > > 0b0000 NI > 0b0001 IMP > > which look like a normal signed enumeration and the in-kernel DIT usage > added by 01ab991fc0ee ("arm64: Enable data independent timing (DIT) in the > kernel") detects the feature with a signed enum. Fix the hwcap to specify > the field as signed. s/signed/unsigned/ for the three instances after the values. > Fixes: 7206dc93a58f ("arm64: Expose Arm v8.4 features") > Signed-off-by: Mark Brown Yup, that should definitely be UNSIGNED. Luckily this wouldn't blow up unless we had 7+ revisions to the DIT feature, but it should still be fixed. The other fields added in that original commit all look correct to me. With the s/signed/unsigned/ foxup above: Reviewed-by: Mark Rutland Mark. > --- > arch/arm64/kernel/cpufeature.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c > index 7e76e1fda2a1..c687b0052a3f 100644 > --- a/arch/arm64/kernel/cpufeature.c > +++ b/arch/arm64/kernel/cpufeature.c > @@ -2775,7 +2775,7 @@ static const struct arm64_cpu_capabilities arm64_elf_hwcaps[] = { > HWCAP_CAP(SYS_ID_AA64PFR0_EL1, ID_AA64PFR0_EL1_FP_SHIFT, 4, FTR_SIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_FPHP), > HWCAP_CAP(SYS_ID_AA64PFR0_EL1, ID_AA64PFR0_EL1_AdvSIMD_SHIFT, 4, FTR_SIGNED, 0, CAP_HWCAP, KERNEL_HWCAP_ASIMD), > HWCAP_CAP(SYS_ID_AA64PFR0_EL1, ID_AA64PFR0_EL1_AdvSIMD_SHIFT, 4, FTR_SIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_ASIMDHP), > - HWCAP_CAP(SYS_ID_AA64PFR0_EL1, ID_AA64PFR0_EL1_DIT_SHIFT, 4, FTR_SIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_DIT), > + HWCAP_CAP(SYS_ID_AA64PFR0_EL1, ID_AA64PFR0_EL1_DIT_SHIFT, 4, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_DIT), > HWCAP_CAP(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_EL1_DPB_SHIFT, 4, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_DCPOP), > HWCAP_CAP(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_EL1_DPB_SHIFT, 4, FTR_UNSIGNED, 2, CAP_HWCAP, KERNEL_HWCAP_DCPODP), > HWCAP_CAP(SYS_ID_AA64ISAR1_EL1, ID_AA64ISAR1_EL1_JSCVT_SHIFT, 4, FTR_UNSIGNED, 1, CAP_HWCAP, KERNEL_HWCAP_JSCVT), > > -- > 2.30.2 > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel