Re: report on debian-9.0-sparc64-NETINST-1.iso with qemu [SOLVED]

2017-03-17 Thread Mark Cave-Ayland
On 27/01/17 18:52, Bruno Haible wrote:

>> But there is a point in Marks reply: maybe nowadays virtio-net also
>> has to be switched into the legacy mode.
>> Instead of "-net nic,model=virtio -net user" can you please try:
>>
>> -netdev user,id=hostnet0  -device
>> virtio-net-pci,disable-modern=off,disable-legacy=off,disable-modern=on,netdev=hostnet0
> 
> Yeah! This works! The machine now can connect to the internet.
> The ifconfig output now is:
> 
> # /target/sbin/ifconfig
> enp0s5: flags=4163  mtu 1500
> inet 10.0.2.15  netmask 255.255.255.0  broadcast 0.0.0.0
> inet6 fec0::5054:ff:fe12:3456  prefixlen 64  scopeid 0x40
> inet6 fe80::5054:ff:fe12:3456  prefixlen 64  scopeid 0x20
> ether 52:54:00:12:34:56  txqueuelen 1000  (Ethernet)
> RX packets 291  bytes 263098 (256.9 KiB)
> RX errors 0  dropped 0  overruns 0  frame 0
> TX packets 174  bytes 15608 (15.2 KiB)
> TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
> 
> lo: flags=73  mtu 65536
> inet 127.0.0.1  netmask 255.0.0.0
> inet6 ::1  prefixlen 128  scopeid 0x10
> loop  txqueuelen 1  (Local Loopback)
> RX packets 0  bytes 0 (0.0 B)
> RX errors 0  dropped 0  overruns 0  frame 0
> TX packets 0  bytes 0 (0.0 B)
> TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
> 
> # lsmod | grep virt
> virtio_net 24168  0
> virtio_pci 14583  0
> virtio_ring12099  2 virtio_net,virtio_pci
> virtio  6188  2 virtio_net,virtio_pci
> 
> (qemu) info network
> virtio-net-pci.0: 
> index=0,type=nic,model=virtio-net-pci,macaddr=52:54:00:12:34:56
>  \ hostnet0: index=0,type=user,net=10.0.2.0,restrict=off
> 
> Thanks a lot!

BTW just a heads-up: I've found and fixed the bug in OpenBIOS which was
causing virtio in its default modern mode to freeze (it was the 64-bit
virtio BAR being programmed incorrectly), and the fix has been merged
into QEMU git master as of yesterday.

So in the upcoming 2.9 release you will no longer need to specify
"disable-modern=on" as part of the qemu-system-sparc64 command line and
"-net nic,model=virtio -net user" will work once again.


ATB,

Mark.



Re: report on debian-9.0-sparc64-NETINST-1.iso with qemu [SOLVED]

2017-02-09 Thread John Paul Adrian Glaubitz
On 02/05/2017 09:03 PM, Torbjörn Granlund wrote:
> Bruno Haible  writes:
> 
>   Here's a summary of what's needed to get a Sparc64 Linux running in QEMU.
>   
> Are these instructions available someplace on the Net for me to link to?

Not yet. That's why I asked whether someone could take Bruno's instructions [1]
and put them up on the wiki or update the existing wiki page [2].

Adrian

> [1] https://lists.debian.org/debian-sparc/2017/01/msg00094.html
> [2] https://wiki.debian.org/Sparc64Qemu

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



Re: report on debian-9.0-sparc64-NETINST-1.iso with qemu [SOLVED]

2017-02-05 Thread Torbjörn Granlund
Bruno Haible  writes:

  Here's a summary of what's needed to get a Sparc64 Linux running in QEMU.
  
Are these instructions available someplace on the Net for me to link to?

I found https://wiki.debian.org/Sparc64Qemu, but it looks quite
different; they have some xml abomination used to make plain
configuration superverbose and highly unreadable...

-- 
Torbjörn
Please encrypt, key id 0xC8601622



Re: report on debian-9.0-sparc64-NETINST-1.iso with qemu [SOLVED]

2017-01-28 Thread Bruno Haible
Here's a summary of what's needed to get a Sparc64 Linux running in QEMU.

I use qemu-2.8.0, compiled from source.

1) Use the image from
   
https://people.debian.org/~glaubitz/debian-cd/2016-05-04/debian-9.0-sparc64-NETINST-1.iso
It is new enough but avoids a 'debootstrap' bug found in newer versions.
(Symptom: During the installation of the base system:
"debootstrap: mknod: /target/dev/null: No such file or directory")

