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 lists.gnu.org (lists.gnu.org [209.51.188.17]) (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 F1C34E81BB2 for ; Mon, 9 Feb 2026 12:51:54 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vpQjj-0001Nh-W3; Mon, 09 Feb 2026 07:51:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vpQji-0001Mj-Hk for qemu-arm@nongnu.org; Mon, 09 Feb 2026 07:51:30 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vpQjf-0005vO-RD for qemu-arm@nongnu.org; Mon, 09 Feb 2026 07:51:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1770641486; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=iGaf82DiZaNTwA9yXzBBSS72wBvCC2p5rMVVRUNUAjc=; b=JMwmuQh5ScDkezEUE9i97Ja6K9Se1+dyOw3hOdN5Cd9PHf9bTK+buqiVeJKvtSmLeZMTMq 55sKGdmeAUyVwptRRDBFyk3209uk3I6SMjXVehPLsYo19STeRwELolWpP4N2m73vqIf2Bi qU8wGjKlp/icA8+dkRrCHlmD9bFZJz8= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-683-b5WHihTlO4Kec2PlTFr3fQ-1; Mon, 09 Feb 2026 07:51:24 -0500 X-MC-Unique: b5WHihTlO4Kec2PlTFr3fQ-1 X-Mimecast-MFC-AGG-ID: b5WHihTlO4Kec2PlTFr3fQ_1770641483 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 319111956089; Mon, 9 Feb 2026 12:51:23 +0000 (UTC) Received: from localhost (dhcp-192-192.str.redhat.com [10.33.192.192]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6FCE11955F2D; Mon, 9 Feb 2026 12:51:21 +0000 (UTC) From: Cornelia Huck To: Peter Maydell , Eric Auger Cc: eric.auger.pro@gmail.com, qemu-devel@nongnu.org, qemu-arm@nongnu.org, maz@kernel.org, oliver.upton@linux.dev, sebott@redhat.com, gshan@redhat.com, ddutile@redhat.com, peterx@redhat.com, philmd@linaro.org, pbonzini@redhat.com Subject: Re: [PATCH v6 02/11] target/arm/machine: Improve traces on register mismatch during migration In-Reply-To: Organization: "Red Hat GmbH, Sitz: Werner-von-Siemens-Ring 12, D-85630 Grasbrunn, Handelsregister: Amtsgericht =?utf-8?Q?M=C3=BCnchen=2C?= HRB 153243, =?utf-8?Q?Gesch=C3=A4ftsf=C3=BChrer=3A?= Ryan Barnhart, Charles Cachera, Avril Crosse O'Flaherty" References: <20260126165445.3033335-1-eric.auger@redhat.com> <20260126165445.3033335-3-eric.auger@redhat.com> User-Agent: Notmuch/0.39 (https://notmuchmail.org) Date: Mon, 09 Feb 2026 13:51:19 +0100 Message-ID: <87ldh2rsfs.fsf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-MFC-PROC-ID: _AB4MR3pP6r9MXi-epCnshHBcFgW8BUdJQ8KvKwFftk_1770641483 X-Mimecast-Originator: redhat.com Content-Type: text/plain Received-SPF: pass client-ip=170.10.129.124; envelope-from=cohuck@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-arm@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-arm-bounces+qemu-arm=archiver.kernel.org@nongnu.org Sender: qemu-arm-bounces+qemu-arm=archiver.kernel.org@nongnu.org On Fri, Feb 06 2026, Peter Maydell wrote: > On Mon, 26 Jan 2026 at 16:55, Eric Auger wrote: >> >> Currently when the number of KVM registers exposed by the source is >> larger than the one exposed on the destination, the migration fails >> with: "failed to load cpu:cpreg_vmstate_array_len" >> >> This gives no information about which registers are causing the trouble. >> >> This patch reworks the target/arm/machine code so that it becomes >> able to handle an input stream with a larger set of registers than >> the destination and print useful information about which registers >> are causing the trouble. The migration outcome is unchanged: >> - unexpected registers still will fail the migration >> - missing ones are printed but will not fail the migration, as done today. > > Improving the diagnostics here is a great idea. > >> The input stream can contain MAX_CPREG_VMSTATE_ANOMALIES(10) extra >> registers compared to what exists on the target. >> >> If there are more registers we will still hit the previous >> "load cpu:cpreg_vmstate_array_len" error. >> >> At most, MAX_CPREG_VMSTATE_ANOMALIES missing registers >> and MAX_CPREG_VMSTATE_ANOMALIES unexpected registers are printed. >> >> Example: >> >> qemu-system-aarch64: kvm_arm_cpu_post_load Missing register in input stream: 0 0x6030000000160003 fw feat reg 3 >> qemu-system-aarch64: kvm_arm_cpu_post_load Unexpected register in input stream: 0 0x603000000013c103 op0:3 op1:0 crn:2 crm:0 op2:3 >> qemu-system-aarch64: kvm_arm_cpu_post_load Unexpected register in input stream: 1 0x603000000013c512 op0:3 op1:0 crn:10 crm:2 op2:2 >> qemu-system-aarch64: kvm_arm_cpu_post_load Unexpected register in input stream: 2 0x603000000013c513 op0:3 op1:0 crn:10 crm:2 op2:3 >> qemu-system-aarch64: error while loading state for instance 0x0 of device 'cpu' >> qemu-system-aarch64: load of migration failed: Operation not permitted >> >> With TCG there is no user friendly formatting of the faulting >> register indexes as with KVM. However the 2 added trace points >> help to identify the culprit indexes. > > Could we move kvm_print_register_name() out of kvm.c and into > somewhere that the TCG code can use it? (I did think when I > was reviewing the patch that added that that we might want it > for TCG too eventually.) I'm wondering which parts could/should be generalized -- the sysreg encodings match with the CP_REG_ encodings, but I don't think much else? Might be worth trying to split those regs off?