qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/3] Fix S390x target
@ 2010-03-24 17:30 Alexander Graf
  2010-03-24 17:30 ` [Qemu-devel] [PATCH 1/3] S390: Add stub for cpu_get_phys_page_debug Alexander Graf
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Alexander Graf @ 2010-03-24 17:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: Carsten Otte

We're in a bad situation with the S390 qemu target. It only works with KVM,
so people can't test it when they don't have access to a real S390 machine.

While trying to build and use s390x-softmmu again I stumbled across a couple
of issues, all addressed in this patch set. The patches should all not affect
non-s390 targets at all.

Alexander Graf (3):
  S390: Add stub for cpu_get_phys_page_debug
  S390: Tell user why VM creation failed
  S390: Don't compile in virtio-pci

 Makefile.objs                          |    3 ++-
 default-configs/arm-softmmu.mak        |    1 +
 default-configs/cris-softmmu.mak       |    1 +
 default-configs/i386-softmmu.mak       |    1 +
 default-configs/m68k-softmmu.mak       |    1 +
 default-configs/microblaze-softmmu.mak |    1 +
 default-configs/mips-softmmu.mak       |    1 +
 default-configs/mips64-softmmu.mak     |    1 +
 default-configs/mips64el-softmmu.mak   |    1 +
 default-configs/mipsel-softmmu.mak     |    1 +
 default-configs/ppc-softmmu.mak        |    1 +
 default-configs/ppc64-softmmu.mak      |    1 +
 default-configs/ppcemb-softmmu.mak     |    1 +
 default-configs/sh4-softmmu.mak        |    1 +
 default-configs/sh4eb-softmmu.mak      |    1 +
 default-configs/sparc-softmmu.mak      |    1 +
 default-configs/sparc64-softmmu.mak    |    1 +
 default-configs/x86_64-softmmu.mak     |    1 +
 kvm-all.c                              |    7 ++++++-
 target-s390x/helper.c                  |    5 +++++
 20 files changed, 30 insertions(+), 2 deletions(-)

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

* [Qemu-devel] [PATCH 1/3] S390: Add stub for cpu_get_phys_page_debug
  2010-03-24 17:30 [Qemu-devel] [PATCH 0/3] Fix S390x target Alexander Graf
@ 2010-03-24 17:30 ` Alexander Graf
  2010-03-24 17:30 ` [Qemu-devel] [PATCH 2/3] S390: Tell user why VM creation failed Alexander Graf
  2010-03-24 17:30 ` [Qemu-devel] [PATCH 3/3] S390: Don't compile in virtio-pci Alexander Graf
  2 siblings, 0 replies; 8+ messages in thread
From: Alexander Graf @ 2010-03-24 17:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: Carsten Otte

We don't implement any virtual memory in the S390 target so far, so let's
add a stub for this now mandatory function.

Fixes building of S390 target.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 target-s390x/helper.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/target-s390x/helper.c b/target-s390x/helper.c
index ba0c052..4a5297b 100644
--- a/target-s390x/helper.c
+++ b/target-s390x/helper.c
@@ -58,6 +58,11 @@ void cpu_reset(CPUS390XState *env)
     tlb_flush(env, 1);
 }
 
