From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51170) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gUANd-0005Wc-IA for qemu-devel@nongnu.org; Tue, 04 Dec 2018 08:04:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gUANc-0006Vg-3D for qemu-devel@nongnu.org; Tue, 04 Dec 2018 08:04:49 -0500 Received: from mail-oi1-x241.google.com ([2607:f8b0:4864:20::241]:37322) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gUANa-0006NL-Sv for qemu-devel@nongnu.org; Tue, 04 Dec 2018 08:04:47 -0500 Received: by mail-oi1-x241.google.com with SMTP id y23so14171081oia.4 for ; Tue, 04 Dec 2018 05:04:46 -0800 (PST) MIME-Version: 1.0 References: <20181116105729.23240-1-clg@kaod.org> <20181116105729.23240-28-clg@kaod.org> <20181129040917.GF14697@umbus.fritz.box> In-Reply-To: From: Peter Maydell Date: Tue, 4 Dec 2018 13:04:34 +0000 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v5 27/36] sysbus: add a sysbus_mmio_unmap() helper List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?C=C3=A9dric_Le_Goater?= Cc: David Gibson , qemu-ppc , QEMU Developers On Tue, 4 Dec 2018 at 12:33, C=C3=A9dric Le Goater wrote: > A completely new interrupt controller was introduced on the POWER9 > processor and it uses MMIO regions for interrupt management. These > regions are backed by simple MRs in QEMU, when using TCG, and backed > by ram_device_ptr MRs under KVM. > > Difficulties arise with the fact that POWER9 pseries guests need > to support the old mode (XICS, no MMIOs) and the new mode XIVE. > The interrupt mode is negotiated at boot between the hypervisor > and the guest and a reset is generated to take into account > the changes. Which means that, at reset, we may need to disconnect > from a KVM IC device and reconnect to another. This is a painful API for QEMU to implement, incidentally, because we don't have any concept really of a warm reset. In theory reset should get you back to exactly the same state as if you'd just started QEMU. You can probably bodge something together, though. > When switching from XICS to XIVE mode : > > if kvm > - destroy KVM XICS device > - create KVM XIVE device > - get fd, mmap, init ram_device_ptr MRs > - map mmio > - enable MMIOs > > When switching from XIVE to XICS : > > - disable MMIOs > if kvm > - delete MRs > - munmap > - destroy KVM XIVE device > - create KVM XICS device This seems basically OK, I think. thanks -- PMM