From patchwork Mon Jan 22 18:13:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 13526022 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 4549EC47DAF for ; Mon, 22 Jan 2024 18:14:38 +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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=iQnCRiUJ5NPLgLdBcgNAfY7y7YeMeT+D5UnEDuWCELk=; b=s72vLHs0MgE1Wu 5fXm6+zPH0tUbXjl6OY1UDSawyuJNap3RyYQThMAIg74LftA7I4flqzHzpLE8lVTo8bt9AP6zYe1a h1512MdUYQaINtuESugfGEXo3lc9jvG68ZCjTE6X5hEGf4mEjtn/P90It8soiJz4EvN823TKWYUB2 w/Ijjb2bu21SffW65+gbONiwxFhiRWxOVFFNn4LSJJv2dcOJ5yaCaM4r4tTN1tOJvOTenOKuU6SPY MUV93mewLJEKKzolT1c7hn1OluLYlwXKpRyDHy9fOK4OHZKDlv6NZf6kRqdhjamudiqrvmwuDDUlt RspasNwfbWDd7aGICTNg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rRyoH-00DSp7-0P; Mon, 22 Jan 2024 18:14:13 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rRyo8-00DSin-1X for linux-arm-kernel@lists.infradead.org; Mon, 22 Jan 2024 18:14:06 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id BEA69B81031; Mon, 22 Jan 2024 18:14:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F3A2DC43330; Mon, 22 Jan 2024 18:14:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705947241; bh=pMisoUEojG3/Bf7hDdiKAYm2Bh03DW07aFvgW2pzxkA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aUORH81LAAj6jX5vMEVBFeJnxYMouWtOeoXv1Tf5yQ0LtJlmOThljKAPKlydkL9G7 eUtPgFRS7Pr8r03HidEmPnICrWcdJPjfkGR6bQg0q7FJ9fLRLP0w0QKM10KwZdSS1t rLwLifWcu8vWCRiX0t+tBztKMUGdkpzgChn5XCD0WSEqlrDWb2JZ+Qwd9r6UnIx0p7 Pa2SQiub0ShEQMxgifOx+aWy4DCUxsl2E0PNLQ/qBfwI+MLZbQ4YYBcdPGMG7FT3zZ /5LSOLH5nVXOVGLpGezI3Sntm5JTEyUlsibtKq9FJCul5+ajyf40oozqVH5hHVG/Bg EuPUwKXUpRT7A== Received: from sofa.misterjones.org ([185.219.108.64] helo=valley-girl.lan) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1rRyo3-00Dh6E-0Y; Mon, 22 Jan 2024 18:13:59 +0000 From: Marc Zyngier To: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev Cc: Catalin Marinas , Will Deacon , Mark Rutland , Suzuki K Poulose , Ard Biesheuvel , James Morse , Oliver Upton , Zenghui Yu Subject: [PATCH v4 03/10] arm64: cpufeature: Correctly display signed override values Date: Mon, 22 Jan 2024 18:13:37 +0000 Message-Id: <20240122181344.258974-4-maz@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240122181344.258974-1-maz@kernel.org> References: <20240122181344.258974-1-maz@kernel.org> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, suzuki.poulose@arm.com, ardb@kernel.org, james.morse@arm.com, oliver.upton@linux.dev, yuzenghui@huawei.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240122_101404_667639_0A9ED0C2 X-CRM114-Status: GOOD ( 12.29 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org When a field gets overriden, the kernel indicates the result of the override in dmesg. This works well with unsigned fields, but results in a pretty ugly output when the field is signed. Truncate the field to its width before displaying it. Reviewed-by: Oliver Upton Reviewed-by: Suzuki K Poulose Signed-off-by: Marc Zyngier Reviewed-by: Catalin Marinas --- arch/arm64/kernel/cpufeature.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c index 92b1546f2622..bae5d0655262 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -949,7 +949,8 @@ static void init_cpu_ftr_reg(u32 sys_reg, u64 new) pr_warn("%s[%d:%d]: %s to %llx\n", reg->name, ftrp->shift + ftrp->width - 1, - ftrp->shift, str, tmp); + ftrp->shift, str, + tmp & (BIT(ftrp->width) - 1)); } else if ((ftr_mask & reg->override->val) == ftr_mask) { reg->override->val &= ~ftr_mask; pr_warn("%s[%d:%d]: impossible override, ignored\n",