[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v5 27/36] sysbus: add a sysbus_mmio_unmap() help
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH v5 27/36] sysbus: add a sysbus_mmio_unmap() helper |
Date: |
Tue, 4 Dec 2018 13:04:34 +0000 |
On Tue, 4 Dec 2018 at 12:33, Cédric Le Goater <address@hidden> 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