[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH v2 07/21] ppc/xive: add MMIO handlers for th
From: |
David Gibson |
Subject: |
Re: [Qemu-devel] [RFC PATCH v2 07/21] ppc/xive: add MMIO handlers for the XIVE interrupt sources |
Date: |
Thu, 28 Sep 2017 23:20:02 +1000 |
User-agent: |
Mutt/1.9.0 (2017-09-02) |
On Thu, Sep 28, 2017 at 10:29:02AM +0200, Benjamin Herrenschmidt wrote:
> On Wed, 2017-09-20 at 15:05 +0200, Cédric Le Goater wrote:
> > > > +/*
> > > > + * XIVE Interrupt Source MMIOs
> > > > + */
> > > > +static uint64_t spapr_xive_esb_read(void *opaque, hwaddr addr,
> > > > unsigned size)
> > > > +{
> > > > + sPAPRXive *xive = SPAPR_XIVE(opaque);
> > > > + uint32_t offset = addr & 0xF00;
> > > > + uint32_t srcno = addr >> xive->esb_shift;
> > > > + XiveIVE *ive;
> > > > + uint64_t ret = -1;
> > > > +
> > > > + ive = spapr_xive_get_ive(xive, srcno);
> > > > + if (!ive || !(ive->w & IVE_VALID)) {
> > > > + qemu_log_mask(LOG_GUEST_ERROR, "XIVE: invalid LISN %d\n",
> > > > srcno);
> > > > + goto out;
> > >
> > > Since there's a whole (4k) page for each source, I wonder if we should
> > > actually map each one as a separate MMIO region to allow us to tweak
> > > the mappings more flexibly
> >
> > yes we could have a subregion for each source. In that case,
> > we should also handle IVE_VALID properly. That will require
> > a specific XIVE allocator which was difficult to do while
> > keeping the compatibility with XICS for migration and CAS.
>
> That will be a serious bloat with lots of interrupts. We also cannot
> possibly have a KVM mm region per interrupt or even a vma.
Yeah. I'd been thinking in terms of thousands of sources, which
wouldn't be too unreasonable in terms of separate regions. With all
the IPIs sounds like it could be more in the hundres of thousands at
which point that would get very nasty.
So I agree, I think we want to keep it one region.
AIUI, how we do that shouldn't affect the guest, though.
> I'm thinking of some kind of /dev/xive (or some other KVM or irqfd
> orignated fd) that allows you to mmap a single big region whose content
> is demand-faulted and invalidated by the kernel to map the various
> interrupts.
>
> So that it looks like a single VMA (and KVM memory block).
>
> Ben.
>
> > C.
> >
> >
>
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
signature.asc
Description: PGP signature
- Re: [Qemu-devel] [RFC PATCH v2 06/21] ppc/xive: introduce handlers for interrupt sources, (continued)
[Qemu-devel] [RFC PATCH v2 07/21] ppc/xive: add MMIO handlers for the XIVE interrupt sources, Cédric Le Goater, 2017/09/11
Re: [Qemu-devel] [RFC PATCH v2 07/21] ppc/xive: add MMIO handlers for the XIVE interrupt sources, Cédric Le Goater, 2017/09/20
Re: [Qemu-devel] [RFC PATCH v2 07/21] ppc/xive: add MMIO handlers for the XIVE interrupt sources, Benjamin Herrenschmidt, 2017/09/28
Re: [Qemu-devel] [RFC PATCH v2 07/21] ppc/xive: add MMIO handlers for the XIVE interrupt sources,
David Gibson <=
[Qemu-devel] [RFC PATCH v2 08/21] ppc/xive: describe the XIVE interrupt source flags, Cédric Le Goater, 2017/09/11
[Qemu-devel] [RFC PATCH v2 09/21] ppc/xive: extend the interrupt presenter model for XIVE, Cédric Le Goater, 2017/09/11
[Qemu-devel] [RFC PATCH v2 10/21] ppc/xive: add MMIO handlers for the XIVE TIMA, Cédric Le Goater, 2017/09/11
[Qemu-devel] [RFC PATCH v2 11/21] ppc/xive: push the EQ data in OS event queue, Cédric Le Goater, 2017/09/11