Skip to contentSkip to conversation

Target-agnostic virtio?

Qemu-devel Rob Landley 5 participants 16 messages Mar 26, 2013 – May 3, 2013

lore
Share & tools
lore
#0 lore raw

Can the virtio things (serial, network, block, virtfs) be used on arbitrary targets yet? I.E. Can I use a virtio network device on arm, mips, powerpc, sparc... (And can the virtio serial console hook up to qemu's stdin/stdout in -nographic mode yet?)

I asked this in 2010 and the answer at the time was "no". Still not entirely sure why.

Rob

#1 lore raw
Quoted 7 lines · Rob Landley

Can the virtio things (serial, network, block, virtfs) be used on arbitrary targets yet? I.E. Can I use a virtio network device on arm, mips, powerpc, sparc... (And can the virtio serial console hook up to qemu's stdin/stdout in -nographic mode yet?)

I asked this in 2010 and the answer at the time was "no". Still not entirely sure why.

Yes, so long as the machine description has a supported bus, e.g. pci. It took almost nothing to hook up virtio-pci to alpha.

r~

#2 lore raw
Quoted 11 lines · Richard Henderson
Quoted 7 lines · Rob Landley

Can the virtio things (serial, network, block, virtfs) be used on arbitrary targets yet? I.E. Can I use a virtio network device on arm, mips, powerpc, sparc... (And can the virtio serial console hook up to qemu's stdin/stdout in -nographic mode yet?)

I asked this in 2010 and the answer at the time was "no". Still not entirely sure why.

Yes, so long as the machine description has a supported bus, e.g. pci. It took almost nothing to hook up virtio-pci to alpha.

I'm out of date: did Alpha get the ability to boot linux on an emulated board? (I'd like to play with it, if so.)

I periodically google for it, but it comes up with stuff like this:

http://stackoverflow.com/questions/10938216/install-an-os-of-alpha-architecture-in-qemu

If so, is there an example image or kernel .config, and corresponding qemu command line you could point me at?

The stuff on http://wiki.qemu.org/Testing is mostly way behind my own images at
http://landley.net/aboriginal (which I hope to have updated to 3.8 in the next day or so), but I just checked again and there's no Alpha image there either...

Rob

#3 lore raw
In reply to Rob Landley
Quoted 3 lines · Rob Landley

Can the virtio things (serial, network, block, virtfs) be used on arbitrary targets yet? I.E. Can I use a virtio network device on arm, mips, powerpc, sparc...

Yes. Moreover, for sparc64 the virtio network is currently the only way to have a network under Linux guest (and a virtio block is the only to have a disk under Linux guest).

Signature · 5 lines
Regards,
Artyom Tarasenko

Linux/sparc and solaris/sparc under qemu blog:
http://tyom.blogspot.com/search/label/qemu
#4 lore raw
Quoted 10 lines · Artyom Tarasenko
Quoted 1 line · Rob Landley

Can the virtio things (serial, network, block, virtfs) be used on

arbitrary

Quoted 1 line

targets yet? I.E. Can I use a virtio network device on arm, mips,

powerpc,

Quoted 1 line

sparc...

Yes. Moreover, for sparc64 the virtio network is currently the only way to have a network under Linux guest (and a virtio block is the only to have a disk under Linux guest).

Do you have an example kernel .config and qemu command line showing how to use virtio for those? (Or a working sparc64 image you can point me to?)

Thanks,

Rob

#5 lore raw
Quoted 9 lines · Rob Landley
Quoted 8 lines · Artyom Tarasenko
Quoted 5 lines · Rob Landley

Can the virtio things (serial, network, block, virtfs) be used on arbitrary
targets yet? I.E. Can I use a virtio network device on arm, mips, powerpc,
sparc...

Quoted 7 lines
Quoted 3 lines

Yes. Moreover, for sparc64 the virtio network is currently the only way to have a network under Linux guest (and a virtio block is the only to have a disk under Linux guest).

Do you have an example kernel .config and qemu command line showing how to use virtio for those? (Or a working sparc64 image you can point me to?)

Yes. Will send it to you as I get to my home machine. Can you make them available on your site?
I have a Debian Wheezy RC1 / SPARC64 How-To, it would be nice to link to the .config and kernel, so people would be able to install it just by a few clicks.

Artyom

--
Regards,
Artyom Tarasenko

linux/sparc and solaris/sparc under qemu blog:
http://tyom.blogspot.com/search/label/qemu

#6 lore raw
Quoted 5 lines · Artyom Tarasenko
Quoted 2 lines

Do you have an example kernel .config and qemu command line showing how to use virtio for those? (Or a working sparc64 image you can point me to?)

Yes. Will send it to you as I get to my home machine. Can you make them available on your site?

Note that there is a section of test kernel images on the QEMU site at http://wiki.qemu.org/Testing, so if you could upload it to there that would be great :)

Quoted 3 lines

I have a Debian Wheezy RC1 / SPARC64 How-To, it would be nice to link to the .config and kernel, so people would be able to install it just by a few clicks.

This is very interesting - could you post a link to the how-to?

ATB,

Mark.

#7 lore raw
Quoted 7 lines · Mark Cave-Ayland
Quoted 5 lines · Artyom Tarasenko
Quoted 3 lines

Do you have an example kernel .config and qemu command line showing how to
use virtio for those? (Or a working sparc64 image you can point me to?)

Quoted 7 lines
Quoted 2 lines

Yes. Will send it to you as I get to my home machine. Can you make them available on your site?

Note that there is a section of test kernel images on the QEMU site at
http://wiki.qemu.org/Testing, so if you could upload it to there that would be great :)

I don't see how to upload files. Can only edit the page.

Quoted 6 lines
Quoted 3 lines

I have a Debian Wheezy RC1 / SPARC64 How-To, it would be nice to link to the .config and kernel, so people would be able to install it just by a few clicks.

This is very interesting - could you post a link to the how-to?

I temporarily put it offline till I find a hosting for the kernel. For some reason the standard Wheezy/sparc64 kernel is not stable under QEMU.
Stay tuned. :)

Artyom

--
Regards,
Artyom Tarasenko

linux/sparc and solaris/sparc under qemu blog:
http://tyom.blogspot.com/search/label/qemu

#8 lore raw
Quoted 16 lines · Artyom Tarasenko
Quoted 3 lines · Mark Cave-Ayland
Quoted 1 line · Artyom Tarasenko
Quoted 1 line

Do you have an example kernel .config and qemu command line

showing how

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

to
use virtio for those? (Or a working sparc64 image you can point

me to?)

Quoted 3 lines
Quoted 3 lines

Yes. Will send it to you as I get to my home machine. Can you make

them

Quoted 3 lines
Quoted 1 line

available on your site?

Quoted 7 lines
Quoted 1 line

Note that there is a section of test kernel images on the QEMU site

at

Quoted 1 line

http://wiki.qemu.org/Testing, so if you could upload it to there

that would

Quoted 1 line

be great :)

