[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 08/10] s390x/pci: fix reg/dereg irq functions
From: |
Cornelia Huck |
Subject: |
[Qemu-devel] [PATCH 08/10] s390x/pci: fix reg/dereg irq functions |
Date: |
Tue, 23 Feb 2016 12:19:08 +0100 |
From: Yi Min Zhao <address@hidden>
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 <address@hidden>
Reviewed-by: Cornelia Huck <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>
---
hw/s390x/s390-pci-bus.h | 2 ++
hw/s390x/s390-pci-inst.c | 23 +++++++++++------------
2 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/hw/s390x/s390-pci-bus.h b/hw/s390x/s390-pci-bus.h
index d8ddb77..59fd5c9 100644
--- a/hw/s390x/s390-pci-bus.h
+++ b/hw/s390x/s390-pci-bus.h
@@ -233,6 +233,8 @@ typedef struct S390PCIBusDevice {
AddressSpace as;
MemoryRegion mr;
MemoryRegion iommu_mr;
+ IndAddr *summary_ind;
+ IndAddr *indicator;
} S390PCIBusDevice;
typedef struct S390pciState {
diff --git a/hw/s390x/s390-pci-inst.c b/hw/s390x/s390-pci-inst.c
index fe73ca8..506147d 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;
--
2.7.1
- [Qemu-devel] [PATCH 00/10] s390x: pending patches, Cornelia Huck, 2016/02/23
- [Qemu-devel] [PATCH 04/10] s390x: remove {kvm_}s390_virtio_irq(), Cornelia Huck, 2016/02/23
- [Qemu-devel] [PATCH 10/10] s390x/css: Use static initialization for channel_subsys fields, Cornelia Huck, 2016/02/23
- [Qemu-devel] [PATCH 06/10] s390x/virtio: old machine leftovers, Cornelia Huck, 2016/02/23
- [Qemu-devel] [PATCH 02/10] s390x/kvm: sync fprs via kvm_run, Cornelia Huck, 2016/02/23
- [Qemu-devel] [PATCH 01/10] linux-headers: update against kvm/next, Cornelia Huck, 2016/02/23
- [Qemu-devel] [PATCH 07/10] s390x/css: introduce indicator refcounting interfaces, Cornelia Huck, 2016/02/23
- [Qemu-devel] [PATCH 09/10] s390x/css: Allocate channel_subsys statically, Cornelia Huck, 2016/02/23
- [Qemu-devel] [PATCH 03/10] s390x: fix debug statement in trigger_page_fault(), Cornelia Huck, 2016/02/23
- [Qemu-devel] [PATCH 05/10] watchdog/diag288: avoid race condition on expired watchdog, Cornelia Huck, 2016/02/23
- [Qemu-devel] [PATCH 08/10] s390x/pci: fix reg/dereg irq functions,
Cornelia Huck <=
- Re: [Qemu-devel] [PATCH 00/10] s390x: pending patches, Cornelia Huck, 2016/02/29