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 DECB5C4167B for ; Mon, 13 Nov 2023 17:44:23 +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=431mT9h6f4X9Q/DifrSFmsUE1Vg+4Ke6flNaT52u3/4=; b=RVIM566Qkkwjf5 3UaA2JwdqSA+shEeCKC0RoN03N42d15CFUDKiEZhtajDJMUbjwcwAgDlPuCJMY7wXX4BDu8BNPiOQ +FbDveuaYRA2jqg6Mn2W6UC6L+4hu0B37f/3TOljB2jvBwa36kvgXSfw2rHDTMl8dvvVhIJsX/M85 WjQxxKan0YfsKeGT2Mkpbc85tyVt8UfWtWk64lIrCVhlY6CKJplbu40ISNniwjMNz31RJFLXxmqIM +QB5FPIANQYciMCtpBlKzazJiXmbCJ9uAM555yl3jZ5fB+i/pg1ZVfTClpIufl929NOuDkS9rdvPd 7yFaf5KKTLOTV3b/EAuA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r2ayT-00EQ3O-0I; Mon, 13 Nov 2023 17:43:49 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r2ayP-00EPyv-2O for linux-arm-kernel@lists.infradead.org; Mon, 13 Nov 2023 17:43:47 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 3CE5F60FD3; Mon, 13 Nov 2023 17:43:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A01D2C43391; Mon, 13 Nov 2023 17:43:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1699897424; bh=JPDliCysNAGaXceqZR+n1mYKUpMZcy9h1sqDdiU78iU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lAAAzI0+e8OMB4uVsbmcNBA09z82k8sDTTbqvT0mKIyOewMLzK6sXfUE2W6rywQGt DtanklzVP6evaAouzKlAna36jJ3wo6joNW5vIJzK16hjMTFJbDja9RrTLdOxAsm7qS 1ueB+/tLgYXGJtyzKZZvTEqt7yJyIBZedy1Sm3YAlUgmPM9biOy6tKjKbCJ03P65Z2 E1UyRMCMfC9pGQ2H4uz8mruv3OuraXwnI8KFaZndOEpe3hAy8cwyte2G9cYdVc93rE Ho2l1EvAU9nkormzdBCnSWXn6598C/fi+7YcSwujelyW+OIYRYqTdaoHnUDTCojrRI yd8C1H2th9IVg== 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 1r2ayM-00CkQ4-8O; Mon, 13 Nov 2023 17:43:42 +0000 From: Marc Zyngier To: linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev Cc: Catalin Marinas , Will Deacon , Mark Rutland , James Morse , Suzuki K Poulose , Oliver Upton , Zenghui Yu Subject: [PATCH 02/12] arm64: cpufeature: Correctly display signed override values Date: Mon, 13 Nov 2023 17:42:34 +0000 Message-Id: <20231113174244.3026520-3-maz@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231113174244.3026520-1-maz@kernel.org> References: <20231113174244.3026520-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, 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-20231113_094345_821175_FCAB6EE1 X-CRM114-Status: GOOD ( 12.11 ) 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 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. Signed-off-by: Marc Zyngier --- 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", -- 2.39.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel