qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/2] s390x patches for 2.8
@ 2016-10-31 10:13 Cornelia Huck
  2016-10-31 10:13 ` [Qemu-devel] [PULL 1/2] s390x/pci: use generic interface to inject interrupt Cornelia Huck
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Cornelia Huck @ 2016-10-31 10:13 UTC (permalink / raw)
  To: peter.maydell; +Cc: borntraeger, agraf, jfrei, qemu-devel, Cornelia Huck

The following changes since commit 5b2ecabaeabc17f032197246c4846b9ba95ba8a6:

  Merge remote-tracking branch 'remotes/kraxel/tags/pull-ui-20161028-1' into staging (2016-10-28 17:59:04 +0100)

are available in the git repository at:

  git://github.com/cohuck/qemu tags/s390x-20161031

for you to fetch changes up to 88ee13c7b656e5504613b527f3a51591e9afae69:

  s390x/pci: Check memory region dispatching callbacks (2016-10-31 10:02:09 +0100)

----------------------------------------------------------------
Two PCI fixes/improvements for s390x.

----------------------------------------------------------------

Pierre Morel (1):
  s390x/pci: Check memory region dispatching callbacks

Yi Min Zhao (1):
  s390x/pci: use generic interface to inject interrupt

 hw/s390x/s390-pci-bus.c  |  4 +---
 hw/s390x/s390-pci-inst.c | 25 ++++++++++++++++++++-----
 2 files changed, 21 insertions(+), 8 deletions(-)

-- 
2.10.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PULL 1/2] s390x/pci: use generic interface to inject interrupt
  2016-10-31 10:13 [Qemu-devel] [PULL 0/2] s390x patches for 2.8 Cornelia Huck
@ 2016-10-31 10:13 ` Cornelia Huck
  2016-10-31 10:13 ` [Qemu-devel] [PULL 2/2] s390x/pci: Check memory region dispatching callbacks Cornelia Huck
  2016-10-31 15:28 ` [Qemu-devel] [PULL 0/2] s390x patches for 2.8 Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Cornelia Huck @ 2016-10-31 10:13 UTC (permalink / raw)
  To: peter.maydell
  Cc: borntraeger, agraf, jfrei, qemu-devel, Yi Min Zhao, Cornelia Huck

From: Yi Min Zhao <zyimin@linux.vnet.ibm.com>

Let's use the generic interface to inject adapter interrupts.

Signed-off-by: Yi Min Zhao <zyimin@linux.vnet.ibm.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
---
 hw/s390x/s390-pci-bus.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c
index b7f8bca..58d0dd2 100644
--- a/hw/s390x/s390-pci-bus.c
+++ b/hw/s390x/s390-pci-bus.c
@@ -463,7 +463,6 @@ static void s390_msi_ctrl_write(void *opaque, hwaddr addr, uint64_t data,
                                 unsigned int size)
 {
     S390PCIBusDevice *pbdev = opaque;
-    uint32_t io_int_word;
     uint32_t idx = data >> ZPCI_MSI_VEC_BITS;
     uint32_t vec = data & ZPCI_MSI_VEC_MASK;
     uint64_t ind_bit;
@@ -489,8 +488,7 @@ static void s390_msi_ctrl_write(void *opaque, hwaddr addr, uint64_t data,
                    0x80 >> ((ind_bit + vec) % 8));
     if (!set_ind_atomic(pbdev->routes.adapter.summary_addr + sum_bit / 8,
                                        0x80 >> (sum_bit % 8))) {
-        io_int_word = (pbdev->isc << 27) | IO_INT_WORD_AI;
-        s390_io_interrupt(0, 0, 0, io_int_word);
+        css_adapter_interrupt(pbdev->isc);
     }
 }
 
