]> git.proxmox.com Git - mirror_qemu.git/commitdiff
spapr/xive: Use xive_source_esb_len()
authorGreg Kurz <groug@kaod.org>
Thu, 13 Aug 2020 17:28:10 +0000 (19:28 +0200)
committerDavid Gibson <david@gibson.dropbear.id.au>
Fri, 14 Aug 2020 03:35:45 +0000 (13:35 +1000)
static inline size_t xive_source_esb_len(XiveSource *xsrc)
{
    return (1ull << xsrc->esb_shift) * xsrc->nr_irqs;
}

Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <159733969034.320580.6571451425779179477.stgit@bahia.lan>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
hw/intc/spapr_xive.c
hw/intc/spapr_xive_kvm.c

index 3c84f64dc4642697d749a619574aef06905e098f..4bd0d606ba1705695297bf57ca74f7c6301979d1 100644 (file)
@@ -336,7 +336,7 @@ static void spapr_xive_realize(DeviceState *dev, Error **errp)
     sysbus_init_mmio(SYS_BUS_DEVICE(xive), &end_xsrc->esb_mmio);
 
     /* Set the mapping address of the END ESB pages after the source ESBs */
-    xive->end_base = xive->vc_base + (1ull << xsrc->esb_shift) * xsrc->nr_irqs;
+    xive->end_base = xive->vc_base + xive_source_esb_len(xsrc);
 
     /*
      * Allocate the routing tables
index d871bb1a00167c9174a7076ce91efaef2bc9c6b2..e8667ce5f621e58591c958c0f43583053b297c3b 100644 (file)
@@ -831,7 +831,7 @@ void kvmppc_xive_disconnect(SpaprInterruptController *intc)
 
     /* Clear the KVM mapping */
     xsrc = &xive->source;
-    esb_len = (1ull << xsrc->esb_shift) * xsrc->nr_irqs;
+    esb_len = xive_source_esb_len(xsrc);
 
     if (xsrc->esb_mmap) {
         memory_region_del_subregion(&xsrc->esb_mmio, &xsrc->esb_mmio_kvm);