qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* RFC Qemu mipssim patches
@ 2021-02-11 15:37 Reinoud Zandijk
  2021-02-12  0:13 ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 7+ messages in thread
From: Reinoud Zandijk @ 2021-02-11 15:37 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 355 bytes --]

Hi,

i'd like to get the following simple patches to the MIPS/mipssim target adding
virtio-mmio devices to it. This makes the target a lot more usefull as microvm
for kernel developement. It currently lives in our qemu extensions patches and
we have a working kernel that supports all virtio devices for it.

Thoughts?

Reinoud Zandijk, NetBSD developer


[-- Attachment #2: patch-hw-mips-Kconfig --]
[-- Type: text/plain, Size: 236 bytes --]

$NetBSD$

--- hw/mips/Kconfig.orig	2020-08-11 19:17:15.000000000 +0000
+++ hw/mips/Kconfig
@@ -20,6 +20,7 @@ config MIPSSIM
     select ISA_BUS
     select SERIAL_ISA
     select MIPSNET
+    select VIRTIO_MMIO
 
 config JAZZ
     bool

[-- Attachment #3: patch-hw-mips-mipssim.c --]
[-- Type: text/x-c, Size: 888 bytes --]

$NetBSD$

--- hw/mips/mipssim.c.orig	2020-08-11 19:17:15.000000000 +0000
+++ hw/mips/mipssim.c
@@ -45,6 +45,7 @@
 #include "qemu/error-report.h"
 #include "sysemu/qtest.h"
 #include "sysemu/reset.h"
+#include "hw/virtio/virtio-mmio.h"
 
 static struct _loaderparams {
     int ram_size;
@@ -229,6 +230,16 @@ mips_mipssim_init(MachineState *machine)
     if (nd_table[0].used)
         /* MIPSnet uses the MIPS CPU INT0, which is interrupt 2. */
         mipsnet_init(0x4200, env->irq[2], &nd_table[0]);
+
+    /*
+     * virtio extention; register 32 virtio devices just after the ISA space
+     * at 0x1fd10000 with strave of 512 bytes as per i386s microvm target.
+     */
+    for (int i = 0; i < 32; i++) {
+        sysbus_create_simple("virtio-mmio",
+            0x1fd10000 + i * 512,
+            env->irq[3]);
+    }
 }
 
 static void mips_mipssim_machine_init(MachineClass *mc)

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

end of thread, other threads:[~2021-02-15  7:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-11 15:37 RFC Qemu mipssim patches Reinoud Zandijk
2021-02-12  0:13 ` Philippe Mathieu-Daudé
2021-02-12  9:44   ` Philippe Mathieu-Daudé
2021-02-13 10:05     ` Qemu mipssim patches, mips malta and virtio bugs Reinoud Zandijk
2021-02-13 13:14       ` Philippe Mathieu-Daudé
2021-02-15  6:39         ` Thomas Huth
2021-02-15  7:56           ` Philippe Mathieu-Daudé

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