I don't see how to upload files. Can only edit the page.

I've got build scripts that reproducibly create bootable system images (with native compilers capable of building linux from scratch) for several different variants of arm, mips, ppc32, sparc32, sh4, x86, and x86-64. (It also builds m68k that runs under aranym but not qemu.)

http://landley.net/aboriginal/about.html

Basically go to http://landley.net/aboriginal/bin and grab a system-image-*.tar.bz2 and ./run-emulator.sh in there. If you want an extracted root-filesystem-*.tar.bz2 that's in there too, and the various config files used to make it should be in /usr/src under there.

If you want to build from source, grab the http://landley.net/aboriginal/downloads most recent tarball, extract it, and "./build.sh sparc" or similar. (If it breaks, tell me. I collect reproducible bug reports.)

I put out a new release about each time a kernel comes out. I don't announce 'em here because I didn't think you were interested...

Quoted 11 lines
Quoted 1 line
Quoted 1 line

I have a Debian Wheezy RC1 / SPARC64 How-To, it would be nice to

link to

Quoted 1 line
Quoted 1 line

the .config and kernel, so people would be able to install it just

by

Quoted 3 lines
Quoted 1 line

a few clicks.

This is very interesting - could you post a link to the how-to?

I temporarily put it offline till I find a hosting for the kernel. For some reason the standard Wheezy/sparc64 kernel is not stable under QEMU.

