Skip to contentSkip to conversation

s390/pci: fix build on 32-bit and non linux

PATCH In review Frank Blaschka 3 participants 6 messages Dec 16, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 s390/pci: fix build on 32-bit and non linux

From: Frank Blaschka <[email protected]>

Remove unnecessary and wrong includes. Fix get_rt_sto and get_st_pto to build on 32-bit.

---
 hw/s390x/s390-pci-bus.c  | 25 +++++++++++--------------
 hw/s390x/s390-pci-inst.c | 30 +++---------------------------
 2 files changed, 14 insertions(+), 41 deletions(-)
hw/s390x/s390-pci-bus.c +11 -14
index c1b57d0..c9c06e6 100644
@@ -11,13 +11,10 @@
  * directory.
  */
 
-#include <hw/pci/pci.h>
+#include "s390-pci-bus.h"
 #include <hw/pci/pci_bus.h>
-#include <hw/s390x/css.h>
-#include <hw/s390x/sclp.h>
 #include <hw/pci/msi.h>
-#include "qemu/error-report.h"
-#include "s390-pci-bus.h"
+#include <qemu/error-report.h>
 
 /* #define DEBUG_S390PCI_BUS */
 #ifdef DEBUG_S390PCI_BUS
@@ -253,18 +250,18 @@ static unsigned int calc_px(dma_addr_t ptr)
     return ((unsigned long) ptr >> PAGE_SHIFT) & ZPCI_PT_MASK;
 }
 
-static unsigned long *get_rt_sto(unsigned long entry)
+static uint64_t get_rt_sto(uint64_t entry)
 {
     return ((entry & ZPCI_TABLE_TYPE_MASK) == ZPCI_TABLE_TYPE_RTX)
-                ? (unsigned long *) (entry & ZPCI_RTE_ADDR_MASK)
-                : NULL;
+                ? (entry & ZPCI_RTE_ADDR_MASK)
+                : 0;
 }
 
