From patchwork Mon Nov 20 12:37:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Zyngier X-Patchwork-Id: 13461190 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 88066C5AD4C for ; Mon, 20 Nov 2023 12:40:09 +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=RYI+l+PzMmLDVT60HGaCl49gGgX6R8JKUGDrbaeAhNQ=; b=RZ28Vby+788h8i nVWthqjfJ0pdYI4PTCBeuibNjrB/uZc4nNp6EEfh0VeOOl26+qk7CSPf2N9KC9rlIQYANSvMLBiEm YOBZYP+3MGssMOI0jdffiMpKnQ5QW4JzzubzTKkfogjLHogjE0tCdHG6EfosM6IpZCiWvEuig6dr3 HedaWFU7HXyyTstaPoeoZgMfmf4/sf1OxggKyi1l2qL4XLOUx9XvUBJhLgVgKSEqKC9NunEn5+Rg3 LAO7HRQ6qNHDaYmsm0bU5lIwvuwgO9QlGWjeC4ecShDvwNvmTYvDFqwt8wxurvzQmBrmuM/cGXaaK fiqWUOA+VWijGHiWjauQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r53Z0-00C1Nw-0e; Mon, 20 Nov 2023 12:39:42 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r53XB-00C0xx-14 for linux-arm-kernel@lists.infradead.org; Mon, 20 Nov 2023 12:37:55 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id D1743B816A4; Mon, 20 Nov 2023 12:37:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 76E25C433A9; Mon, 20 Nov 2023 12:37:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700483866; bh=vtc/5i6kKGwwu5BufGLykkpy1F0YD84NHR2T4NoIoUU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dRNxqfbh1jzkFJf77g7zg7wNraBJPkF5RGRNx3zpH8aUKLRNoDC8rWq8qHAatPA2R vgO0aouZ8392ckzEzJuUb1usSOWfOQ8YjS+u/WQoOVWaExddZ2sIVwqi+yf7kL06Do PmgntSz+icctQMp5+LukVrZyrSYFIW/J7HJxCryYHbbBJqBUZ0bil3vdokk/472KXE 6QfdzPRCodMoQmfBODS+n+qyF2039WRSt9NMa48GcLMRROJ9vPHSJlUtQwVT2qo4sz OCWf7WRlRfdhv/yzFk8ELTyQui6mwSVF2DmLNGIOlK1vIaolHwpySkUc9pcqp+fm4I IkCh0VMQR79rQ== 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 1r53X6-00EjJv-CI; Mon, 20 Nov 2023 12:37:44 +0000 From: Marc Zyngier To: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev Cc: Catalin Marinas , Will Deacon , Mark Rutland , Ard Biesheuvel , James Morse , Suzuki K Poulose , Oliver Upton , Zenghui Yu Subject: [PATCH v2 03/13] arm64: cpufeature: Correctly display signed override values Date: Mon, 20 Nov 2023 12:37:11 +0000 Message-Id: <20231120123721.851738-4-maz@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231120123721.851738-1-maz@kernel.org> References: <20231120123721.851738-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, ardb@kernel.org, james.morse@arm.com, suzuki.poulose@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-20231120_043749_816132_5C3D63EE X-CRM114-Status: GOOD ( 12.14 ) 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 Signed-off-by: Marc Zyngier Reviewed-by: Suzuki K Poulose --- 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 e52d2c2b757f..767a6f288755 100644 --- a/arch/arm64/kernel/cpufeature.c +++ b/arch/arm64/kernel/cpufeature.c @@ -950,7 +950,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",