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 1200CC433EF for ; Wed, 6 Apr 2022 06:45:17 +0000 (UTC) Received: from localhost ([::1]:38900 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nbzPo-0002QQ-OT for qemu-devel@archiver.kernel.org; Wed, 06 Apr 2022 02:45:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56844) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nbzJj-0000bn-4a for qemu-devel@nongnu.org; Wed, 06 Apr 2022 02:38:59 -0400 Received: from proxmox-new.maurer-it.com ([94.136.29.106]:2903) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nbzJg-00058E-SC for qemu-devel@nongnu.org; Wed, 06 Apr 2022 02:38:58 -0400 Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 8C044459FE; Wed, 6 Apr 2022 08:38:46 +0200 (CEST) Message-ID: Date: Wed, 6 Apr 2022 08:38:23 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH] acpi: Bodge acpi_index migration Content-Language: en-US To: "Dr. David Alan Gilbert (git)" , qemu-devel@nongnu.org, mst@redhat.com, imammedo@redhat.com, alex.williamson@redhat.com References: <20220405190658.65187-1-dgilbert@redhat.com> From: Fabian Ebner In-Reply-To: <20220405190658.65187-1-dgilbert@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=94.136.29.106; envelope-from=f.ebner@proxmox.com; helo=proxmox-new.maurer-it.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, NICE_REPLY_A=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, leobras@redhat.com, Thomas Lamprecht , peterx@redhat.com, quintela@redhat.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Am 05.04.22 um 21:06 schrieb Dr. David Alan Gilbert (git): > From: "Dr. David Alan Gilbert" > > The 'acpi_index' field is a statically configured field, which for > some reason is migrated; this never makes much sense because it's > command line static. > > However, on piix4 it's conditional, and the condition/test function > ends up having the wrong pointer passed to it (it gets a PIIX4PMState > not the AcpiPciHpState it was expecting, because VMSTATE_PCI_HOTPLUG > is a macro and not another struct). This means the field is randomly > loaded/saved based on a random pointer. In 6.x this random pointer > randomly seems to get 0 for everyone (!); in 7.0rc it's getting junk > and trying to load a field that the source didn't send. The migration > stream gets out of line and hits the section footer. > > The bodge is on piix4 never to load the field: > a) Most 6.x builds never send it, so most of the time the migration > will work. > b) We can backport this fix to 6.x to remove the boobytrap. > c) It should never have made a difference anyway since the acpi-index > is command line configured and should be correct on the destination > anyway > d) ich9 is still sending/receiving this (unconditionally all the time) > but due to (c) should never notice. We could follow up to make it > skip. > > It worries me just when (a) actually happens. > > Fixes: b32bd76 ("pci: introduce acpi-index property for PCI device") > Resolves: https://gitlab.com/qemu-project/qemu/-/issues/932 > > Signed-off-by: Dr. David Alan Gilbert > --- > hw/acpi/acpi-pci-hotplug-stub.c | 4 ---- > hw/acpi/pcihp.c | 6 ------ > hw/acpi/piix4.c | 11 ++++++++++- > include/hw/acpi/pcihp.h | 2 -- > 4 files changed, 10 insertions(+), 13 deletions(-) > Fixes the issue for me, thanks! Tested-by: Fabian Ebner