-- 
2.10.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PULL 2/2] s390x/pci: Check memory region dispatching callbacks
  2016-10-31 10:13 [Qemu-devel] [PULL 0/2] s390x patches for 2.8 Cornelia Huck
  2016-10-31 10:13 ` [Qemu-devel] [PULL 1/2] s390x/pci: use generic interface to inject interrupt Cornelia Huck
@ 2016-10-31 10:13 ` Cornelia Huck
  2016-10-31 15:28 ` [Qemu-devel] [PULL 0/2] s390x patches for 2.8 Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Cornelia Huck @ 2016-10-31 10:13 UTC (permalink / raw)
  To: peter.maydell
  Cc: borntraeger, agraf, jfrei, qemu-devel, Pierre Morel,
	Cornelia Huck

From: Pierre Morel <pmorel@linux.vnet.ibm.com>

The instructions PCI STORE, PCI LOAD and PCI STORE BLOCK
use calls to memory_region_dispatch_write() and
memory_region_dispatch_read() but do not test the return value.

Furthermore, the instruction PCI STORE BLOCK sets up a PGM_ADDRESSING
exception when the operand 3 is not within the designated PCI address
space instead of a PGM_OPERAND exception.

Let's setup a PGM_OPERAND exception in all of these failure cases.

Signed-off-by: Pierre Morel <pmorel@linux.vnet.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
---
 hw/s390x/s390-pci-inst.c | 25 ++++++++++++++++++++-----
 1 file changed, 20 insertions(+), 5 deletions(-)

diff --git a/hw/s390x/s390-pci-inst.c b/hw/s390x/s390-pci-inst.c
index 80a5104..0864d9b 100644
--- a/hw/s390x/s390-pci-inst.c
+++ b/hw/s390x/s390-pci-inst.c
@@ -316,6 +316,7 @@ int pcilg_service_call(S390CPU *cpu, uint8_t r1, uint8_t r2)
     uint64_t offset;
     uint64_t data;
     MemoryRegion *mr;
+    MemTxResult result;
     uint8_t len;
     uint32_t fh;
     uint8_t pcias;
@@ -365,8 +366,12 @@ int pcilg_service_call(S390CPU *cpu, uint8_t r1, uint8_t r2)
             return 0;
         }
         mr = pbdev->pdev->io_regions[pcias].memory;
-        memory_region_dispatch_read(mr, offset, &data, len,
-                                    MEMTXATTRS_UNSPECIFIED);
+        result = memory_region_dispatch_read(mr, offset, &data, len,
+                                             MEMTXATTRS_UNSPECIFIED);
+        if (result != MEMTX_OK) {
+            program_interrupt(env, PGM_OPERAND, 4);
+            return 0;
+        }
     } else if (pcias == 15) {
         if ((4 - (offset & 0x3)) < len) {
             program_interrupt(env, PGM_OPERAND, 4);
@@ -444,6 +449,7 @@ int pcistg_service_call(S390CPU *cpu, uint8_t r1, uint8_t r2)
     uint64_t offset, data;
     S390PCIBusDevice *pbdev;
     MemoryRegion *mr;
+    MemTxResult result;
     uint8_t len;
     uint32_t fh;
     uint8_t pcias;
@@ -502,8 +508,12 @@ int pcistg_service_call(S390CPU *cpu, uint8_t r1, uint8_t r2)
             mr = pbdev->pdev->io_regions[pcias].memory;
         }
 
-        memory_region_dispatch_write(mr, offset, data, len,
+        result = memory_region_dispatch_write(mr, offset, data, len,
                                      MEMTXATTRS_UNSPECIFIED);
+        if (result != MEMTX_OK) {
+            program_interrupt(env, PGM_OPERAND, 4);
+            return 0;
+        }
     } else if (pcias == 15) {
         if ((4 - (offset & 0x3)) < len) {
             program_interrupt(env, PGM_OPERAND, 4);
@@ -633,6 +643,7 @@ int pcistb_service_call(S390CPU *cpu, uint8_t r1, uint8_t r3, uint64_t gaddr,
     CPUS390XState *env = &cpu->env;
     S390PCIBusDevice *pbdev;
     MemoryRegion *mr;
+    MemTxResult result;
     int i;
     uint32_t fh;
     uint8_t pcias;
@@ -690,7 +701,7 @@ int pcistb_service_call(S390CPU *cpu, uint8_t r1, uint8_t r3, uint64_t gaddr,
 
     mr = pbdev->pdev->io_regions[pcias].memory;
     if (!memory_region_access_valid(mr, env->regs[r3], len, true)) {
-        program_interrupt(env, PGM_ADDRESSING, 6);
+        program_interrupt(env, PGM_OPERAND, 6);
         return 0;
     }
 
@@ -699,9 +710,13 @@ int pcistb_service_call(S390CPU *cpu, uint8_t r1, uint8_t r3, uint64_t gaddr,
     }
 
     for (i = 0; i < len / 8; i++) {
-        memory_region_dispatch_write(mr, env->regs[r3] + i * 8,
+        result = memory_region_dispatch_write(mr, env->regs[r3] + i * 8,
                                      ldq_p(buffer + i * 8), 8,
                                      MEMTXATTRS_UNSPECIFIED);
+        if (result != MEMTX_OK) {
+            program_interrupt(env, PGM_OPERAND, 6);
+            return 0;
+        }
     }
 
     setcc(cpu, ZPCI_PCI_LS_OK);
-- 
2.10.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PULL 0/2] s390x patches for 2.8
  2016-10-31 10:13 [Qemu-devel] [PULL 0/2] s390x patches for 2.8 Cornelia Huck
  2016-10-31 10:13 ` [Qemu-devel] [PULL 1/2] s390x/pci: use generic interface to inject interrupt Cornelia Huck
  2016-10-31 10:13 ` [Qemu-devel] [PULL 2/2] s390x/pci: Check memory region dispatching callbacks Cornelia Huck
@ 2016-10-31 15:28 ` Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2016-10-31 15:28 UTC (permalink / raw)
  To: Cornelia Huck
  Cc: Christian Borntraeger, Alexander Graf, Jens Freimann,
	QEMU Developers

