• Running mipsel guest under libvirt/qemu

    From Christoph Biedl@21:1/5 to All on Mon Jun 5 14:20:01 2017
    Hello,

    in a desperate attempt to understand #852962, thus salvaging ycmd and youcompleteme for stretch, I tried to set up an emulated mipsel machine
    using libvirt/qemu, and failed horribly. There are tons of documents
    out there, many years old, contradicting, not helping.

    So: Is this feasible at all? I could use a pointer then.

    So far: Create a virtual machine, with installer CD and virtual disk.
    Then libvirt needs a patch by Aurilien[1][2]. Then libvirt complains
    about mips_bios.bin although some pages[3] state this was no
    longer required. Providing a dummy image, the machine starts, but shows
    just a blank screen and qemu eats 100% CPU. Then booting via "Direct
    kernel boot", ditto. I've tried several "console=" parameters, no
    avail. Perhaps libvirt plays tricks on me, wasn't the first time.

    It *is* possible to start qemu-system-mipsel directly, with an
    additional '-serial stdio' parameter, but for reasons I'd really like to control the machine using libvirt, and I fail to see how to fiddle the
    kernel console into the libvirt terminal.

    - What did I miss?
    - How comes appearently nobody encounters such issues?

    Christoph

    [1] https://www.redhat.com/archives/libvir-list/2016-May/msg00197.html
    [2] Which for whatever reason this did not make it into stretch
    [3] https://www.linux-mips.org/wiki/QEMU#MIPS_BIOS_not_found_on_startup

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1

    iQIcBAEBCgAGBQJZNTw1AAoJEMQsWOtZFJL9wVQP/jJ3ffatyVmDHfZ3pOyjguTG wP6STXTPAdB/jXuZzCZc72ASVlCOQvl71Vnq1zS4F1wh5YAVkyi4+sfQq/4QzN3t +ZodZUhyBvwFAng0I0YRDE4XYKNsHXQBPoxCgalnvrv0vg1bz1/4JjUChF2DLOAo VsRF4+WgPAxEFOM65gftoJwV8xGviAAI7MEnjjnV/UTIC91x9AF9wjIyDo7UbS6I 4xYfzuRlETzh3yGzx682EZ8KAY1afH1nHtGYFm1iNhs0lenAgLx/l4+3Q4iVR3Hy JtMmkNFlteoqWL2eD1rrGPDzbJpeZoDsDlXfUuZN72PbZTgDsqO0xex/IejP2QAH 8Y9hQdgz6TTFfjDKV7J9PKQKcYQR1u1cw9csGtBJ8rfIY54FkF050piMeb/8O4sm 4VgOvhT7gxEoSu6sCYARzgjfficTaSpbyjtALAy/DFL1Q4WJjvuiNuBjzcwBfaIG 7gessY8IHhAcfc20/OPXY7j8IJAHl6izb+mlBU/HX+gTXt65SAYmk4lBA3BbC/Ce JZVG6tl8uzRq7A3Gu+HDe7DI1LUIqGjmGdDhewvXVG02z88949q0941oBWEktD57 KD6eaWFCsr1M309o0Rh9VTH6Ou8oHlrflLwkj7mhRjnSLK5Ipa6XK18hKlmKPT7l eio90kERk+G4L97wmIkr
    =DKYy
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Christoph Biedl@21:1/5 to All on Mon Jun 5 20:30:01 2017
    James Cowgill wrote...

    I remember trying to use libvirt some time ago on mips and having to
    manually specify the base address of the serial port on malta. I found
    this config file but its a few years old so it might not work anymore.

    Thanks. Adding

    <serial type='pty'>
    <target port='0'/>
    <address type='isa' iobase='0x3f8' irq='0x4'/>
    </serial>
    <console type='pty'>
    <target type='serial' port='0'/>
    <address type='isa' iobase='0x3f8' irq='0x4'/>
    </console>

    using "virsh edit" provides a working a serial console. Aside, adding a
    speed like "console=ttyS0,115200" makes the installation a bit more
    smooth.

    I expect there are very few users of qemu-mipsel with libvirt. Some of
    the issues you've encountered may be genuine bugs.

    Indeed. Now I'm stuck at network configuration. virtio-net isn't
    properly detected, and e1000 results in kernel errors.

    The quest continues ...

    Christoph

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1

    iQIcBAEBCgAGBQJZNZRcAAoJEMQsWOtZFJL9/NQP/3V+sVXunlCw2Q8riM0fCwvu UGSXqw6TaC9j3/T9siHSB/b4NrW7RP8vBhVomRLUI0DYL066NUyE9EemX3wl5jEW WDfTOLA2Z8e+0vO3e+btPI4AyGMjotZpjZuUarLivjgTBRfDejN9c0iyrR9eFCdE FqlJ7MoYxfxOda45E1Yb+WRaY8xJAK2A3b1phZYpV1fbN7m5aAt3bs67TuHks7VB VmLqpwdh226gED6HO9lDPWVFK8XkKwvl/fv0s0D4emOhjtIwrb/p/RNKkZkLdnZm 2VR4vug/ShsPefrMH+2ApJfrYTkGsPX5GauYWlfbBRE/CPUNxbK7PRpT60WH/Kdg TFbrvUSveyYQVyEXX8Ra2dTtcbhKdpN+XveR6Xm75t1oyNoAJTtQNgK5M9d2O5LJ E/d2CtXEng7x48blOyA/G6h3WkOWah4fJryfV2w0oXHWXutW/Qkue6XaWWpRZEcY SXlhraEMgUvxFWynTrl8goThscLe78jhS+7Pyp68RWrmPZibZmv7FixTYoP7rS2o yVLJKIuk1y8SdtQlYbxGrSvGFRJeRN4utoFPIANbroJsBfaU/21HKt0IKq0/8pOn baSPM5NEUcoQHBtL5ILtNqh6qWYOX5T1eyPSZ+my6CV4Ey0kPjxKvL1fkVzqLTbF fCNbjcZ489mc1FCN+JUu
    =NkB4
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From James Cowgill@21:1/5 to Christoph Biedl on Mon Jun 5 15:50:02 2017
    Copy: debian-mips@lists.debian.org

    This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --4n4s53KBAAxV2P4o41r9wEiPsdUcW2U24
    Content-Type: multipart/mixed;
    boundary="------------C61EBAD6A724385396B7E6D1"

    This is a multi-part message in MIME format. --------------C61EBAD6A724385396B7E6D1
    Content-Type: text/plain; charset=windows-1252
    Content-Transfer-Encoding: quoted-printable

    Hi,

    On 05/06/17 12:10, Christoph Biedl wrote:
    Hello,

    in a desperate attempt to understand #852962, thus salvaging ycmd and youcompleteme for stretch, I tried to set up an emulated mipsel machine
    using libvirt/qemu, and failed horribly. There are tons of documents
    out there, many years old, contradicting, not helping.

    So: Is this feasible at all? I could use a pointer then.

    So far: Create a virtual machine, with installer CD and virtual disk.
    Then libvirt needs a patch by Aurilien[1][2]. Then libvirt complains
    about mips_bios.bin although some pages[3] state this was no
    longer required. Providing a dummy image, the machine starts, but shows
    just a blank screen and qemu eats 100% CPU. Then booting via "Direct
    kernel boot", ditto. I've tried several "console=" parameters, no
    avail. Perhaps libvirt plays tricks on me, wasn't the first time.

    You have to use direct kernel booting on mips. If you provide a dummy bootloader, qemu will execute it and just hang.

    I remember trying to use libvirt some time ago on mips and having to
    manually specify the base address of the serial port on malta. I found
    this config file but its a few years old so it might not work anymore.

    It *is* possible to start qemu-system-mipsel directly, with an
    additional '-serial stdio' parameter, but for reasons I'd really like to control the machine using libvirt, and I fail to see how to fiddle the
    kernel console into the libvirt terminal.

    - What did I miss?
    - How comes appearently nobody encounters such issues?

    I expect there are very few users of qemu-mipsel with libvirt. Some of
    the issues you've encountered may be genuine bugs.

    Thanks,
    James

    --------------C61EBAD6A724385396B7E6D1
    Content-Type: text/xml;
    name="debian-vm-1-qemu.xml"
    Content-Transfer-Encoding: quoted-printable
    Content-Disposition: attachment;
    filename="debian-vm-1-qemu.xml"

    <domain type='qemu' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
    <name>debian-vm-1-qemu1</name>
    <uuid>c48e51ea-ba43-4de6-bd20-21469badae9e</uuid>
    <memory unit='KiB'>2097152</memory>
    <currentMemory unit='KiB'>2097152</currentMemory>
    <vcpu placement='static'>1</vcpu>
    <os>
    <type arch='mips64el' machine='malta'>hvm</type>
    <kernel>/var/lib/libvirt/boot/vmlinux-mips64el</kernel>
    <initrd>/var/lib/libvirt/boot/initrd-mips64el</initrd>
    <cmdline>root=/dev/vda console=ttyS0 mem=2048m net.ifnames=0</cmdline>
    <boot dev='hd'/>
    </os>
    <clock offset='utc'/>
    <on_poweroff>destroy</on_poweroff>
    <on_reboot>restart</on_reboot>
    <on_crash>destroy</on_crash>
    <devices>
    <emulator>/usr/bin/qemu-system-mips64el</emulator>
    <disk type='file' device='disk'>
    <driver name='qemu' type='raw'/>
    <source file='/var/lib/libvirt/images/debian-vm-1-qemu1'/>
    <target dev='vda' bus='virtio'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </disk>
    <controller type='pci' index='0' model='pci-root'/>
    <controller type='usb' index='0' model='piix3-uhci'>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
    </controller>
    <serial type='pty'>
    <target port='0'/>
    <address type='isa' iobase='0x3f8' irq='0x4'/>
    </serial>
    <console type='pty'>
    <target type='serial' port='0'/>
    <address type='isa' iobase='0x3f8' irq='0x4'/>
    </console>
    <memballoon model='virtio'>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </memballoon>
    </devices>
    <qemu:commandline>
    <qemu:arg value='-cpu'/>
    <qemu:arg value='MIPS64R2-generic'/>
    </qemu:commandline>
    </domain>

    --------------C61EBAD6A724385396B7E6D1--

    --4n4s53KBAAxV2P4o41r9wEiPsdUcW2U24--

    -----BEGIN PGP SIGNATURE-----

    iQIzBAEBCgAdFiEE+Ixt5DaZ6POztUwQx/FnbeotAe8FAlk1UWgACgkQx/Fnbeot Ae+c9g//a5pv2JWCT5E7ETCbOBeRfic2t6le89YIbbE7QHcEEml9x7dmdCrttWMU y0MokfSPVk1gU/hHUUN+9dqzSPDtChSEvbf6BCW0flX8Noqat3aUpkQAKNRiOiDH bBUXrqnXNS4p8P0FN3HoZRqgkT6h4dIgfKGZjchzzoI1oPL6L47N5Yv+aAzZpCOI 0CpReCqoZ6k5K49DCSArJkOjDw9F5J+jg1KXJ+MMemXqEGdu79cRG/pbmJXfR87i fROvjpY9IDOAoekXRx+1ZQNRWSoiyC6TL5Qffh0i+2tyWnkgyq4Q1unHQ0ZbZIDj 8iewHRe6m9fILcK+q+FauyUL2G7QzChmwNI+53GTMeaLM8qlw4aNl49yPjWSIxBY onLneqqDoy/bGbLJTzFbQgbcJdqp4Mig1d7FWpO3pHFf5UrjtBGip5TMte04NvwJ F6MJ7RsmapcfHh9kg2jyQVcaF/D5Qt7tjFmMCWIcUkAgzpWr5/ZJAX6lhZFRpyX+ ds5YPgI9pK3dNhvA2mxr6TEO9f4ycI/5Q0ABVQ1DOvDPuYsaPgS+T5+PWbNnyIW4 AZP6YaZvhGSP6VqrtIHloVSNMgfo7qNBQx/wdrpexgOghvb5AIOMe+xNfsjEz5Xj NI74q4tJHPkig7Oisb6kAqhc0GsFHjc/KJpKuwH0kmm8gKVTsOA=
    =kTN4
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)