summaryrefslogtreecommitdiffstats
path: root/hw/s390x/s390-pci-inst.c
diff options
context:
space:
mode:
authorYi Min Zhao2016-01-28 06:26:43 +0100
committerCornelia Huck2016-03-01 12:15:29 +0100
commit8581c115d2b995e216223f9f9d29fb4810474dc4 (patch)
tree22d5dfd7e54599300060020bd5c4419a1ae0e11a /hw/s390x/s390-pci-inst.c
parents390x/css: introduce indicator refcounting interfaces (diff)
downloadqemu-8581c115d2b995e216223f9f9d29fb4810474dc4.tar.gz
qemu-8581c115d2b995e216223f9f9d29fb4810474dc4.tar.xz
qemu-8581c115d2b995e216223f9f9d29fb4810474dc4.zip
s390x/pci: fix reg/dereg irq functions
Indicator refcounting interfaces are introduced. This patch fixes introducing unneeded indicator mappings and failure to release AISB mappings on deregistration. Signed-off-by: Yi Min Zhao <zyimin@linux.vnet.ibm.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Diffstat (limited to 'hw/s390x/s390-pci-inst.c')
-rw-r--r--hw/s390x/s390-pci-inst.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/hw/s390x/s390-pci-inst.c b/hw/s390x/s390-pci-inst.c
index fe73ca8819..506147d670 100644
--- a/hw/s390x/s390-pci-inst.c
+++ b/hw/s390x/s390-pci-inst.c
@@ -621,19 +621,19 @@ int pcistb_service_call(S390CPU *cpu, uint8_t r1, uint8_t r3, uint64_t gaddr,
static int reg_irqs(CPUS390XState *env, S390PCIBusDevice *pbdev, ZpciFib fib)
{
- int ret;
- S390FLICState *fs = s390_get_flic();
- S390FLICStateClass *fsc = S390_FLIC_COMMON_GET_CLASS(fs);
+ int ret, len;
ret = css_register_io_adapter(S390_PCIPT_ADAPTER,
FIB_DATA_ISC(ldl_p(&fib.data)), true, false,
&pbdev->routes.adapter.adapter_id);
assert(ret == 0);
- fsc->io_adapter_map(fs, pbdev->routes.adapter.adapter_id,
- ldq_p(&fib.aisb), true);
- fsc->io_adapter_map(fs, pbdev->routes.adapter.adapter_id,
- ldq_p(&fib.aibv), true);
+ pbdev->summary_ind = get_indicator(ldq_p(&fib.aisb), sizeof(uint64_t));
+ len = BITS_TO_LONGS(FIB_DATA_NOI(ldl_p(&fib.data))) * sizeof(unsigned long);
+ pbdev->indicator = get_indicator(ldq_p(&fib.aibv), len);
+
+ map_indicator(&pbdev->routes.adapter, pbdev->summary_ind);
+ map_indicator(&pbdev->routes.adapter, pbdev->indicator);
pbdev->routes.adapter.summary_addr = ldq_p(&fib.aisb);
pbdev->routes.adapter.summary_offset = FIB_DATA_AISBO(ldl_p(&fib.data));
@@ -649,12 +649,11 @@ static int reg_irqs(CPUS390XState *env, S390PCIBusDevice *pbdev, ZpciFib fib)
static int dereg_irqs(S390PCIBusDevice *pbdev)
{
- S390FLICState *fs = s390_get_flic();
- S390FLICStateClass *fsc = S390_FLIC_COMMON_GET_CLASS(fs);
-
- fsc->io_adapter_map(fs, pbdev->routes.adapter.adapter_id,
- pbdev->routes.adapter.ind_addr, false);
+ release_indicator(&pbdev->routes.adapter, pbdev->summary_ind);
+ release_indicator(&pbdev->routes.adapter, pbdev->indicator);
+ pbdev->summary_ind = NULL;
+ pbdev->indicator = NULL;
pbdev->routes.adapter.summary_addr = 0;
pbdev->routes.adapter.summary_offset = 0;
pbdev->routes.adapter.ind_addr = 0;