2) Use the following qemu options:
2.1) Machine args:
 -m 512 -vga none
Without the option "-vga none", the installed system, after one minute,
activates a framebuffer device on the emulated VGA card, and something
goes wrong with that (either the Sparc64 Linux does not have the right
drivers for it, or qemu cannot display its contents).
(Symptom: Black screen after booting into the installed system.)

2.2) Disk args:
 -drive file=debian90.img,format=raw,index=0
This is standard.

2.3) Network device args:
 -netdev user,id=hostnet0 -device 
virtio-net-pci,disable-modern=off,disable-legacy=off,disable-modern=on,netdev=hostnet0
Without it, the network card accepts a configuration through the built-in DHCP
server of QEMU, but - as I could see by putting myself in a chroot environment
at the end of the installation - an 'ssh me@10.0.2.2' cannot connect to the
host machine at 10.0.2.2, and DNS lookup doesn't work either.
Thanks to Artyom Tarasenko for the solution.

2.4) Display args:
 -nographic
This makes it easier (compared to "-display gtk" or "-display vnc:N")
to copy text from the host into the guest VM.

3) During the installation of the Debian system (use qemu option
   -cdrom /path/to/debian-9.0-sparc64-NETINST-1.iso -boot d
), when it comes to partitioning the disk, use
  Manual.
  - Create a first partition, size less than 1 MB (I used 250 MB), ext2, /boot,
set bootable: true. This will become /dev/sda1.
  - Create a second partition, size: the rest of the disk minus 1 GB, ext4, /.
This will become /dev/sda2.
  - Create a third partition, swap.
With the default partitioning, on a disk larger than 1 GB, the kernel and initrd
may not lie within the first 1 GB of this disk. Symptom: The installation
completes but the installed system can not boot: "Cannot find /etc/silo.conf".

You can now boot into the installed system. At the SILO prompt, I can either
wait or press Return, or enter this kernel invocation line:
  1/vmlinuz initrd=/initrd.img root=/dev/sda2

4) After booting into the installed system (use qemu option  -boot c), fix
two network configuration problems:

4.1) Symptom: "ifconfig" lists only the loopback device, but "ifconfig -a"
shows that there is actually a network device enp0s4.
Fix: Edit /etc/network/interfaces, to mention enp0s4 instead of enp0s5.
For some reason, the name of the network device was different during the
installation session than in the installed system.

Then reboot.

4.2) Accessing a web site by name does not work.
/etc/resolv.conf contains: "nameserver fec0::3"
Workaround: Disable IPv6 through
echo 'net.ipv6.conf.all.disable_ipv6 = 1' > /etc/sysctl.d/01-disable-ipv6.conf

Then reboot.

5) Finally edit /etc/apt/sources.list, as shown in
https://wiki.debian.org/Sparc64. Now you can "sudo apt-get install" whatever
you like.


Bruno



Re: report on debian-9.0-sparc64-NETINST-1.iso with qemu [SOLVED]

2017-01-28 Thread John Paul Adrian Glaubitz
On 01/28/2017 11:46 AM, Bruno Haible wrote:
> Here's a summary of what's needed to get a Sparc64 Linux running in QEMU.