-static unsigned long *get_st_pto(unsigned long entry)
+static uint64_t get_st_pto(uint64_t entry)
 {
     return ((entry & ZPCI_TABLE_TYPE_MASK) == ZPCI_TABLE_TYPE_SX)
-            ? (unsigned long *) (entry & ZPCI_STE_ADDR_MASK)
-            : NULL;
+            ? (entry & ZPCI_STE_ADDR_MASK)
+            : 0;
 }
 
 static uint64_t s390_guest_io_table_walk(uint64_t guest_iota,
@@ -280,7 +277,7 @@ static uint64_t s390_guest_io_table_walk(uint64_t guest_iota,
 
     sto_a = guest_iota + rtx * sizeof(uint64_t);
     sto = ldq_phys(&address_space_memory, sto_a);
-    sto = (uint64_t)get_rt_sto(sto);
+    sto = get_rt_sto(sto);
     if (!sto) {
         pte = 0;
         goto out;
@@ -288,7 +285,7 @@ static uint64_t s390_guest_io_table_walk(uint64_t guest_iota,
 
     pto_a = sto + sx * sizeof(uint64_t);
     pto = ldq_phys(&address_space_memory, pto_a);
-    pto = (uint64_t)get_st_pto(pto);
+    pto = get_st_pto(pto);
     if (!pto) {
         pte = 0;
         goto out;
@@ -322,7 +319,7 @@ static IOMMUTLBEntry s390_translate_iommu(MemoryRegion *iommu, hwaddr addr,
     /* s390 does not have an APIC maped to main storage so we use
      * a separate AddressSpace only for msix notifications
      */
-    if (addr == ZPCI_MSI_ADDR) {
+    if (((uint64_t)addr) == ZPCI_MSI_ADDR) {
         ret.target_as = &s->msix_notify_as;
         ret.iova = addr;
         ret.translated_addr = addr;
hw/s390x/s390-pci-inst.c +3 -27
index 83ab60f..d486cbb 100644
@@ -11,34 +11,10 @@
  * directory.
  */
 
-#include <sys/types.h>
-#include <sys/ioctl.h>
-#include <sys/mman.h>
-
-#include <linux/kvm.h>
-#include <asm/ptrace.h>
-#include <hw/pci/pci.h>
-#include <hw/pci/pci_host.h>
-#include <net/net.h>
-
-#include "qemu-common.h"
-#include "qemu/timer.h"
-#include "migration/qemu-file.h"
-#include "sysemu/sysemu.h"
-#include "sysemu/kvm.h"
-#include "cpu.h"
-#include "sysemu/device_tree.h"
-#include "monitor/monitor.h"
 #include "s390-pci-inst.h"
-
-#include "hw/hw.h"
-#include "hw/pci/pci.h"
-#include "hw/pci/pci_bridge.h"
-#include "hw/pci/pci_bus.h"
-#include "hw/pci/pci_host.h"
-#include "hw/s390x/s390-pci-bus.h"
-#include "exec/exec-all.h"
-#include "exec/memory-internal.h"
+#include "s390-pci-bus.h"
+#include <exec/memory-internal.h>
+#include <qemu/error-report.h>
 
 /* #define DEBUG_S390PCI_INST */
 #ifdef DEBUG_S390PCI_INST
Signature · 1 line
1.8.5.5
#2 lore raw
Quoted 5 lines · Alexander Graf
Quoted 5 lines

Am 16.12.2014 um 10:28 schrieb Frank Blaschka <[email protected]>:

Quoted 9 lines
Quoted 6 lines

From: Frank Blaschka <[email protected]>

Remove unnecessary and wrong includes. Fix get_rt_sto and get_st_pto to build on 32-bit.

Could you please roll the fixes into the offending patches and repost the set? Otherwise we break bisectability on 32bit hosts.

Sure, but since this is an initial drop and I have to touch the patches anyhow can I merge all add-ons and fixes to the initial patch set?

I would like to end up finally with just 3 patches:

s390: Add PCI bus support
s390: implement pci instructions
kvm: extend kvm_irqchip_add_msi_route to work on s390

If so I would post V2 of the initial patch set including all changes.

Frank

Quoted 2 lines

Alex

#3 lore raw
Quoted 19 lines · Frank Blaschka
Quoted 5 lines · Alexander Graf
Quoted 5 lines

Am 16.12.2014 um 10:28 schrieb Frank Blaschka <[email protected]>:

Quoted 9 lines
Quoted 6 lines

From: Frank Blaschka <[email protected]>

Remove unnecessary and wrong includes. Fix get_rt_sto and get_st_pto to build on 32-bit.

Could you please roll the fixes into the offending patches and repost the set? Otherwise we break bisectability on 32bit hosts.

Sure, but since this is an initial drop and I have to touch the patches anyhow can I merge all add-ons and fixes to the initial patch set?

Quoted 7 lines

I would like to end up finally with just 3 patches:

s390: Add PCI bus support
s390: implement pci instructions
kvm: extend kvm_irqchip_add_msi_route to work on s390

If so I would post V2 of the initial patch set including all changes.

Cornelia is the maintainer here, so you'll need to ask her :). Anything that doesn't break bisectability is certainly better than code that breaks it.

By squashing all those patches together you'll make bisecting harder for s390 - if you can live with it so can I.

Alex

#4 lore raw
Quoted 28 lines · Alexander Graf
Quoted 25 lines · Frank Blaschka
Quoted 5 lines · Alexander Graf
Quoted 5 lines

Am 16.12.2014 um 10:28 schrieb Frank Blaschka <[email protected]>:

Quoted 9 lines
Quoted 6 lines

From: Frank Blaschka <[email protected]>

Remove unnecessary and wrong includes. Fix get_rt_sto and get_st_pto to build on 32-bit.

Could you please roll the fixes into the offending patches and repost the set? Otherwise we break bisectability on 32bit hosts.

Sure, but since this is an initial drop and I have to touch the patches anyhow can I merge all add-ons and fixes to the initial patch set?

I would like to end up finally with just 3 patches:

s390: Add PCI bus support
s390: implement pci instructions
kvm: extend kvm_irqchip_add_msi_route to work on s390

Quoted 6 lines
Quoted 1 line

If so I would post V2 of the initial patch set including all changes.

Cornelia is the maintainer here, so you'll need to ask her :). Anything that doesn't break bisectability is certainly better than code that breaks it.

OK. Coni what do you prefere?

Quoted 6 lines

By squashing all those patches together you'll make bisecting harder for s390 - if you can live with it so can I.

Alex

#5 lore raw
In reply to Frank Blaschka
Quoted 19 lines · On Tue, 16 Dec 2014 12:46:49 +0100 Frank Blaschka…
Quoted 5 lines · Alexander Graf
Quoted 5 lines

Am 16.12.2014 um 10:28 schrieb Frank Blaschka <[email protected]>:

Quoted 9 lines
Quoted 6 lines

From: Frank Blaschka <[email protected]>

Remove unnecessary and wrong includes. Fix get_rt_sto and get_st_pto to build on 32-bit.

Could you please roll the fixes into the offending patches and repost the set? Otherwise we break bisectability on 32bit hosts.

Sure, but since this is an initial drop and I have to touch the patches anyhow can I merge all add-ons and fixes to the initial patch set?

Quoted 7 lines

I would like to end up finally with just 3 patches:

s390: Add PCI bus support
s390: implement pci instructions
kvm: extend kvm_irqchip_add_msi_route to work on s390

If so I would post V2 of the initial patch set including all changes.

As you need to repost anyway, posting a cleaned-up series is fine with me. You also have my ack on merging the MAINTAINERS patch :)