+target_phys_addr_t cpu_get_phys_page_debug(CPUState *env, target_ulong addr)
+{
+    return 0;
+}
+
 #ifndef CONFIG_USER_ONLY
 
 int cpu_s390x_handle_mmu_fault (CPUState *env, target_ulong address, int rw,
-- 
1.6.0.2

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

* [Qemu-devel] [PATCH 2/3] S390: Tell user why VM creation failed
  2010-03-24 17:30 [Qemu-devel] [PATCH 0/3] Fix S390x target Alexander Graf
  2010-03-24 17:30 ` [Qemu-devel] [PATCH 1/3] S390: Add stub for cpu_get_phys_page_debug Alexander Graf
@ 2010-03-24 17:30 ` Alexander Graf
  2010-03-24 17:30 ` [Qemu-devel] [PATCH 3/3] S390: Don't compile in virtio-pci Alexander Graf
  2 siblings, 0 replies; 8+ messages in thread
From: Alexander Graf @ 2010-03-24 17:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: Carsten Otte

The KVM kernel module on S390 refuses to create a VM when the switch_amode
kernel parameter is not used.

Since that is not exactly obvious, let's give the user a nice warning.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 kvm-all.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/kvm-all.c b/kvm-all.c
index 534ead0..acf7e31 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -609,8 +609,13 @@ int kvm_init(int smp_cpus)
     }
 
     s->vmfd = kvm_ioctl(s, KVM_CREATE_VM, 0);
-    if (s->vmfd < 0)
+    if (s->vmfd < 0) {
+#ifdef TARGET_S390X
+        fprintf(stderr, "Please add the 'switch_amode' kernel parameter to "
+                        "your host kernel command line\n");
+#endif
         goto err;
+    }
 
     /* initially, KVM allocated its own memory and we had to jump through
      * hooks to make phys_ram_base point to this.  Modern versions of KVM
-- 
1.6.0.2

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

* [Qemu-devel] [PATCH 3/3] S390: Don't compile in virtio-pci
  2010-03-24 17:30 [Qemu-devel] [PATCH 0/3] Fix S390x target Alexander Graf
  2010-03-24 17:30 ` [Qemu-devel] [PATCH 1/3] S390: Add stub for cpu_get_phys_page_debug Alexander Graf
  2010-03-24 17:30 ` [Qemu-devel] [PATCH 2/3] S390: Tell user why VM creation failed Alexander Graf
@ 2010-03-24 17:30 ` Alexander Graf
  2010-03-24 18:22   ` Blue Swirl
  2 siblings, 1 reply; 8+ messages in thread
From: Alexander Graf @ 2010-03-24 17:30 UTC (permalink / raw)
  To: qemu-devel; +Cc: Carsten Otte

As soon as virtio-pci.c gets compiled and used on S390 the internal qdev magic
gets confused and tries to give us PCI devices instead of S390 virtio devices.

Since we don't have PCI on S390, we can safely not compile virtio-pci at all.

In order to do this I added a new config option "CONFIG_PCI" that I enabled
for every platform except S390. Thanks to this the change should be a complete
nop for every other platform.

If anyone feels like their platform shouldn't support PCI either, just remove
the config option. If you think we should build even less when we don't have
PCI, feel free to come up with a follow-up patch.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 Makefile.objs                          |    3 ++-
 default-configs/arm-softmmu.mak        |    1 +
 default-configs/cris-softmmu.mak       |    1 +
 default-configs/i386-softmmu.mak       |    1 +
 default-configs/m68k-softmmu.mak       |    1 +
 default-configs/microblaze-softmmu.mak |    1 +
 default-configs/mips-softmmu.mak       |    1 +
 default-configs/mips64-softmmu.mak     |    1 +
 default-configs/mips64el-softmmu.mak   |    1 +
 default-configs/mipsel-softmmu.mak     |    1 +
 default-configs/ppc-softmmu.mak        |    1 +
 default-configs/ppc64-softmmu.mak      |    1 +
 default-configs/ppcemb-softmmu.mak     |    1 +
 default-configs/sh4-softmmu.mak        |    1 +
 default-configs/sh4eb-softmmu.mak      |    1 +
 default-configs/sparc-softmmu.mak      |    1 +
 default-configs/sparc64-softmmu.mak    |    1 +
 default-configs/x86_64-softmmu.mak     |    1 +
 18 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/Makefile.objs b/Makefile.objs
index 281f7a6..a6ce4f5 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -128,7 +128,8 @@ user-obj-y += cutils.o cache-utils.o
 
 hw-obj-y =
 hw-obj-y += loader.o
-hw-obj-y += virtio.o virtio-console.o virtio-pci.o
+hw-obj-y += virtio.o virtio-console.o
+hw-obj-$(CONFIG_PCI) += virtio-pci.o
 hw-obj-y += fw_cfg.o pci.o pci_host.o pcie_host.o
 hw-obj-y += watchdog.o
 hw-obj-$(CONFIG_ISA_MMIO) += isa_mmio.o
diff --git a/default-configs/arm-softmmu.mak b/default-configs/arm-softmmu.mak
index 02ad192..a3819e1 100644
--- a/default-configs/arm-softmmu.mak
+++ b/default-configs/arm-softmmu.mak
@@ -24,3 +24,4 @@ CONFIG_SSI_SD=y
 CONFIG_LAN9118=y
 CONFIG_SMC91C111=y
 CONFIG_DS1338=y
+CONFIG_PCI=y
diff --git a/default-configs/cris-softmmu.mak b/default-configs/cris-softmmu.mak
index 8711402..9377235 100644
--- a/default-configs/cris-softmmu.mak
+++ b/default-configs/cris-softmmu.mak
@@ -2,3 +2,4 @@
 
 CONFIG_NAND=y
 CONFIG_PTIMER=y
+CONFIG_PCI=y
diff --git a/default-configs/i386-softmmu.mak b/default-configs/i386-softmmu.mak
index 4dbf656..192dcb8 100644
--- a/default-configs/i386-softmmu.mak
+++ b/default-configs/i386-softmmu.mak
@@ -16,3 +16,4 @@ CONFIG_IDE_PIIX=y
 CONFIG_NE2000_ISA=y
 CONFIG_PIIX_PCI=y
 CONFIG_SOUND=y
+CONFIG_PCI=y
diff --git a/default-configs/m68k-softmmu.mak b/default-configs/m68k-softmmu.mak
index 0a78375..07e02d6 100644
--- a/default-configs/m68k-softmmu.mak
+++ b/default-configs/m68k-softmmu.mak
@@ -2,3 +2,4 @@
 
 CONFIG_GDBSTUB_XML=y
 CONFIG_PTIMER=y
+CONFIG_PCI=y
diff --git a/default-configs/microblaze-softmmu.mak b/default-configs/microblaze-softmmu.mak
index c800c16..ddc3c15 100644
--- a/default-configs/microblaze-softmmu.mak
+++ b/default-configs/microblaze-softmmu.mak
@@ -1,3 +1,4 @@
 # Default configuration for microblaze-softmmu
 
 CONFIG_PTIMER=y
+CONFIG_PCI=y
diff --git a/default-configs/mips-softmmu.mak b/default-configs/mips-softmmu.mak
index 345a093..4598a0d 100644
--- a/default-configs/mips-softmmu.mak
+++ b/default-configs/mips-softmmu.mak
@@ -16,3 +16,4 @@ CONFIG_IDE_ISA=y
 CONFIG_IDE_PIIX=y
 CONFIG_NE2000_ISA=y
 CONFIG_SOUND=y
+CONFIG_PCI=y
diff --git a/default-configs/mips64-softmmu.mak b/default-configs/mips64-softmmu.mak
index 5900ee6..6c7f3c6 100644
--- a/default-configs/mips64-softmmu.mak
+++ b/default-configs/mips64-softmmu.mak
@@ -16,3 +16,4 @@ CONFIG_IDE_ISA=y
 CONFIG_IDE_PIIX=y
 CONFIG_NE2000_ISA=y
 CONFIG_SOUND=y
+CONFIG_PCI=y
diff --git a/default-configs/mips64el-softmmu.mak b/default-configs/mips64el-softmmu.mak
index 3e1ba93..2dcac82 100644
--- a/default-configs/mips64el-softmmu.mak
+++ b/default-configs/mips64el-softmmu.mak
@@ -16,3 +16,4 @@ CONFIG_IDE_ISA=y
 CONFIG_IDE_PIIX=y
 CONFIG_NE2000_ISA=y
 CONFIG_SOUND=y
+CONFIG_PCI=y
diff --git a/default-configs/mipsel-softmmu.mak b/default-configs/mipsel-softmmu.mak
index 17b83d0..e3e3878 100644
--- a/default-configs/mipsel-softmmu.mak
+++ b/default-configs/mipsel-softmmu.mak
@@ -16,3 +16,4 @@ CONFIG_IDE_ISA=y
 CONFIG_IDE_PIIX=y
 CONFIG_NE2000_ISA=y
 CONFIG_SOUND=y
+CONFIG_PCI=y
diff --git a/default-configs/ppc-softmmu.mak b/default-configs/ppc-softmmu.mak
index 5fe591c..50932fa 100644
--- a/default-configs/ppc-softmmu.mak
+++ b/default-configs/ppc-softmmu.mak
@@ -15,3 +15,4 @@ CONFIG_IDE_ISA=y
 CONFIG_IDE_CMD646=y
 CONFIG_NE2000_ISA=y
 CONFIG_SOUND=y
+CONFIG_PCI=y
diff --git a/default-configs/ppc64-softmmu.mak b/default-configs/ppc64-softmmu.mak
index fe05073..7215e16 100644
--- a/default-configs/ppc64-softmmu.mak
+++ b/default-configs/ppc64-softmmu.mak
@@ -15,3 +15,4 @@ CONFIG_IDE_ISA=y
 CONFIG_IDE_CMD646=y
 CONFIG_NE2000_ISA=y
 CONFIG_SOUND=y
+CONFIG_PCI=y
diff --git a/default-configs/ppcemb-softmmu.mak b/default-configs/ppcemb-softmmu.mak
index 54fcef1..b6ee6d0 100644
--- a/default-configs/ppcemb-softmmu.mak
+++ b/default-configs/ppcemb-softmmu.mak
@@ -15,3 +15,4 @@ CONFIG_IDE_ISA=y
 CONFIG_IDE_CMD646=y
 CONFIG_NE2000_ISA=y
 CONFIG_SOUND=y
+CONFIG_PCI=y
diff --git a/default-configs/sh4-softmmu.mak b/default-configs/sh4-softmmu.mak
index 79a4195..f82cb33 100644
--- a/default-configs/sh4-softmmu.mak
+++ b/default-configs/sh4-softmmu.mak
@@ -3,3 +3,4 @@
 CONFIG_USB_OHCI=y
 CONFIG_SERIAL=y
 CONFIG_PTIMER=y
+CONFIG_PCI=y
diff --git a/default-configs/sh4eb-softmmu.mak b/default-configs/sh4eb-softmmu.mak
index 73af23b..164d0ae 100644
--- a/default-configs/sh4eb-softmmu.mak
+++ b/default-configs/sh4eb-softmmu.mak
@@ -3,3 +3,4 @@
 CONFIG_USB_OHCI=y
 CONFIG_SERIAL=y
 CONFIG_PTIMER=y
+CONFIG_PCI=y
diff --git a/default-configs/sparc-softmmu.mak b/default-configs/sparc-softmmu.mak
index 09c0853..031a8e4 100644
--- a/default-configs/sparc-softmmu.mak
+++ b/default-configs/sparc-softmmu.mak
@@ -7,3 +7,4 @@ CONFIG_ESCC=y
 CONFIG_M48T59=y
 CONFIG_PTIMER=y
 CONFIG_FDC=y
+CONFIG_PCI=y
diff --git a/default-configs/sparc64-softmmu.mak b/default-configs/sparc64-softmmu.mak
index 14aab35..c779da0 100644
--- a/default-configs/sparc64-softmmu.mak
+++ b/default-configs/sparc64-softmmu.mak
@@ -11,3 +11,4 @@ CONFIG_IDE_QDEV=y
 CONFIG_IDE_PCI=y
 CONFIG_IDE_ISA=y
 CONFIG_IDE_CMD646=y
+CONFIG_PCI=y
diff --git a/default-configs/x86_64-softmmu.mak b/default-configs/x86_64-softmmu.mak
index a9992af..054b16b 100644
--- a/default-configs/x86_64-softmmu.mak
+++ b/default-configs/x86_64-softmmu.mak
@@ -16,3 +16,4 @@ CONFIG_IDE_PIIX=y
 CONFIG_NE2000_ISA=y
 CONFIG_PIIX_PCI=y
 CONFIG_SOUND=y
+CONFIG_PCI=y
-- 
1.6.0.2

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

* Re: [Qemu-devel] [PATCH 3/3] S390: Don't compile in virtio-pci
  2010-03-24 17:30 ` [Qemu-devel] [PATCH 3/3] S390: Don't compile in virtio-pci Alexander Graf
@ 2010-03-24 18:22   ` Blue Swirl
  2010-03-24 18:24     ` Alexander Graf
  0 siblings, 1 reply; 8+ messages in thread
From: Blue Swirl @ 2010-03-24 18:22 UTC (permalink / raw)
  To: Alexander Graf; +Cc: Carsten Otte, qemu-devel

On 3/24/10, Alexander Graf <agraf@suse.de> wrote:
> As soon as virtio-pci.c gets compiled and used on S390 the internal qdev magic
>  gets confused and tries to give us PCI devices instead of S390 virtio devices.
>
>  Since we don't have PCI on S390, we can safely not compile virtio-pci at all.
>
>  In order to do this I added a new config option "CONFIG_PCI" that I enabled
>  for every platform except S390. Thanks to this the change should be a complete
>  nop for every other platform.

The name should be CONFIG_VIRTIO_PCI, CONFIG_PCI would enable
compilation of pci.c.

>  If anyone feels like their platform shouldn't support PCI either, just remove
>  the config option. If you think we should build even less when we don't have
>  PCI, feel free to come up with a follow-up patch.

None of the currently supported Sparc32 boards have PCI. There are
some real devices with PCI (JavaStations) though.

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

* Re: [Qemu-devel] [PATCH 3/3] S390: Don't compile in virtio-pci
  2010-03-24 18:22   ` Blue Swirl
@ 2010-03-24 18:24     ` Alexander Graf
  2010-03-24 19:17       ` Blue Swirl
  0 siblings, 1 reply; 8+ messages in thread
From: Alexander Graf @ 2010-03-24 18:24 UTC (permalink / raw)
  To: Blue Swirl; +Cc: Carsten Otte, qemu-devel

Blue Swirl wrote:
> On 3/24/10, Alexander Graf <agraf@suse.de> wrote:
>   
>> As soon as virtio-pci.c gets compiled and used on S390 the internal qdev magic
>>  gets confused and tries to give us PCI devices instead of S390 virtio devices.
>>
>>  Since we don't have PCI on S390, we can safely not compile virtio-pci at all.
>>
>>  In order to do this I added a new config option "CONFIG_PCI" that I enabled
>>  for every platform except S390. Thanks to this the change should be a complete
>>  nop for every other platform.
>>     
>
> The name should be CONFIG_VIRTIO_PCI, CONFIG_PCI would enable
> compilation of pci.c.
>   

My idea was to keep the config option generic and rip out all PCI stuff
from s390x-softmmu. We don't even do MMIO :-).

Alex

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

* Re: [Qemu-devel] [PATCH 3/3] S390: Don't compile in virtio-pci
  2010-03-24 18:24     ` Alexander Graf
@ 2010-03-24 19:17       ` Blue Swirl
  0 siblings, 0 replies; 8+ messages in thread
From: Blue Swirl @ 2010-03-24 19:17 UTC (permalink / raw)
  To: Alexander Graf; +Cc: Carsten Otte, qemu-devel

On 3/24/10, Alexander Graf <agraf@suse.de> wrote:
> Blue Swirl wrote:
>  > On 3/24/10, Alexander Graf <agraf@suse.de> wrote:
>  >
>  >> As soon as virtio-pci.c gets compiled and used on S390 the internal qdev magic
>  >>  gets confused and tries to give us PCI devices instead of S390 virtio devices.
>  >>
>  >>  Since we don't have PCI on S390, we can safely not compile virtio-pci at all.
>  >>
>  >>  In order to do this I added a new config option "CONFIG_PCI" that I enabled
>  >>  for every platform except S390. Thanks to this the change should be a complete
>  >>  nop for every other platform.
>  >>
>  >
>  > The name should be CONFIG_VIRTIO_PCI, CONFIG_PCI would enable
>  > compilation of pci.c.
>  >
>
>
> My idea was to keep the config option generic and rip out all PCI stuff
>  from s390x-softmmu. We don't even do MMIO :-).

In that case you should also rip out all PCI cards.

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

* [Qemu-devel] [PATCH 2/3] S390: Tell user why VM creation failed
  2010-03-25 13:58 [Qemu-devel] [PATCH 0/3] Fix S390x target v2 Alexander Graf
@ 2010-03-25 13:59 ` Alexander Graf
  0 siblings, 0 replies; 8+ messages in thread
From: Alexander Graf @ 2010-03-25 13:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: blauwirbel, cotte, waldi

The KVM kernel module on S390 refuses to create a VM when the switch_amode
kernel parameter is not used.

Since that is not exactly obvious, let's give the user a nice warning.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 kvm-all.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/kvm-all.c b/kvm-all.c
index 534ead0..acf7e31 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -609,8 +609,13 @@ int kvm_init(int smp_cpus)
     }
 
     s->vmfd = kvm_ioctl(s, KVM_CREATE_VM, 0);