On 31 October 2016 at 10:13, Cornelia Huck <cornelia.huck@de.ibm.com> wrote:
> The following changes since commit 5b2ecabaeabc17f032197246c4846b9ba95ba8a6:
>
>   Merge remote-tracking branch 'remotes/kraxel/tags/pull-ui-20161028-1' into staging (2016-10-28 17:59:04 +0100)
>
> are available in the git repository at:
>
>   git://github.com/cohuck/qemu tags/s390x-20161031
>
> for you to fetch changes up to 88ee13c7b656e5504613b527f3a51591e9afae69:
>
>   s390x/pci: Check memory region dispatching callbacks (2016-10-31 10:02:09 +0100)
>
> ----------------------------------------------------------------
> Two PCI fixes/improvements for s390x.
>
> ----------------------------------------------------------------
>
> Pierre Morel (1):
>   s390x/pci: Check memory region dispatching callbacks
>
> Yi Min Zhao (1):
>   s390x/pci: use generic interface to inject interrupt
>
>  hw/s390x/s390-pci-bus.c  |  4 +---
>  hw/s390x/s390-pci-inst.c | 25 ++++++++++++++++++++-----
>  2 files changed, 21 insertions(+), 8 deletions(-)

Applied, thanks.

-- PMM

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-10-31 15:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-31 10:13 [Qemu-devel] [PULL 0/2] s390x patches for 2.8 Cornelia Huck
2016-10-31 10:13 ` [Qemu-devel] [PULL 1/2] s390x/pci: use generic interface to inject interrupt Cornelia Huck
2016-10-31 10:13 ` [Qemu-devel] [PULL 2/2] s390x/pci: Check memory region dispatching callbacks Cornelia Huck
2016-10-31 15:28 ` [Qemu-devel] [PULL 0/2] s390x patches for 2.8 Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).