Thanks a lot for the detailed walk through. I'll put that up on the
Debian Wiki.

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaub...@debian.org
`. `'   Freie Universitaet Berlin - glaub...@physik.fu-berlin.de
  `-GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913



Re: report on debian-9.0-sparc64-NETINST-1.iso with qemu [SOLVED]

2017-01-27 Thread Mark Cave-Ayland
On 27/01/17 18:52, Bruno Haible wrote:

> Yeah! This works! The machine now can connect to the internet.
> The ifconfig output now is:
> 
> # /target/sbin/ifconfig
> enp0s5: flags=4163  mtu 1500
> inet 10.0.2.15  netmask 255.255.255.0  broadcast 0.0.0.0
> inet6 fec0::5054:ff:fe12:3456  prefixlen 64  scopeid 0x40
> inet6 fe80::5054:ff:fe12:3456  prefixlen 64  scopeid 0x20
> ether 52:54:00:12:34:56  txqueuelen 1000  (Ethernet)
> RX packets 291  bytes 263098 (256.9 KiB)
> RX errors 0  dropped 0  overruns 0  frame 0
> TX packets 174  bytes 15608 (15.2 KiB)
> TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
> 
> lo: flags=73  mtu 65536
> inet 127.0.0.1  netmask 255.0.0.0
> inet6 ::1  prefixlen 128  scopeid 0x10
> loop  txqueuelen 1  (Local Loopback)
> RX packets 0  bytes 0 (0.0 B)
> RX errors 0  dropped 0  overruns 0  frame 0
> TX packets 0  bytes 0 (0.0 B)
> TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
> 
> # lsmod | grep virt
> virtio_net 24168  0
> virtio_pci 14583  0
> virtio_ring12099  2 virtio_net,virtio_pci
> virtio  6188  2 virtio_net,virtio_pci
> 
> (qemu) info network
> virtio-net-pci.0: 
> index=0,type=nic,model=virtio-net-pci,macaddr=52:54:00:12:34:56
>  \ hostnet0: index=0,type=user,net=10.0.2.0,restrict=off
> 
> Thanks a lot!

Excellent! I should add that qemu-system-sparc64 should support virtio
1.0 at some point when I get some time to figure out why it hangs - all
that's happened is that the default flipped from legacy to modern with
the last QEMU release which is why this is now suddenly visible.


ATB,

Mark.



Re: report on debian-9.0-sparc64-NETINST-1.iso with qemu [SOLVED]

2017-01-27 Thread Bruno Haible
Artyom Tarasenko wrote on 27.01.2017:
> On Thu, Jan 26, 2017 at 10:16 PM, Bruno Haible  wrote:
> > Mark Cave-Ayland wrote:
> >> >> The hardware emulated by QEMU on this platform is
> >> >>   hub 0
> >> >>\ hub0port1: user.0: index=0,type=user,net=10.0.2.0,restrict=off
> >> >>\ hub0port0: ne2k_pci.0: 
> >> >> index=0,type=nic,model=ne2k_pci,macaddr=52:54:00:12:34:56
> >> >> Does anyone happen to know?
> >> >
> >> > You should ask Mark Cave-Ayland or Artyom Tarasenko who are the 
> >> > maintainers for
> >> > the SPARC target in qemu.
> >>
> >> I can confirm that virtio does work in QEMU, but only in legacy (0.9)
> >> mode - for some reason if 1.0 mode is used then we seem to hang because
> >> we're missing an interrupt. I've managed to recreate this locally but
> >> not had the time to dig into the details yet - any help always
> >> appreciated :)
> >>
> >> The command line you need for virtio on QEMU looks something like this:
> >>
> >> ./qemu-system-sparc64 -drive
> >> file=debian-9.0-sparc64-NETINST-1.iso,if=none,index=0,id=cd,media=cdrom
> >> -device virtio-blk-pci,disable-modern=on,drive=cd -nographic
> >
> > Thanks for the attempt to help. But I don't have a need for virtio for
> > the disk or cdrom - the default works perfectly fine there. The problem I
> > have is with the network card: the default doesn't work, and virtio
> > (as recommended by Artyom) crashes qemu.
> 
> To be more specific, it's not crashing qemu. It just brings the
> emulated system in a condition in which it won't function (trap after
> the maximal trap level is reached). So it's not necessarily a qemu
> bug. Can be a virtio/kernel bug as well.
> 
> But there is a point in Marks reply: maybe nowadays virtio-net also
> has to be switched into the legacy mode.
> Instead of "-net nic,model=virtio -net user" can you please try:
> 
> -netdev user,id=hostnet0  -device
> virtio-net-pci,disable-modern=off,disable-legacy=off,disable-modern=on,netdev=hostnet0

Yeah! This works! The machine now can connect to the internet.
The ifconfig output now is:

# /target/sbin/ifconfig
enp0s5: flags=4163  mtu 1500
inet 10.0.2.15  netmask 255.255.255.0  broadcast 0.0.0.0
inet6 fec0::5054:ff:fe12:3456  prefixlen 64  scopeid 0x40
inet6 fe80::5054:ff:fe12:3456  prefixlen 64  scopeid 0x20
ether 52:54:00:12:34:56  txqueuelen 1000  (Ethernet)
RX packets 291  bytes 263098 (256.9 KiB)
RX errors 0  dropped 0  overruns 0  frame 0
TX packets 174  bytes 15608 (15.2 KiB)
TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73  mtu 65536
inet 127.0.0.1  netmask 255.0.0.0
inet6 ::1  prefixlen 128  scopeid 0x10
loop  txqueuelen 1  (Local Loopback)
RX packets 0  bytes 0 (0.0 B)
RX errors 0  dropped 0  overruns 0  frame 0
TX packets 0  bytes 0 (0.0 B)
TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

# lsmod | grep virt
virtio_net 24168  0
virtio_pci 14583  0
virtio_ring12099  2 virtio_net,virtio_pci
virtio  6188  2 virtio_net,virtio_pci

(qemu) info network
virtio-net-pci.0: 
index=0,type=nic,model=virtio-net-pci,macaddr=52:54:00:12:34:56
 \ hostnet0: index=0,type=user,net=10.0.2.0,restrict=off

Thanks a lot!

Bruno



Re: report on debian-9.0-sparc64-NETINST-1.iso with qemu [SOLVED]

2017-01-27 Thread John Paul Adrian Glaubitz
Can someone sitting in front of their computer please put that information up 
on the Debian Wiki in the sparc64 section. I'd appreciate that a lot :).

Adrian
(currently on mobile)

> On Jan 27, 2017, at 7:52 PM, Bruno Haible  wrote:
> 
> Artyom Tarasenko wrote on 27.01.2017:
>>> On Thu, Jan 26, 2017 at 10:16 PM, Bruno Haible  wrote:
>>> Mark Cave-Ayland wrote:
>> The hardware emulated by QEMU on this platform is
>>  hub 0
>>   \ hub0port1: user.0: index=0,type=user,net=10.0.2.0,restrict=off
>>   \ hub0port0: ne2k_pci.0: 
>> index=0,type=nic,model=ne2k_pci,macaddr=52:54:00:12:34:56
>> Does anyone happen to know?
> 
> You should ask Mark Cave-Ayland or Artyom Tarasenko who are the 
> maintainers for
> the SPARC target in qemu.
 
 I can confirm that virtio does work in QEMU, but only in legacy (0.9)
 mode - for some reason if 1.0 mode is used then we seem to hang because
 we're missing an interrupt. I've managed to recreate this locally but
 not had the time to dig into the details yet - any help always
 appreciated :)
 
 The command line you need for virtio on QEMU looks something like this:
 
 ./qemu-system-sparc64 -drive
 file=debian-9.0-sparc64-NETINST-1.iso,if=none,index=0,id=cd,media=cdrom
 -device virtio-blk-pci,disable-modern=on,drive=cd -nographic
>>> 
>>> Thanks for the attempt to help. But I don't have a need for virtio for
>>> the disk or cdrom - the default works perfectly fine there. The problem I
>>> have is with the network card: the default doesn't work, and virtio
>>> (as recommended by Artyom) crashes qemu.
>> 
>> To be more specific, it's not crashing qemu. It just brings the
>> emulated system in a condition in which it won't function (trap after
>> the maximal trap level is reached). So it's not necessarily a qemu
>> bug. Can be a virtio/kernel bug as well.
>> 
>> But there is a point in Marks reply: maybe nowadays virtio-net also
>> has to be switched into the legacy mode.
>> Instead of "-net nic,model=virtio -net user" can you please try:
>> 
>> -netdev user,id=hostnet0  -device
>> virtio-net-pci,disable-modern=off,disable-legacy=off,disable-modern=on,netdev=hostnet0
> 
> Yeah! This works! The machine now can connect to the internet.
> The ifconfig output now is:
> 
> # /target/sbin/ifconfig
> enp0s5: flags=4163  mtu 1500
>inet 10.0.2.15  netmask 255.255.255.0  broadcast 0.0.0.0
>inet6 fec0::5054:ff:fe12:3456  prefixlen 64  scopeid 0x40
>inet6 fe80::5054:ff:fe12:3456  prefixlen 64  scopeid 0x20
>ether 52:54:00:12:34:56  txqueuelen 1000  (Ethernet)
>RX packets 291  bytes 263098 (256.9 KiB)
>RX errors 0  dropped 0  overruns 0  frame 0
>TX packets 174  bytes 15608 (15.2 KiB)
>TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
> 
> lo: flags=73  mtu 65536
>inet 127.0.0.1  netmask 255.0.0.0
>inet6 ::1  prefixlen 128  scopeid 0x10
>loop  txqueuelen 1  (Local Loopback)
>RX packets 0  bytes 0 (0.0 B)
>RX errors 0  dropped 0  overruns 0  frame 0
>TX packets 0  bytes 0 (0.0 B)
>TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
> 
> # lsmod | grep virt
> virtio_net 24168  0
> virtio_pci 14583  0
> virtio_ring12099  2 virtio_net,virtio_pci
> virtio  6188  2 virtio_net,virtio_pci
> 
> (qemu) info network
> virtio-net-pci.0: 
> index=0,type=nic,model=virtio-net-pci,macaddr=52:54:00:12:34:56
> \ hostnet0: index=0,type=user,net=10.0.2.0,restrict=off
> 
> Thanks a lot!
> 
> Bruno