-    if (s->vmfd < 0)
+    if (s->vmfd < 0) {
+#ifdef TARGET_S390X
+        fprintf(stderr, "Please add the 'switch_amode' kernel parameter to "
+                        "your host kernel command line\n");
+#endif
         goto err;
+    }
 
     /* initially, KVM allocated its own memory and we had to jump through
      * hooks to make phys_ram_base point to this.  Modern versions of KVM
-- 
1.6.0.2

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

end of thread, other threads:[~2010-03-25 13:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-24 17:30 [Qemu-devel] [PATCH 0/3] Fix S390x target Alexander Graf
2010-03-24 17:30 ` [Qemu-devel] [PATCH 1/3] S390: Add stub for cpu_get_phys_page_debug Alexander Graf
2010-03-24 17:30 ` [Qemu-devel] [PATCH 2/3] S390: Tell user why VM creation failed Alexander Graf
2010-03-24 17:30 ` [Qemu-devel] [PATCH 3/3] S390: Don't compile in virtio-pci Alexander Graf
2010-03-24 18:22   ` Blue Swirl
2010-03-24 18:24     ` Alexander Graf
2010-03-24 19:17       ` Blue Swirl
  -- strict thread matches above, loose matches on Subject: below --
2010-03-25 13:58 [Qemu-devel] [PATCH 0/3] Fix S390x target v2 Alexander Graf
2010-03-25 13:59 ` [Qemu-devel] [PATCH 2/3] S390: Tell user why VM creation failed Alexander Graf

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).