From: Reinoud Zandijk <reinoud@NetBSD.org>
To: qemu-devel@nongnu.org
Subject: RFC Qemu mipssim patches
Date: Thu, 11 Feb 2021 16:37:46 +0100 [thread overview]
Message-ID: <20210211153746.GA25676@dropje.13thmonkey.org> (raw)
[-- 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)
next reply other threads:[~2021-02-11 15:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-11 15:37 Reinoud Zandijk [this message]
2021-02-12 0:13 ` RFC Qemu mipssim patches 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é
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210211153746.GA25676@dropje.13thmonkey.org \
--to=reinoud@netbsd.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).