How is your kernel nonstandard, and what's the instability? I booted the one you sent me but it went:

netconsole: network logging started
VFS: Cannot open root device "vda1" or unknown-block(253,1): error -6 Please append a correct "root=" boot option; here are the available partitions:
fd00 28212 vda driver: virtio_blk

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(253,1)
Call Trace:

Probably because the sparc root filesystem I have lying around is squashfs. I can rebuild with ext2 but not on my lunch break. (I cleaned out the build dir so it has to build the cross toolchains first, underpowered netbook, takes a while...)

I have various patches I need to apply to get stuff to work at
http://landley.net/hg/aboriginal/file/tip/sources/patches and am always working out more. (I push them upstream when I can, but the maintainers aren't always interested.)

(Currently the project is migrating from uClibc to musl libc, in part because I can fish target support out of klibc and apply it to musl in a way I can't for uClibc, so I can _finally_ get s390 and such to work... But day job and my other projects eat lots of time so it goes slowly...)

Rob

#9 lore raw
In reply to Artyom Tarasenko
Quoted 16 lines · Artyom Tarasenko
Quoted 3 lines · Rob Landley
Quoted 2 lines · Artyom Tarasenko

On Tue, Mar 26, 2013 at 1:52 AM, Rob Landley <[email protected]>

Quoted 11 lines · wrote:
Quoted 9 lines
Quoted 5 lines

Can the virtio things (serial, network, block, virtfs) be used on arbitrary
targets yet? I.E. Can I use a virtio network device on arm, mips, powerpc,
sparc...

Yes. Moreover, for sparc64 the virtio network is currently the only way to have a network under Linux guest (and a virtio block is the only to have a disk under Linux guest).

Quoted 7 lines
Quoted 1 line

Do you have an example kernel .config and qemu command line showing

how to

Quoted 1 line

use virtio for those? (Or a working sparc64 image you can point me

to?)

Yes. Will send it to you as I get to my home machine. Can you make them available on your site?

I plan to add a sparc64 target built from source to Aboriginal Linux.

For a lot of the 64-bit targets, actual 64 bit userspace support is strangely lacking. For ppc64 they say to use ppc32, and I've been told that about sparc64 as well. I don't know if this is an optimization or a requirement. I have a 32 bit image, I'd like to test the 64 bit codepaths as well...

Quoted 3 lines

I have a Debian Wheezy RC1 / SPARC64 How-To, it would be nice to link to the .config and kernel, so people would be able to install it just by a few clicks.

I have http://landley.net/aboriginal/about.html

Rob

#10 lore raw
Quoted 26 lines · Rob Landley
Quoted 17 lines · Artyom Tarasenko
Quoted 15 lines · Rob Landley
Quoted 11 lines · Artyom Tarasenko
Quoted 5 lines · Rob Landley

Can the virtio things (serial, network, block, virtfs) be used on arbitrary
targets yet? I.E. Can I use a virtio network device on arm, mips, powerpc,
sparc...

Yes. Moreover, for sparc64 the virtio network is currently the only way to have a network under Linux guest (and a virtio block is the only to have a disk under Linux guest).

Quoted 6 lines
Quoted 3 lines

Do you have an example kernel .config and qemu command line showing how to
use virtio for those? (Or a working sparc64 image you can point me to?)

Yes. Will send it to you as I get to my home machine. Can you make them available on your site?

Quoted 7 lines

I plan to add a sparc64 target built from source to Aboriginal Linux.

For a lot of the 64-bit targets, actual 64 bit userspace support is strangely lacking. For ppc64 they say to use ppc32, and I've been told that about sparc64 as well. I don't know if this is an optimization or a requirement. I have a 32 bit image, I'd like to test the 64 bit codepaths as well...

It's a sort of optimization, the pointers are smaller. OpenBSD/sparc64 takes a different approach, every binary is 64 bits. Would it be hard to make Aboriginal *BSD? ;-)

Quoted 11 lines
Quoted 5 lines

I have a Debian Wheezy RC1 / SPARC64 How-To, it would be nice to link to the .config and kernel, so people would be able to install it just by a few clicks.

I have http://landley.net/aboriginal/about.html

Rob

#11 lore raw
Quoted 6 lines · Blue Swirl
Quoted 1 line

I plan to add a sparc64 target built from source to Aboriginal

Linux.

Quoted 3 lines

For a lot of the 64-bit targets, actual 64 bit userspace support is strangely lacking. For ppc64 they say to use ppc32, and I've been

told that

Quoted 8 lines
Quoted 2 lines

about sparc64 as well. I don't know if this is an optimization or a requirement. I have a 32 bit image, I'd like to test the 64 bit

codepaths as

Quoted 1 line

well...

It's a sort of optimization, the pointers are smaller. OpenBSD/sparc64 takes a different approach, every binary is 64 bits. Would it be hard to make Aboriginal *BSD? ;-)

Not _that_ hard, but I'm not sure it's interesting?

Aboriginal Linux is basically 7 packages: linux, gcc, binutils, uClibc, make, bash, and busybox. (I also add distcc so the native toolchain can move some of the heavy lifting of compilation outside the emulator, but that's optional.)

This is the smallest system capable of not only rebuilding itself under itself, but building Linux From Scratch under the result (and thus natively bootstrapping up to an arbitrary set of packages).

I'm gradually replacing busybox with toybox, and I'm migrating from uClibc to musl. I vaguely plan to read the various klibc arch support bits to add new architectures to musl, but my day job doesn't have anything to do with my hobby programming so there's a chronic shortage of time, and toybox 1.0 is my priority right now for reasons I blatered at length about at ELC a month or so back (http://youtu.be/SGmtP5Lg_t0).

In theory swapping in a bsd kernel and libc, and beating the toolchain into accepting it, might not be too hard. But what I'm more likely to do is try to add sparc64 support to musl and convince the toolchain it's just going to have to cope with the idea of a 64 bit sparc userspace.

Rob

#12 lore raw
In reply to Rob Landley
Quoted 17 lines · Rob Landley
Quoted 16 lines · Artyom Tarasenko
Quoted 14 lines · Rob Landley
Quoted 11 lines · Artyom Tarasenko
Quoted 5 lines · Rob Landley

Can the virtio things (serial, network, block, virtfs) be used on arbitrary
targets yet? I.E. Can I use a virtio network device on arm, mips, powerpc,
sparc...

Yes. Moreover, for sparc64 the virtio network is currently the only way to have a network under Linux guest (and a virtio block is the only to have a disk under Linux guest).

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

Do you have an example kernel .config and qemu command line showing how to
use virtio for those? (Or a working sparc64 image you can point me to?)

Yes. Will send it to you as I get to my home machine. Can you make them available on your site?

I plan to add a sparc64 target built from source to Aboriginal Linux.

Good to hear that. The more use/test cases, the less bugs! Actually I was asking whether you would host a non-Aboriginal, foreign Debian kernel.
But never mind, I figured it's better to fix QEMU to be able use a vanilla Debian kernel
instead of building custom kernels. :-)

So if you have more than one PCI / virtio device in your qemu-system-sparc64 setup, you
may want to update your QEMU to today's git master.

Quoted 5 lines

For a lot of the 64-bit targets, actual 64 bit userspace support is strangely lacking. For ppc64 they say to use ppc32, and I've been told that about sparc64 as well. I don't know if this is an optimization or a requirement. I have a 32 bit image, I'd like to test the 64 bit codepaths as well...

I guess it's rather an optimisation. At least I saw BusyBox working under QEMU before the sparc v8plus was fixed.

Artyom

--
Regards,
Artyom Tarasenko

linux/sparc and solaris/sparc under qemu blog:
http://tyom.blogspot.com/search/label/qemu

#13 lore raw
Quoted 10 lines · Artyom Tarasenko
Quoted 2 lines

For a lot of the 64-bit targets, actual 64 bit userspace support is strangely lacking. For ppc64 they say to use ppc32, and I've been

told that

Quoted 2 lines

about sparc64 as well. I don't know if this is an optimization or a requirement. I have a 32 bit image, I'd like to test the 64 bit

codepaths as

Quoted 1 line

well...

I guess it's rather an optimisation. At least I saw BusyBox working under QEMU before the sparc v8plus was fixed.

If you mean http://busybox.net/downloads/binaries/busybox-sparc that's a 32-bit binary output from the Aboriginal Linux build. (I try to upload new ones each time Denys has a release, but I'm buried in todo items and don't always get to it. Right now I need to clean up and repost the inittmpfs patches for 3.9...)

Rob

#14 lore raw
Quoted 10 lines · Rob Landley
Quoted 9 lines · Artyom Tarasenko
Quoted 8 lines

For a lot of the 64-bit targets, actual 64 bit userspace support is strangely lacking. For ppc64 they say to use ppc32, and I've been told that
about sparc64 as well. I don't know if this is an optimization or a requirement. I have a 32 bit image, I'd like to test the 64 bit codepaths as
well...

Quoted 6 lines
Quoted 2 lines

I guess it's rather an optimisation. At least I saw BusyBox working under QEMU before the sparc v8plus was fixed.

If you mean http://busybox.net/downloads/binaries/busybox-sparc that's a 32-bit binary output from the Aboriginal Linux build.

No, I mean busybox-static_1.18.4-2_sparc64.deb from the older Debian distribution.
Meanwhile it's 1.20,
http://ftp.debian-ports.org/debian/pool-sparc64/main/b/busybox/busybox-static_1.20.0-8_sparc64.deb
but I only experimented with 1.18. Back then it was definitely a pure 64 bit application:

$  file busybox
busybox: ELF 64-bit MSB executable, SPARC V9, Sun UltraSPARC1
Extensions Required, relaxed memory ordering, version 1 (SYSV),
statically linked, for GNU/Linux 2.6.18, stripped

HTH,
Artyom

--
Regards,
Artyom Tarasenko

linux/sparc and solaris/sparc under qemu blog:
http://tyom.blogspot.com/search/label/qemu

#15 lore raw
Quoted 21 lines · Artyom Tarasenko
Quoted 3 lines · Rob Landley
Quoted 2 lines · Artyom Tarasenko
Quoted 2 lines

For a lot of the 64-bit targets, actual 64 bit userspace support

is

Quoted 1 line
Quoted 1 line
Quoted 1 line

strangely lacking. For ppc64 they say to use ppc32, and I've

been told

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

that
about sparc64 as well. I don't know if this is an optimization

or a

Quoted 5 lines
Quoted 5 lines
Quoted 3 lines

requirement. I have a 32 bit image, I'd like to test the 64 bit codepaths as
well...

I guess it's rather an optimisation. At least I saw BusyBox

working under

Quoted 4 lines
Quoted 1 line

QEMU before the sparc v8plus was fixed.

If you mean http://busybox.net/downloads/binaries/busybox-sparc

that's a

Quoted 8 lines
Quoted 1 line

32-bit binary output from the Aboriginal Linux build.

No, I mean busybox-static_1.18.4-2_sparc64.deb from the older Debian distribution.
Meanwhile it's 1.20,
http://ftp.debian-ports.org/debian/pool-sparc64/main/b/busybox/busybox-static_1.20.0-8_sparc64.deb
but I only experimented with 1.18. Back then it was definitely a pure 64 bit application:

let's see, wget the 1.20 version, dpkg-deb -X busybox-static* sparky, strings sparky/bin/busybox | grep -i libc...

Statically linked against glibc 2.13. Still, good test for at least the application emulation side of things.

I hit the limits of platform support I could beat out of uClibc a few years back, and these days I'm poking at musl. (It doesn't support much yet, but it's a _lot_ easier to add new targets and klibc provides bsd-licensed templates for most of them.) I need to reproduce the existing uClibc targets I'm using so I can wean my project off of that package before worrying too much about new stuff though. :)

Thanks,

Rob