From nobody Tue Feb 10 04:15:14 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) 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=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) 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 1510234573518426.809321673254; Thu, 9 Nov 2017 05:36:13 -0800 (PST) Received: from localhost ([::1]:36935 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eCn01-00055w-44 for importer@patchew.org; Thu, 09 Nov 2017 08:36:05 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40725) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eCmtu-0000BJ-8C for qemu-devel@nongnu.org; Thu, 09 Nov 2017 08:29:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eCmtq-0005MS-4F for qemu-devel@nongnu.org; Thu, 09 Nov 2017 08:29:46 -0500 Received: from 3.mo68.mail-out.ovh.net ([46.105.58.60]:48615) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eCmtp-0005Lw-TY for qemu-devel@nongnu.org; Thu, 09 Nov 2017 08:29:42 -0500 Received: from player750.ha.ovh.net (b6.ovh.net [213.186.33.56]) by mo68.mail-out.ovh.net (Postfix) with ESMTP id 4DBE699C7C for ; Thu, 9 Nov 2017 14:29:40 +0100 (CET) Received: from zorba.kaod.org.com (LFbn-1-2231-173.w90-76.abo.wanadoo.fr [90.76.52.173]) (Authenticated sender: clg@kaod.org) by player750.ha.ovh.net (Postfix) with ESMTPSA id 246B1181B2C; Thu, 9 Nov 2017 11:15:28 +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: Thu, 9 Nov 2017 11:14:33 +0100 Message-Id: <20171109101439.390-7-clg@kaod.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171109101439.390-1-clg@kaod.org> References: <20171109101439.390-1-clg@kaod.org> MIME-Version: 1.0 X-Ovh-Tracer-Id: 3082150996274350931 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedttddriedugdegiecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd 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.58.60 Subject: [Qemu-devel] [PATCH for-2.12 v2 06/12] 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_0 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 --- hw/ppc/spapr.c | 5 ++++- include/hw/ppc/spapr.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 70f6a96ec909..d4d0a36cc5bf 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 @@ -1706,7 +1709,7 @@ static bool spapr_irq_map_needed(void *opaque) return false; } =20 - return true; + 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 71faeff17a40..090eda962ccb 100644 --- a/include/hw/ppc/spapr.h +++ b/include/hw/ppc/spapr.h @@ -82,6 +82,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