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 084DAC433EF for ; Tue, 26 Apr 2022 09:05:32 +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:To:From:Date:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=eBXheQ9zHdN6ZCar3N3vflHAN2uJvDJhCLU2f/atAwI=; b=P5HQH9gCDczXRY r7mAiAu+mcEm3lMc16B9ly0+qg1LWZwdlJGpQVbuYR3bSi/9wofPmxWApQl73jtLDPinz7GXlg+yO GqldLpaB7d1361xwAXr6kQSNiw7fNjXaNEaKCVft0T4Uy7zJZPI4eB/OTveFzBGZe1g/XLQcmn4Pc lec30nfLXKH7t+TrfGSIe8YS30T+RmBSneVhfsMy1sPiX/rl88/yGcb5cAcHUiaL8rb0Dhd+967/1 UejCZtb2RMAnDhf+LMxFeYk9YSIb9t37yJkeK4pfbOdx0HA/EahJZtxaoVD/QIhpuF8hUZATf5xIE B42iIPSnvuzQMmxS5spw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1njH7U-00DWH7-2H; Tue, 26 Apr 2022 09:04:28 +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 1njH7Q-00DWG1-L6 for linux-arm-kernel@lists.infradead.org; Tue, 26 Apr 2022 09:04:26 +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 1558F23A; Tue, 26 Apr 2022 02:04:23 -0700 (PDT) Received: from monolith.localdoman (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 179BA3F73B; Tue, 26 Apr 2022 02:04:21 -0700 (PDT) Date: Tue, 26 Apr 2022 10:04:23 +0100 From: Alexandru Elisei To: maz@kernel.org, james.morse@arm.com, suzuki.poulose@arm.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu Subject: Re: [PATCH 2/2] KVM/arm64: Print sysreg table name when table is not sorted Message-ID: References: <20220425163904.859195-1-alexandru.elisei@arm.com> <20220425163904.859195-4-alexandru.elisei@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220425163904.859195-4-alexandru.elisei@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220426_020424_821000_DF049DE1 X-CRM114-Status: GOOD ( 23.45 ) 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 Hi, Err.. this is a work-in-progress version of patch #2 ("KVM/arm64: Print emulated register table name when it is unsorted"). I sent it by mistake because I forgot to clean the patch directory before sending the series. I'll resend the series without this patch. Thanks, Alex On Mon, Apr 25, 2022 at 05:39:04PM +0100, Alexandru Elisei wrote: > When a sysreg table entry is out-of-order, KVM attempts to print the > address of the table: > > [ 0.143881] kvm [1]: sys_reg table (____ptrval____) out of order (0) > > Printing the name of the table instead of a pointer is more helpful in this > case: > > [ 0.143881] kvm [1]: sys_reg table sys_reg_descs out of order (0) > > Signed-off-by: Alexandru Elisei > --- > arch/arm64/kvm/sys_regs.c | 20 +++++++++++--------- > 1 file changed, 11 insertions(+), 9 deletions(-) > > diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c > index 57302048afd0..7b62a2daf056 100644 > --- a/arch/arm64/kvm/sys_regs.c > +++ b/arch/arm64/kvm/sys_regs.c > @@ -2188,18 +2188,18 @@ static const struct sys_reg_desc cp15_64_regs[] = { > }; > > static bool check_sysreg_table(const struct sys_reg_desc *table, unsigned int n, > - bool is_32) > + const char *table_name, bool is_32) > { > unsigned int i; > > for (i = 0; i < n; i++) { > if (!is_32 && table[i].reg && !table[i].reset) { > - kvm_err("sys_reg table %p entry %d lacks reset\n", table, i); > + kvm_err("sys_reg table %s entry %d lacks reset\n", table_name, i); > return false; > } > > if (i && cmp_sys_reg(&table[i-1], &table[i]) >= 0) { > - kvm_err("sys_reg table %p out of order (%d)\n", table, i - 1); > + kvm_err("sys_reg table %s out of order (%d)\n", table_name, i - 1); > return false; > } > } > @@ -2866,12 +2866,14 @@ int kvm_sys_reg_table_init(void) > struct sys_reg_desc clidr; > > /* Make sure tables are unique and in order. */ > - valid &= check_sysreg_table(sys_reg_descs, ARRAY_SIZE(sys_reg_descs), false); > - valid &= check_sysreg_table(cp14_regs, ARRAY_SIZE(cp14_regs), true); > - valid &= check_sysreg_table(cp14_64_regs, ARRAY_SIZE(cp14_64_regs), true); > - valid &= check_sysreg_table(cp15_regs, ARRAY_SIZE(cp15_regs), true); > - valid &= check_sysreg_table(cp15_64_regs, ARRAY_SIZE(cp15_64_regs), true); > - valid &= check_sysreg_table(invariant_sys_regs, ARRAY_SIZE(invariant_sys_regs), false); > + valid &= check_sysreg_table(sys_reg_descs, ARRAY_SIZE(sys_reg_descs), > + "sys_reg_descs", false); > + valid &= check_sysreg_table(cp14_regs, ARRAY_SIZE(cp14_regs), "cp14_regs", true); > + valid &= check_sysreg_table(cp14_64_regs, ARRAY_SIZE(cp14_64_regs), "cp14_64_regs", true); > + valid &= check_sysreg_table(cp15_regs, ARRAY_SIZE(cp15_regs), "cp15_regs", true); > + valid &= check_sysreg_table(cp15_64_regs, ARRAY_SIZE(cp15_64_regs), "cp15_64_regs", true); > + valid &= check_sysreg_table(invariant_sys_regs, ARRAY_SIZE(invariant_sys_regs), > + "invariant_sys_regs", false); > > if (!valid) > return -EINVAL; > -- > 2.36.0 > > _______________________________________________ > kvmarm mailing list > kvmarm@lists.cs.columbia.edu > https://lists.cs.columbia.edu/mailman/listinfo/kvmarm _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel