From nobody Mon Feb 9 08:58:07 2026 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1510327832564888.2657681968224; Fri, 10 Nov 2017 07:30:32 -0800 (PST) Received: from localhost ([::1]:42260 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eDBG3-0006o5-J9 for importer@patchew.org; Fri, 10 Nov 2017 10:30:15 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47749) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eDB7M-0007sj-Fu for qemu-devel@nongnu.org; Fri, 10 Nov 2017 10:21:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eDB7L-0006Ka-HT for qemu-devel@nongnu.org; Fri, 10 Nov 2017 10:21:16 -0500 Received: from 1.mo68.mail-out.ovh.net ([46.105.41.146]:59851) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eDB7L-0006J3-AY for qemu-devel@nongnu.org; Fri, 10 Nov 2017 10:21:15 -0500 Received: from player737.ha.ovh.net (b9.ovh.net [213.186.33.59]) by mo68.mail-out.ovh.net (Postfix) with ESMTP id 4D1659C282 for ; Fri, 10 Nov 2017 16:21:14 +0100 (CET) Received: from zorba.kaod.org.com (deibp9eh1--blueice1n7.emea.ibm.com [195.212.29.161]) (Authenticated sender: clg@kaod.org) by player737.ha.ovh.net (Postfix) with ESMTPSA id E1E33E009E; Fri, 10 Nov 2017 16:21:06 +0100 (CET) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, David Gibson , Greg Kurz , Benjamin Herrenschmidt Date: Fri, 10 Nov 2017 15:20:12 +0000 Message-Id: <20171110152017.24324-7-clg@kaod.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171110152017.24324-1-clg@kaod.org> References: <20171110152017.24324-1-clg@kaod.org> MIME-Version: 1.0 X-Ovh-Tracer-Id: 14117095982310329171 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedttddrieefgdejgecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 46.105.41.146 Subject: [Qemu-devel] [PATCH for-2.12 v3 06/11] spapr: store a reference IRQ bitmap X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_6 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" To save some state when the guest is migrated, we capture the IRQ bitmap after all devices have been reseted and store it as a reference for the machine. Signed-off-by: C=C3=A9dric Le Goater --- We should probably merge this patch with the previous in the next versions of the patchset. For the moment, I thought it would be interesting to isolate the topic for discussion. hw/ppc/spapr.c | 7 ++++++- include/hw/ppc/spapr.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 4ef0b73559ca..bf0e5b4f815b 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -1437,6 +1437,9 @@ static void ppc_spapr_reset(void) qemu_devices_reset(); spapr_clear_pending_events(spapr); =20 + spapr->irq_map_ref =3D bitmap_new(spapr->nr_irqs); + bitmap_copy(spapr->irq_map_ref, spapr->irq_map, spapr->nr_irqs); + /* * We place the device tree and RTAS just below either the top of the = RMA, * or just below 2GB, whichever is lowere, so that it can be @@ -1683,7 +1686,9 @@ static const VMStateDescription vmstate_spapr_patb_en= try =3D { =20 static bool spapr_irq_map_needed(void *opaque) { - return true; + sPAPRMachineState *spapr =3D opaque; + + return !bitmap_equal(spapr->irq_map, spapr->irq_map_ref, spapr->nr_irq= s); } =20 static const VMStateDescription vmstate_spapr_irq_map =3D { diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h index 5835c694caff..023436c32b2a 100644 --- a/include/hw/ppc/spapr.h +++ b/include/hw/ppc/spapr.h @@ -81,6 +81,7 @@ struct sPAPRMachineState { struct sPAPRNVRAM *nvram; int32_t nr_irqs; unsigned long *irq_map; + unsigned long *irq_map_ref; ICSState *ics; sPAPRRTCState rtc; =20 --=20 2.13.6